RAIL SYSTEM

self-hosting language · distributed fleet · self-training AI
1,774
lines of Rail
67/67
tests passing
297K
binary size
22
stdlib modules

COMPILER

Rail compiles itself. The compiler is a Rail program.
source
.rail
lexer
tokens
parser
AST
codegen
ARM64
link
binary
-- Rail compiles itself in one command
$ ./rail_native self

=== Self-compilation ===
  Source: 103,583 chars
  Compiled to assembly
  as: OK
  ld: OK
  Binary: /tmp/rail_self

ARM64 Native

Direct assembly generation. No LLVM, no GCC. Pure Rail → machine code. 297K binary, zero dependencies.

Metal GPU

Automatic GPU dispatch. Pure arithmetic maps route to Metal compute shaders. map f data just works.

Linux ARM64

Cross-compile to bare Linux ELF. Syscall-based libc, no glibc. 74K static binaries for Pi Zero.

FLEET

Three machines. One dashboard. Every node reports to the compiler.

MINI

CPU: Apple M4 Pro
RAM: 24 GB unified
Role: Compiler · Inference · Training
Agent: fleet_agent.rail — pure Rail

AIR

CPU: Apple M1
RAM: 8 GB unified
Role: Relay · Future Pi gateway
Agent: fleet_agent — compiled Rail binary

RAZER

CPU: AMD Ryzen
GPU: RTX 3070 · 8 GB VRAM
Disk: 936 GB
Role: CUDA training · Large model LoRA
Agent: fleet_agent.py — Python (x86_64)

PI ZERO PENDING

CPU: ARM Cortex-A53
Role: Edge compute · 74K Rail binaries
Status: Awaiting USB data cable

FLYWHEEL

The compiler is the oracle. Generate → Compile → Harvest → Train → Repeat.
COMPILER
ORACLE
GENERATE
code
COMPILE
verify
HARVEST
data
TRAIN
model
4.5K
verified examples
25
difficulty levels
92%
peak benchmark
4
trained models

0.5B

Smallest model. 16 LoRA layers, 1024 seq. Scores 24% baseline. Fast iteration.

1.5B

Primary training target. 16 layers, 1024 seq. Running on Mac Mini Metal.

4B

Needs Razer3070 for full training. 4 layers on Mac (OOM). CUDA unlocks 16 layers.

9B

Code brain. Inference only on 24GB. Reached level 25. Generates training data for smaller models.

LANGUAGE

Pure functional. Pattern matching. Foreign function interface. Compiles to bare metal.
-- factorial with tail-call optimization
fact n = if n <= 1 then 1 else n * fact (n - 1)

-- HTTP server in 4 lines
import "stdlib/http.rail"
handle req = respond 200 "hello world"
main = serve 8080 handle

-- GPU dispatch — map routes to Metal automatically
main = let r = map (\x -> x * 3 + 1) (range 1000000)
        print (show (head r))

json

Parse & emit JSON

http

Client & server

sqlite

Database bindings

regex

POSIX regex

socket

BSD sockets

base64

Encode & decode

RAIL SYSTEM v1.3.0
initializing compiler oracle...
loading fleet agents (3 nodes)...
flywheel status: ACTIVE
self-compile: 67/67
SYSTEM READY