Hacker News new | ask | show | jobs
by jvanderbot 1895 days ago
It is. It's not going to replace Python, and if maintenance is the metric, then "rewrite it in rust" is not the right move. But I do think Rust will gain traction, be a round a long time, and slowly become a complement to existing C/C++ ecosystems through wrapping and binding.

I'm just not sure the other way will materialize. Until Rust can be used to feed back into C/C++ ecosystems and long-standing projects (like the linux kernel), it'll struggle to be the primary ecosystem / language for non-new (e.g., non-trivial) projects.

1 comments

At this point Rust is not the prmary ecosystem for anything.

The important and exciting new things are written in C++, not Rust. Rust has no advantages over C++ once you know C++.

I find a lot more things that I like in rust over Cxx; I like the trait system over Cxx's whole virtual functions and interfaces. I like algebraic types and forced enumeration of cases, I like immutable by default without the need to write const everywhere, and I certainly prefer cargo over anything I have seen in Cxx ecosystem.
I agree that Rust isn't the primary ecosystem. But that's not a reason to dismiss Rust. If Rust could create components that can be incorporated into C/C++ systems, then we'd have a real contender for systems programming. The problem is Rust is strict, and it only goes one way, from C/C++ to Rust. That's the right first step!

Saying C++ is better than Rust "once you know it" doesn't make a lot of sense to me. No language is intrinsically better once mastered by a productive programmer.

Isn't this what the cxx project is aiming to do? https://github.com/dtolnay/cxx
This statement is wrong. Rust has many advantages over C++. Knowing c++ doesn’t make these advantages disappear. It’s like saying you know assembly language and can write 100% bug free code in assembly so C++ has no advantage over it.

Realistically, both languages have advantages and disadvantages.

I would counter then that it's impossible to ever "know C++" then given that even C++ experts write in memory-based security exploits from time to time.