patrickgwsmith/Orb
59.1
Adequate · 15 November 2026
8.1k
lines of production code
Elixir
primary language
5
measurements over time
What this system is
Orb is an Elixir library that provides a domain-specific language for writing and compiling WebAssembly modules directly from Elixir code. It enables developers to define WASM functions, manage memory, and handle numeric types using familiar Elixir syntax, which the system then compiles into low-level WebAssembly binaries. The tooling supports both Elixir and JavaScript runtimes, offering a structured approach to generating and executing WebAssembly code within the Elixir ecosystem.
How it got here
2023 — Orb DSL and compiler infrastructure overhaul
11 changes.
This period focused on a comprehensive refactor of the Orb WebAssembly compiler, replacing legacy instruction representations with structured modules and protocols for robust type checking and control flow. The work introduced a refined Domain Specific Language featuring explicit numeric types, strict equality enforcement, and new macros like must!/1, alongside extensive documentation and test coverage to validate the new compilation pipeline.
2024–2025 — WebAssembly compilation infrastructure and documentation
5 changes.
The project established a dedicated documentation site and introduced a new DSL for defining WebAssembly functions using Elixir-like syntax. Core compiler components were refactored to use explicit structs for memory operations and instruction modules, enabling proper WebAssembly binary generation and type handling.
Features
Introduce Orb.DSL for defining WebAssembly functions
Added the \Orb.DSL\ module and \Orb.DSL.Defw\ macros, enabling developers to define WebAssembly functions using Elixir-like syntax (\defw\/\defwp\). This new DSL supports local variables, explicit result types, and keyword-list arguments, compiling directly to WebAssembly binaries with memory, data, and exports. It replaces or supplements the previous \func\/\funcp\ macros by providing a more structured way to declare public and private WASM functions within the Orb framework.
lib/orb/dsl · high confidence
Launch of the Orb documentation site
The project now includes a dedicated documentation site built with Deno, featuring a static site generator that renders Markdown content from the repository. The site provides a structured navigation menu covering installation, core concepts (such as WebAssembly, composable modules, and strings), and running modules in JavaScript or Elixir. It includes an installation guide specifying the \orb\ dependency version \\~\> 0.2.2\, a 404 error page, and a footer with links to GitHub, the blog, and social media profiles. The site also hosts interactive examples, such as a temperature converter, by serving compiled WebAssembly files.
site · high confidence
New Orb WebAssembly examples and build tooling
The examples directory now includes a collection of Livebook guides and supporting files demonstrating Orb's WebAssembly capabilities. These include an introduction to defining and running Orb modules with Wasmex, a dynamic compilation example using OrbWasmtime, a MIME type lookup example, a temperature converter using enums, a .gitignore parser, and a YouTube URL parser. A Makefile has also been added to automate the build process from Elixir scripts to WebAssembly text and binary formats.
examples · high confidence
Orb DSL adds \`must!/1\` macro and refines local variable syntax
The Orb DSL now includes a \must!/1\ macro for asserting multiple conditions, which traps with \unreachable\ if any condition is false. Additionally, the formatter configuration has been updated to recognize new DSL keywords (\i32\, \let\, \return\, \local\, \global\, \const\, \defc\) as locals without parentheses, and the \.tool-versions\ file specifies Elixir 1.19.2 and Erlang 28.1.1.
(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.
Dependencies
Initial release with Elixir 1.17 support and documentation tooling
The Orb package is initialized as version 0.2.2, upgrading the supported Elixir version from 1.14.2 to 1.17. This release adds \wasmex\ and \jason\ as test dependencies and \ex\_doc\ as a development dependency to enable documentation generation. The package license is set to BSD-3-Clause, and the project configuration includes links to the GitHub repository and the useorb.dev homepage, along with specific Livebook examples for documentation.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 59 → 59 (-0.3)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 65 → 57 (-7.1)
- Architecture 88 → 99 (+10.5)
- Maturity 56 → 56 (+0.0)
- Readiness 49 → 49 (+0.0)
- Security 98 → 97 (-1.3)
- Performance 100 → 100 (+0.0)
Resolved (1)
- Projects may be oversized for their cohesion
New (12)
- Edited copies of one member (3 members, 10+ corresponding lines) (lib/orb/numeric/dsl.ex)
- Edited copies of one member (3 members, 2+ corresponding lines) (lib/orb/numeric/add.ex)
- Edited copies of one member (3 members, 4+ corresponding lines) (lib/orb/to_glsl.ex)
- Edited copies of one member (4 members, 1+ corresponding lines) (lib/orb/numeric/add.ex)
- Edited copies of one member (4 members, 7+ corresponding lines) (lib/orb/numeric/dsl.ex)
- Edited copy of a member (11 corresponding lines) (lib/orb/block.ex)
- Edited copy of a member (13 corresponding lines) (lib/orb/memory/load.ex)
- Edited copy of a member (6 corresponding lines) (lib/orb/instruction.ex)
- Edited copy of a member (7 corresponding lines) (lib/orb/block.ex)
- Edited copy of a member (7 corresponding lines) (lib/orb/i32/dsl.ex)
- Edited copy of a member (7 corresponding lines) (lib/orb/instruction/call.ex)
- Edited copy of a member (9 corresponding lines) (lib/orb/memory/load.ex)
Written by cca.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 15 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 870e50d56aa471290836e16303b801e2efc06420 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-3c33c1882dc1.