Skip to content

The Shape Book

A high-performance, statically typed programming language for data transformation and simulation.

Welcome to The Shape Book.

Shape is a high-performance, statically typed programming language for data transformation and simulation.

It is designed for people who like the speed and guarantees of Rust, but want a faster edit-run loop and a compact, expressive syntax.

  • Performance-first execution for large data workloads
  • Static type safety with strong inference and useful tooling
  • Expression-oriented code where control flow returns values
  • Fast iteration: scripts, modules, REPL, and direct CLI execution
  • Composability: modules, typed objects, traits, and compile-time features

Shape is a general-purpose language. It is not tied to a single industry or schema.

Core concepts you will use everywhere:

  • Bindings: let and const (use let as the default)
  • Typed values: int, number, string, bool, objects, Vec<T>, Table<T>, enums
  • Functions: fn declarations and lambdas
  • Typed matching: structural and type-based match
  • Error propagation: Option<T>, Result<T>, ?, and !!
  • Data pipelines: Vec<T> and Table<T>-based transformations
fn clamp_non_negative(x: int) -> int {
if x < 0 { 0 } else { x }
}
let a = clamp_non_negative(-3)
let b = clamp_non_negative(5)
print(a)
print(b)
  • Python users who need stronger type guarantees and more speed
  • Engineers building data-heavy pipelines and simulations
  • Teams that want strict typing without verbose boilerplate
  • Developers who want strong LSP/IDE support while prototyping quickly
  1. Core syntax and expression semantics
  2. Type inference and type annotations
  3. Functions, modules, traits, and compositional design
  4. Data transformations with vectors and tables
  5. Error handling with Option<T> and Result<T>
  6. Advanced features such as comptime and async concurrency

If you are new to Shape:

  1. Installation
  2. Your First Query
  3. Basic Concepts
  4. Variables and Types

If you already write Shape and need deeper reference, jump into the Fundamentals and Advanced sections directly.

  • Code blocks use current Shape syntax (fn, from ... use, expression-first control flow).
  • let is used for mutable local bindings in examples.
  • Examples favor general data problems over domain-specific presets.
  • Option<T> and Result<T> are used instead of sentinel-value APIs.

Continue with Installation.