Type-safe Coalton or pure Common Lisp. Same binary. ~43ms startup. Zero dependencies.
Smelter (smt) is a self-contained CLI runner for Coalton that brings type-safe scripting to your workflow. Think Babashka for typed Lisp, with ML-style type inference and zero runtime dependencies.
# Quick install
curl -fsSL https://raw.githubusercontent.com/abacusnoir/smelter/master/install.sh | bash
# Run type-safe Coalton scripts
smt run script.coal
# Or run pure Common Lisp
smt cl run script.lisp
# Evaluate expressions (Coalton or CL)
smt eval '(+ 2 3)'
smt cl eval '(format nil "Hello ~A" "World")'- β‘ ~43ms startup - Faster than Ruby (62ms), competitive with Python (29ms) and Node.js (35ms)
- π§ ML-style type inference - Catch errors at compile time with Hindley-Milner type system
- π¦ 9.3MB binary - Self-contained, optimized, no dependencies to install
- π― Zero dependencies - Single binary, works everywhere
- π Shebang support - Run
.coalfiles directly with#!/usr/bin/env smt run - π» Interactive REPL - Explore and test code interactively
- π Cross platform - macOS (Intel/ARM) and Linux support
- π Batteries included - HTTP, JSON, file I/O, process execution built-in
- β 112+ tests - Comprehensive test coverage ensures reliability
Quick Install (Recommended):
curl -fsSL https://raw.githubusercontent.com/abacusnoir/smelter/master/install.sh | bashManual Installation:
# Download latest release for your platform
# macOS (Apple Silicon):
curl -L https://github.com/abacusnoir/smelter/releases/latest/download/smelter-macos-arm64.tar.gz | tar xz
# macOS (Intel):
curl -L https://github.com/abacusnoir/smelter/releases/latest/download/smelter-macos-x64.tar.gz | tar xz
# Linux (x86_64):
curl -L https://github.com/abacusnoir/smelter/releases/latest/download/smelter-linux-x64.tar.gz | tar xz
# Install to system
sudo mv smelter-* /usr/local/bin/smt
chmod +x /usr/local/bin/smtCreate hello.coal:
#!/usr/bin/env smt run
(declare greet (String -> String))
(define (greet name)
(concatenate "Hello, " name "!"))
(define main
(println (greet "World")))Run it:
chmod +x hello.coal
./hello.coal
# Output: Hello, World!Check out examples/showcase/ for production-ready demos:
- config-validator.coal - Type-safe configuration validation
- error-handling.coal - Result types for guaranteed error handling
- type-safety.coal - Compile-time type checking examples
- build-pipeline.coal - Type-safe build orchestration
- data-transform.coal - Type-safe data processing pipelines
./smt run examples/showcase/config-validator.coalCoalton Mode (type-safe):
smt run <file.coal> # Run a Coalton script
smt eval <expression> # Evaluate a Coalton expression
smt repl # Start interactive REPLCL Mode (pure Common Lisp):
smt cl run <file.lisp> # Run a CL script
smt cl eval <expression> # Evaluate a CL expression
smt cl repl # Start CL REPL
smt-cl <file.lisp> # Shortcut (for shebangs)General:
smt --version # Show version information
smt --help # Show helpQuick arithmetic:
smt eval '(+ 2 3)'
# Output: 5Type-safe factorial:
#!/usr/bin/env smt run
(declare factorial (Integer -> Integer))
(define (factorial n)
(if (== n 0) 1
(* n (factorial (- n 1)))))
(define main
(println (show-int (factorial 10))))Interactive REPL:
$ smt repl
Smelter 0.1.0 - Coalton REPL
smt> (+ 2 3)
5
smt> :quit
Goodbye!- SBCL (Steel Bank Common Lisp)
- Make
- curl (for installing dependencies)
# Clone the repository
git clone https://github.com/abacusnoir/smelter.git
cd smelter
# Install dependencies (automatically installs Quicklisp and Coalton)
make deps
# Build the binary
make build
# Run comprehensive tests (112+ test cases)
make test-all
# Install locally
make install# Quick development cycle
make dev
# Build with compression
make compress
# Create release archive
make releaseSmelter embeds SBCL and Coalton into a single executable using sb-ext:save-lisp-and-die. The build process:
- Load Dependencies - Quicklisp loads Coalton and dependencies
- Create Core - SBCL saves a core image with Coalton pre-compiled
- Build Binary - The CLI layer wraps the core into an executable
- Optimize - Tree-shaking and compression reduce size
This approach gives you:
- β Fast startup - No compilation at runtime
- β Zero deps - Everything embedded in one file
- β Type safety - Full Coalton type system available
- β Familiar UX - Works like any other CLI tool
Startup time. Smelter starts in ~43ms vs 500ms+ for compiled ML languages. For scripting, startup time matters more than peak performance.
Simplicity and power. Lisp syntax means a simpler parser, better error messages, and powerful macros. The ML-style type system gives you safety without verbose syntax.
For scripts, yes. Smelter is perfect for DevOps scripts, data processing, and build automation with 112+ tests ensuring reliability. The clean syntax and comprehensive test coverage make it ready for production scripting.
DevOps Scripts - Type-safe deployments with compile-time guarantees Data Processing - CSV reports, ETL pipelines with type safety Build Automation - Replace complex Makefiles with typed workflows API Integration - HTTP clients with JSON parsing built-in
This project is open source under the MIT License. The source code is shared for transparency and learning. Contributions will be welcomed in the future once the project stabilizes further.
This project is licensed under the MIT License - see the LICENSE file for details.
- Coalton - The statically-typed Lisp that makes this possible
- SBCL - Steel Bank Common Lisp implementation
- Babashka - Inspiration for zero-friction scripting
- Quicklisp - Common Lisp package manager
v0.1.0 Performance Metrics:
| Metric | Smelter | Python | Ruby | Node.js |
|---|---|---|---|---|
| Startup Time | ~43ms | ~29ms | ~62ms | ~35ms |
| Binary Size | 9.3MB | 45MB* | 35MB* | 75MB* |
| Type Safety | β Yes | β No | β No | β No |
*Runtime size, not including libraries
- Self-contained binary - No separate runtime or package manager needed
- ML-style type inference - Compile-time safety without annotation overhead
- Competitive startup - 51.6% faster than initial release (88ms β 43ms)
- Optimized size - 9.3MB optimized binary (50% smaller than v0.1.0-alpha)
Questions? For now, please explore the examples and documentation. Community engagement will be enabled once the project matures further.