3 ms·
ANTLR is not the same as what I am describing. ANTLR generates code in each target language: I am talking about a common runtime that all languages call into.
by haberman 16y ago
ANTLR is not the same as what I am describing. ANTLR generates code in each target language: I am talking about a common runtime that all languages call into. Think of it as a "parsing VM." Using this scheme, there would be no need to have separate backends for C and Java, the only thing you'd need to port is the bindings.
- beza1e1 15y agoWhy would that be a good idea? What advantage would a just-in-time parser generator have that a static parser generator does not?
- haberman 15y agoFast parsing from any language (even slow languages like Ruby) without having to compile and link generated C code for every grammar into the interpreter. With this approach, you could have a C extension that could load any grammar at runtime and parse it extremely fast. C/Assembly code is orders of magnitude faster at parsing than generating eg. Ruby that does the parsing.