Mapanare — The AI-Native Programming Language
Mapanare is the first AI-native compiled programming language where agents, signals, streams, and tensors are first-class language primitives — not libraries bolted on after the fact. It compiles to native binaries via LLVM and WebAssembly. ~168x faster than Python, on par with Rust (1.17x geomean) and C (0.96x geomean). Self-hosted compiler (38,000+ lines of .mn across 10 modules), 5,534+ tests, no Python required at runtime.
Key Features
- Agents — Concurrent actors with typed channels, lifecycle management, supervision, and backpressure. Native LLVM backend uses OS threads with lock-free ring buffers.
- Signals — Reactive state with automatic dependency tracking and computed values.
- Streams — Async pipelines with the pipe operator. Adjacent map/filter operations fuse automatically.
- Tensors — N-dimensional arrays with compile-time shape validation and matrix multiplication.
- GPU Compute — CUDA and Vulkan via dlopen. @gpu, @cuda, @vulkan annotations for automatic dispatch. Built-in tensor kernels.
- WebAssembly — Compile to WAT/WASM for browser and server-side execution. WASI preview 1 support.
- AI Stdlib — LLM drivers, embedding providers, RAG pipelines as native stdlib modules.
- Data Engine — Dato: tables, aggregations, joins, null handling, reshape, CSV/JSON I/O.
- Database Drivers — SQLite, PostgreSQL, Redis, KV, connection pooling, schema migrations.
- Web & Security — Web crawler, vulnerability scanner, HTTP fuzzer, HTTP server toolkit.
- Native Compilation — Compile to native binaries via LLVM or WebAssembly. Python transpiler deprecated.
Get Started
Install Mapanare with a single command: curl -fsSL https://mapanare.dev/install | bash on Linux/macOS, or irm https://mapanare.dev/install.ps1 | iex on Windows PowerShell. You can also install via pip: pip install mapanare.
Quick Example
agent Classifier {
input text: String
output label: String
fn handle(text: String) -> String {
return "positive"
}
}
fn main() {
let cls = spawn Classifier()
cls.text <- "Mapanare is fast"
let result = sync cls.label
print(result)
}
Documentation
- Getting Started
- Variables & Mutability
- Functions & Lambdas
- Control Flow
- Structs & Enums
- Type System
- Error Handling
- Operators
- Modules & Imports
- Traits
- Decorators
- Agents
- Signals
- Streams
- Tensors
- Pipes
- CLI Reference
- Standard Library
Performance
Mapanare's LLVM backend delivers ~168x faster execution than Python (geomean). Cross-language vs Rust: 1.17x geomean. vs C gcc: 0.96x geomean. Async benchmarks: 0.85x Go (faster). The v5.0.0 performance arc closed 80% of the Rust gap through 8 targeted experiments.
For AI & LLMs
Full machine-readable documentation is available at llms.txt (summary) and llms-full.txt (complete reference with all code examples).