5 ms·
The Zig Programming Language
- jug 4y agohttps://news.ycombinator.com/from?site=ziglang.org https://news.ycombinator.com/from?site=ziglang.org
- bruce343434 4y ago
- brink 4y agoAren't most people aware that Zig exists?
- deleted 4y ago[deleted]
- wyldfire 4y agoIt depends on how often you hit 'reload' on HN. Ten times an hour? you've heard of it. Ten times a month? much less likely. Most of my work colleagues haven't heard of HN and therefore wouldn't have frequent opportunities to hear about Zig.
- Tozen 4y agoIf anything, Zig is over-represented on Hacker News with posts and positive mentions, particularly when you compare it to other newer languages. To include the other newer languages getting ignored, bashed, or trolled. Where with Zig, it doesn't get that kind of "heat". But just because Zig might be a "darling" of Hacker News, doesn't mean that's the case in general. For these newer languages, they need to distinguish themselves, in terms of reasons why people would turn to them. In a world of established languages like C, Rust, Golang, Object Pascal, etc... Why use Zig? The argument to use it over what they already know, might not be there for a lot of people.
- azth 4y agoI like their take on generic programming.
- dilap 4y agoSort of random to see this pop-up out of nowhere. Very interesting language. This blew my mind: https://github.com/ziglang/zig/blob/master/lib/std/multi_array_list.zig https://github.com/ziglang/zig/blob/master/lib/std/multi_arr...
- deleted 4y ago[deleted]
- Bayart 4y agoZig's a regular presence on HN (as is creator Andrew Kelley).
- dilap 4y agoOh totally. I was just surprised to see a well-known (to people on HN!) language on the front-page w/o any particular news to drive it. HN front page can be random like that. :-) (See also: random wikipedia pages that sometimes show up.)
- verdagon 4y agoSomething I really appreciate about Zig is its "colorblind async/await" [0]. To my eyes, it's the best of both worlds. It doesn't require a GC like Go's "contiguous stacks" approach [1] or Loom's approach [2]. It also doesn't require coloring like Javascript/Rust's async/await approach, which can sometimes seem like a viral leaky abstraction, causing incidental complexity in the presence of certain patterns. The main catch is around recursion, but that's not so bad, as Zig as a whole seems to steer users away from recursion anyway, with another interesting feature that detects it at compile time. I think new languages should be going this direction: focus on making things easier for the user, avoid causing incidental complexity, and keep abstractions zero-cost. Just my two cents! [0] https://kristoff.it/blog/zig-colorblind-async-await/ https://kristoff.it/blog/zig-colorblind-async-await/ [1] https://medium.com/a-journey-with-go/go-how-does-the-goroutine-stack-size-evolve-447fc02085e5 https://medium.com/a-journey-with-go/go-how-does-the-gorouti... [2] https://youtu.be/NV46KFV1m-4 https://youtu.be/NV46KFV1m-4
- pharmakom 4y agoNot familiar with Zig but doesn’t colourblindness lose you control over the binding points of the computation? This can be key for optimisation.
- layer8 4y agoIt arguably isn’t fully colorblind: https://gavinhoward.com/2022/04/i-believe-zig-has-function-colors/ https://gavinhoward.com/2022/04/i-believe-zig-has-function-c...
- kbd 4y agoThe mistake that article makes (imo) is that "colorblindness" means at compile-time. i.e. you don't have to define both a sync and an async version of a function. Obviously async vs sync have different representations at run time.
- layer8 4y agoDefinitions aside I’d say that it seems to be a leaky abstraction.
- agentultra 4y agoPretty neat language. One of the few that lets you treat allocation failures are regular errors (and makes writing/adding your own allocators really straight-forward). Although I think HN is probably aware of this lang by now...
- Aaronstotle 4y agoI really like the ziglings collection for an introduction (mainly for beginners but still lots of fun) https://github.com/ratfactor/ziglings https://github.com/ratfactor/ziglings
- rkagerer 4y agoAnyone here using Zig for embedded programming?
- nyberg 4y agoThere's https://github.com/ZigEmbeddedGroup/microzig https://github.com/ZigEmbeddedGroup/microzig and other work within the same space. I've used it for linux-based embedded platforms to both debug and build switches.