TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Colm programming language released: best parser-writer ever

87 pointsby edwardogabout 14 years ago

8 comments

ScottBursonabout 14 years ago
Thurston claims that no previous grammar system supports his three requirements of generalized parsing, grammar-dependent scanning, and context-dependent parsing.<p>I would argue that Prolog Definite Clause Grammars, which date back to the early 1970s, have all three of these properties. Furthermore, since the context is maintained functionally, by threading additional values through the productions, no "undo actions" are required; Prolog's built-in backtracking is all that's needed.<p>Of course, the problem with DCGs is performance: they're exponential in the worst case. But I think they deserve mention in a dissertation like this anyway. Also, any backtracking parser risks exponential worst-case performance; it will be interesting to see how Colm avoids this fate (I've only read the first few pages yet).
评论 #2560838 未加载
评论 #2560801 未加载
jwsabout 14 years ago
Notice that the DNS example is parsing a binary DNS request, not a text file.
评论 #2561180 未加载
habermanabout 14 years ago
From my quick scan of the thesis, the basic design seems to be a programming language in which you write <i>both</i> the parser <i>and</i> 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.<p>I think it's generally a hard sell if you try to convince people that they need to write their algorithms in your special language. Parsing tools deliver value because grammars are easier to write than the imperative code that implements those grammars. That value offsets the cost of having to learn a new special-purpose language. But imperative programming languages are already pretty good at tree traversal and transformation, so there's little benefit to using a special-purpose language for this.<p>I think that the next big thing in parsing will be a runtime that easily integrates into other languages so that the parsing framework can handle <i>only</i> the parsing and all of the tree traversal and transformation can be performed using whatever language the programmer was already using. This requires much less buy-in to a special-purpose language.
评论 #2561029 未加载
评论 #2560989 未加载
评论 #2561597 未加载
bdfh42about 14 years ago
Quote "Colm does not yet have any documentation".<p>Then I would hazard that it is not yet a language as without documentation it has no "grammar". At best it is a patois.
评论 #2560410 未加载
评论 #2560478 未加载
评论 #2560441 未加载
colomonabout 14 years ago
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...
评论 #2560824 未加载
评论 #2560621 未加载
Twisolabout 14 years ago
Adrian Thurston (the creator of Colm) is also responsible for the fantastic Ragel state machine generator.
DrCatboxabout 14 years ago
I am more interested in DSNP, how come this project has not received more fame than the infamous Disapora? <a href="http://www.complang.org/dsnp/" rel="nofollow">http://www.complang.org/dsnp/</a>
评论 #2560876 未加载
Barrasmaraabout 14 years ago
This kind of sounds like Semantic Design's DMS software Reengineering toolkit and the Parlanse language.
评论 #2561671 未加载