2 ms·
I find this comparison much easier than comparing C and Rust. C has an extensive and still unparalleled set of libraries available using the C calling conventi
by JoshTriplett 10y ago
I find this comparison much easier than comparing C and Rust. C has an extensive and still unparalleled set of libraries available using the C calling conventions; both C++ and Rust can call those libraries but often want a translation layer that adapts to the conventions of the language. C++ and Rust both have extensive libraries of their own; while C++ has been around longer, you'll still often find yourself needing to use a C library because a native C++ library doesn't exist. (It doesn't help that C++ has gone through several ABI changes, and still doesn't reliably have a cross-compiler compatible ABI the way C does; even clang++ and g++ have had various incompatibilities, and still prefer separate C++ standard libraries. C remains the reliable ABI for libraries.)
While I'm impressed with the changes in modern C++11/14/17, it has both the feature and problem of still including classic C and C++. There's a reasonable subset of C++ to program in, but nobody can quite agree on what that is, and a codebase can't easily enforce that. And C++ is still a very large language, with quite a bit of surface area in the language itself; I prefer a smaller language with a large library ecosystem.
Rust is still quite young. It's incredibly fun to program in, has the most welcoming community I've ever seen, and can help you write safe, expressive, high-performance code. (Tip: check out the "rayon" crate for incredibly easy parallelism.) It has an extensive library ecosystem, and a robust FFI to call (or be called by) C code. However, depending on what you're doing and and how many boundaries you're pushing, you may find some corners of the language still under active development; for instance, if you want to embed some Rust code into a broader build system that builds various other components under other languages, support for that just went into Cargo.
If you're writing pure Rust code, or Rust code that calls out to C, you should find the language and ecosystem ready now. If you're trying to embed Rust into an existing project, expect to play with various experimental bits for a while.
- pritambarhate 10y ago>> I prefer a smaller language with a large library ecosystem I think this is the reason why Java is so popular and Go is becoming increasingly popular. The average programmer can succeed with combination and become productive faster.