5 ms·
I've been doing a lot of rust lately and I have to say it blows c/c++ out of the water. Sure, c/c++ has more libs, but almost every other feature in rust is fan
by jfaucett 10y ago
I've been doing a lot of rust lately and I have to say it blows c/c++ out of the water. Sure, c/c++ has more libs, but almost every other feature in rust is fantastic, and wrapping a clib via ffi is really easy in rust. My only (minor) complaint with rust is that they aren't pushing no_std enough IMHO, but I'm biased since all my code is no_std :) so obviously I'd like to see a lot less work in the stdlib and more on stabilizing low-level stuff and creating better apis there for doing things that are currently kind of annoying like creating your own data structs, and doing bit manipualations in fast math libs, etc.
Anyway rust is awesome, especially cargo (finally sane build/package management/versioning for a systems language). I will never code in c++ again if I can help it.
- un008 10y agostop the hype, please.
- vitiral 10y agoOne of their (more minor admittedly) goals this year is to improve/stabilize no_std as well as make std more portable. Looking forward to another great year in rust!
- steveklabnik 10y agoTo be clear, no_std is itself stable, but when creating a binary, you need two language items, and those aren't stable. It's not 100% clear what the right path is yet for that, but we'll get there. :)
- KuiN 10y agoCan you explain what you mean by "you need two language items"? I'm just getting into Rust now and planning some bare metal stuff.
- steveklabnik 10y agohttps://doc.rust-lang.org/book/no-stdlib.html https://doc.rust-lang.org/book/no-stdlib.html (This link will change in one or two releases; I landed a new "Unstable Book" a few days ago.) The TL;DR is Rust expects certain stuff to be implemented in Rust code to work, and that's provided by the standard library. When you don't use the standard library, libcore implements all but a few of them. Implementing them is not yet stable.
- steveklabnik 10y agoThis is now at https://doc.rust-lang.org/nightly/unstable-book/lang-items.html https://doc.rust-lang.org/nightly/unstable-book/lang-items.h...
- steveklabnik 10y agoSo glad to hear you're loving Rust! https://github.com/rust-lang/rust-roadmap/issues/15 https://github.com/rust-lang/rust-roadmap/issues/15 is the roadmap item for some things relating to this; id you want to chime in with your pain points here, that'd be very helpful!
- agumonkey 10y agoThe rust team deserves a thanking rally for pulling this off.
- RcouF1uZ4gsC 10y agoBy that way, in referring to C++, are you referring to modern C++ or C with classes? Whenever is see people criticizing C/C++, I suspect they are doing C with classes style programming and (rightfully) hating that.
- coldtea 10y ago>I suspect they are doing C with classes style programming and (rightfully) hating that. Rightfully? People resort(ed) to "C with classes" to make C++ tolerable and/or reliable. If anything, it's the opposite: when most people complain about C++ it's about C++ itself, the full language, and its whole baggage of features and their obscure interactions and intricacies. Not about using C++ as C with classes.
- flohofwoe 10y agoUsing C++ as "C with classes" with some carefully selected new features is an absolutely fine subset of the C++ language and IMHO the only way to circumvent the mess that C++ has become. The problems are the huge pile of cruft that has accumulated over the years in the std library, the boost-over-engineering approach, and the unfocused development of the language (instead of cutting the cruft down new standards add random new features on top of the existing mess). The current 'shiny new languages' will probably look the same in 30 years though.
- drbawb 10y ago>Sure, c/c++ has more libs, ... My problem is honestly that Cargo has spoiled me. C (& C++) may indeed have more libraries; but adding them to a project is a non-trivial exercise. Assuming your project subscribes to the "build it with one command" philosophy then: - You'll need to install the target project's build system - You'll need to invoke that from your project's build system - You'll need to copy those artifacts (which depends upon implementation details of their build system) to the right output directory (which depends upon implementation details of your build system.) - Then finally you get to include the headers complete with ifndef guards. (Honestly it's getting increasingly more difficult for me to even tolerate C/C++ header files.) - P.S: probably repeat this list for every target platform you build on. --- When installing a package takes a single line of configuration, or a single command, I am far more likely to ignore my "not invented here shoulder-demon" and just add a 3rd party dependency. In C/C++ I actively avoid adding dependencies, regardless of how numerous they may be.