top | item 46447497

(no title)

spoiler | 2 months ago

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).

discuss

order

smeeagain2|2 months ago

[deleted]

ReflectedImage|2 months ago

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.