Skip to main content

Development Status

Script's core language is complete. Library functionality (HTTP, TLS, fs, etc.) will be developed in the Rolls ecosystem.

Phase Roadmap

PhaseStatusDescription
Phase 0✅ CompleteRuntime kernel (NaN-boxing, allocator, stubs)
Phase 1✅ CompleteSSA IR (lowering, type inference, optimizations)
Phase 2✅ CompleteNative Backend (Cranelift JIT + LLVM AOT)
Phase 3✅ CompleteLanguage Completion (full TypeScript syntax)
Phase 4🚧 WorkingSelf-Hosting Compiler (compiles itself to native)
Phase 5📋 PlannedRolls Ecosystem (HTTP, TLS, fs, crypto libraries)
Phase 6📋 PlannedTooling (fmt, lint, LSP, profiler)
Phase 7📋 PlannedDistribution (Unroll package manager)

Core Language: Complete

✅ All Language Features Implemented

  • Control Flow: if/else, while, for, do..while, break/continue with labels
  • Error Handling: try/catch/finally, throw with exception propagation
  • Classes & OOP: ES6 classes, inheritance, super(), getters/setters, private fields (#field)
  • Decorators: TypeScript-style decorators on classes, methods, and fields
  • Template Literals: Backtick strings with interpolation
  • Type System: Type annotations, Hindley-Milner inference, generics, ownership types
  • Modules: ES module import/export syntax with file-based resolution
  • Async/Await: async function, await, Promise.resolve/then/catch

✅ Self-Hosting Compiler Complete

The compiler written in Script can now compile itself to native binaries:

ComponentStatusOutput
Rust Compiler (src/compiler/)✅ ProductionNative binaries
Bootstrap Compiler (bootstrap/)✅ ReferenceBytecode
Modular Compiler (compiler/)✅ Self-CompilingLLVM IR → Native

Build Pipeline:

./target/release/script compiler/main.tscl llvm input.tscl  # → input.tscl.ll
clang input.tscl.ll -c -o input.o # → input.o
clang input.o -o output # → native binary

Performance (Native vs VM):

TestNativeVMSpeedup
Fibonacci(25)7502575025~30x faster
Loops~30x faster
Recursion~30x faster
Objects/Functions~4x faster

Test Coverage

Current test status:

113 tests passed, 0 failed

Coverage includes:

  • IR lowering and optimization (DCE, CSE, constant folding, copy propagation)
  • Type inference and specialization
  • Runtime stubs and heap allocation
  • VM functionality
  • Borrow checker and closures
  • Backend compilation (Cranelift JIT, LLVM AOT)
  • Language features (loops, exceptions, classes, decorators, modules)
  • Self-compilation verification
  • Deterministic build verification

Performance

MetricVMJITSpeedup
Arithmetic2.34 µs/iter0.39 µs/iter~6x
JIT compilation-980 µs-
Break-even-~500 iterations-

Performance Targets

BenchmarkNode.jsBunTarget Script
fib(35)50 ms30 ms20 ms
Startup30 ms10 ms5 ms

What's Intentionally Minimal

Script Core is like "C without libc" — minimal and self-contained. These features are delegated to the Rolls ecosystem:

Not in CoreWhyFuture Location
HTTP/TLS serversExternal dependencies@rolls/http, @rolls/tls
Database driversDatabase-specific@rolls/db
JSON parsingCan be pure Script@rolls/json
Math functionsStandard library@rolls/math
Advanced file systemPOSIX-specific@rolls/fs
Crypto operationsExternal libraries@rolls/crypto

Next Steps

  1. Rolls Ecosystem: Build official system libraries (@rolls/http, @rolls/fs, etc.)
  2. Unroll Package Manager: Create build system and package management
  3. Tooling: Formatter, linter, LSP for IDE integration
  4. Bootstrap Verification: Verify hash(tscl₁) == hash(tscl₂) for deterministic self-hosting

Contributing

Contributions are welcome! See the Contributing Guide for details.