Having a modern language that attempts to directly model low level systems is very important.
I concur with the suggestion of 2^19, because even though fewer people would recognize it immediately, many of them would question the significance, and their eventual realization would be more satisfying.
I think you might be overestimating the curiosity of the average person.
I'm regularly baffled / saddened by how many people care so little about learning anything new, no matter how small.
Is it a woe of modern times? Or has it always been this way?
Oh absolutely. But I like to optimize for the others. :)
Also, the audience for consideration here is pretty ... rarified. 0.0% of people in the world, to a first approximation, have heard of Zig. Those that have, are probably pretty aware of powers-of-two math, and maybe curious enough to wonder about a value that seems odd but is obviously deliberately chosen.
> Is it a woe of modern times? Or has it always been this way?
I suspect it's always been this way. People are busy, math is hard, and little games with numbers are way less engaging than games with physical athleticism or bright lights.
In a different place, at a different time, I would have used the same exact wording.
I think we would be very good friends IRL :D
Mad props to them for picking up my joke and turning it into a recurring donation.
> There are no plans to move the NATS server to Zig.
> Zig will become a Tier 1 NATS client, and Synadia will utilize Zig in resource constrained environments to bridge OT/IT for manufacturing, IIOT, connected cars, robotics and embodied AI.
Still I use jom for building but I may move to Zig build
i understand zig as a better C, but in what world is another memory unsafe language a good idea?
i mean i kinda get if the thing you are writing would require LOTS of unsafe, then zig provides better ergonomics
however most programs can definitely be written without unsafe and in that case i dont get why wed do this to ourselves in 2025
why not take advantage of memory safe, and data race safety?
Conceptually C and C++ are also in that potential solution space, but I'm sure they feel that Zig's properties are superior for what they want.
Discussion then: https://news.ycombinator.com/item?id=45703926
The Rust Foundation on the otherhand…
I might miss your point, but I don't see the difference.
Remember people, 10,000 CPU hours of fuzzing can save you 5ms of borrow checking!
(I’m joking, I’m joking, Zig and Rust are both great languages, fuzzing does more than just borrow checking, and I do think TigerBeetle’s choices make sense, I just couldn’t help noticing the irony of those two sentences.)
This is what makes TigerBeetle context somewhat special --- in many scenarios, security provided by memory safety is good enough, and any residual correctness bugs/panics are not a big deal. For us, we need to go extra N miles to catch the rest of the bugs as well, and DST is a much finer net for those fishes (given static allocation & single threaded design).
Mathematically speaking, any simple (i.e. non-dependent) type system catches 0% of possible bugs :) That's not to say it can't be very useful, but it doesn't save a lot of testing/other assurance methods.
[1]: https://cwe.mitre.org/top25/archive/2024/2024_cwe_top25.html Also, spatial safety is more important for security than temporal safety. As far as language guarantees go, Zig and Rust only differ on #8 on the list.
Having a serious, dedicated, and smart partner, in industry, working hard to operationalize and turn a profit on the language is a massive boon to the whole project (and it would be even if they didn't choose to give back monetarily, but all the more since they are!).
morkalork•2mo ago
Edit: Thank you all for your responses!
letmetweakit•2mo ago
mutkach•2mo ago
- Do you like filling out the type annotations in Python (making sure linter check passes)? Do you like TYPES in general?
- Do you like working with memory (crushing memory bugs, solving leaks)?
- Do you prefer imperative or functional approach more?
morkalork•2mo ago
I do like working with memory, seeing a custom slab allocator used in production code was one of the more interesting aspects of the little experience I had with c++, but always having to be "on guard" so as to not shoot myself in the foot with pointer manipulation was kind of exhausting.
I like both.
mutkach•2mo ago
simonw•2mo ago
Hacker News discussion: https://news.ycombinator.com/item?id=46153466
grayhatter•2mo ago
For hobby projects, zig will get you *much* closer to the underlying system. So if your goal is systems programming where you're responsible for and get to play with the system itself. Zig will get you there much faster, and the language wont take much time to learn and have fun with.
Surely someone will now attempt to correct me, by asserting it's impossible for anyone to write safe code without rust, and it's improper for me to even suggest Zig. But I'm enjoying the language a lot. It's easy to pick up and understand, and importantly it gets out of your way quickly so you can build exactly the system you want.
For more complex or professional projects however, I would still recommend Zig but more because I can't stand rust. It bothers me that it rejects valid programs because the compiler is unable to prove what I can. So the additional dance rust requires ruins an otherwise fine language.
edit: my default language before zig was also python, so feels reasonable to also mention that I'm pretty sure it'll be significantly easier to transition from python into Zig rather than into rust. There's a number of idioms and expectations from python that fit well in zig, but dont fit in rust.
matklad•2mo ago
If you don't have time to learn both, then learn Zig, as it requires much smaller time investment (though do try to find time for both).
vlovich123•2mo ago
https://docs.rs/comptime/latest/comptime/
CathalMullan•2mo ago
smj-edison•2mo ago
zozbot234•2mo ago
the__alchemist•2mo ago
the__alchemist•2mo ago
Note that there are a number of domains where Zig might be a practical option in the future, but aren't now due to library support. With Rust, you will reinvent wheels more than most people have an appetite for. In Zig, you will do this for most things.
AlotOfReading•2mo ago
The main complaint about the borrow checker is that what seem like trivial changes can have subtle implications that require wildly different ownership patterns to be made correct. Rust tells you something's wrong. If you don't thoroughly understand how you're using pointers (which few people do), it can feel like trivial changes exploding into much larger refactors than you'd need in languages where the rules aren't statically enforced.
SatvikBeri•2mo ago
whatshisface•2mo ago
Zambyte•2mo ago
It links out to the standard library documentation, which is also comprehensive and easy to navigate: https://ziglang.org/documentation/master/std
ulbu•2mo ago
no, the docs really don’t cut it.
it is strongly opinionated about the correct way to do things but it leaves you to your own devices to piece together an understanding from source code, ziggit, and discord.
Zambyte•2mo ago
That is currently in the process of changing. Of course people are discussing things that are changing.
> no, the docs really don’t cut it.
Yes they do :) - source: have written multiple small projects in Zig.
I encourage you to actually read the page I linked from top to bottom if you are interested in learning Zig. I did it because mitchellh mentioned in an interview that it's what he did. It's easy to follow, useful, and not an overwhelming amount of information.
ulbu•2mo ago
the source code has always been the main source of truth and documentation. which means no documentation. std is littered with undocumented behaviours, the build system is still something many people use half-blind. and while i’m fine with breaking changes, but the way they’re just dropped onto our laps with, it seems, almost zero thought put into how to acquaint the users with it. (i started to feel almost as if patience in introducing the concepts and interfaces is one of those things that is below andrew)
while i admit that zig’s authors’ claim to technical excellence is deserved, communication has never been excellent. i’m sure there are people who would gladly involve themselves in documentation efforts, but the chances of receiving andrew’s ire and demeaning disposition are so great that it might be paralysing such efforts leaving it to the Guy himself who's not too wont to educate others.
schaefer•2mo ago
flohofwoe•2mo ago
For some people the huge 'surface area' and strict type system of Rust is a big turn-off, while others want exactly that from a programming language.
vlovich123•2mo ago
One main difference is that Rust is guaranteed memory safe with generally no runtime overhead for that safety. It also has protections and abstractions to make multithreaded code safe and generally correct.
lenkite•2mo ago
Depends on your definition of safety and correctness. Async Rust does not prevent deadlocks and make them very difficult to detect
https://rfd.shared.oxide.computer/rfd/0609
bbkane•2mo ago
Zig is gaining integration into larger projects (Ghostty, TigerBeetle, Roc, Ubers build system come to mind), but it's not yet achieved Rust's success
Vaslo•2mo ago
cmrdporcupine•2mo ago
Disappointingly as a Rust dev, I don't actually see a lot of Rust being used for "systems" development (OS, driver, DB internals, embedded, etc), but increasingly for network services/web services/web stack work, heavily biased towards tokio async driven applications. It's a lot of engineers living further up the stack, leaning on frameworks, and in applications with very large dependency tree footprints. As a % anyways. There's a lot more Rust code out there than Zig.
I think Zig has a far more minimalistic thing going on and I like that. I find its type system a lot more primitive, and would miss ADTs/enums, and the borrow checker etc. but I like its overall philosophy better.
whatshisface•2mo ago
lacker•2mo ago
whatshisface•2mo ago
Zambyte•2mo ago
Zambyte•2mo ago
It really depends what you mean by "interesting" :-)
smj-edison•2mo ago
Rust feels like "let's take the best safety features from both", while Zig feels like "let's take the best transparency from both". In a way, Rust's traits are more foreign to C++ than Zig's comptime, as Zig has similar duck typing (though the ergonomics are much cleaner, especially with @compileError).
jgilias•2mo ago
I see Zig as being a lot more in C tradition and lineage with nicer and safer memory management techniques. Also comptime (Lisp-ish there?)
My two cents
hackermailman•2mo ago
Systems programming can be done in ocaml or any language really where there is some documentation on the runtime how not to trigger the GC or flags that can be passed to custom set GC policy