logoalt Hacker News

Ohm's Peg-to-WASM Compiler

44 pointsby azhenleylast Friday at 4:41 AM15 commentsview on HN

Comments

joshmarinacciyesterday at 10:25 PM

I’ve been following the Ohm project for years and it’s the best way to build parsers I’ve ever seen. I’ve used it to parse many program languages and even markdown. I’m happy to see it get even faster.

https://joshondesign.com/2021/07/16/ohm_markdown_parser

show 1 reply
kristianptoday at 1:44 AM

The precursor to Ohm, Ometa [1,2] was created at the Viewpoints Research Institute some more papers at [3].

[1] https://en.wikipedia.org/wiki/OMeta

[2] https://tinlizzie.org/VPRIPapers/tr2008003_experimenting.pdf

[3] https://tinlizzie.org/IA/index.php/Papers_from_Viewpoints_Re...

egonschieletoday at 1:58 AM

I have been very curious to try Ohm. I'm currently using a hand-rolled parser combinator library, but Ohm looks slick. The online editor is nice too https://ohmjs.org/editor/

shootoday at 1:06 AM

Josh Haberman has a good 2013 blog post discussing LL & LR parsers, theory vs practice, context-free grammars & Parsing Expression Grammars (PEGs): https://blog.reverberate.org/2013/09/ll-and-lr-in-context-wh...

wenertoday at 1:59 AM

The only thing I prefe peggyjs over ohm is runtime deps, I thinkg this might let ohm aot the grammar to avoid the deps.

kristianplast Friday at 5:48 AM

I'd be interested to know some applications of ohm. What have people built with it?

show 1 reply
ohmtoday at 2:14 AM

It seems decent.

quotemstrtoday at 12:14 AM

Am I the only one who doesn't like PEGs and prefers EBNF-style parser generators? The order-dependence of PEG alternatives and the lack of ambiguity detection are footguns, IMHO