4 ms·
Personally, I find rapid prototyping much faster in Rust than Python, and I don't think I'm a "top expert".
by shpongled 4y ago
Personally, I find rapid prototyping much faster in Rust than Python, and I don't think I'm a "top expert".
- nine_k 4y agoCan you write a function in a REPL and run it instantly? Can you easily inspect intermediate results? In this regard I love Haskell's REPL mode, it's really productive for prototyping. It has a worse discoverability / autocompletion story than Python REPL though.
- jimbob45 4y agoThe only time I've ever needed a REPL is if I'm working with a badly architected codebase such that I don't know the shapes of my inputs. It's otherwise pretty easy to reason about well-architected code without needing to run it.
- sli 4y agoA lot of Lisp development is (or can be) REPL-based, Clojure(script) especially, but that's almost a whole paradigm in and of itself.
- wtetzner 4y agoHaving spent a lot of time writing both Clojure and Rust professionally, I think a lot of the benefit you get from a REPL is making up for the lack of a good type system and good IDE support. I also find that the support Rust has for unit tests partially makes up for the lack of a REPL. Clojure has a bunch of other benefits over Rust when it comes to quick prototyping though.
- anon291 4y agoIn Haskell, you always know the shape of the input, so this completely misses the point of what the commenter above is trying to say.
- GoblinSlayer 4y agoFor me the most interesting and non-obvious property of the code is how the whole thing interacts in the long run, but you can't possibly figure that out with REPL as preparation of inputs would be immense.
- japhib 4y agoI heartily disagree with this -- anything I've tried to prototype in Rust has resulted in much frustration over lifetimes, types, etc.
- wtetzner 4y agoI suspect it has a lot to do with your familiarity and level of experience with Rust. Probably also how much you’ve written code in languages with similar features/idioms. I also find Rust to be quicker for prototyping than Python. However, I find Java quicker than Rust.
- jasmer 4y agoI loathe to say you must be doing something wrong. I mean objectively it really should not be the case! There is literally a ton more you have to write and do for the same thing in Rust. You get runtime safety and performance as a benefit, but those are not benefits in rapid prototyping.
- foota 4y agoSometimes, not making mistakes can help your velocity more than it being quick to type out. It depends I think on what you're doing.
- jasmer 4y agoI'll give you that. And if someone is really in the 'zen' with a language, I can see them being quick on the draw. And it depends a lot on the project and deps. as well.
- Jtsummers 4y agoWhen I've prototyped in Python I mostly find myself using tuples, dictionaries, and lists. Generally the dicts and lists contain homogenous types but occasionally heterogenous types but they're really "variants" (variations on a theme). Writing the same types of programs in Rust usually proved straightforward by (ab)using the same basic types and operations on them. For handling the occasional heterogenous collection case, an enum of related variants sufficed and it wasn't a much slower effort than prototyping in Python would have been. I would expect someone with more Rust experience than me (which is not much) to be at least as fast as I am with Python in Rust, especially if they know the tooling better. At least for these kinds of tasks.
- anon291 4y agoPython is much easier to follow in 2023 with its optional typing support and fantastic libraries like Pydantic that make it easy to use. We are deeply missing a statically typed scripting language.