3 ms·
Claiming rust is as expressive as Python/JS/Kotlin for non-fp-nerds is precisely what leads to rust evangelism strike force memes.
by entha_saava 6y ago
Claiming rust is as expressive as Python/JS/Kotlin for non-fp-nerds is precisely what leads to rust evangelism strike force memes.
- nilkn 6y agoThere’s not any particular way I can respond to this, because there really isn’t any substance except to attempt to link me to something you find distasteful/annoying. I use both languages professionally on a daily basis and it is on that basis that I make my claim. Here’s one way I could respond. There are numerous things in Python that I find more difficult than in Rust. For instance, I think async/.await in Rust is generally easier than asyncio is in Python, and in the former case the compiler is quite good at detecting various concurrency bugs whereas you’re entirely on your own in Python. It’s far easier to write multicore programs in Rust than Python thanks to the lack of a global interpreter lock. Python makes extensive use of runtime exceptions for basic error handling, which I find very exhausting to reason about and account for during development; tools like mypy are also unable to help there at all, and I must rely on the questionable quality of documentation or just scavenging through code. Pythonic things like None-equivalent values often make it impractical to use Optional values as return types in idiomatic code, thus pressuring you to use more exceptions in places where one would just use Option or Result in Rust. Python has poor support at best for sum types, which I tend to use extensively for almost every problem space. Python does not support pattern matching, though some support for this has been proposed for a future version of the language. Handling dependencies generally is much easier in Rust as well thanks to cargo. Perhaps you think these are all just the concerns of “FP nerds,” but for me these differences often mean I can write correct, high quality backend services in Rust faster than I can in Python — and the result is often 10x-100x faster with no optimization work whatsoever. That seems worth the relatively small amount of time I spend worrying about lifetimes or ownership or the fact that I use map/filter/iterators instead of list or dictionary comprehensions.