OhmJS
@ohmjs.org
67 followers 54 following 22 posts
A user-friendly parsing toolkit for JavaScript and TypeScript ∙ https://ohmjs.org Support Ohm development on GitHub Sponsors: https://github.com/sponsors/pdubroy
Posts Media Videos Starter Packs
ohmjs.org
OhmJS @ohmjs.org · 28d
Hey everyone, just FYI:

After investigating, we do *not* believe that ohm-js, or any other package under the @ ohmjs namespace, is affected by the Shai-Hulud worm or any of the recent npm supply chain attacks.
ohmjs.org
OhmJS @ohmjs.org · Aug 5
Any Ohm fans who want to get a taste of low-level programming?

Get 25% off the only book in the world* that will teach you WebAssembly with Ohm!

(*So far.)
wasmgroundup.com
The summer holidays just started here in southern Germany.

So, it's time for a ☀️ SUMMER SALE ☀️ —

Use the code SUMMER25 for a 25% discount on the book until Sept 15: wasmgroundup.com
WebAssembly from the Ground Up
A book about WebAssembly — learn Wasm by building a simple compiler in JavaScript.
wasmgroundup.com
Reposted by OhmJS
dubroy.com
Pretty pleased with the ergonomics of the Wasm (macro-)assembler in @ohmjs.org.

It's built on the low-level assembler lib we created for @wasmgroundup.com, but has some nice higher-level features, including labeled breaks. I'm particularly proud of the idea to put the block label at the end. 😊
A code screenshot showing a TypeScript/JavaScript function called ⁠wrapTerminalLike that generates WebAssembly (WASM) code. The code contains:  • A function definition that takes a ⁠thunk parameter  • Assembly code generation using an ⁠asm object with methods like ⁠block(), ⁠localSet(), ⁠break(), etc.  • A ⁠break statement that references a label called ⁠'_success' (highlighted with a pink arrow and annotation "This...")  • A label definition for ⁠'_success' at the bottom (highlighted with a red arrow and annotation "...goes here")  • Additional assembly operations like ⁠newTerminalNodeWithSavedPos(), ⁠updateLocalFailurePos(), and ⁠setRet()  The pink annotations with arrows illustrate the control flow relationship between the break statement and its corresponding label, showing how the break jumps to the ⁠'_success' label.
ohmjs.org
OhmJS @ohmjs.org · Jul 17
You know about the Ohm Discord, right?

Great place to ask questions, get feedback on your grammars, and hang out with the some of the friendliest folks out there.

discord.gg/KwxY5gegRQ
Join the Ohm Land Discord Server!
Check out the Ohm Land community on Discord - hang out with 169 other members and enjoy free voice and text chat.
discord.gg
ohmjs.org
OhmJS @ohmjs.org · Jul 14
I'd also like to acknowledge the support from Adam Bouhenguel and Project Substrate (projectsubstrate.org), which provided the funding to build the initial MVP. 🙏

Without their support none of this would have been possible!
Project Overview
projectsubstrate.org
ohmjs.org
OhmJS @ohmjs.org · Jul 14
We're still looking for more sponsors! If you or your company can help fund this effort: github.com/sponsors/pd...

Since 2017, my work on Ohm has been unpaid. Your sponsorship helps the project be sustainable, ensuring that I can maintain and improve Ohm for many years to come!
Sponsor @pdubroy on GitHub Sponsors
I'm the lead developer of Ohm (ohmjs.org), a user-friendly parsing toolkit for JavaScript and TypeScript. I also created the Ohm Editor, and the interactive visualization for understanding and ...
github.com
ohmjs.org
OhmJS @ohmjs.org · Jul 10
A few different Ink & Switch projects have used Ohm…here's the latest one.

From @alexwarth.bsky.social (co-creator of Ohm) and @geoffreylitt.com (who made Wildcard, one of our all-time favourite Ohm-powered projects)
alexwarth.bsky.social
What if a spreadsheet cell could hold multiple values at the same time?

That's the idea behind Ambsheets, a project I've been working on w/ @geoffreylitt.com at @inkandswitch.com. It's a new spreadsheet that makes it easier for you to explore many possibilities simultaneously.

1/2
ohmjs.org
OhmJS @ohmjs.org · Jun 24
Outside of this specific funding need, if you get value from Ohm you should consider a recurring sponsorship: github.com/sponsors/pdu...

This keeps the project sustainable and ensures that I can continue to spend time maintaining and improving Ohm for everyone!
ohmjs.org
OhmJS @ohmjs.org · Jun 23
We are seeking funding to make it possible to ship a production-ready version. (It's an estimated 8–10 more weeks of effort.)

If you or your company would benefit from the portability and performance improvements and could potentially help fund this work, please get in touch with @dubroy.com!
ohmjs.org
OhmJS @ohmjs.org · Jun 23
Ever wanted to use Ohm from another language? Go, Python, Rust?

See the brand new, experimental support for compiling Ohm grammars to Wasm: github.com/ohmjs/ohm/d...

It wasn't the main goal, but it also appears to be a perf win — parsing is about 10x faster on real-world grammars (e.g. ES5).
A couple months ago, I started prototyping a new feature: the ability to compile an Ohm grammar to WebAssembly, so that it can be used from languages other than JS. You can find more background (use cases and implementation details) in #503.  The MVP is complete, and this feature is now available for early testing (with some limitations). We're very interested to get feedback and hear what uses cases people have for this.  Although it wasn't the main motivation for this work, early benchmarks are showing ~10x improvement in parse times. Take this with a grain of salt — since the implementation isn't yet complete, it's hard to know what the final performance will look like. But it looks like this will be a significant performance win for real-world grammars!
Reposted by OhmJS
dubroy.com
Working on a cheat sheet for @ohmjs.org grammars. wdyt?
ohmjs.org
OhmJS @ohmjs.org · May 16
Making progress on the Wasm implementation — and encountering some interesting challenges!
dubroy.com
Ok ok this may not make a lot of sense but I am *extremely* happy to have gotten this code working!! So I feel compelled to share.

(And yes, I wrote my own macro-assembler for #wasm in JavaScript. That's how much fun I'm having, and yes I mean that sincerely.)

1/x
Reposted by OhmJS
dubroy.com
Made some good progress on this! Follow along on the issue if you're interested: github.com/ohmjs/ohm/is...
ohmjs.org
OhmJS @ohmjs.org · Apr 29
Hey folks, we had another Cloudflare ⇆ GitHub SSL issue which meant the web site was down for about an hour.

Thanks for @onlineornot.com we found out pretty quickly, and it should be fixed now!

And we'll be getting rid of Cloudflare so hopefully we'll be rid of this problem for good 🤞
Reposted by OhmJS
wasmgroundup.com
Wondering if the book is *practical*?

I'm currently using the helper library extracted from the book for a new @ohmjs.org feature which will allow you to compile Ohm grammars to Wasm.

This will make it possible to use Ohm grammars from Go, Python, etc.

Details here 👉 github.com/ohmjs/ohm/is...
dubroy.com
btw what I'm using here is the "assembler library" that we construct bit by bit in @wasmgroundup.com. It's also available as a standalone NPM package: www.npmjs.com/package/@was...

There's not yet much documentation (outside of the book), but we'll work on that soon!
ohmjs.org
OhmJS @ohmjs.org · Mar 12
Very cool to learn that Ohm was used to create Gambu-Script, which is used to teach programming to over 90k students in Austria!

It's part of SchuBu, a free-to-use digital schoolbook: www.schubu.org/p768/progra...
An illustration explaining computer programming basics titled 'Sequence'. The top contains text explaining that a computer program is a set of instructions. Below is a cartoon illustration showing a purple robot sitting at a computer with a confused green monitor display. The robot is speaking in binary code (shown in a speech bubble), while the monitor shows question marks in a thought bubble. The scene includes bookshelves in the background. The caption reads 'Fig. 1 Learning languages pays off.' An educational diagram explaining loops in programming using GamBu-Script. The image shows text explaining that loops are a way to handle repeated actions in programming, with two syntax examples: 'repeat x seconds [command]' and 'repeat x times [command]'. At the bottom, there's a code example in a red-bordered box showing 'right 100' followed by 'repeat 100 times left 1'.
ohmjs.org
OhmJS @ohmjs.org · Mar 10
If you dig Ohm and are interested in WebAssembly, check out this book by @dubroy.com (co-creator of Ohm).

You'll learn Wasm (the instruction set and module format) by building a compiler for a small programming language.

It's also a great way to learn Ohm!
wasmgroundup.com
Excited to announce the official launch of our online book, WebAssembly from the Ground Up! 🎉

It's the book we wish we'd had 3 years ago.

No messing with tools and frameworks. It's a hands-on guide to the core of Wasm: the instruction set and module format.

Link below. 👇
Learn Wasm by building a simple compiler in JavaScript. No compiler expertise necessary. All the code is in the book; we'll take you through it step by step. Get your hands dirty and see for yourself what WebAssembly is all about.
ohmjs.org
OhmJS @ohmjs.org · Feb 17
Anyone catch Ohm in the current edition of JavaScript Weekly? javascriptweekly.com/issues/723
ohmjs.org
OhmJS @ohmjs.org · Jan 29
Should be fixed now, but please let us know if you still see any issues!
ohmjs.org
OhmJS @ohmjs.org · Jan 29
Just been told that ohmjs.org is currently down. Sorry about the disruption!

We're working on a fix, but in the meantime, if you need to access the docs you can find them here: github.com/ohmjs/ohm/t...
ohm/doc at main · ohmjs/ohm
A library and language for building parsers, interpreters, compilers, etc. - ohmjs/ohm
github.com