TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Colm programming language released: best parser-writer ever

87 点作者 edwardog将近 14 年前

8 条评论

ScottBurson将近 14 年前
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 未加载
jws将近 14 年前
Notice that the DNS example is parsing a binary DNS request, not a text file.
评论 #2561180 未加载
haberman将近 14 年前
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 未加载
bdfh42将近 14 年前
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 未加载
colomon将近 14 年前
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 未加载
Twisol将近 14 年前
Adrian Thurston (the creator of Colm) is also responsible for the fantastic Ragel state machine generator.
DrCatbox将近 14 年前
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 未加载
Barrasmara将近 14 年前
This kind of sounds like Semantic Design's DMS software Reengineering toolkit and the Parlanse language.
评论 #2561671 未加载