News for hackers. Stuff that matters.
Re:Challenging LR Parsing by tlb on Wednesday September 16, 2020 @12:56PM (#24494560)
For error recovery, do any parsers have a notion of which tokens are more likely to be wrong?

For example, in an actively edited C++ file, braces are more likely correct than angle brackets which are overloaded. So it's reasonable to auto-insert closing > if you see a } with an open <, but not reasonable to insert a } if you see a > with an open <.

Re:Challenging LR Parsing by ltratt on Wednesday September 16, 2020 @01:06PM (#24494683)
> For error recovery, do any parsers have a notion of which tokens are more likely to be wrong?

lrpar has a %avoid_insert declaration which allows users to say "these token types are better avoided if there are other equivalently good repair sequences". It's simple, but it works well https://softdevteam.github.io/grmtools/master/book/errorreco...

Re:Challenging LR Parsing by maxbrunsfeld on Wednesday September 16, 2020 @01:51PM (#24495225)
I like this solution, and have thought about adding something similar as an "advanced feature" in Tree-sitter grammars. I'm interested to see how you've used it in grammars.
Re:Challenging LR Parsing by raphlinus on Wednesday September 16, 2020 @01:06PM (#24494690)
To the extent that there will be further research on this problem, I think it will be driven by machine learning. We're already seeing this with autocompletion with TabNine, and no reason a similar approach couldn't work for the other issues facing draft code.

If you had a large dataset of keystroke-by-keystroke edit streams, you'd be able to match up erroneous code with the eventual fix. Google or Facebook could absolutely capture these datasets for their internal work if they wanted, and I suspect the results could be scary-good. They wouldn't be able to release the models, though, even for their open source work (Chromium and Android), because it would have such a high chance of revealing internal secrets.

Re:Challenging LR Parsing by the_duke on Wednesday September 16, 2020 @01:22PM (#24494889)
I haven't used it, but Microsoft is already offering machine learning based completions with IntelliCode [1]. See also the introductory blog post. [2]

It also offers sharing refined predictions within teams.

I think we will see some interesting developments in this domain over the next few years.

[1] https://visualstudio.microsoft.com/services/intellicode/

[2] https://devblogs.microsoft.com/visualstudio/ai-assisted-inte...