On Wed, May 13, 2015 at 10:36 AM, Keean Schupke <[email protected]> wrote:

What I meant is that we want to produce a parser specialised to the grammar
> as the output of the combinator meta-program.
>

Ah. If we could do that as compile-time computation, then perhaps we would
want to do that. That's essentially what bison, yacc, antlr, and friends
do. But...

The diagnostic advantages of bison and friends are clear and valuable. The
performance advantages of them are much less so. Setting pathological
grammars aside, the main overhead in the parse/tokenize stage lies in the
tokenizer. Memoization really *is* good enough to remove the parser from
the "things in the way" list.


> This is a bit like parser generators the read EBNF syntax and output C/C++
> code, except the combinators form a DSL in the host language, and the code
> generation happens at compile time in the meta program, instead of a tool
> outside the language.
>

I see what you're thinking. Though it's worth noting that any sufficiently
rich meta language is essentially a general purpose scripting language. It
isn't clear that I want my compiler to be just as vulnerable to viruses as
my word processor.


Jonathan
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to