3 ms·
> It would be both simple and very slow. I don't think many people are okay with the idea of waiting several seconds on starting the compiler. Is there a speci
by chriswarbo 9y ago
> It would be both simple and very slow. I don't think many people are okay with the idea of waiting several seconds on starting the compiler.
Is there a specific reason you think it would be slow? Translating between text formats is pretty quick, and there's no need to do anything else that compilers normally do (e.g. building an AST; type-checking; resolving imports; optimising; generating code; etc.)
> At the very least you have to keep the compiler process running and you need a protocol to communicate with the compiler.
That may have a slight speed benefit, but for something as fast as parsing I think it would be over-engineering. Just pipe through stdio.
> It already exists and is called Language Server Protocol.
LSP is certainly interesting, although it's very new and seems rather limited.
I'm mostly curious why so many languages, after choosing (perfectly reasonably) to avoid an s-expression syntax, end up "throwing the baby out with the bathwater" by providing no "backend" syntax for tooling. Some tools represent code as e.g. XML for their own purposes, but I've never seen a tool-agnostic format, or a language "endorse" one of these as an interchange format. Instead, I've seen a huge amount of effort wasted on writing and maintaining a whole bunch of bespoke parsers and pretty-printers.