3 ms·
If you’re looking for more “PL ADD” fuel, don’t forget to look into Zig! https://ziglang.org/ https://ziglang.org/ Of all the modern systems level programming
by electrograv 7y ago
If you’re looking for more “PL ADD” fuel, don’t forget to look into Zig! https://ziglang.org/ https://ziglang.org/
Of all the modern systems level programming languages I’ve seen, I like Zig the most. It combines a powerful, modern type system (generics, algebraic data types, statically checked null references) with an impressive simplicity (e.g. without the productivity-consuming and mentally burdensome “borrow checker” of Rust).
- bb1234 7y agoQuestion: For someone who does not know either Rust or Zig, would you say that Zig also has tools that help the programmer protect from data race conditions (I have read that Rust is helpful in this regard)?
- totalperspectiv 7y agoI have looked at Zig! It looks sweet, but a little to early days for me personally. For example, there's no documentation on how to open a read a line from a file. The best I can find is an example implementation of `cat` in the source repo. I will certainly be coming back to it at some point though.
- pcwalton 7y ago> without the productivity-consuming and mentally burdensome “borrow checker” of Rust The borrow checker also gives you memory safety, which Zig does not have at the moment. Solving use-after-free and related issues is a hard problem. I have yet to see a way to solve it that doesn't boil down to one of runtime garbage collection, not allowing heap allocation at all, not freeing memory at all, or a region system/borrow checking. It's fine to not like the borrow checker, but it's there for a reason.
- pjmlp 7y agoYeah, but currently it still is a roadblock when writing GUI code, to the point that Gtk-rs samples use macros to overcome the boilerplate to access widget data from callbacks.
- littlestymaar 7y agoI'd not call the borrow-checker "productivity-consuming" : it is indeed a tough challenge for somebody learning the language, but in the medium/long run it becomes totally transparent when you've internalized its expectations. I've been working in Rust full time for one year now, and the only time I really had to think hard about "how to write this piece of code while complying to the borrowck rules", I was really happy to have it, because I would have written a nasty memory bug if nobody told me that I was doing something stupid. It comes with a steep learning curve though, and I remember giving up three times in two years when I decided to give Rust a try. It eventually clicked on the fourth attempt(Idk if the docs had evolved between the third or fourth time or if it's the result of the slow progress I made through the three first try) but now, I really happy with the language.