3 ms·
> Also the whole language suffers from being a weird mix of C-like statement syntax and FP-like expression syntax I quite like this though. All other expressio
by hechang1997 7y ago
> Also the whole language suffers from being a weird mix of C-like statement syntax and FP-like expression syntax
I quite like this though. All other expression based languages like MLs and Haskell use indentation, making it very hard to parse. To me, Rust's syntax allows very granular control. I wish more things in the language can become expressions, like the let expression, for/while loop.
- dgb23 7y agoI agree that it is useful. But from the perspective of a learner it is a stumbling block. Rusts syntax seems to be a compromise to cater to c-likeness. Not a deal breaker at all, just something that I think is not as good as it could have been and will confuse adopters at least in the beginning. On the flip-side it might attract more developers who are not familiar with anything that is not c-like. As a side note, Lisps are expression based and have a very clean syntax where you don’t need to mentally construct an AST, it is literally there in front of you already.