Live data from Hacker News

Colm programming language released: best parser-writer ever

complang.org

41–45 of 45 posts

Re: Colm programming language released: best parser-writer ever

#41

From my quick scan of the thesis, the basic design seems to be a programming language in which you write both the parser and any transformations you want to perform. It's not clear whether there is an easily-accessible parse tree serialization that you can use to load the output into another language, or whether you'd have to invent that yourself. I think it's generally a hard sell if you try to convince people that…

What you're describing sounds like the Gold parser: http://www.devincook.com/goldparser/

Yes, or my own project, Gazelle: http://www.gazelle-parser.org/

Re: Colm programming language released: best parser-writer ever

#43
post #12
post #6

It would be interesting to see someone who understood both this and Perl 6's grammars to do a comparison. Based on Colm's quick description and my rough understanding of Perl 6 grammars, they sound like they are roughly equally powerful. But I admit I'm not sure I understand what "transformation language" means...

Although similar in expressive power, Colm offers instruction logging to auto-reverse global state changes upon backtracking, something Perl 6 grammars does not (yet) support; at the moment we need to manually manage them with embedded blocks.

Re: "reverse global state changes upon backtracking": this sounds similar to the (manual) "undo actions" supported by the Kelbt parser [1], perhaps unsurprisingly as it was developed by the same author :-)

[1] http://www.complang.org/kelbt/

Re: Colm programming language released: best parser-writer ever

#44
post #22

Earlier quoted context omitted.

AntLR can do this, although it does not work that well. I used the C backend, which is pretty directly ported from the Java backend. C-in-Java-style is pretty awkward.

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.

Why would that be a good idea? What advantage would a just-in-time parser generator have that a static parser generator does not?

Re: Colm programming language released: best parser-writer ever

#45
post #44

Earlier quoted context omitted.

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.

Why would that be a good idea? What advantage would a just-in-time parser generator have that a static parser generator does not?

Fast 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.

Post reply on HN