3 ms·
Does anyone actually use Zig in production? I've only ever read about it here on HN. There's no avoiding Rust. It's becoming the jQuery of systems programming.
by secondcoming 6y ago
Does anyone actually use Zig in production? I've only ever read about it here on HN.
There's no avoiding Rust. It's becoming the jQuery of systems programming.
C++ has lost the plot in some respects but you don't, and probably won't ever, end up using all of it. A lot of it is to make it easier to write things like the STL, not your typical end-user program. Learn up to 17, there's some good stuff in there. If someone in an interview gives you some highly complex templatey code snippet to analyse just tell them to go fuck themselves.
- gpanders 6y ago> Does anyone actually use Zig in production? Likely not, or at least they shouldn't, as it still has yet to have a 1.0 release and is undergoing constant changes in syntax and API. However, that doesn't mean one can't take the time to learn it right now. Zig shows a lot of promise for being a real contender in this space once it does have a stable release.
- UncleOxidant 6y ago> Does anyone actually use Zig in production? As I'm mostly retired at this point, I don't really care how marketable skills are anymore. I go for what looks interesting.
- secondcoming 6y agoLucky you!
- chubot 6y agoI agree that C++ has lost the plot, but I find that it's a very good language for code generation. I don't write it directly, but I use its incredible compilers and ecosystem, including multiple profiling and debugging tools (uftrace is a nice one that even dynamic languages seem to lack). I'm translating a subset of statically typed Python to C++: http://www.oilshell.org/blog/2020/05/translation-progress.html http://www.oilshell.org/blog/2020/05/translation-progress.ht... http://www.oilshell.org/blog/2020/01/parser-benchmarks.html http://www.oilshell.org/blog/2020/01/parser-benchmarks.html I use very much a "pidgin" subset of the language -- one that is easy to step through in the debugger! The problem with all these fancy new features is that you're more likely to trip over bugs in the debugger, e.g. incorrect line number information and stack traces. So the generated code doesn't even use operator overloading, which e.g. C++ 11 range for loops require. I want to be able to see everything. Yet I also want to use features like templates, virtual methods, and strict enums, which C doesn't have. ----- Another "modern" project that does this is the Souffle datalog compiler, which generates "monolithic" C++ programs with heavy use of C++ templates: https://souffle-lang.github.io/translate https://souffle-lang.github.io/translate (I heard about it due to its role in prototyping Rust's type system) C++ templates are not fun to write but they have some interesting properties for code generation. ----- So I would happy if we stopped writing C++ by hand. But I do not like the alternative rewriting inferior versions of existing programs/libraries in entirely new languages. They often have new bugs, are slower, and have fewer features. I really like what Zig is doing to reuse existing code (i.e. bundling a C compiler). I think that both Rust and Go ecosystems have led to a lot of fragmentation and redundant efforts.
- chubot 6y agoaddendum: So I think there is also room for more languages that compile to C++, and live within its ecosystem rather than fragmenting it. The "History of Clojure" paper has a nice view on that. Why Clojure is tied to the JVM. So it's part of the ecosystem rather than fragmenting it.
- fulafel 6y agoThought experiment: What feature additions would modern C++ need to be a good Clojure compile target? Besides the obvious GC.
- _hl_ 6y ago> Does anyone actually use Zig in production? Zig is cool but still very much unstable, running it in production is very much not recommended and/or insane. There's still quite a lot of compiler/stdlib bugs, design edge cases, and breaking changes including introduction of new bugs. But it's amazingly refreshing for hobby stuff!
- deleted 6y ago[deleted]
- kbenson 6y ago> There's no avoiding Rust. It's becoming the jQuery of systems programming. I'm not sure if that's meant as a good thing or a bad thing. Given the target audience, I expect a good thing, as for people not entirely immersed into JavaScript and web development at the time (which I expect most people reading about C++ features here were not), jQuery was a godsend. It gets kind of a bad wrap these days, but from my perspective, JavaScript just adopted all the paradigms it encouraged into the language so it's no longer needed. Hard to argue with that success, IMO.
- ben509 6y agojQuery was undermined not because it wasn't a good idea or it was poorly designed, but because it matured early on and Javascript evolved rapidly enough that the technical premises it was built on no longer applied. A more concrete example of this is Windows and Java's use of UCS-2 as their character type. That was a forward thinking move which then became a painful legacy issue when Unicode changed. That's inevitably going to happen to Rust to some extent, but it's targetting a realm that is far slower to evolve and it seems like they are very mindful of history and theory.