News for hackers. Stuff that matters.
Re:Don't Panic! Better, Fewer, Syntax Errors for LR Parsers by qppo on Wednesday July 15, 2020 @10:20PM (#23855041)
I mean it sounds like you have an issue with batch compilers more than "text based languages." If you didn't toss out the AST you'd have to serialize it (now you're compiling to two targets at once), and when you want to recompile you need to parse the serialized AST along with the source code for 90% of the same information.
Re:Don't Panic! Better, Fewer, Syntax Errors for LR Parsers by fanf2 on Wednesday July 15, 2020 @11:07PM (#23855305)
Yes, modern query-oriented compilers (such as TypeScript and C# Roslyn) keep the AST in memory and co-operate closely with the editor via the language server protocol.

I recently saw an example of a language that aims to be AST-first rather than notation-first: it serialises to XML! http://mbeddr.com/

Re:Don't Panic! Better, Fewer, Syntax Errors for LR Parsers by baq on Thursday July 16, 2020 @07:26AM (#23857832)
Nothing modern about it, lisp has been doing it for fifty years now. S-exprs also serialize to xml quite nicely ;)
Re:Don't Panic! Better, Fewer, Syntax Errors for LR Parsers by fanf2 on Thursday July 16, 2020 @09:16AM (#23858659)
In a query-oriented compiler, you can give it a source location and ask for type infomation, or where is the definition of the symbol at that location, and the compiler will do just enough work to give you the answer, using laziness and memoization to make it reasonably efficient. As far as I know, LISP systems don't work that way: they parse and evaluate (and maybe compile) as soon as an expression is entered, without the kind of laziness you see in a query-oriented compiler.

This recent link was pretty good, I think https://ollef.github.io/blog/posts/query-based-compilers.htm... and this discussion with Anders Hejlsberg https://youtu.be/wSdV1M7n4gQ