v0.3 · MIT Licensed · 9 MB Runtime

Documents as Data.
One Language. One Pipeline.

Lambda Script is a functional scripting language and runtime engine that parses, validates, queries, transforms, and renders all your data.

Input
MD · HTML · JSON · YAML · LaTeX · PDF …
Parse
Mark Node Tree
Transform
Validate · Query · Map
Output
HTML · PDF · SVG · PNG · JSON …

Expressive, Concise, Powerful

// Map: double each element
[1, 2, 3] | ~ * 2                    // [2, 4, 6]

// Extract fields from a collection
users | ~.name                        // ["Alice", "Bob", "Carol"]

// Filter with 'that'
[1, 2, 3, 4, 5] that ~ > 3           // [4, 5]

// Chain: filter → map → aggregate
users that ~.age >= 18 | ~.name | len // count adult names

// Vector arithmetic broadcasts automatically
[1, 2, 3] + 10                        // [11, 12, 13]
[1, 2] * [3, 4]                       // [3, 8]
// First-class markup syntax
let card = <div class: "card"
    <h2 "Hello World">
    <p "Lambda treats documents as data.">
>

// Render to HTML string
format(card, 'html')

// Parse any format into a unified tree
let doc = input("readme.md", 'markdown')
let data = input("config.yaml", 'yaml')

// Query the tree
doc?<img>                           // all images in document
doc?<a href: string>                 // all links with href
// Type annotations
let x: int = 42
let items: [string] = ["a", "b"]

// Union and optional types
type Result = int | error
type Name = string?

// Object types with methods
type Point {
    x: float, y: float;
    fn distance(other: Point) =>
        math.sqrt((x - other.x)**2 + (y - other.y)**2)
}

// Element type patterns for document schemas
type Link = <a href: string; string>
type Article = <article title: string; string, Section*>
// Filter and transform with for-expressions
for (x in data where x > 0) x * 2

// With local bindings
for (x in data, let sq = x * x where sq > 10) sq

// Sorting and pagination
for (x in items order by x.price desc limit 5) x.name

// Grouping and aggregation
for (u in users where u.active
     order by u.age desc
     limit 10 offset 5)
  {name: u.name, age: u.age}
fn describe(x) => match x {
    case null:             "nothing"
    case 0:                "zero"
    case 1 to 9:           "small number"
    case int that (~ > 9): "big number"
    case string:           "text: " ++ ~
    case [int]:            "int array"
    default:               "something else"
}

// Query operator — like jQuery for data trees
html?<img>                    // all images
html?<div class: string>      // divs with class
data?{status: "ok"}           // maps with status=="ok"

One Runtime. One Data Model. One Pipeline.

Replace stitched-together toolchains with a single, expressive functional language that treats documents as data.

λ

Pure Functional Core

Immutable data, first-class functions and types, expressive pipe operator for fluent data transformation pipelines.

JIT Compiled Performance

MIR-based JIT compilation delivers near-native speed. Competitive with Node.js V8, 13× faster than CPython.

📄

Multi-Format Document Pipeline

Parse Markdown, HTML, JSON, YAML, LaTeX, PDF, XML, CSV, TOML, and more into a unified node tree representation.

Schema Validation

Rich type system with schema-based validation for structured data and document trees, including element schemas for HTML/XML.

🎨

Layout & Rendering Engine

Built-in Radiant HTML/CSS engine with block, inline, flex, grid, and table layout. Render to SVG, PDF, PNG, or JPEG.

🖥

Interactive Viewer

Open HTML, Markdown, LaTeX, SVG, PDF, diagrams, and Lambda scripts in a native viewer with lambda view.

Near-Native Speed via JIT Compilation

Benchmarked across 56 standard benchmarks (R7RS, AWFY, BENG, KOSTYA, LARCENY, JetStream).

vs. Engine Geo. Mean Ratio Lambda Wins Total
Node.js (V8) 1.05× 28 56
QuickJS 0.12× (8× faster) 49 53
CPython 3.13 0.08× (13× faster) 47 55

Ratio < 1.0 = Lambda is faster. Excels on micro-benchmarks, tight numeric loops, and recursive workloads.

Proven & Performant

13×
Faster than CPython (geomean)
20+
Input formats — JSON, HTML, CSS, PDF …
9 MB
Single binary, zero dependencies
100%
HTML5 (html5lib / WPT) · 1,560+ tests
98.2%
CSS 2.1 (W3C) · 1,788 / 1,821 tests
100%
CommonMark · 662 / 662 tests
100%
YAML 1.2 · 231 / 231 tests

What Can You Build?

Get Running in 30 Seconds

Download the binary, unzip, and run.

$ lambda view