4 ms·
They're right that Rust is expression-oriented and Python is statement-oriented, and that expression-oriented languages allow for composing certain things more
by DonaldPShimoda 5y ago
They'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.