Coincidentally, I just started writing some rust... I find this sentiment strange; people don’t look to other languages because you can’t do something in c++, but more often because you can.
-
-
-
Good point, yes, C++ is a behemoth of a language, it can do many things (it's debatable how good it does them, though). Everybody has their own sort of dialect. Maybe we should've looked into formalizing that, instead of inventing a bunch of new languages.
-
And, like the entire history of C++, now you have fancy-new-feature *and* everything you had before. The C++ community will never break the world to gain safety.
-
Yes. How is that a bad thing? I'm wondering what Rust will do. Will it just break/alter your code and tell you to deal with it?
-
When you consider how many years it's been since C++ was created, Rust is more than overdue. It's simply not possible to shoehorn new concepts into an old language without tearing away most of that concept's value. Rust has them deeply embedded into the core language semantics.
-
Rust isn't the first to attempt this, though. Remember D? D did many things right, too! Still never caught on.
-
I wouldn't consider D as an attempt for a number of reasons. It released as a proprietary language with a standard library that required a runtime garbage collector. Different target audience. By the time it somewhat got into shape, Rust was already here, and vastly superior.
End of conversation
New conversation -
-
-
Likely ignoring it with good reason too. Name a specific feature if you want to talk details :P
-
Strong static typing, for examples. One of C++'s staples for a long time. Praised as being great in Rust, yet almost completely ignored in C++.
-
Except that Rust is mostly type-safe while C++ is not.
-
Primitive types aren't in C++, that's correct. But beyond that, C++ is fully type-safe. And you can also coerce "primitive" types to be fully type-safe.
-
"Fully type safe" kind of depends on what you mean by "type safe" and what language features you're using. It's type safe as long as you only use dynamic casts and always check the result, and, of course, don't have undefined behavior.
-
I've seen a couple Rust devs claiming C++ isn't type safe by pointing out how the implicit conversions throw it out of the window. Unfortunately, most are "deliberate" mistakes.
-
... I don't understand what you're saying. The *point* of type safety is *safety*, i.e. protecting yourself from mistakes. Implicit conversions break that protection, so they're not type safe.
-
Let me phrase it better. C++ is type-safe. The C++ standard library is not.
- 1 more reply
New conversation -
-
-
They've been criticizing them for years because the ergonomics are so bad that c++ features might as well not be there.
-
Having features in your checklist isn't enough to drive adoption. Not surprising that when they show up as coherent and usable somewhere else, people are excited.
-
That's actually a very good point. Maybe I've come accustomed to the abominations of C++ (I still believe most of my C++ is miles ahead in readability and ergonomics than my old C).
End of conversation
New conversation -
-
-
Defaults matter. `let` is immutable by default in rust, for example; references are safe and explicit (and pointers are for the ugly optimized unsafe code). Also, sum types and pattern matching :) C++ can do similar things but the ergonomics is often terrible…
-
Yes, unfortunately, C++ is the language of wrong defaults.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.