TinyTalk (.tnt, v4.0.0) is an ultra-fast, self-hosting systems programming language and multi-target native compiler. It unites Python's clean indentation syntax, Smalltalk's live-object interactive computing model, and unboxed bare-metal machine code generationβwith zero borrow-checker ceremony and zero garbage-collection pauses.
β‘ 30-Second Mental Model β’ β‘ Benchmarks β’ ποΈ Three Core Pillars β’ π¬ Python vs TinyTalk β’ π» Code Showcase β’ π³ Cloud & Containers β’ π¦ Standard Library β’ π οΈ Unified Toolchain β’ π Quickstart β’ π Backward Compatibility
Important
TinyTalk v4.0.0 is the direct architectural evolution of Black Mamba (.bmb). Every existing .bmb program, library, test suite, and module continues to compile and execute without modification. Both tnt (primary) and bmb (legacy) CLI tools are distributed side-by-side, sharing the exact same high-performance compilation pipeline. Existing Python codebases importing mamba are transparently alias-routed to tinytalk via dynamic meta-path hooks.
If you know Python, you already know 95% of TinyTalk. Under the hood, TinyTalk completely eliminates Python's 35-year interpreter bottlenecks by emitting unboxed, bare-metal machine code directly into CPU registers, with zero external C compiler dependencies.
| Feature / Dimension | Standard Python (CPython 3.14) | Mojo π₯ | Rust π¦ | Go πΉ | TinyTalk (.tnt) β‘π¬ |
|---|---|---|---|---|---|
| Syntax Familiarity | Pure Python | Python-like (fn vs def split) |
C-Family / Complex | C-Family | 100% Python Indentation Syntax |
| Living Object Model | Static text files | Static text files | Static text files | Static text files | Live Image Snapshots (.tntimg) & Morphic Canvas |
| AST Representation | Ephemeral parse tree | LLVM MLIR AST | Rust AST | Go AST | Content-Addressed Hypergraph (.tntgraph) |
| Memory Model | Stop-the-world GC pauses | Strict Borrow Checker | Strict Borrow Checker | Concurrent GC (stop-the-world spikes) | Lexical Arenas (Zero Borrow Ceremony, Zero GC) |
| Execution Speed | Baseline ( |
||||
| Tail-Call Optimization | RecursionError |
Manual loops | LLVM tailrec (limited) | None | Automatic Tail-Call Optimization (Auto-TCO) |
| Standalone Binary Size |
pyinstaller) |
5.5 KB EXE / 3.9 KB ELF | |||
| Container Image Size |
python:slim) |
~20 KB (FROM scratch, zero-daemon) |
|||
| WebAssembly Footprint |
pyodide) |
Experimental | 1.7 KB (Instant 120 FPS in Browser) | ||
| C Compiler Needed? | MSVC / GCC for extensions | Modular LLVM toolchain |
rustc / LLVM |
gc internal |
Zero (Built-in Pure Native Linkers) |
| Multithreading | Blocked by GIL | Hardware threads | OS threads | Goroutines | Zero-GIL Hardware Atomics & Lock-Free Channels |
flowchart LR
SRC["π¬ Source Code\n(.tnt / .bmb / .py)"] --> PARSE["β‘ Parser &\nType Inference"]
GRAPH["πΈοΈ HyperGraph\n(.tntgraph)"] --> PARSE
PARSE --> MIR["βοΈ Mid-Level SSA IR\n(Auto-TCO, Inlining, DCE)"]
MIR --> JIT["β‘ In-Memory JIT\n(<1 ms Latency)"]
MIR --> EXE["π¦ 5.5 KB Win64\nPE32+ Executable"]
MIR --> ELF["π§ 3.9 KB Linux\nELF64 Static Executable"]
MIR --> MACHO["π macOS ARM64\nApple Silicon Mach-O"]
MIR --> OCI["π³ ~20 KB OCI\nContainer Tarball"]
MIR --> WASM["π 1.7 KB WebAssembly\n(120 FPS in Browser)"]
MIR --> C11["π ANSI C11 + OpenMP\nPortable Emitter"]
All benchmarks were measured head-to-head on 64-bit Windows across identical algorithmic kernels:
====================================================================================
TINYTALK (.tnt) vs CPYTHON 3.14 HEAD-TO-HEAD NATIVE BENCHMARK SUITE
====================================================================================
Benchmark Kernel | CPython 3.14 (ms) | TinyTalk (ms) | Speedup
------------------------------------------------------------------------------------
fib(32) [Recursive Call Tree] | 297.65 ms | 11.550 ms | 25.8x
count_primes(30000) [Integer ALU] | 23.28 ms | 1.375 ms | 16.9x
collatz_steps(40000) [Bitwise Loop] | 228.14 ms | 8.389 ms | 27.2x
mandelbrot(120x120) [SSE2 Float64] | 40.19 ms | 3.272 ms | 12.3x
tail_sum(5_000_000) [Auto-TCO] | RecursionError! | 2.689 ms | INF (TCO)
website_server.tnt [HTTP/1.1 Engine] | 18,400 req/s | 459,643 req/s | 25.0x
------------------------------------------------------------------------------------
Verified tail_sum(5_000_000) = 12500002500000 (0 stack frames allocated via Auto-TCO)
collatz_steps(40000) [27.2x] β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°
fib(32) [25.8x] β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°
website_server.tnt [25.0x] β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°
count_primes(30000) [16.9x] β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°
mandelbrot(120x120) [12.3x] β°β°β°β°β°β°β°β°β°β°β°β°
tail_sum(5_000_000) [ βx ] β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β° (Auto-TCO: 0 Frames)
-
Unboxed Register Allocation: Primitive numbers, floats, and short strings (
$\le 7$ bytes) reside directly in 64-bit CPU registersβnot as 28-byte boxed heap objects. - Lexical Arenas & Escape Analysis: Memory is scoped to function lifecycles and stack allocations. You get C-speed memory reclamation without GC pauses and without fighting a borrow checker.
- Automatic Tail-Call Optimization (Auto-TCO): Deep recursive loops transform into zero-frame register jumps, executing millions of iterations in sub-millisecond times.
-
Zero-GIL Concurrency: Native OS threads, hardware atomics, lock-free ring channels (
chan.tnt), and actor supervision loops run simultaneously on all available CPU cores.
- Persistent Image Snapshots (
.tntimg/tnt image): Save your entire living environmentβactive modules, living heaps, database records, and Morphic canvasβinto a portable binary image snapshot. Thaw and resume execution in < 0.15 ms. - Infinite 2D Morphic Canvas (
tnt studio --canvas): A spatial programming environment where modules and live data structures exist as interactive visual morphs wired together with bidirectional real-time code synchronization. - Live Inquisitor Agent: Inspect live objects, trace execution message flows, profile latency hot-spots, and hot-swap running code on the fly without restarting the process.
- Semantic Hypergraph (
.tntgraph/tnt graph): A post-text binary DAG format where every AST symbol is content-addressed via Blake3/SHA-256 hashes. Eliminates text parsing overhead, invalid syntax errors, and whitespace formatting conflicts. - Multi-Perspective Projections (
tnt project): Project the same AST hypergraph into multiple syntax perspectives on demand: Pythonic text, Smalltalk messages, Morphic visual diagrams, or LaTeX mathematical formulas. - Lossless 3-Way Transmutation (
tnt transmute): Freely transmute between.py,.tnt,.bmb, and.tntgraphwith mathematically verified, bit-for-bit JIT execution parity.
Traditional CPython 3.14 (Every variable is a 28+ byte heap object)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β x = 42 β
β [Pointer: 8 bytes] ββ> PyLongObject [Heap: 28 bytes] β
β ββ ob_refcnt (8 bytes) β
β ββ ob_type (8 bytes) β
β ββ ob_digit (8 bytes) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
TinyTalk (.tnt) (Unboxed values live directly in CPU registers)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β x = 42 β
β Register RAX: [ 0x000000000000002A ] (0 bytes on heap)β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Feature | Traditional Python (CPython) | TinyTalk (.tnt) |
|---|---|---|
| Object Overhead | 28 bytes for an integer, 152 bytes for a small class | 0 bytes (unboxed in CPU registers or stack) |
| Small Strings ( |
48β56 bytes heap allocated (PyUnicodeObject) |
0 heap allocations (SSO tagged in 64-bit register) |
| Garbage Collection | Stop-the-world cyclic GC pauses (millisecond spikes) | 0.000 ms GC pauses (Compile-time Lexical Arenas) |
| Method Calls | Dynamic __dict__ hash table lookups |
Direct 1-cycle function pointers / compile-time dispatch |
In traditional Python, every function call incurs a massive 2,112-byte stack frame (_PyEval_EvalFrameDefault). Deep recursion quickly crashes with RecursionError. TinyTalk automatically detects tail recursion and compiles it into a zero-stack-frame register jump loop:
# In TinyTalk, this executes 5,000,000 recursive calls in 2.6 ms with 0 stack growth!
def tail_sum(n: i64, acc: i64) -> i64:
if n <= 0:
return acc
return tail_sum(n - 1, acc + n)flowchart TD
subgraph CPython["Traditional Python (GIL Contention)"]
T1["Thread 1"] -->|Requests Lock| GIL["Global Interpreter Lock (GIL)"]
T2["Thread 2 (BLOCKED)"] -.->|Waiting| GIL
T3["Thread 3 (BLOCKED)"] -.->|Waiting| GIL
GIL --> CPU1["1 CPU Core Active (Multi-core Wasted)"]
end
subgraph TinyTalk["TinyTalk (Zero-GIL Multi-Core)"]
M1["Thread 1"] --> Core1["CPU Core 1 (100% Native)"]
M2["Thread 2"] --> Core2["CPU Core 2 (100% Native)"]
M3["Thread 3"] --> Core3["CPU Core 3 (100% Native)"]
M1 <==>|"Lock-Free MPMC (chan.tnt)"| M2
M2 <==>|"Atomic Hardware CAS"| M3
end
TinyTalk blends expressive Python syntax with systems-level power and Smalltalk dynamism:
# 1. Unboxed Value Structs (Stored directly in CPU registers, 0 GC overhead)
struct Vec3:
x: f64
y: f64
z: f64
fn norm_sq(self) -> f64:
return self.x * self.x + self.y * self.y + self.z * self.z
# 2. Hardware 64-bit SSE2 / AVX Float Math
def distance_3d(v1: Vec3, v2: Vec3) -> f64:
dx = v1.x - v2.x
dy = v1.y - v2.y
dz = v1.z - v2.z
return sqrt(dx * dx + dy * dy + dz * dz)
# 3. Whole-Program Cartesian Type Inference (No redundant type annotations needed)
def is_prime(n):
if n <= 1: return False
d = 2
while d * d <= n:
if n % d == 0: return False
d += 1
return True
# 4. Pipeline Dataflow Operator (|>) for Clean Composition
def step_double(x: i64) -> i64: return x * 2
def step_add_const(x: i64) -> i64: return x + 42
def step_square(x: i64) -> i64: return x * x
# 5. Pattern Matching (Compiled to single-cycle CPU jump tables)
def evaluate_status_code(code: i64) -> str:
match code:
case 200: return "OK: Explosive Performance"
case 201: return "Created: Zero Overhead"
case 404: return "Error: GIL Not Found"
case _: return "Active: Bare-Metal Speed"
# 6. Automatic Tail-Call Optimization (Auto-TCO)
def tail_accumulator(n, acc):
if n <= 0: return acc
return tail_accumulator(n - 1, acc + n)
def main() -> i64:
p1 = Vec3(0.0, 3.0, 4.0)
p2 = Vec3(3.0, 7.0, 4.0)
print(f"3D Vector Distance: {distance_3d(p1, p2)}")
# Clean functional pipeline: (7 * 2 + 42)^2 = 3136
pipe_val = 7 |> step_double |> step_add_const |> step_square
print(f"Pipeline Result: {pipe_val}")
print(f"Status: {evaluate_status_code(200)}")
print(f"Auto-TCO Sum (1,000,000 frames): {tail_accumulator(1000000, 0)}")
return 0Traditional Python Docker containers weigh 150 MB to 500 MB and require building on Linux with a Docker daemon. TinyTalk generates ~20 KB pure-Python OCI/Docker container image tarballs from FROM scratch with zero Docker daemon required:
flowchart LR
SRC["service.tnt\n(Source Code)"] --> ELF["ELF64 Executable\n(Direct Linux Syscalls)"]
ELF --> OCI["Pure OCI Tarball\n(manifest.json + config + /app)"]
OCI --> RUN["docker load -i image.tar\ndocker run --rm service:v4\n(Starts in 0.4 ms, Size: 20 KB)"]
# Build a minimal, production-ready Linux OCI container directly on Windows/macOS/Linux:
tnt container examples/tinytalk_flagship.tnt -t tinytalk-app:v4 --tar dist/app.tar
# Instantly load and run without any build step:
docker load -i dist/app.tar
docker run --rm tinytalk-app:v4TinyTalk includes an embedded pure-native HTTP/1.1 engine capable of over 450,000 requests per second on a single core:
# Start the production web application server:
tnt run website_server.tntDeploy and chat with large language models locally without PyTorch, CUDA toolkits, or heavy dependencies. TinyTalk features a built-in GGUF parser and quantized matrix-vector arithmetic (q4_0 / q8_0 GEMV):
# Start an interactive local streaming chat session:
tnt chat --model models/default_v2.ggufTinyTalk emits pure, self-contained binaries with zero runtime dependencies:
CPython + PyInstaller Bundle [85.0 MB] β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°β°
Pyodide WebAssembly Bundle [32.0 MB] β°β°β°β°β°β°β°β°β°β°β°
------------------------------------------------------------------------------------
TinyTalk Standalone EXE [0.005 MB] β (5.5 KB - Starts in 0.001 ms)
TinyTalk Linux ELF64 [0.003 MB] β (3.9 KB - Direct Linux Syscalls)
TinyTalk OCI Container [0.020 MB] β (20.0 KB - Full Scratch Docker Image)
TinyTalk WebAssembly (.wasm) [0.001 MB] β (1.7 KB - Over 18,000x smaller than Pyodide!)
| Deployment Target | Traditional Python | TinyTalk (.tnt) |
Reduction Ratio |
|---|---|---|---|
| Windows Executable | 80 MB β 120 MB (pyinstaller) |
5.5 KB β 12 KB (tnt build --target exe) |
~10,000x smaller |
| Linux Executable | 40 MB β 100 MB (docker / nuitka) |
3.9 KB β 7.4 KB (tnt build --target elf) |
~15,000x smaller |
| Cloud Container | 150 MB β 500 MB (python:slim) |
~20 KB (tnt container) |
~15,000x smaller |
| WebAssembly | 32 MB (pyodide download) |
1.7 KB β 2.7 KB (tnt build --target wasm) |
~18,000x smaller |
| Cold Boot Latency | 1.2s β 2.5s (unpacking zip archives) | < 0.001 ms (direct OS memory map) | Instant |
TinyTalk includes an extensive pure-native standard library in tinytalk/stdlib/ compiling directly to unboxed native machine code with zero CPython runtime dependencies. All standard libraries can be imported seamlessly from .tnt or .bmb files:
| Category | Modules | Key Capabilities |
|---|---|---|
| Web & Networking | http, fastapi, socket, tls, requests |
HTTP/1.1 (450k+ req/s), RFC 6455 WebSockets, parameterized routing, pure-native TLS 1.3. |
| AI & High-Performance Math | tensor, llama, simd, series, autograd |
2D GEMM, GGUF local LLM inference, 512-bit AVX-512, Arrow columnar data (79.2M rows/s). |
| Concurrency & Systems | thread, chan, alloc, embedded, cluster, shm, fiber |
Zero-GIL threads, lock-free MPMC channels, slab allocator, No-OS embedded HAL, distributed RPC. |
| Data Formats & Storage | sql, db, kv, json, csv, hash |
ACID SQLite/SQL engine, append-only WAL KV store, DOM JSON, tabular CSV, SHA-256/Murmur3. |
| Collections & Utilities | collections, heap, iter, array, math, random, time, regex, unicode |
Deque/Counter, binary min-heap, Xoshiro256++ PRNG, Thompson NFA regex, Unicode UAX #29. |
| Compiler & Metaprogramming | compiler, codegen, image, graph, transmute, vcs |
Pratt parser, PE32+ assembler, Smalltalk .tntimg, semantic .tntgraph, 3-way VCS. |
The TinyTalk CLI (tnt or bmb) provides a unified command center for development, compilation, debugging, and live-object exploration:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β THE TINYTALK 4.0 SUITE β
ββββββββββββββββ¬βββββββββββββββ¬βββββββββββββββ¬βββββββββββββββ¬βββββββββββββββ¬ββββββββββββββ€
β tnt run β tnt build βtnt container β tnt studio β tnt image β tnt fuzz β
β Native JIT β Multi-Target β ~20KB OCI β 2D Morphic β Live Snapshotβ Adversarial β
β <1ms Startup β Static Bin β No Docker! β Live Canvas β < 0.15ms Res β 210 Vectors β
ββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
| Command | Purpose | Example |
|---|---|---|
tnt run (or bmb run) |
Instant native execution via in-memory JIT | tnt run app.tnt --stats |
tnt build |
Build standalone binary across all targets | tnt build app.tnt --target all --debug |
tnt container |
Build ~20 KB zero-base OCI image tarball | tnt container app.tnt -t app:v4 --tar app.tar |
tnt studio |
Smalltalk live interactive object studio & 2D Morphic Canvas | tnt studio --canvas --open |
tnt image |
Freeze/resume Smalltalk .tntimg heap snapshots (< 0.15 ms) |
tnt image save app.tnt -o app.tntimg |
tnt graph |
Zero-syntax content-addressed AST hypergraph (.tntgraph) |
tnt graph build app.tnt -o app.tntgraph |
tnt project |
Multi-perspective projections (Python, Morphic, Math, Sexpr) | tnt project view app.tntgraph --format python |
tnt vcs |
Semantic 3-way graph VCS and structural merge | tnt vcs diff base.tntgraph feature.tntgraph |
tnt transmute |
Lossless 3-way transmutation (.py .tnt .tntgraph) |
tnt transmute roundtrip app.py |
tnt chat |
Local streaming LLM conversational AI | tnt chat --model models/default_v2.gguf |
tnt test |
Discover and run all project test suites | tnt test |
tnt gatekeeper |
5-stage zero-defect pre-release quality gatekeeper | tnt gatekeeper |
tnt fuzz |
9-vector adversarial compiler fuzzer & differential oracle | tnt fuzz --diff 80 --pe 20 |
tnt profile |
Nanosecond call profiling & SVG flamegraphs | tnt profile app.tnt -o flamegraph.svg |
tnt repl |
Interactive bare-metal JIT REPL | tnt repl |
tnt doc |
Generate static HTML API documentation | tnt doc tinytalk/stdlib -o docs/api --open |
Download tinytalk-v4.0.0-win64.zip from GitHub Releases and add tnt.exe to your PATH. Both tnt.exe and bmb.exe are bundled.
pip install dist/tinytalk_lang-4.0.0-py3-none-any.whl(Or install in editable mode for local development: pip install -e .)
git clone https://github.com/kicode01/tinytalk-lang.git
cd tinytalk-lang
# Run 5-Stage Zero-Defect Pre-Release Gatekeeper
python -m tinytalk.cli gatekeeper# Run Flagship Language Showcase
tnt run examples/tinytalk_flagship.tnt --stats
# Run Real-World High-Frequency Trading & Order Matching Engine
tnt run examples/tinytalk_hft_engine.tnt --statstnt build app.tnt --target all --debug- Generates:
build/app.exe(Standalone Windows x86-64 executable with SEH unwind tables, CodeViewRSDS, COFF symbols)build/app.elf(Static Linux x86-64 binary with.symtaband DWARF v4.debug_linetables)build/app.macho(Standalone macOS Apple Silicon ARM64 binary)build/app.wasm(WebAssembly 1.0 binary module for browser / node)build/app.c(Portable ANSI C11 +#linesource mappings + OpenMP SIMD)build/app.ll(Standard LLVM IR)
tnt container app.tnt -t tinytalk-app:v4 --tar dist/app.tar
docker load -i dist/app.tar
docker run --rm tinytalk-app:v4tnt studio --canvas --openInstall the official TinyTalk VS Code extension in editors/vscode/ for full syntax highlighting, grammar definitions, snippets, and Language Server Protocol (LSP 3.17) integration for both .tnt and .bmb files.
TinyTalk guarantees uninterrupted continuity for the entire Black Mamba ecosystem:
- Source Code Parity: Any
.bmbsource file can be run directly usingtnt run app.bmborbmb run app.bmb. - Command Alias: Running
bmbinvokes the exact same compiler binary astnt. - Package Imports: Existing Python scripts importing
import mambaorfrom mamba.cli import mainare automatically resolved via_MambaCompatFindertotinytalk. - Image Compatibility: Existing
.bmbimgmemory images can be inspected, loaded, and resumed seamlessly.
We believe in 100% engineering honesty. Every design trade-off, hardware boundary, and roadmap milestone is documented:
- π
ROADMAP.md: Detailed engineering roadmap from v0.1 to v4.0.0 and beyond. β οΈ docs/LIMITATIONS.md: Transparent inventory of current architectural trade-offs and memory model details.- π
docs/REVERSE_ENGINEERING_REPORT.md: Deep-dive technical analysis of CPython 3.14 evaluation frame disassembly vs. TinyTalk JIT machine code.
TinyTalk is licensed under the MIT License. Contributions, issues, and discussions are welcome!
Heritage Notice: TinyTalk (
.tnt) is the evolution of Black Mamba (.bmb). All.bmbfiles, tools, and specifications remain first-class citizens with permanent backward compatibility.
Disclaimer: TinyTalk is an independent open-source programming language and native compiler. It is not affiliated with, endorsed by, or sponsored by the Python Software Foundation (PSF). Python is a registered trademark of the Python Software Foundation.