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.
What Shape Optimizes For
Section titled “What Shape Optimizes For”- 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
Core Language Model
Section titled “Core Language Model”Shape is a general-purpose language. It is not tied to a single industry or schema.
Core concepts you will use everywhere:
- Bindings:
letandconst(useletas the default) - Typed values:
int,number,string,bool, objects,Vec<T>,Table<T>, enums - Functions:
fndeclarations and lambdas - Typed matching: structural and type-based
match - Error propagation:
Option<T>,Result<T>,?, and!! - Data pipelines:
Vec<T>andTable<T>-based transformations
A Small Example
Section titled “A Small Example”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)Who This Book Is For
Section titled “Who This Book Is For”- 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
What You Will Learn
Section titled “What You Will Learn”- Core syntax and expression semantics
- Type inference and type annotations
- Functions, modules, traits, and compositional design
- Data transformations with vectors and tables
- Error handling with
Option<T>andResult<T> - Advanced features such as comptime and async concurrency
Reading Order
Section titled “Reading Order”If you are new to Shape:
If you already write Shape and need deeper reference, jump into the Fundamentals and Advanced sections directly.
Conventions Used In This Book
Section titled “Conventions Used In This Book”- Code blocks use current Shape syntax (
fn,from ... use, expression-first control flow). letis used for mutable local bindings in examples.- Examples favor general data problems over domain-specific presets.
Option<T>andResult<T>are used instead of sentinel-value APIs.
Next Step
Section titled “Next Step”Continue with Installation.