3 ms·
While you're right about Zig being a step back from Rust, a lot of people are not willing to make the large step to go from C to Rust (maybe from C++, the step
by brabel 4y ago
While you're right about Zig being a step back from Rust, a lot of people are not willing to make the large step to go from C to Rust (maybe from C++, the step is much smaller, but Zig is in the C league, not C++).
I think it will be successful despite that, because we've seen this happen before in other ecosystems... e.g. Scala was a large step away from Java, while Kotlin is a much smaller one, and in a way, you could also describe it as a step back from Scala. Yet, despite being younger, Kotlin has already surpassed Scala according to some rankings and has some major projects already (maybe more than Scala) investing heavily on it, like Android and Gradle.
Perhaps, another example is Elm... much simpler than Haskell or PureScript, but it seems to be by far the most popular functional language on the frontend.
Finally, I've written some Zig and definitely didn't feel like I have to debug a lot of segfaults... the tools to avoid that problem are already pretty good (the debug memory allocator is almost as strict as the Rust borrow checker and will keep you on check!) and even having little experience manually managing memory, I was able to get stuff done quite easily (unlike with C which I do find extremely dangerous on my own hands).
- pjmlp 4y agoFor me, Zig is Modula-2 with C syntax, and some cool metaprogramming capabilities, much better than C will ever be, but I expect something better than what a 1978 systems programming language was offering in regards to safety (or NEWP from 1961 for that matter). I guess in the end should be happier that more Zig and less C gets written.
- zozbot234 4y agoRust is a lot simpler than C++ or Scala. It has some upfront complexity wrt. C or Zig, but that pays off when dealing with larger programs, where avoiding subtle bugs becomes much harder.
- pjmlp 4y agoTwo macro systems, async/await runtime puzzle, pin, references to const values, build scripts, eventually its own GADT equivalency,.... It isn't there yet, but wait for 40 years industry adoption will make to it.
- IshKebab 4y agoNow do C++! He didn't say it is simple; he said it is simpler than C++. Now, I'd say they're on the same order of magnitude for simplicity. The huge advantage Rust has is that it tells you when you got it wrong, whereas C++ says "OK, I will put the toast in the fridge."
- pjmlp 4y agoA language with 10 years history is simpler than one with 40 year of legacy.... While Rust is definitely an improvement over C++, it remains to be seen how those 40 years of legacy will look like.