Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, no. That is not a fair description of Rust. It's got far fewer mistakes than C++ and, get this, it has a mechanism for tentative features that can get revised and fixed based on usage experience. It doesn't always work especially for far-reaching decisions (I hear that async is considered problematic), but it prevents a lot of stupid mistakes that C++ is carrying along forever - with a few exceptions (e.g. garbage collection support, extern templates) and some very notable inclusions (the kind of botched module system, suboptimal unordered_map, std::string which is more of a byte/word array).

I like C++ because I like the fairly unique high performance low level feature set, not because I particularly like most of the detailed design decisions that went into it. Rust has the same goals, but is better thought out IMO. I'm sure that I will find some more trouble in Rust as I use it more, but so far the impression is quite good. I have become pretty good at writing C++ code that works after fixing one or two stupid bugs, and that works even better in Rust, mostly without the stupid bugs because you can't forget to null-check a pointer to another subsystem while starting up etc.



* should have been: high level, high performance feature set

I also call C++ a high level low level language.


[flagged]


You're naming and lambasting multiple different technologies and their communities without justifying why they are so bad. Few people use C without knowing about the threat of buffer overflows or invalid pointer dereferences, and C can be used productively in spite of these obvious flaws. Instead of trying to drive people away from what they do, if you seek understanding then you should allow others to justify their reasons. If you only test your understanding against your understanding, you're not making an assessment at all. You can find and talk to many smart people here and elsewhere, if you so desire.


You're saying "force into this and that" like there's some evil omnipotent entity compelling people to write Rust against their own free will lol. What do you mean by forced? People enjoy writing Rust, so hence it's being written in other projects.

Saying LLVM is written in C++ doesn't really bring much to the discussion. It was released 25 years ago, and C++ was released 40 years ago (hey, it's older than me lol). Rust was released like 10 years ago. So, yeah... I guess it makes sense that they used C++ back then? I'd have picked C++ back then too.

I've written C++ for about 15 years, and I don't have a blind hatred for the languge, but going back to it doesn't fill me with joy either, especially after having written Rust for the past few years.

The module system is more intuitive to use than the preprocessing file concatenation. There's also a nice package manager. I know some people find this a downside though, but I prefer it to fighting autoconf or CMake.

Syntax highlighting for Rust code doesn't lag 10+ seconds.

Symbol search doesn't require three different third-party tools to work.

Documentation is built in AND nice (no doxy doesn't count as nice, not in any universe).

Testing is built in. There's a (mostly) homogeneous build system

The borrowing rules are things you think about in C++ anyway, but Rust just makes it so you don't forget them; there's some clang lints that help with this in C++ anyway.

The syntax, while sometimes a bit noisy, is nicer in the average case, but C++ has been getting better in that regard.

There's much fewer API gotchas with Rust than with C++ (from the top of my head: closures, std::optional, std::variant, iterators, {a..z}values, a managerie of constructors, SFINAE, all these things have pain in the ass built in as a core principle). I also despise function overloading.

The macro system, while I don't like it too much in Rust, makes things

The type system in Rust is so much better it's not even comparable.

But anyway, Rust has some downsides. It requires you to change how you design solution sometimes. The compilation times are crap (but the compilers also does so much).


[flagged]


The military isn't going to allow C++ anymore due to it being a massive security hazard. You can't get away with buffer overflows, use after frees, data races, etc. forever.

Due to an evil entity called the military industrial complex, you are going to be using Rust in the future.


[flagged]


Well it's in Windows, Linux and Mac OS kernels. So you moving into Retro computing?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: