One Year of Rust in Production
Dmitry Kudryavtsev reflects on a year using Rust for his project JustFax, highlighting its type safety, stability, and superior tooling, while noting challenges with compile times and frontend development.
Read original articleDmitry Kudryavtsev reflects on his first year using Rust in production, particularly in his side project, JustFax. Initially, he migrated from LemonSqueezy to Stripe, which unexpectedly expanded into a significant refactor involving job processing and accounting systems, all implemented in Rust. Kudryavtsev emphasizes Rust's type safety and compile-time checks, which prevent many common errors found in dynamic languages like JavaScript. He appreciates the stability of Rust applications, noting he has never experienced a crash, unlike with Node.js. However, he acknowledges the challenges of Rust's compile times, especially with complex projects, which can lead to slower development cycles compared to JavaScript. Despite these drawbacks, he finds Rust's tooling superior, with less boilerplate and a more straightforward project setup. Kudryavtsev also points out the limitations of Rust in frontend development, where rapid prototyping is hindered by the need for recompilation. Overall, he expresses satisfaction with his choice of Rust, attributing it to improved software quality and job security.
- Dmitry Kudryavtsev has spent a year using Rust in production for his project JustFax.
- Rust's type safety and compile-time checks help prevent common coding errors.
- He has not experienced any crashes in Rust applications, contrasting with his experience in Node.js.
- Compile times in Rust can be lengthy, affecting development speed.
- Kudryavtsev finds Rust's tooling to be more efficient than that of JavaScript frameworks.
Related
Rust for Filesystems
At the 2024 Linux Summit, Wedson Almeida Filho and Kent Overstreet explored Rust for Linux filesystems. Rust's safety features offer benefits for kernel development, despite concerns about compatibility and adoption challenges.
I Hope Rust Does Not Oxidize Everything
The author expresses concerns about Rust's widespread adoption in programming, citing issues with syntax, async features, complexity, and long compile times. They advocate for language diversity to prevent monoculture, contrasting Rust with their language Yao.
Don't write Rust like it's Java
The author discusses transitioning from Java to Rust, highlighting Rust's type safety, differences in traits and interfaces, complexities of ownership, and the importance of embracing Rust's unique features for effective programming.
From Julia to Rust
The article outlines the author's transition from Julia to Rust, highlighting Rust's memory safety features, design philosophies, and providing resources for learning, while comparing code examples to illustrate syntax differences.
Rust for Linux Revisited
Drew DeVault reflects on the Rust-for-Linux project's challenges, suggesting a new Rust-compatible kernel could alleviate political hurdles and developer burnout, while attracting contributors and expediting development.
This is Rust's Achilles heel and has been since almost day one. Once a project is at a nontrivial scale, it really starts to weight it down. I'm working on a Rust/C++/QT QML desktop app and I've spent the last week refactoring my crates/libraries so I can split them off as shared libraries that can be built independently, otherwise even incremental builds can take minutes. Thankfully there are some crates to make a stable ABI and dynamic reload.
> LLMs rarely help with a proper solution, as most of the packages are kind of niche.
This has also bitten me quite a bit but at the same time, I've been impressed with what Claude 3.5 and o1-preview have been able to do with Rust even with niche libraries like cxx-qt - a relatively new library with little in the training data. A lot of stuff like writing Rust implementations of QAbstractListModel works really well when given the right context (like an example implementation of another list model).
LLMs have also been a boon for writing macros, both macro_rules and proc macros.
The author's experience with sqlx is spot on. It's a game-changer for database interactions, though it does come with some drawbacks in terms of compile times and CI/CD pipeline complexity.
One point I'd add is about the ecosystem. While it's true that Rust doesn't have the same breadth of libraries as, say, JavaScript, the quality of the libraries that do exist is generally very high. And the community is incredibly helpful when you do run into issues.
That statement is not really just about memory safety, but it's also about the type system and pattern matching, which prevents a lot of _logic_ bugs that would cause runtime errors and not just memory safety problems. You don't have nil pointer dereferences like you do with go, you don't have problems with accidentally passing a single item instead of a list of items, or a string instead of integer like you might get with python.
It's also a lot easier to write than it's reputation would imply, especially if you don't especially care about memory efficiency or performance and you aren't writing close to the metal, and you can just clone stuff onto the heap all over the place. Even with that, it uses way less memory and cpu than a comparable app in python or java and it's usually more efficient than go.
Modula-2 40 years ago. The ship had strong bones to build upon a long time ago, but alas, C. The tyranny of the masses.
SQLx seems like end game stuff at first glance, but after trying it out for a while I eventually decided that it wasn't for me. Writing dynamic/conditional queries just sucks and there isn't any good solution. On the DX side, completion, formatting/linting, highlighting is also non-existent (at least on VS Code).
I eventually settled on [Diesel][0] (a query builder-ish ORM) and I'm loving it so far. Its [performance][1] crushes every other SQL libraries, including SQLx (very counter-intuitive, huh?). It's technically an ORM, but the query builder is very flexible and you can also extend it with your own traits. It got its warts, but it's the most tolerable SQL rust library I've found so far.
[0]: https://diesel.rs
I find that they’re quite good at converting example api calls between languages for the most part…though haven’t worked in rust for a while
Seems like the writer finally experienced an errors as values statically typed language which doesn't have a ton of legacy in it. Many of the issues OP mentioned (CJS vs MJS, configuration file changes) comes from being around for a while, Rust just hasn't had the time in the saddle yet to show how they would deal with that. Don't get me wrong, I'm not saying they won't deal with it well but Python 2-3, Vue, JS CJS to MJS etc all show that a fundamental change to some core part of the language / framework is very tough to navigate and quite frankly Rust hasn't needed to do that yet.
Related
Rust for Filesystems
At the 2024 Linux Summit, Wedson Almeida Filho and Kent Overstreet explored Rust for Linux filesystems. Rust's safety features offer benefits for kernel development, despite concerns about compatibility and adoption challenges.
I Hope Rust Does Not Oxidize Everything
The author expresses concerns about Rust's widespread adoption in programming, citing issues with syntax, async features, complexity, and long compile times. They advocate for language diversity to prevent monoculture, contrasting Rust with their language Yao.
Don't write Rust like it's Java
The author discusses transitioning from Java to Rust, highlighting Rust's type safety, differences in traits and interfaces, complexities of ownership, and the importance of embracing Rust's unique features for effective programming.
From Julia to Rust
The article outlines the author's transition from Julia to Rust, highlighting Rust's memory safety features, design philosophies, and providing resources for learning, while comparing code examples to illustrate syntax differences.
Rust for Linux Revisited
Drew DeVault reflects on the Rust-for-Linux project's challenges, suggesting a new Rust-compatible kernel could alleviate political hurdles and developer burnout, while attracting contributors and expediting development.