Zig vs Rust. Which one is going to be future?
I think about pros and cons and what to choose for the second (modern) language in addition to C.
- dudinax ( @dudinax@programming.dev ) 8•4 hours ago
Rust. It’s a qualitative improvement over the old ways.
The future won’t belong to Rust itself, but one of its descendants. Rust is too clunky to be the ultimate expression of its best ideas.
- xigoi ( @xigoi@lemmy.sdf.org ) English1•57 minutes ago
What does Rust improve over its predecessor? The only really new thing is the borrow checker, which is only useful in very low-level programming.
- lorty ( @lorty@lemmy.ml ) 6•4 hours ago
Unless Zig starts its own cult, I feel Rust will win in the end.
- TehPers ( @TehPers@beehaw.org ) English19•6 hours ago
Honestly C is the future. I don’t know why people would move from C to any other language. It does the job well enough that there’s no reason not to use it.
Think about it. Every modern application depends on a piece of code written in C, not Rust or Zig or any other language (except assembly). It can be used to solve any problem, and works in more places than any other language.
These arguments about “security” and “memory safety” are all pointless anyway in the face of modern code scanning tools. Cross-platform dev can be done trivially with preprocessors. If that’s not enough, I don’t know what to say. Get better at writing C obviously.
Lifetimes and UB should all be kept in mind at all times. You can explicitly mark lifetimes in your C code if you want using comments. Any index-out-of-bounds bugs, use-after-free, etc are just signs that your team needs more training and better code scanning utils. Write more tests!
Anything more complex than a simple
typedef
is just a sign that you’re over-engineering your solution.#include
is both simple, and does exactly what you’d expect any reasonable language to do - paste your referenced code inline. It’s genius, and doesn’t require any complicated explanations on namespaces and classes and subclasses and so on.So which will be the future? C obviously.
/s
- QuazarOmega ( @QuazarOmega@lemy.lol ) English3•6 hours ago
this was SO well written it was lowkey infuriating
- slacktoid ( @slacktoid@lemmy.ml ) English14•5 hours ago
The number of people that genuinely believe this ( I saw the /s) … Tells me that they haven’t written any useful C or C++ code
- TehPers ( @TehPers@beehaw.org ) English4•5 hours ago
I’m not going to say that C is unusable by any means (and I’m not saying you are saying that). It’s a perfectly usable language. I do think that more people would benefit from exploring other options though. Programming languages are tools, not sports teams. People should familiarize themselves with many tools so they always have a good tool to use for any job.
I think a lot of people believe this because there is some truth to parts of it. I think we see languages like Rust and Zig (and others) popping up to try and solve specific problems better than others.
As for OP’s post, there is no single “C successor” or anything like that. People will use the best tool they know of for the job whether that’s C, Rust, C++, Zig, Python, C#, etc. Many languages will “replace” C in some projects, and at the same time, C will replace other languages in some projects (likely to a lesser extent though).
(Not /s this time)
- slacktoid ( @slacktoid@lemmy.ml ) English2•2 hours ago
Oh completely. C is here to stay, C has surpassed language and become protocol cause of libc being so centric to Unix like languages. But it needs to be done carefully and thoughtfully. The other languages are solving some of the pain points C has which I think a lot of people would be better off using than C.
- a1studmuffin ( @a1studmuffin@aussie.zone ) English4•4 hours ago
… or worked in a large team with juniors and members coming and going over a long period of time.
- robinm ( @robinm@programming.dev ) 16•6 hours ago
You got me in the first 3 quarters, not gonna lie!
- OpenStars ( @OpenStars@discuss.online ) English6•6 hours ago
Isn’t exactly this kind of thing what is mostly responsible for the demise of Perl?
As I heard it told, the developers of Perl worked so long & hard on the next version after Perl 5, but then veered off to make a new language (Raku) and despite the reality being otherwise, people feared so much that Perl would die (i.e. that 6 would never materialize) that in the meantime “everyone” had switched to Python (despite it clearly being an inferior language - hehehehe:-P).
So that would be a “con” I suppose, if fights over which language is better ends up diluting efforts to work on or with either.
- mox ( @mox@lemmy.sdf.org ) 1•19 minutes ago
Isn’t exactly this kind of thing what is mostly responsible for the demise of Perl?
Perl died because better tools became available.
- macniel ( @DmMacniel@feddit.org ) 6•7 hours ago
Who wants oxidised Metal when you can take off every Zig! You know what you doing!? Move Zig. For great justice.
- G0ldenSp00n ( @G0ldenSp00n@lemmy.jacaranda.club ) 1•6 hours ago
Rust is named after the fungus, not oxidized metal
- vrek ( @vrek@programming.dev ) English1•3 hours ago
Python is named after Monty python and not the snake
- I Cast Fist ( @ICastFist@programming.dev ) 2•2 hours ago
Brainfuck is named after… uh, something
- thingsiplay ( @thingsiplay@beehaw.org ) 1•7 hours ago
Both. Why can’t we have both?