Live data from Hacker News

Zig's New Relationship with LLVM

kristoff.it

231–240 of 295 posts

Re: Zig's New Relationship with LLVM

#231

I see zig users commenting here -- the "getting started" guide at https://ziglearn.org/ immediately fails with the installable zig binary from Arch (0.6.0) due to https://github.com/ziglang/zig/issues/5683 I'd never heard of zig until now, but as a community having top level "how to get started" website using features only available from the Master branch of github is... not a good way to get people into your languag…

"So I just installed pre-1.0 language that is clearly in heavy development and I'm so repulsed by this fast change and friction omg".

Yeah its almost like it isn't finished yet?

Re: Zig's New Relationship with LLVM

#232

Earlier quoted context omitted.

Use std.debug.warn and you'll be fine with 0.6.0 and master. Right now there's no strict and methodical update path from one version to the next, but generally speaking changes to the language get special-cased into zig fmt. For example the current `anytype` type has replaced `var` and running zig fmt on a project I hadn't updated yet changed all references. That said, Hello World, when taken seriously, it's not that…

Thank you (for both replies) and to everyone else, this makes it crystal clear what's going on - there's a lack of "hey everyone, this is very unstable at the moment and the basic internals are changing, using anything except the latest Github builds is highly discouraged" which might really help when added to the various places above. I'm a toe-dipper -- I need to run and play with some sample code (basic Hello, Wor…

The only thing that's lacking is your understanding of semver.

Zig is currently 0.6.0, you see that first number? This alone is a clear indication that nothing is truly stable and anything can disappear at any time for any reason.

Re: Zig's New Relationship with LLVM

#233
post #111

Earlier quoted context omitted.

> I really like the Zig approach of improving the tooling for manual memory management rather than replacing manual memory management. The new test allocator checks your code for memory leaks, use after free, and double free in a highly ergonomic fashion. I think is fantastic that zig encourages writing tests, and I think if you get full test coverage in your zig code with the test allocator, you will probably solve…

Address Sanitizer and valgrind are widely-used standard tools for finding allocation bugs

I guess my feeling is that the tool chain for C/C++ is now C, C++, plus the preprocessor stuff (its own language), linker, make, (plus probably automake, cmake), gdb, valgrind, asan, etc etc etc, just to get "best practices/safe coding" right.

With zig, not 100% comparable (like not sure about gdb, but zig stacktraces and error traces are fantastic) it's all done in one language. Such a lowering of mental overhead and entry barrier!

The only thing you have to learn is that at comptime you get access to some magic (like the ++ operator)

Re: Zig's New Relationship with LLVM

#234
post #110

Earlier quoted context omitted.

> When this is brought up, people [...] don't seem to acknowledge that this is not a problem with any other language. This was a deliberate design decision by andrew for all zig pre-1.0 to supress discussions about coding style (use CR, LF, CRLF, LFCR as a line ending? tabs vs. spaces? ...) as it's considered bike shedding Zig 1.0 won't have this restrictions anymore. More information can be found here: https://githu…

Why not do that with a formatting tool that applies to the compiler source instead of purposely breaking hello world on windows?

Same answer as to why you don't configure your text editor to just not emit useless and outdated CR from past century - he has better things to do. And no, really, check out Zig repo's issue tab, he really has better things to do with his time on a project that's still evolving.

You're demanding 1.0+ usability from a language that's has yet to stand up on its own feet and is currently, unsurprisingly, 0.6.0 and won't be 1.0 any time soon because there's a massive amount of work that needs to be done.

This also isn't C and it wasn't developed/maintained for past 50 years.

Re: Zig's New Relationship with LLVM

#235

I see zig users commenting here -- the "getting started" guide at https://ziglearn.org/ immediately fails with the installable zig binary from Arch (0.6.0) due to https://github.com/ziglang/zig/issues/5683 I'd never heard of zig until now, but as a community having top level "how to get started" website using features only available from the Master branch of github is... not a good way to get people into your languag…

"So I just installed pre-1.0 language that is clearly in heavy development and I'm so repulsed by this fast change and friction omg". Yeah its almost like it isn't finished yet?

All your comments are toxicity-laced. Calm down, my dude.

Re: Zig's New Relationship with LLVM

#236
post #52

Zig is one of the most interesting languages I've seen in a very long time, and possibly the first radical breakthrough in low-level programming design in decades. Maybe it will become a big success and maybe it will tank, but after having two visions for low-level programming -- that of C's "syntax-sugared Assembly", or that of C++'s "zero-cost abstractions" whose low-level, low-abstraction code appears high level o…

> also inspires a new approach to partial evaluation, replacing generics and value templates, concepts/traits/typeclasses, constexprs/procedural macros, macros (or, at least, the "good parts" of macros) and conditional compilation with a single, simple feature.

So, zig is new to me but looking at an overview of the feature in question here this feels pretty hyperbolic? I certainly agree that the approach it takes is syntactically less noisy than angle-bracket generics/templates (which I dislike quite a lot) but it doesn't seem particularly revolutionary vs. the way evaluation of types in haskell works, for eg. A function that produces a type based on type arguments is roughly a typeclass.

And the intermediate products of a function with comptime arguments are still pretty much semantically equivalent to a C++ template anyways, just with the arguments in a different place.

It is cool, and I like the angle it takes, but it seems more synthesis than revolution to me. Am I missing something?

Re: Zig's New Relationship with LLVM

#237

Earlier quoted context omitted.

Thank you (for both replies) and to everyone else, this makes it crystal clear what's going on - there's a lack of "hey everyone, this is very unstable at the moment and the basic internals are changing, using anything except the latest Github builds is highly discouraged" which might really help when added to the various places above. I'm a toe-dipper -- I need to run and play with some sample code (basic Hello, Wor…

The only thing that's lacking is your understanding of semver. Zig is currently 0.6.0, you see that first number? This alone is a clear indication that nothing is truly stable and anything can disappear at any time for any reason.

This reply is rude and uncalled for, you created an account 28 minutes ago just to act like a condescending jerk?

    $ pacman -Q | awk '{print $2}' | egrep "^0\." -c
    257

Re: Zig's New Relationship with LLVM

#238

I see zig users commenting here -- the "getting started" guide at https://ziglearn.org/ immediately fails with the installable zig binary from Arch (0.6.0) due to https://github.com/ziglang/zig/issues/5683 I'd never heard of zig until now, but as a community having top level "how to get started" website using features only available from the Master branch of github is... not a good way to get people into your languag…

I have done this as zig makes many breaking changes often, not because new features come out all the time (almost all of the things showcased on the site if not all were around back in 0.6). I do not want to teach people things that are already for the most part outdated. Things move very fast, especially in the standard library. edit: to clarify I am the maintainer/owner of ziglearn

jgjgg

Re: Zig's New Relationship with LLVM

#239

I see zig users commenting here -- the "getting started" guide at https://ziglearn.org/ immediately fails with the installable zig binary from Arch (0.6.0) due to https://github.com/ziglang/zig/issues/5683 I'd never heard of zig until now, but as a community having top level "how to get started" website using features only available from the Master branch of github is... not a good way to get people into your languag…

Similarly, I rolled back to the official docs from Master and the hello.zig from there is similarly nonop using the tagged 0.6.0 build: https://ziglang.org/documentation/master/ Please, please - make a Hello, World which is not so intrinsically tied to random features on Master to just work across all the iterations. Hello, World is supposed to be the simplest, non-breaking easy to compile no esoteric compiler featur…

bbbbbbbbbbbbbbbbbbbbbbbb

Re: Zig's New Relationship with LLVM

#240

Earlier quoted context omitted.

nod From my other replies, it would be of assistance to state that this on the guide right at the Install section, as I did have a choice which zig to use and chose the simple package from my repo given no further direction. (BTW: could you explain why I should install ZLS in step 4? Since we're here.. :) ) With a line of text that I must use the latest dev/git code (etc.), my choice would have then gone the other di…

I pushed some changes to reflect this

Nice, thanks. The description added to (4) in the Install clears up what that's for nicely (along with the primary changes, very clear).
Post reply on HN