3 ms·
> HTMX is great for rapid prototyping, but Rust has never struck me as suitable for rapid prototyping. There are some nice abstractions here than reduce the amo
by civilitty 3y ago
> HTMX is great for rapid prototyping, but Rust has never struck me as suitable for rapid prototyping. There are some nice abstractions here than reduce the amount of code for sure, but that's only one aspect of rapid prototyping. Rust still has a high learning curve, compiles relatively slowly, and still takes a lot more code to achieve things than the equivalent Python or even JavaScript/TypeScript.
In order to support the borrow checker, Rust has a richer type system that allows programmers to encode far more of the business domain than most other languages. Short of logic bugs, the vast majority of my Rust code is in the "if it compiles, it works" bucket which makes it great for rapid prototyping despite the slow compile times. I have to spend a lot less time and mental bandwidth on testing and defensive coding and Rust's version of the public/private distinction o makes it great for wrapping the data model behind types that can only be used correctly - like making sure a user id can only come from a User model type instantiated by the database code and not an arbitrary integer.
My favorite part though is that web frameworks like Rocket make it really easy to manage all of the magic going on behind the scenes using trait definitions, in contrast to mega-frameworks like Django. (Rocket was created by the Flask author iirc)
- stmblast 3y agoThe first framework I used was Rocket! I'm sad that the development pace for it has slowed down extremely significantly though.
- chromatin 3y ago> (Rocket was created by the Flask author iirc) unrelated individuals (Flask, Armin Ronacher; Rocket, Sergio Benitez) you're right though that Armin is writing Rust these days though!
- throw10920 3y agoRust's richer type system provides relatively little value over other contemporary type systems like those of Python, TypeScript, and C#, while not providing anything remotely resembling an "interactive" development experience (no REPL, incredibly slow compilation, not hotpatching), and imposing the extremely burdensome and completely unnecessary burden of manual lifetime management. Until these flaws are fixed, Rust is utterly unsuitable for rapid prototyping.