Edit: Just confused myself, comments are // and multiline literals are \\. Thanks to laszlokorte for catching my mistake! Zig claims very proudly it is about clarity but shortly into reading through the documentation I already found this extremely surprising: "Multiline string literals have no escapes and can span across multiple lines. To start a multiline string literal, use the \\ token. Just like a comment, the s…
Zig 0.4.0 Released
31–40 of 141 posts
Re: Zig 0.4.0 Released
#32> 4. blake hash of file contents Why this algo in particular? Is this a security feature? I suppose wrt "Reflections On Trusting Trust" it may be. But if it didn't need to be secure it could probably be a lot faster (assuming this is a critical path for cache hits).
I didn't put a lot of consideration into the algorithm in particular. I was going to do SHA-256 but somebody told me Blake was faster. I haven't tested the performance of any other algorithms, but that's a completely swappable component. I'm sure the hash function will be swapped with a different one before 1.0.0 is done.
Re: Zig 0.4.0 Released
#33Re: Zig 0.4.0 Released
#34Zig's new release has a ton of improvements: new targets (e.g. LLVM 8, WASM, support tiers), C pointers, Vector type, better docs, and my personal favorite: Zig now makes things as static as possible by default. I love seeing all the progress with Zig, V, Muon, and Rust. All these languages are potentially-better systems languages than C/C++, with better safety, better definitions, and better semantics. Zig has an ex…
Honestly, I don't see it happening. Zig and rust and jai and d all feast on c's remains, but the result can only be fragmentation. And then you lose one of the big draws of c: ubiquity. Zig has two compilers. Rust has one (serious) compiler. Jai has 1, d has either 1.5 or 3.5 (depending on how you count). And although all those languages want to replace c as the language-that-you-use-for-everything, and they might ea…
Zig and Jai aren't going anywhere. Zig appears to be a largely single contibutor (https://github.com/ziglang/zig/graphs/contributors the creator has As for rust we don't know yet how big of a chunk of marketshare it will take from new c and c++ code.
Not many people still use c code for "everything", most have already switched.
Re: Zig 0.4.0 Released
#35Earlier quoted context omitted.
Honestly, I don't see it happening. Zig and rust and jai and d all feast on c's remains, but the result can only be fragmentation. And then you lose one of the big draws of c: ubiquity. Zig has two compilers. Rust has one (serious) compiler. Jai has 1, d has either 1.5 or 3.5 (depending on how you count). And although all those languages want to replace c as the language-that-you-use-for-everything, and they might ea…
I don't see any single thing replacing C (or C++) but what's interesting here is many of these languages work very well with the C ABI, not just as an FFI concept but with notions of memory and data layout. The interesting side effect might be that we'll see Zig not just work with C code but Zig work with Jai with D with Rust. All of that code can still interface with C or C++ code (in both directions). This lowers t…
Re: Zig 0.4.0 Released
#36If there's one truth I've learned in my decades of dealing with computers, it's that you can't beat C at being C.
Before now, I'd never heard of Zig in particular, but I can think of several other languages that have tried or are currently trying. A lot of people seem to think they can make something a little better than C, in some ways, and that will be enough. I doubt that even C18 itself, if it were invented from scratch today, would be able to unseat another systems programming language.
Everybody forgot about Worse-is-Better: "Unix and C are the ultimate computer viruses". Any language which isn't more 'viral' than C (in terms of being ported, and attracting users) has no chance. You're starting tiny, and growing less quickly.
Re: Zig 0.4.0 Released
#37Wow, that easy cross-compilation story is great. Neat ergonomic benefits also, like Zip downloading musl on your behalf to create static binaries.
Re: Zig 0.4.0 Released
#38Some of my personal highlights:
- clean syntax
- comptime (as explicit and simple as it should be)
- reflection
- minimal/no external dependencies
- single threaded mode (instead of taking cuts at runtime)
- concise and explicit error handling
- build-in build system
- amazing C interop
...
Good sample code can also be found in the standard library, and it has the benefit of being up to date with with language.
Thanks Andy!
Re: Zig 0.4.0 Released
#39"Zig is aggressively pursuing its goal of overthrowing C as the de facto language for system programming." If there's one truth I've learned in my decades of dealing with computers, it's that you can't beat C at being C. Before now, I'd never heard of Zig in particular, but I can think of several other languages that have tried or are currently trying. A lot of people seem to think they can make something a little be…
Re: Zig 0.4.0 Released
#40Zig's new release has a ton of improvements: new targets (e.g. LLVM 8, WASM, support tiers), C pointers, Vector type, better docs, and my personal favorite: Zig now makes things as static as possible by default. I love seeing all the progress with Zig, V, Muon, and Rust. All these languages are potentially-better systems languages than C/C++, with better safety, better definitions, and better semantics. Zig has an ex…
Honestly, I don't see it happening. Zig and rust and jai and d all feast on c's remains, but the result can only be fragmentation. And then you lose one of the big draws of c: ubiquity. Zig has two compilers. Rust has one (serious) compiler. Jai has 1, d has either 1.5 or 3.5 (depending on how you count). And although all those languages want to replace c as the language-that-you-use-for-everything, and they might ea…