Ohm – A library and language for building parsers, interpreters, compilers, etc

Ohm is a parsing toolkit consisting of a library and a domain-specific language. You can use it to parse custom file formats or quickly build parsers, interpreters, and compilers for programming languages.

The Ohm language is based on parsing expression grammars (PEGs), which are a formal way of describing syntax, similar to regular expressions and context-free grammars. The Ohm library provides a JavaScript interface for creating parsers, interpreters, and more from the grammars you write.

  • Full support for left-recursive rules means that you can define left-associative operators in a natural way.
  • Object-oriented grammar extension makes it easy to extend an existing language with new syntax.
  • Modular semantic actions. Unlike many similar tools, Ohm completely separates grammars from semantic actions. This separation improves modularity and extensibility, and makes both grammars and semantic actions easier to read and understand.
  • Online editor and visualizer. The Ohm Editor provides instant feedback and an interactive visualization that makes the entire execution of the parser visible and tangible. It’ll make you feel like you have superpowers. :muscle:

Some awesome things people have built using Ohm:

  • Seymour, a live programming environment for the classroom.
  • Chorus, a project exploring the middle ground between spreadsheets and programming.
  • Shadama, a particle simulation language designed for high-school science.
  • turtle.audio, an audio environment where simple text commands generate lines that can play music.
  • A browser-based tool that turns written Konnakkol (a South Indian vocal percussion art) into audio.
  • Wildcard, a browser extension that empowers anyone to modify websites to meet their own specific needs, uses Ohm for its spreadsheet formulas…

This thread was posted by one of our members via one of our news source trackers.

1 Like

Corresponding tweet for this thread:

Share link for this tweet.

@ohm - saw this and wondered whether it was you behind it :laughing:

2 Likes

Ha! Unfortunately, no. I think it would have been a bit vain as well :rofl:

2 Likes

It’s a cool name tho Ohm! :sunglasses:

I remember that when I first came across your username I immediately thought of electricity :electric_plug: :robot:

2 Likes