finds.dev← search

// the find

douglascrockford/howjavascriptworks

★ 333 · JavaScript · updated Mar 2023

Programs from the book _How JavaScript Works_

Companion source code for Douglas Crockford's book How JavaScript Works: standalone implementations of arbitrary-precision integer, float, and rational arithmetic, plus a small tokenizer/parser/codegen/runtime pipeline called 'neo'. It's for people reading the book, or anyone who wants worked examples of Crockford's closure-based, no-class, no-`this`, no-prototype style of JS.

Real from-scratch big-number arithmetic (big_integer.js, big_float.js, big_rational.js) rather than a thin wrapper over BigInt, so you can actually see how the algorithms work. The neo.* files are a complete tiny compiler pipeline (tokenize -> parse -> codegen -> runtime) in readable plain JS, which is rare to find in one small repo. Public domain, zero dependencies, single-purpose files that can be read in isolation without pulling in a framework.

No package.json or module structure - these are loose files meant to sit next to the book, not something you npm install or import cleanly. Testing is limited to manually opened test_bf.html/test_bi.html/test_br.html pages, no automated test runner or CI. Last push was March 2023 with no activity since, so treat it as frozen, not maintained. The code has almost no in-repo comments explaining intent, so without the book itself a lot of the 'why' behind design choices (especially in the neo compiler files) is opaque.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →