5 ms·
Ohm's Peg-to-WASM Compiler
- kristianp 7mo agoI'd be interested to know some applications of ohm. What have people built with it?
- corysama 7mo agoAt the bottom of that page is a list of “Here are some awesome things people have built using Ohm:”
- zamadatix 7mo agoDunno if the link was changed or something but I had to go to the main page to see the list at the bottom https://ohmjs.org/ https://ohmjs.org/. Hope that saves someone some searching!
- wslh 7mo agoYou can also check rhe examples folder: https://github.com/ohmjs/ohm/tree/main/examples https://github.com/ohmjs/ohm/tree/main/examples
- pdubroy 7mo agoFrom https://ohmjs.org https://ohmjs.org — Here are some awesome things people have built using Ohm: - Shopify's theme-tools (https://github.com/Shopify/theme-tools/ https://github.com/Shopify/theme-tools/), used in their online code editor and the official VS code extension. - Seymour (https://github.com/harc/seymour https://github.com/harc/seymour), a live programming environment for the classroom. - Shadama (https://tinlizzie.org/~ohshima/shadama2/live2017/ https://tinlizzie.org/~ohshima/shadama2/live2017/), a particle simulation language designed for high-school science. - Slang (http://slang.kylestetz.com/ http://slang.kylestetz.com/), a browser-based audio programming language, and turtle.audio, a music sequencer inspired by turtle graphics programming. - Simpletalk (https://github.com/dkrasner/Simpletalk https://github.com/dkrasner/Simpletalk) is an expressive, programmable authoring system inspired by Hypercard and Smalltalk. (See also the StrangeLoop talk). - Wildcard (https://www.geoffreylitt.com/wildcard/ https://www.geoffreylitt.com/wildcard/), a browser extension that empowers anyone to modify websites to meet their own specific needs, uses Ohm for its spreadsheet formulas. - JAMScript (https://citelab.github.io/JAMScript/ https://citelab.github.io/JAMScript/) is a programming language for edge-based IoT applications. - Bruno (https://github.com/usebruno/bruno https://github.com/usebruno/bruno) is an open source IDE for exploring and testing APIs. It has also been used in a number of projects by Ink & Switch (https://inkandswitch.com https://inkandswitch.com), including Potluck (Dynamic documents as personal software: https://www.inkandswitch.com/potluck/ https://www.inkandswitch.com/potluck/), the Deja Vu project at MIT (https://sdg.csail.mit.edu/project/deja-vu/ https://sdg.csail.mit.edu/project/deja-vu/), ...
- joshmarinacci 7mo agoI’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 https://joshondesign.com/2021/07/16/ohm_markdown_parser
- wslh 7mo agoWhat is great about the Ohm approach compared to typical lex/yacc/ANTLR parsers is that it avoids ambiguity by using ordered choice (the first matching rule wins), instead of requiring you to resolve conflicts explicitly. This makes working with Ohm/PEGs less painful in the initial phase of a project. It's also important to highlight that this makes the parsing process slower.
- ogogmad 7mo agoI had the impression that PEG and Earley/GLR all fully solved the parsing problem, but in different ways. But then recently, I found this guy's blog: https://www.oilshell.org/blog/tags.html?tag=parsing#parsing https://www.oilshell.org/blog/tags.html?tag=parsing#parsing Now I don't know what to think. The author's got a ton more experience than me. It seems there's a big enough market out there for people wanting non-ambiguity proofs and linear running-time proofs. Then again, the more I think about parsing, the more I think it's a completely made-up problem. I'm pretty sure there's a middle ground between Lisp (or even worse, Forth) and Python. Fancy parsing has robbed us of the possibilities of metaprogramming and instead opened up a market for Stephen Wolfram, whose product features a homo-iconic language. I've been gorging on Formal Language Theory literature recently. I am now fully convinced that Regular Languages are a very good idea: They are precisely the string-search problems that can be solved in constant space. If you had to find occurrences of certain patterns in a massive piece of text, you would naturally try to keep the memory usage of your search program independent of the text's size. But the theory of Regular Languages only actually gets off the ground when you wonder if Regular Languages are closed under concatenation or not. It turns out that they are closed under concatenation, but this requires representing them as Non-Deterministic Finite-State Automata - which leads to the Kleene Star operation and then Regular Expressions. This is a non-obvious piece of theory which solves a well-formulated problem. So now I suspect that if history were to repeat again, Regular Expressions would still have been invented and used for the same reasons. By contrast, I find Context-Free Grammars much more dubious, and LR almost offensive? The problem with LR is I can't find a description of what it is that isn't just a gory description of how it works. And furthermore, it doesn't appear to relate to anything other than parsing. There's no description anywhere of how any of its ideas could be used in any other area.
- quotemstr 7mo agoAm 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
- shoo 7mo agoJosh 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-why-parsing-tools.html https://blog.reverberate.org/2013/09/ll-and-lr-in-context-wh...
- wener 7mo agoThe only thing I prefe peggyjs over ohm is runtime deps, I thinkg this might let ohm aot the grammar to avoid the deps.
- kristianp 7mo agoThe 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 https://en.wikipedia.org/wiki/OMeta [2] https://tinlizzie.org/VPRIPapers/tr2008003_experimenting.pdf https://tinlizzie.org/VPRIPapers/tr2008003_experimenting.pdf [3] https://tinlizzie.org/IA/index.php/Papers_from_Viewpoints_Research_Institute https://tinlizzie.org/IA/index.php/Papers_from_Viewpoints_Re...
- egonschiele 7mo agoI 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/ https://ohmjs.org/editor/
- ohm 7mo agoIt seems decent.
- Trung0246 7mo agoUnfortunately it still unable to handle to context sensitive language which is a deal breaker for me (like C++ raw string as an example). https://github.com/ohmjs/ohm/issues/158 https://github.com/ohmjs/ohm/issues/158