patrickgwsmith/Orb
68.1
Adequate · 18 September 2026
8.1k
lines of production code
Elixir
primary language
1
measurement over time
What this system is
Orb is an Elixir library that compiles a domain-specific language into WebAssembly binaries, allowing developers to write low-level WASM code using familiar Elixir syntax. It provides structured DSLs for defining functions, managing memory, and handling numeric and string types, which are then translated into valid WebAssembly opcodes. The system includes comprehensive tooling for compilation, documentation, and testing via Wasmex, enabling the creation of portable, high-performance modules from Elixir scripts.
How it got here
2023 — WebAssembly compiler infrastructure overhaul
10 changes.
This period focused on a comprehensive refactoring of the Orb WebAssembly compiler, replacing legacy instruction representations with structured protocols and dedicated modules for control flow and data handling. The work introduced a robust DSL for numeric types and memory access, expanded documentation, and added extensive test coverage and examples to validate the new compilation pipeline.
2024–2025 — Documentation and WASM compilation infrastructure
5 changes.
This period focused on establishing the project's public presence with the initial release of the Orb documentation site. Concurrently, significant internal work was done to enhance WebAssembly compilation capabilities, including refactoring memory operations, introducing new instruction modules, and implementing a Domain Specific Language for defining WASM functions in Elixir. These changes were supported by the addition of comprehensive test infrastructure using the Wasmex library.
Features
Add introductory and functional WebAssembly examples
The examples directory now includes a comprehensive set of Livebook guides and supporting files demonstrating Orb's WebAssembly capabilities. New content covers basic module definition and execution (01-intro), dynamic compilation using OrbWasmtime, a .gitignore parser, MIME type resolution via the mime package, a temperature converter utilizing exported enums, and a complex YouTube URL parser. A Makefile is also provided to automate the build process from Elixir scripts to WebAssembly binaries.
examples · high confidence
Initial public release of the Orb documentation site
The project now includes a complete documentation website built with Deno, featuring a structured navigation system, installation guides, and core concept pages. The site provides interactive examples, such as a temperature converter, and includes a search interface for GitHub and WebAssembly specifications. It also offers a 404 page and a footer with links to social media and the blog, marking the first public-facing documentation for the Orb WebAssembly compiler.
site · high confidence
Introduce Orb.DSL for defining WebAssembly functions
The \lib/orb/dsl\ library now provides macros (\defw\, \defwp\, \func\, \funcp\) to define WebAssembly functions directly in Elixir, compiling them to \.wasm\ binaries. This DSL allows users to declare function signatures with result types and local variables, supports keyword-list arguments, and handles specific types like \Orb.Str\ by mapping them to pointer and size parameters. The implementation includes infrastructure for managing WebAssembly exports, tables, and global state, enabling a more declarative approach to writing low-level WebAssembly code within the Orb framework.
lib/orb/dsl · high confidence
Orb DSL adds \`must!/1\` assertion macro and \`Str\` local variable support
The Orb DSL now includes a \must!/1\ macro for asserting multiple conditions, which traps with \unreachable\ if any condition is false. Additionally, the language supports \Str\ types as local variables, allowing assignment between \Str\ variables and from function returns, with \Str\ represented internally as paired \ptr\ and \size\ locals. The project also updates its development environment to Elixir 1.19.2 and Erlang 28.1.1 via \.tool-versions\ and configures the Elixir formatter to recognize new DSL keywords like \local\, \global\, and \const\ without parentheses.
(repo-wide) · high confidence
Behavioural changes
Introduces I32 DSL and UnsafePointer types with strict equality enforcement
This change adds the \Orb.I32.DSL\ module, which defines arithmetic and bitwise operators for 32-bit integers, and introduces \Orb.I32.UnsafePointer\ and \Orb.I32.U8.UnsafePointer\ to handle memory access with specific alignment and load instructions. A key behavioral shift is the enforcement of strict equality: the standard \==\ and \!=\ operators now raise errors, requiring users to use \===\ and \!==\ instead, while also adding support for bitwise AND (\&&&\) and left shift (\\<\<\<\).
lib/orb/i32 · high confidence
New instruction modules for WASM compilation and string handling
The \lib/orb/instruction\ area now includes new instruction modules (\Call\, \Const\, \Global.Get\, \Global.Set\, \Relative\) that enable the compiler to generate WebAssembly binary output. These modules implement the \Orb.ToWasm\ protocol to emit specific WASM opcodes (e.g., \call\, \global.get\, \i32.eq\) and handle type narrowing for \Orb.Str\ (represented as \{ptr, size}\ tuples) during function calls and global access.
lib/orb/instruction · high confidence
Orb WebAssembly compiler documentation and API overhaul
The \lib/orb.ex\ module has been significantly expanded to serve as the primary documentation and entry point for the Orb WebAssembly compiler. The change replaces the previous placeholder documentation with a comprehensive guide explaining how Orb allows Elixir developers to write WebAssembly modules using familiar syntax (such as \defw\, \global\, and arithmetic operators) that compiles down to low-level instructions. It details key concepts like stack-based execution, locals, globals (mutable and readonly), and type annotations (I32, etc.), providing concrete examples for calculating means, validating ranges, and managing state. This update reflects a major shift in the library's API and usage patterns, moving from a less structured approach to a more explicit, compiler-centric DSL that handles memory, data, and exports directly within Elixir modules.
lib · high confidence
Refactor WebAssembly compilation infrastructure with new instruction and control flow models
The \lib/orb\ library has been significantly refactored to support a more robust WebAssembly compilation pipeline. This change introduces a new \Orb.Instruction\ struct to replace previous atom-based instruction representations, providing explicit type checking for operands and operations. Control flow logic has been restructured into dedicated modules (\Orb.Block\, \Orb.Control\, \Orb.IfElse\), enabling better handling of blocks, loops, and conditional branches with proper identifier management. The compiler (\Orb.Compiler\) now utilizes an ETS-based context for tracking function calls and global types during compilation, while constant string management has been moved to \Orb.Constants\ for efficient deduplication and offset tracking. Additionally, new modules for custom types (\Orb.CustomType\), data handling (\Orb.Data\), and specific numeric types (\Orb.I32\, \Orb.I64\, \Orb.F32\, \Orb.F64\) provide a more structured DSL for defining WebAssembly functions and types.
lib/orb · high confidence
Refactor instruction handling with new Orb.Instruction protocol
The internal representation of WebAssembly instructions has been migrated from a legacy tuple-based syntax (e.g., {:i32, ...}) to a structured Orb.Instruction protocol. This change introduces a new Orb.ToWat.Instructions module that handles the conversion of integers and floats to their corresponding WAT representations (i32.const and f32.const) and delegates struct-based instructions to the Orb.ToWat protocol. This refactoring removes support for older, deprecated instruction formats and simplifies the codebase by extracting low-level WAT conversion logic into dedicated helper modules.
_lib/orb/to\wat · high confidence
Refactor memory load and store operations into dedicated structs
The memory subsystem in lib/orb/memory has been restructured to use explicit structs for memory operations. Orb.Memory.Load and Orb.Memory.Store now encapsulate load and store instructions respectively, handling address wrapping, alignment validation, and WAT/WASM code generation. Orb.Memory.Slice provides a 64-bit representation for memory ranges and implements the Orb.Iterator protocol to allow iterating over memory bytes. This change replaces previous inline or tuple-based representations with structured types that support alignment constraints and proper WebAssembly instruction encoding.
lib/orb/memory · high confidence
Unified numeric operations supporting both integers and floats
The \lib/orb/numeric\ module now provides a unified DSL for arithmetic and comparison operators that automatically handles both integer and float types based on context. Users can now perform addition, subtraction, multiplication, division, and comparisons using standard Elixir operators (\+\, \-\, \\*\, \/\, \\<\, \\>\, etc.) on WebAssembly numeric types (i32, i64, f32, f64), with the system selecting the appropriate WebAssembly instruction (e.g., \i32.add\ vs \f32.add\) or performing compile-time optimization when possible. Bitwise operations (\&&&\, \\|\|\|\, \\<\<\<\) remain restricted to integer types, and equality checks now use \===\ and \!==\ instead of \==\ and \!=\ to align with Orb's type system.
lib/orb/numeric · high confidence
Test coverage
Add WasmexCase test support module; Added comprehensive test coverage for Orb compiler features; Added test suite for example modules; Added tests for I32 convenience functions and control flow generation.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 68.
Lenses
- Code Health 88
- Architecture 99
- Maturity 55
- Readiness 67
- Security 98
Changes since last survey
- 300 commits — 277 feature/other, 23 fixes
By area
- lib/orb — 119 commits
- (root) — 49 commits
- site/main.ts — 34 commits
- site/readme.md — 27 commits
- site/concepts — 13 commits
- site/_nav.md — 10 commits
- lib/orb.ex — 6 commits
- site/_footer.md — 6 commits
- site/install.md — 4 commits
- test/examples — 4 commits
- test/orb_test.exs — 4 commits
- test/string_constants_test.exs — 3 commits
- .github/workflows — 2 commits
- site/run — 2 commits
- site/silverorb — 2 commits
- test/defw_test.exs — 2 commits
- test/loop_test.exs — 2 commits
- .nova/Configuration.json — 1 commit
- .nova/Tasks — 1 commit
- examples/01-intro.livemd — 1 commit
Notable commits
- fix: Fix (data …) string output
- fix: Fix I32.cond including unreachable for true catch-all
- fix: Fix MutRef.store/2
- fix: Fix block/loop label indices
- fix: Fix docs
- fix: Fix inferred type of Memory.swap!/4
- fix: Fix interpolating possible tuple type
- fix: Fix looking up with string func_name
- fix: Fix must! for multiple asserts
- fix: Fix ordering of constant registration issue!
- fix: Fix push type of relative ops (eq, ne, gt, etc)
- fix: Fix since
- fix: Fix site example
- fix: Fix version in install instructions
- fix: Fix wasm compile issue
- fix: Fix wasm of exported memory
- fix: Fix wasm output for Memory.copy!/3
- fix: Fix wasm_mode not working
- fix: Fix: forgot to add fallback type narrow for Global.Get
- fix: site: Fix /strings route
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
patrickgwsmith/Orb was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 18 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit ba18a80fa49c5a69e94821171b96862b086eedb4 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-5d04157a340d.