Overview
Simplex is a programming language designed for the AI era. It combines the best ideas from Erlang, Rust, Ray, and Unison to create a language that is AI-native, distributed-first, fault-tolerant, and resumable.
At its core, Simplex is built around the concept of Cognitive Hive AI (CHAI) - an architecture that orchestrates swarms of specialized Small Language Models (SLMs) instead of relying on monolithic large language models.
Primary Goals
Simplex is designed with five primary goals:
- AI-Native: AI operations are first-class language constructs, not external API calls
- Distributed-First: Programs naturally decompose across VM swarms
- Fault-Tolerant: Any worker can die; the system continues
- Resumable: Computations checkpoint and resume transparently
- Lightweight Syntax: Simple, readable code compiling to efficient bytecode
Core Philosophy
Let It Crash
Borrowed from Erlang, this philosophy embraces failure as normal. Instead of trying to prevent all errors, Simplex provides supervision trees that automatically restart failed actors. This leads to more robust systems that can recover gracefully from unexpected conditions.
Ownership Without GC
Inspired by Rust, Simplex uses ownership-based memory management. Every value has exactly one owner, and when that owner goes out of scope, the value is automatically deallocated. This provides deterministic memory behavior without garbage collection pauses.
Content-Addressed Code
Like Unison, Simplex identifies functions by their SHA-256 hash. This means:
- Same hash = identical behavior = perfect caching
- Trivial serialization across networks (send hash, not code)
- No dependency conflicts
- Seamless distribution across nodes
Actors as Distribution Unit
Actors provide natural isolation boundaries. They communicate via message passing, checkpoint at message boundaries, and can migrate between nodes transparently. This makes distribution a natural consequence of the programming model.
Execution Model
Simplex programs run on the Simplex Virtual Machine (SVM), a lightweight runtime designed to run efficiently on small instances (512MB RAM). Multiple SVMs form a swarm that can scale horizontally.
Simplex Source Code
|
Simplex Compiler (type checking, optimization)
|
Simplex Bytecode (.sbc files)
|
Simplex Virtual Machine (SVM)
|-- Bytecode Executor
|-- Actor Scheduler
|-- Checkpoint Manager
|-- Message Router
|-- Swarm Client
|
Swarm Network (multiple SVM nodes)
|-- Coordinator (Raft consensus)
|-- Checkpoint Store (S3/Blob)
|-- AI Inference Pool
Type System
Simplex uses static typing with aggressive type inference. You get the safety of static types while writing code that looks almost dynamically typed:
// Type inference - no annotations needed
let x = 42 // Inferred as i64
let name = "Simplex" // Inferred as String
let items = [1, 2, 3] // Inferred as List<i64>
// Explicit types when needed
let config: Map<String, Value> = {}
// Algebraic data types
enum Result<T, E> {
Ok(T),
Err(E)
}
// Pattern matching
match result {
Ok(value) => process(value),
Err(e) => handle_error(e)
}
First-Class AI Integration
Unlike other languages where AI is bolted on through external APIs, Simplex treats AI operations as native language constructs:
// Text completion
let response = await ai::complete(prompt)
// Generate embeddings
let vector = ai::embed(text)
// Structured extraction
let invoice = await ai::extract<InvoiceData>(document)
// Classification
let sentiment = await ai::classify<Sentiment>(text)
// Similarity search
let nearest = ai::nearest(query_vec, candidates, k: 5)
Language Influences
| Language/System | What Simplex Borrowed |
|---|---|
| Erlang/OTP | Actor model, supervision trees, "let it crash" philosophy, fault tolerance patterns |
| Rust | Ownership-based memory management, algebraic data types, pattern matching, traits |
| Ray | Distributed computing primitives, actor placement strategies, cluster scaling |
| Unison | Content-addressed code, function hashing, code distribution |