A new implementation of Mesche.
- C 97.6%
- Makefile 1.6%
- Shell 0.8%
Sigil
Practical Symbolic Power
Sigil is a programming language designed for building standalone applications and games. It prioritizes developer experience, debuggability, and cross-platform deployment.
Goals
- Standalone Distribution: Build applications that users can run without installing anything
- Developer Experience: REPL-driven development with informative, recoverable errors
- Cross-Platform: Targets Linux, macOS, Windows, and WebAssembly
- Small and Fast: Minimal binary size with quick startup
Current Status
Sigil is a self-hosting implementation with a comprehensive standard library and tooling infrastructure. The compiler compiles itself (fixed-point verified) and the language includes advanced features like continuations, channels, and exception handling.
Core Language
- NaN-boxed values with Whippet GC (semi-space collector)
- Reader with full S-expression parsing, syntax objects, and source locations
- Bytecode interpreter with CPS-based compilation
- Hygienic macros via
syntax-rules - Module system with
define-libraryandimport - Self-hosted compiler (
(sigil compiler)modules) - First-class continuations via
call/cc - Delimited continuations with
reset/shift - Exception handling with
guard,raise, and condition types - Channels for concurrent programming
- R7RS Small compatible - works with existing Scheme libraries and learning resources
Standard Library
| Module | Description |
|---|---|
(sigil io) |
File and stream I/O, ports, binary I/O |
(sigil path) |
Pure path string manipulation |
(sigil fs) |
Filesystem operations, directory traversal, temp files |
(sigil process) |
Process spawning, environment, subprocess I/O |
(sigil time) |
Timestamps, date decomposition, timing utilities |
(sigil string) |
SRFI-28/48 format, string manipulation |
(sigil socket) |
TCP/UDP networking, non-blocking I/O, DNS |
(sigil json) |
JSON parsing and serialization |
(sigil sxml) |
SXML to HTML/XML generation |
(sigil args) |
CLI argument parsing with subcommands |
(sigil test) |
Test framework with assertions |
(sigil exceptions) |
Exception types and handling |
(sigil channels) |
Channel-based concurrency |
(sigil coroutines) |
Generators and coroutines |
Tooling
- sgl-boot: Bootstrap compiler for building the Sigil compiler
- sigil CLI: Main binary with REPL and script execution
- Documentation generator: Markdown parser and static site generator
- Project system:
project.sglformat for builds
Building
Sigil requires only a C99 compiler and Make. For development, use the Guix shell to ensure correct dependencies:
guix shell -m manifest.scm # Enter development environment
make CC=gcc # Build (CC=gcc required in Guix shell)
make CC=gcc test # Run tests
Cross-Compilation
make CC=emcc TARGET=wasm # WebAssembly via Emscripten
make CC=x86_64-w64-mingw32-gcc # Windows cross-compile
Project Structure
sigil/
├── components/
│ ├── libsigil/ # Core runtime library (VM, reader, GC, primitives)
│ ├── sgl-boot/ # Bootstrap compiler (C bytecode compiler)
│ └── cli/ # Main sigil binary
├── stdlib/ # Sigil standard library and compiler modules
│ ├── prelude.sgl # Core macros (let, cond, and, or, quasiquote, etc.)
│ └── sigil/
│ ├── compiler/ # Self-hosted compiler modules
│ ├── io.sgl, path.sgl, fs.sgl, ... # Standard library
│ └── ...
├── packages/ # Standalone packages (sigil-docs, sigil-app, etc.)
├── vendor/whippet/ # Vendored Whippet garbage collector
├── test/ # Test suite (unit/, compiler/, fixtures/, integration/)
├── examples/ # Example programs (guess.sgl, adventure/, chat-server.sgl)
├── build/ # Build output and configuration
└── scripts/ # Development helper scripts
Examples
- guess.sgl: Number guessing game demonstrating basic I/O
- adventure/: Multi-module text adventure using macros
- chat-server.sgl: TCP chat server demonstrating sockets and concurrency
Documentation
See PLAN.md for development roadmap and sigil-specification.md for the complete language design specification.
License
Sigil is licensed under the MIT License.