>None of this means Rust is "bad" or that C is "better". It means they optimise for different values. Rust optimises for correctness and maintainability under heavy abstraction. C optimises for transparency and minimalism under extreme constraints.
>Sometimes you don't want a language that keeps you safe. Sometimes you want one that simply gets out of your way.
D lang is a wonderful Goldilocks in this regard between C and Rust. It has D-as-better-C [1]. There's no head scratching macro, excellent meta programming, bare metal programming and fast compile time and run time [2]. The programming syntax is very intuitive with UFCS [3].
Forget safety. Using enums in Rust is sheer delight. The fact they can even contain associated data is the really powerful. That alone makes me love the language. Especially with bitfields.
It cannot be matched in in C, even with a lot of macro magic. Plus, C is way too lax with type strictness and enums.
This looks like it was written by an LLM. Not complaining, because my major use of LLMs is rubber-ducking, not code-generation, and I very often get responses like this when doing repeated iterations and deep-diving into a review/comparison.
The concepts are probably the authors, but the text we are seeing is probably the LLMs.
Regardless of the LLM overtones, this is still decent content.
The problem is not that {language} does or does not do or have {thing}. The problem is managers expecting the work product of coders who only half know the language that they are working in to be productionizable.
I think this is weirdly resonated with me. I used moved to Rust from C for embedded programming, and realized that my whole paradigm shifted on how I write programs.
Rust is much more than safe(r) C, it is different approach of architecting apps to have safer relations between components. Now that I am looking at my old code, I see how it would benefit from this paradigm.
And it also a 'problem' with Rust - it requires one to think differently. You can write Rusty code in C, and indeed results are just better, but trying to write Rust in C style would lead to fighting compiler and suffering.
Other languages, like Zig or Go, they chose different approach - to decorate C with modern features, and that works too.
Yet another Rust article that ignores the choice among memory safe languages, including the ML linage that inspired Rust's type system.
The only reason to pick Rust instead of one of those, is exactly because the memory safety without GC that it offers, when any form of automatic resource management, be it in whatever form, is not possible, or welcomed by the domain experts.
The choice between Rust and C-derived languages is not only about memory safety
(bbuyukliev.blogspot.com)38 points by bluetomcat 22 hours ago | 14 comments
Comments
Even when I need what C does "well" from the author's pov I can just wrap my code in a big unsafe {} in Rust.
I still get a bunch of things from the language that are not safety- but ergonomics-related and that I would't want to miss anymore.
>Sometimes you don't want a language that keeps you safe. Sometimes you want one that simply gets out of your way.
D lang is a wonderful Goldilocks in this regard between C and Rust. It has D-as-better-C [1]. There's no head scratching macro, excellent meta programming, bare metal programming and fast compile time and run time [2]. The programming syntax is very intuitive with UFCS [3].
[1] Better C:
https://dlang.org/spec/betterc.html
[2] Ask HN: Why do you use Rust, when D is available? (255 comments):
https://news.ycombinator.com/item?id=23494490
[3] Function:
https://dlang.org/spec/function.html
It cannot be matched in in C, even with a lot of macro magic. Plus, C is way too lax with type strictness and enums.
The concepts are probably the authors, but the text we are seeing is probably the LLMs.
Regardless of the LLM overtones, this is still decent content.
Rust is much more than safe(r) C, it is different approach of architecting apps to have safer relations between components. Now that I am looking at my old code, I see how it would benefit from this paradigm.
And it also a 'problem' with Rust - it requires one to think differently. You can write Rusty code in C, and indeed results are just better, but trying to write Rust in C style would lead to fighting compiler and suffering.
Other languages, like Zig or Go, they chose different approach - to decorate C with modern features, and that works too.
The only reason to pick Rust instead of one of those, is exactly because the memory safety without GC that it offers, when any form of automatic resource management, be it in whatever form, is not possible, or welcomed by the domain experts.