4 ms·
Making the _compiler itself_ provide an API enables things like LSP, which don't want to generate machine code at all. A traditional single-pass compiler usuall
by remexre 2y ago
Making the _compiler itself_ provide an API enables things like LSP, which don't want to generate machine code at all. A traditional single-pass compiler usually can't accommodate this without re-plumbing.
- halffullbrain 2y agoThe Eclipse Compiler for Java [1] is a notable exception, architected around incremental compilation, an API for “live” AST manipulation, and a layered non-batch approach to when to invoke various analysis steps. The LSP for Java [2] used in eg. VSCode’s Java plugins, builds on this API. But, no, I haven’t seen a generalized approach to this architecture discussed in literature. 1: https://github.com/eclipse-jdt/eclipse.jdt.core https://github.com/eclipse-jdt/eclipse.jdt.core 2: https://github.com/eclipse-jdtls/eclipse.jdt.ls https://github.com/eclipse-jdtls/eclipse.jdt.ls
- tester756 2y agoI'm aware, I've used C#/.NET Compiler ecosystem and their Compiler as a Service approach But it seems like you're just creating libs that everyone and embedd / use and that's it e.g `auto ast = Compiler.GenerateAST(code);`