Re: new: lang/zig

2021-03-03 Thread George Koehler
On Sun, 28 Feb 2021 07:24:06 +0100
Sebastien Marie  wrote:

> The port should be buildable on ${LLVM_ARCHS}, but I restricted it to
> a smaller archs sets: the zig0 compiler (zig stage0 compiler written
> in C++, and used to bootstrap to stage1) requires an insane datasize
> (6 Go). I kept only archs where datasize of pbuild user was big
> enough (amd64 arm64 and powerpc64).

I want to try it on powerpc64.  There might be problems, because Zig
has only "Tier 3 Support" for powerpc64,
https://ziglang.org/learn/overview/#tier-3-support

At tier 3, foreign function calls between C and Zig might not work.
LLVM can emit powerpc64 code, but that isn't enough.  The frontend
must have special knowledge of the C ABI for powerpc64, and build the
LLVM IR code in a compatible way.  We might also get lucky, and some
C calls might work without the special knowledge, if they don't use
va_arg(3) lists nor pass structs by value.

Will send another mail after I try the powerpc64 build.   --George



Re: new: lang/zig

2021-02-27 Thread Evan Silberman



> On Feb 27, 2021, at 11:02 PM, Theo de Raadt  wrote:
> 
> I met a programmer using an obscure
> language...

Who said “One vast and branchless trunk of code
Stands in the desert...Near it on the sand
Half-sunk a shattered memory protection barrier lies…

That’s all I got


Re: new: lang/zig

2021-02-27 Thread Theo de Raadt
Sebastien Marie  wrote:

I take no position on what lands in ports, but want to make a public
comment.  I doubt you wrote the following sentence:

> Zig is a general-purpose programming language and toolchain for
> maintaining robust, optimal, and reusable software.

I am sure both csh and php aspired to do the same.

One thing Rust has done, is to teach everyone they must lead with
propoganda.  After all if your propoganda isn't overbearing, obviously
you've got nothing?  It is pretty sad others feel compelled to repeat
such bombastic same-old same-old glowing terms, rather than describing
"what we do is different".

Robust?  Show us 100 critical and meaningful programs.
Optimal?  That results from LLVM in the back-end.
Reusable?  Uhm show us 100 critical and meaningful programs.

Perhaps these authors don't understand that those of us attempting to
use modern techniques like privsep in C (proper privsep is exceedingly
rare outside of the C universe because memory-safe makes privsep
irrelevant /sarc) remain uninspired by such lead-ins.  We recognize all
the tools in the world are imperfect, but wow, such a first sentence
does wonders to lose the audience.  I met a programmer using an obscure
language...



new: lang/zig

2021-02-27 Thread Sebastien Marie
Hi,

I would like to import lang/zig.

Zig is a general-purpose programming language and toolchain for
maintaining robust, optimal, and reusable software.

https://ziglang.org/

The target version is a development version (0.8.0-dev.1038+58344e001)
as OpenBSD support is somehow partial in latest stable (0.7.1). The
current development version is mostly functional: zig is able to
build zig, testsuite mostly succeed (failure on crosscompilation), and
I still have problems with .event loop which needs EVFILT_USER (or I
need to implements .event differently).

Zig is using llvm as backend (it should become an optional dependency
at some point), and the current code support only llvm-11 (and work is
in progress to support llvm-12). As we don't have these llvm versions
in ports (neither in base), the port is using zig-bootstrap
(https://github.com/ziglang/zig-bootstrap) repository, which provides
llvm+clang+lld+zig all-in-one.

The port is first building llvm-11, and next zig, which is statically
linked to the llvm+clang+lld libraries (so no llvm-11 parts on disk at
runtime).

I polished the build to be able to build and link with llvm-11 whereas
devel/llvm is installed, without conflicts. Patches on llvm-11 are
minimal.

The port isn't using the ${WRKSRC}/build script from upstream: this
build script is intented to crosscompile zig to others platforms, and
so llvm and zig are built two times. Instead of, I am providing a
files/build.sh script to build, install and test.

The port should be buildable on ${LLVM_ARCHS}, but I restricted it to
a smaller archs sets: the zig0 compiler (zig stage0 compiler written
in C++, and used to bootstrap to stage1) requires an insane datasize
(6 Go). I kept only archs where datasize of pbuild user was big
enough (amd64 arm64 and powerpc64).

I have tested it on amd64 exclusively.

Comments or OK ?
-- 
Sebastien Marie


zig.tar.gz
Description: application/tar-gz