6 ms·
Ziglang – robust, optimal, and maintainable programming language
- networkimprov 7y agoInterested to hear what folks see as the major markets for Zig... EDIT: By markets I meant application categories, e.g. OS kernel, firmware, embedded, etc. I'd already gathered that its closest competitors are C and Rust.
- loeg 7y agoReplacement for C (not C++) as a low-level systems programming language. (C++ and other language programmers often conflate C with C++, but the two are really different languages.)
- kyllo 7y agoIt's a systems programming language described as a replacement for C, this blog post shows how to incrementally replace C with Zig in your codebase: http://tiehuis.github.io/blog/zig1.html http://tiehuis.github.io/blog/zig1.html The single-page documentation is here: https://ziglang.org/documentation/master/ https://ziglang.org/documentation/master/ It seems like it would be attractive if you want a systems language that's much more modern than C (and comes with build and testing systems) but you're not interested in Rust's borrow-checker.
- afiori 7y agoAs I understand it is meant to have merge lots of modern improvements but keep the (positive parts of the) feeling of C.
- brianpgordon 7y agoWhat do you mean by "optimal?" You mean runtime performance?
- rodmena 7y agoIt means you can't write bad code in it. When you write something, the code will compile the best way it can behave.
- rodmena 7y agoZig has a number of useful constructs such as sum types, compile-time introspection, improved error handling and no preprocessor!
- littlestymaar 7y ago> Performance and Safety: Choose Two How does Zig manages its memory ? I couldn't find any info on a garbage collector, so I assume the memory isn't dynamically-managed. If it's statically managed, how is it done ? I it using some kind of region-based checking, like Rust with its borrow-checker ? Or is it 100% in the hands of the programmer ? (In which case, the «safety» argument is a bit strange).
- dinglejungle 7y agoIt's 100% manual[1]; that "safety" you're quoting is not referring to memory safety. [1] https://ziglang.org/#Manual-memory-management https://ziglang.org/#Manual-memory-management
- AndyKelley 7y agomemory safety is in fact planned, check out the GitHub issue links at the end of the safety section for more information. I'm excited about those plans - in my opinion it will make zig a real competitor to Rust in particular. Until then rust has the upper hand for the memory safety use case.
- majkinetor 7y agohttps://ziglang.org/#Manual-memory-management https://ziglang.org/#Manual-memory-management
- matthewbauer 7y agoWhat does Zig offer over something like Rust?
- dinglejungle 7y agohttps://github.com/ziglang/zig/wiki/Why-Zig-When-There-is-Already-CPP%2C-D%2C-and-Rust%3F https://github.com/ziglang/zig/wiki/Why-Zig-When-There-is-Al...
- voldacar 7y agoZig truly is a better C, glad to see it getting so much attention around these parts
- dang 7y agoIt's great that people are interested in this, but the topic itself has had significant attention in the past year, which is the criterion we use for dupes (https://news.ycombinator.com/newsfaq.html https://news.ycombinator.com/newsfaq.html). https://news.ycombinator.com/item?id=19811183 https://news.ycombinator.com/item?id=19811183 https://news.ycombinator.com/item?id=19610199 https://news.ycombinator.com/item?id=19610199 https://hn.algolia.com/?query=Zig%20points%3E30&sort=byDate&dateRange=all&type=story&storyText=false&prefix&page=0 https://hn.algolia.com/?query=Zig%20points%3E30&sort=byDate&...