DEV Community

Discussion on: WTF is Rust? The Illustrated Notes

Collapse
cryptoquick profile image
Distributed Hunter Trujillo

Agreed. It's not the "middle ground" so much as, the best of both worlds. I also like your chart because it's not as ergonomically superior as JS, as in, people coming from carefully manicured JS and TS codebases might find writing programs in it, and reading Rust code somewhat jarring, but not THAT jarring, and many of the idioms carry over nearly 1-to-1.

C++, OTOH... arguably, Rust is just as fast, if not faster, than many C++ programs, and it certainly builds MUCH faster.

Also, in terms of utility, Rust is growing into every conceivable place it can be shoehorned, similar to how JS became with NodeJS, Electron, and React Native, but... It's actually more comprehensive, and performance-oriented. Applications built in Lucet, Krustlet, and WASI are a little far off, but not that far off, and the promise is huge. Furthermore, projects like Iced have the potential to replace what Electron does for web apps, with no need to change frameworks. It would be similar to Flutter, in that, it's a frontend framework, but builds for multiple platforms, i.e., web and desktop native. Further, people are experimenting with Rust on mobile devices, such as Cargo-Mobile, with native ARM instructions (aarch64 target). This is all a testament to the versatility and benefit we're starting to see from Rust, and while not fully mature, it's much better than it was even a year ago, and two years ago, it's night and day.

Collapse
cryptoquick profile image
Distributed Hunter Trujillo

One more thing; the toolchain is comprehensive, built-in, and on the vast majority of projects, fully utilized; unit tests and benchmarks are often written in the same file, along with automatically-generated documentation that is not just useful, but centrally-located for all projects (docs.rs). Rustfmt is extensively used to the point where, any open source contribution will be formatted the same way. It would be as if NPM came with Jest, Prettier, TypeScript, and Webpack all built-in, (AND, critically, all projects actually used them), and it could compile to tiny (by comparison) platform-native targets relatively quickly (though not as quickly as Go). Oh, and if the docs don't do it for you, most projects also come with a pretty comprehensive set of examples. Oh, and the community is weird and wonderful and diverse and awesome and helpful and active and energetic, so, that also helps. They're also not terribly dogmatic, other than, Rust is awesome, and it should be used everywhere. The critical thing is, most people don't really specify "how", since Rust is relatively easy to refactor compared with most other languages, and there's no one way to write amazing Rust.