3 ms·
The key challenge of rust for me: "Complex grammar. I've become somewhat infamous about wanting to keep the language LL(1) but the fact is that today one can't
by krupan 3y ago
The key challenge of rust for me:
"Complex grammar. I've become somewhat infamous about wanting to keep the language LL(1) but the fact is that today one can't parse Rust very easily, much less pretty-print (thus auto-format) it, and this is an actual (and fairly frequent) source of problems. It's easier to work with than C++, but that's fairly faint praise. I lost almost every argument about this, from the angle brackets for type parameters to the pattern-binding ambiguity to the semicolon and brace rules to ... ugh I don't even want to get into it. The grammar is not what I wanted. Sorry."
- kzrdude 3y agoIs there a practical issue with this, or is this more philosophical?
- cryptonector 3y agoIs there anything easier to parse than Lisp? Plus you get homoiconicity and `quote` is free. But... it's ugly.
- krupan 3y agoI'm not parsing expert, but being hard to parse makes it harder to write tools that work with the language. Personally I find rust to be not easy at all for humans to read, and so it's interesting that it's also hard for parsers to parse. Not sure what was optimized for in the design.
- kzrdude 3y agoI've coded a moderate amount in Rust since it was born, I think the prevailing rustfmt style is too bent towards machine-perfect neatness (one example: function definitions are split so that every parameter has a new line). This machine perfect neatness comes from lots of small places in the syntax where Rust decided let's make the syntax permissive so that it's easy to autogenerate code with some macro or to make good diffs. Then a systematic implementation of trailing commas and allowing leading/trailing separators in some places. The result is quite sterile and to me is no longer organically nicely readable. tldr: rustfmt has no soul
- pushkine 3y agoPrettier Rust does a good job at improving readability