3 ms·
Huh? Rust allows for putting statements in a lambda and everything is an expression, so it’s easier to compose particular parts of the language. Python la
by thruway516 5y ago
Huh?
Rust allows for putting statements in a lambda and everything is an expression,
so it’s easier to compose particular parts of the language. Python lacks it.
Rust doesn’t have classes so the object orientation is not as evolved as it is
in Python. Python also comes across with the necessity of writing more tests,
production outages, or runtime crashes. Rust makes it less expensive to identify
and fix possible bugs.
This person is unfamiliar with both Python and Rust
- ozzythecat 5y ago> Python also comes across with the necessity of writing more tests, production outages, or runtime crashes This made me literally laugh out loud.
- DonaldPShimoda 5y agoThey're right that Rust is expression-oriented and Python is statement-oriented, and that expression-oriented languages allow for composing certain things more easily. I don't think it's a big deal, but it is correct. I think the second point about classes/object orientation is... odd. I think they might not understand traits? Which is a pretty big thing to miss out on in a comparison like this. The point about tests is probably to do with Rust having static checks (type-checking, borrow-checking, etc.) versus Python not having these. And although you can do some static checks in Python with external tools like mypy, the type system is less expressive and easier to coerce than Rust's, so I do think you'll end up with more tests out of necessity.
- thruway516 5y agoYes they're right about Rust being expression-oriented and allowing you to compose certain things more easily (in theory - in practice I don't see this being used a lot in Rust outside of match expressions). I read the overall comment as 'Rust is more expressive and composable than python' which doesn't feel correct - by design - mainly because of strong typing and safety checks. I didn't understand the statement about lambdas since to me Python and Rust lambdas are practically equivalent. It came across as if they read about Rust and Python without really being familiar with at least one of them.