those are definitely the *biggest* factors, but grammar complexity class isn't completely irrelevant- especially since we've managed to avoid the C family's missteps
-
-
a lot of parsers are little simple things- editor syntax specifications, quick fuzzy searches, cross-language tools, (unfortunately) proc macros. every little bit of complexity in the grammar makes things harder there
1 reply 0 retweets 3 likes -
I completely forgot about procedural macros! They make parsing so much more difficult as to make LL(k) not even relevant as a concern in comparison.
1 reply 0 retweets 2 likes -
not really? they work almost like comments when it comes to parsing, except you tokenize their innards (unlike comments)
1 reply 0 retweets 1 like -
Of course they’re easy to *tokenize*, but they’re not easy to *expand*. Any tool that does not expand macros is broken.
3 replies 1 retweet 3 likes -
syntax highlighting parsers don't need to handle this :) nor does rustfmt but yes, I agree with your general point wrt proc macros
2 replies 0 retweets 0 likes -
Syntax highlighting doesn’t even need to parse the language, only lex it.
2 replies 0 retweets 0 likes -
semantic highlighting needs to parse.
1 reply 0 retweets 0 likes -
Of all the difficulties involved in doing partial parses of Rust, with error recovery, etc, unbounded lookahead is not even in the top 100.
1 reply 0 retweets 0 likes -
this isn't about some huge one-time insurmountable cost it's about drawing a line in the sand so the grammar doesn't slowly slide into something ugly
1 reply 0 retweets 1 like
And I’m saying this is a pointless line to draw. Draw the line at, like, the lexer hack. Not this. If we had persisted with the “line in the sand” reasoning in Rust’s early days, we’d have been writing “match foo { None. => {…} }” because someone might name a variable None.
-
-
Yes, that was a mistake.
1 reply 0 retweets 5 likes -
Replying to @graydon_pub @pcwalton and
It was compounded by dozens of other "just a little more" mistakes and we are now in 2019 and nobody even knows whether it'll be possible to formalize the language in a grammar at all.
2 replies 0 retweets 5 likes - 11 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.