sigildocs

Sigil Releases

0.7.0

Parallelism and production readiness. Sigil gains multi-core execution, better I/O scalability, proper exception semantics, machine-readable procedure specifications, structured logging, and four new packages. With the stability and DX foundations from 0.5.0 and 0.6.0, this release focuses on the features needed to build and run serious applications.

Multi-VM Threading

The headline feature. Each thread-spawn creates a new VM with its own stack, heap, GC, symbol table, and module registry — zero shared mutable state, no locks needed. Threads communicate by message passing with automatic serialization/deserialization. parallel-map provides a high-level API for data-parallel workloads, partitioning work across N workers and collecting results.

Tail-Optimized Exception Handling

Replaced prompt-based exception handling with a dedicated VM-level handler stack. guard bodies now execute in true tail position, eliminating the 512-prompt practical limit. Deep recursive guard patterns (10,000+ iterations) work without overflow. Closure arity errors are now catchable by guard. Cross-context exception propagation works correctly through eval and load boundaries.

I/O Multiplexing

Replaced select(2) with epoll (Linux) and kqueue (macOS/BSD) behind the existing socket-select and fd-select APIs. Purely internal change with no Scheme API impact. Handles 200+ concurrent file descriptors efficiently.

Preemptive Yield Points

Yield checks at loop back-edges prevent CPU-bound tasks from starving other coroutines in the async scheduler. Default disabled — only activates when running inside with-async. Configurable interval via SIGIL_YIELD_INTERVAL environment variable.

Procedure Specifications

Machine-readable specs for procedure parameters and return values using real Scheme predicates. Specs use the inline (: ...) syntax placed as the first expression in a define or lambda body:

(define (add a b)
  (: number? number? -> number?)
  (+ a b))
  • Runtime checking: Optional predicate checks gated by the sigil-checks feature — zero cost in release builds
  • Predicate combinators: any-of, maybe, list-of, none-of for expressive type constraints
  • Struct field annotations: define-struct fields accept type predicates, auto-generating specs for constructors, accessors, and mutators
  • Full coverage: 330+ specs across 35+ modules, all audited against conventions
  • Tooling: Specs displayed in MCP search/exports output and generated API documentation

define-native Compiler Form

Declares bindings provided by native C code at runtime. Scheme modules can document and export native functions without fallback implementations, with optional specs and docstrings. Uses the new OP_DEFINE_IF_UNBOUND opcode to avoid overwriting native bindings registered at VM startup.

New Packages

PackageDescription
sigil-tuiImmediate-mode terminal UI toolkit with native C grid, layout system, components, event parsing, and text input
sigil-jmapJMAP email client (RFC 8620/8621) with session discovery, mailbox operations, email query/send
sigil-yamlYAML parsing and serialization with block/flow collections, block scalars, anchors/aliases, multi-document
sigil-logStructured logging with levels, text/JSON output, configurable targets, and lazy macros

sigil-tui-demo provides a chat client simulation exercising all TUI components.

HTTP Improvements

  • Streaming HTTP download support with binary-safe reads
  • File serving with Range request support and port positioning

Developer Tooling

  • MCP server: Procedure specs shown in search and exports output
  • API docs: sigil docs api fixed and now displays spec signatures in generated documentation
  • Build system: Test compilation propagates build config features (e.g., sigil-checks)

Bug Fixes

  • Fixed false positive capture corruption check in serializer
  • Fixed Windows build: mingw macro collision with _inline field name
  • Fixed Windows build: use define-native for unix-connect (not available on Windows)
  • Fixed exception handler double-pop causing test runner segfault
  • Fixed bootstrap compilation: replaced when with if in %set-spec!

0.6.0

This release brings Sigil much closer to full R7RS compliance, adds a complete web development workflow with live browser reloading, and introduces three new packages: a PEG parsing library, an Org Mode parser, and an XMPP client. Developer tooling improves significantly with rich error diagnostics, an enhanced MCP server, and watch mode for incremental builds.

R7RS Compliance

The biggest area of work in this release. Sigil now supports nearly all of R7RS Small:

  • Control flow: dynamic-wind, do syntax, guard prompt limit raised for deeper exception handling
  • Macros: let-syntax, letrec-syntax
  • Modules: include, include-ci, import set modifiers (only, except, prefix, rename)
  • I/O: Bytevector ports, read-bytevector!, char-ready?, u8-ready?
  • Output: write-shared with datum labels for circular structure printing
  • Feature detection: features, cond-expand, syntax-error
  • Libraries: (scheme time), (scheme process-context), (scheme repl) with interaction-environment
  • Literals: #u8(...) bytevector literal syntax in compiler and reader

Web Development

A full live-development workflow for web applications:

  • Live reloading: nREPL server with SSE-based browser reload — edit code, see changes instantly
  • Higher-level UI components: Expanded component library for sigil-web
  • API refinements: Improved ergonomics for routing, form handling, and GET requests
  • CSS generation: css-sel for compound selectors
  • MCP browser tools: 7 new tools for live browser control (morph, navigate, execute JS, reload CSS, error overlay)
  • Demo application: Vinyl Vault, a full CRUD demo showcasing the web stack

New Packages

PackageDescription
sigil-pegParsing Expression Grammars with S-expression DSL, backtracking, and captures
sigil-orgOrg Mode parser producing SXML (headlines, metadata, source blocks, tables, lists)
sigil-xmppXMPP client with STARTTLS, SASL (SCRAM-SHA-1/PLAIN), roster, presence, and MUC

Supporting packages: sigil-crypto gains HMAC-SHA1 and PBKDF2-SHA1, sigil-tls adds tls-upgrade for STARTTLS.

Developer Tooling

  • Rich error diagnostics: Structured error type hierarchy with Levenshtein-based "did you mean?" suggestions, source snippets with caret indicators in stack traces
  • MCP server: Package-provided tool discovery, multi-form eval, format auto-fix, runtime doc fallback for undocumented exports, nREPL describe and modules operations
  • Watch mode: sigil build --watch and sigil test --watch with --format json support
  • Value inspection: New (sigil inspect) module for structured introspection via nREPL and MCP
  • Project templates: sigil init gains web-app, api-service, and mcp-tool templates
  • Docstring collection: Variable definitions now collect docstrings; native docs propagate through re-exports

Performance

  • Dict lookup: FNV-1a hash cached on string keys, avoiding repeated computation

Library Improvements

  • sigil-markdown: Inline parser rewritten using PEG grammars (~120 fewer lines, same behavior)
  • sigil-json: Handle UTF-16 surrogate pairs in unicode escapes per RFC 8259
  • sigil-docs: Re-export descriptions resolved from source module entries

Bug Fixes

  • Fixed SIGIL_NATIVES_MAX limit (increased to 2048) for projects with many native bindings
  • Fixed --no-color flag in test runner
  • Fixed git-fetch to include tags when updating cached bare repos
  • Fixed binary-safe nREPL wire protocol and SIGPIPE handling
  • Fixed MCP format tool crash

0.5.0

This release is all about stability and correctness. A comprehensive audit of the garbage collector uncovered and fixed a critical write barrier gap, and GC stress testing now runs across the entire compiler pipeline. The HAMT dict implementation is complete, arbitrary-precision integers (bignums) are fully integrated, and every open issue has been resolved. Performance improves with inline caching and superinstructions, and the multimedia packages have been reorganized for flexibility.

GC Correctness

The most impactful change in this release: the tri-color write barrier was implemented but never called. Every mutation site that writes a heap pointer into an existing object could violate the tri-color invariant during incremental marking. This was the root cause of several hard-to-reproduce crashes.

  • Write barriers: Added sigil__gc_write_barrier() calls to all 13 heap mutation sites across vm.c and natives.c
  • Compiler rooting: Removed the SIGIL_GC_DISABLE_DURING_COMPILATION workaround entirely. Fixed 46+ unrooted allocation sites in the compiler through systematic audit
  • GC stress testing: SIGIL_GC_STRESS=1 forces GC on every allocation, maximizing the window for bugs. All tests pass under stress

Performance

  • Inline caching: Module binding lookups now use per-code cache arrays. On benchmarks, 3.3M hash lookups reduced to ~38K cold-start misses, with 100% steady-state cache hit rate
  • Superinstructions: Peephole optimizer fuses 8 common opcode patterns (e.g., PUSHLOCAL+PUSHLOCAL, PUSH_CONST+ADD). Compiler-level fusion merges source location tracking with call opcodes

Arbitrary-Precision Integers

Integers larger than 2^47 now automatically promote to bignums instead of raising an error:

  • Full arithmetic operations (add, subtract, multiply, divide, modulo, GCD)
  • Comparison and bitwise operations
  • Transparent promotion and demotion (bignum results that fit in a fixnum automatically demote)
  • Serialization support in bytecode files

Dict Completeness

The HAMT (Hash Array Mapped Trie) implementation is now feature-complete:

  • Printing: HAMT dicts display all entries with display and write
  • Equality: equal? walks HAMT nodes for structural comparison
  • Collision handling: Fixed silent key dropping when hash collisions occur at the same node
  • Removal: Proper structural dict-remove with sharing, branch collapse, and HAMT-to-array demotion when count drops below 8

Error Handling

  • Three exit(1) calls in the module system replaced with sigil__vm_error() so the Scheme-level exception system handles them gracefully
  • OP_ABORT_TO_PROMPT now extracts real error messages from exception objects
  • Macro expansion errors propagate properly to the compiler
  • match raises an error instead of printing a warning when no clauses match

Stack Traces

Procedures now track where they were defined. Stack traces show definition locations, making it easier to identify which function failed:

Stack trace (most recent call first):
  0: my-helper
     at utils.sgl:42:5

Multimedia Packages

sigil-studio has been split into three independent packages for more flexible dependency management:

PackageDescription
sigil-appWindowing, input, application lifecycle (sokol_app)
sigil-graphics2D rendering, image loading, font rendering (sokol_gfx, stb)
sigil-audioSound effects and music streaming (sokolaudio, stbvorbis)

sigil-studio remains as a meta-package that pulls in all three. New: playlist support with wait-music-end and play-playlist.

Build System

  • Test harness generation for packages with native C dependencies
  • c-flags field on library definitions
  • --profile flag for opcode-level performance analysis
  • Build safety: warns when replacing the running binary, errors on 0-byte output or missing target package

Test Coverage

Added test suites for 15+ packages that previously had none, including sigil-crypto, sigil-tls, sigil-web (routing, middleware, cookies, SSE, security), sigil-socket, sigil-process, sigil-mcp, sigil-jwt, sigil-websocket, sigil-markdown, sigil-format, and sigil-sxml. Error path tests added across the standard library.

Bug Fixes

  • Fixed assq-ref to return values instead of aliasing assq; added assv-ref
  • Fixed number->string precision for exact IEEE 754 roundtrip (was losing digits on large flonums)
  • Fixed REPL string-length error after exception recovery
  • Fixed cross-module symbol resolution corruption
  • Fixed bundle directory listing for bundled applications (VFS)
  • Fixed sigil-run re-import of (sigil core) before calling entry main
  • Fixed process port caching for stable repeated access
  • Removed dead opcodes (OP_LOAD_BYTECODE, OP_MAKE_CLOSURE_RT, OP_WRITE_BYTECODE_FILE)

0.4.0

This release makes Sigil leaner and faster. Native list operations cut compilation time in half, release binaries are 44% smaller, and a new profiling module helps you find bottlenecks in your own code. Macro authors get full hygiene support, and error handling improves with catchable VM errors and cleaner stack traces.

Breaking Changes

  • sigil-web: Renamed UI components from sigil-* to sg-* prefix (e.g., sigil-button becomes sg-button) to mirror data-sg-* attributes

Performance

Profiling revealed hotspots in list operations during macro expansion. Native C implementations of assoc, assq, assv, member, memq, and memv deliver significant speedups:

  • Test suite runs 2x faster (33s → 15s)
  • Module compilation 50% faster
  • Release binaries 44% smaller (3.2MB → 1.8MB)

Macro Hygiene

Full hygienic macro support for syntax-rules and syntax-case. Macros now properly respect lexical scope, preventing accidental variable capture:

  • Local and module-level hygiene
  • free-identifier=? for comparing identifiers during expansion
  • #' reader shorthand for (syntax ...) expressions
  • New (sigil syntax) module with syntax->datum, datum->syntax, generate-temporaries

Error Handling

  • Catchable VM errors: guard can now catch type errors, division by zero, and out-of-bounds access. Use the new vm-error? predicate in (sigil error).
  • Better stack traces: Errors display file paths with line and column positions. Anonymous lambda frames are filtered by default for cleaner output.

Profiling

New (sigil profile) module for performance analysis:

(with-profiling
  (my-expensive-operation))
(profile-report)  ; Shows call counts, timing, allocations

Library Improvements

  • sigil-http: Keyword arguments for make-http-server and http-serve (port:, host:, handler:)
  • sigil-sxml: New sxml->html for converting SXML trees to HTML strings
  • sigil-version: New package for semantic version parsing and comparison

Bug Fixes

  • Fixed source file names in error stack traces
  • Fixed socket API consistency across platforms
  • Fixed with-api-docs path resolution in sigil-publish
  • Fixed sigil-irc package dependency declaration

0.3.0

This release focuses on modular compilation and improved application bundling. Native dependencies like SQLite, TLS, and crypto are now separate packages, so applications only compile what they actually use. The new sigil publish command provides a complete static site generation pipeline, and bundling gains script mode support for simpler deployments.

Breaking Changes

  • sigil-http: API review changes including lazy TLS loading for compile-time independence

Modular Native Packages

Heavy native dependencies have been extracted from sigil-lib into separate packages:

PackageDescription
sigil-sqliteSQLite database bindings
sigil-tlsTLS/SSL support
sigil-cryptoCryptographic functions

Applications that don't use these features no longer compile them, resulting in smaller binaries and faster builds.

Application Bundling

  • Script mode: Bundle single-file scripts with sigil bundle script.sgl
  • Custom runtimes: Build tailored runtimes with only needed native modules
  • Native package detection: Automatic entrypoint generation for native dependencies
  • Production runtime (sigil-run): Script mode support for bundled applications

New Command: sigil publish

Static site generation with a pipeline-based architecture:

(site output-dir: "dist"
      pipeline: (list markdown-processor syntax-highlighter)
      watch-patterns: '("content/**/*.md" "templates/**/*.html"))

Site operators integrate with the threading macro for composable pipelines.

Library Improvements

  • sigil-json: Added json-get-in for nested access
  • sigil-stdlib: New conveniences and predicates from API review
  • sigil-args: New features and comprehensive documentation
  • sigil-test: Native test build integration and new assertions
  • sigil-build: Consolidated shared code and improved test support

Bug Fixes

  • Fixed temp file creation on Windows (sigil-lib)

0.2.0

This release focuses on improving the idiomatic functional programming style of Sigil. New modules for sequences and function composition make it easier to write clean, composable code. Pattern matching gains dict, vector, and struct support, and several APIs have been refined for consistency.

Breaking Changes

  • Module renamed: (sigil exceptions)(sigil error)
  • API changes: map and for-each now operate on single lists only. Use list-map and list-for-each for multi-list operations.
  • Renamed functions: remove-directorydelete-directory, channel-closechannel-close!

New Modules

ModuleDescription
(sigil random)Random number generation, shuffling, and sampling
(sigil seq)Polymorphic sequences and transducers
(sigil array)Efficient fixed-size collections
(sigil fn)Function composition: compose, pipe, partial, juxt

Pattern Matching Improvements

  • Dict pattern matching: (match d ((dict a: x b: y) ...))
  • Vector literal syntax: #(a b c) patterns
  • New forms: match-lambda, match-lambda*
  • Struct and vector pattern support

Other Enhancements

  • Unicode case conversion: char-upcase, char-downcase, string-upcase, string-downcase with full Unicode support
  • HTTP client: Added chunked transfer encoding support
  • CLI: sigil cli upgrade now uses native HTTP client (no curl dependency)
  • Dict utilities: dict-select, dict-rename-keys, dict-get-in for nested access
  • Threading: some-> macro for nil-short-circuiting pipelines

0.1.0

The first public release of Sigil, a practical Scheme for building standalone applications.

NOTE: Sigil is still highly experimental and changing fast, but don't let that stop you from trying it out and providing feedback!

Highlights

  • Standalone executables: Bundle your application with all dependencies into a single binary (~1-2MB base size)
  • Fast startup: Bytecode VM with incremental garbage collection
  • Hygienic macros: Full syntax-rules with syntax-case support
  • Batteries included: JSON, HTTP client/server, sockets, process management, and more

Core Runtime (sigil-lib)

The foundation: bytecode VM, S-expression reader, incremental mark-sweep GC, and native bindings for I/O, filesystem, networking, and process management.

Standard Library (sigil-stdlib)

Nearly complete R7RS base with practical extensions:

  • (sigil core) - Pattern matching, records, delimited continuations, array/dict utilities
  • (sigil math) - Trigonometric, exponential, and bitwise operations
  • (sigil string) - String manipulation utilities
  • (sigil path) - Cross-platform path handling
  • (sigil fs) - Filesystem operations
  • (sigil io) - Extended I/O primitives
  • (sigil process) - Process spawning and pipes
  • (sigil time) - Date/time operations
  • (sigil exceptions) - Exception handling
  • (scheme *) - R7RS compatibility modules

Build System (sigil-build)

Package-based workspace architecture with:

  • Dependency resolution across workspace packages
  • Multiple build configurations (dev, debug, release)
  • Executable bundling with embedded bytecode archives

CLI Tools (sigil-cli)

Development workflow commands:

  • sigil build - Compile packages and dependencies
  • sigil bundle - Create standalone executables
  • sigil test - Run test suites
  • sigil repl - Interactive development
  • sigil format - Code formatting
  • sigil changes - Release management
  • sigil cli - Install and manage Sigil installations

Libraries

PackageDescription
sigil-jsonJSON parsing and serialization
sigil-httpHTTP/1.1 client and server with TLS support
sigil-socketTCP/UDP networking
sigil-websocketWebSocket client and server
sigil-sqliteSQLite database bindings
sigil-gitGit repository operations
sigil-replInteractive REPL with readline
sigil-nreplNetwork REPL for editor integration
sigil-testTest framework with assertions
sigil-formatS-expression code formatter
sigil-markdownMarkdown parsing with frontmatter
sigil-sxmlSXML document construction
sigil-ansiTerminal colors and formatting
sigil-argsCommand-line argument parsing
sigil-hooksExtensible hook system
sigil-mcpModel Context Protocol server
sigil-jwtJWT token encoding and verification
sigil-docsDocumentation generation
sigil-webWeb application framework
sigil-publishStatic site generation pipeline
sigil-ircIRC client
sigil-cssCSS generation from Sigil code
Note: Library APIs may change between minor releases until 1.0. Core modules (sigil-lib, sigil-stdlib) aim for stability.

Platform Support

PlatformArchitectureStatus
Linuxx86_64, aarch64Primary development platform
macOSarm64, x86_64Builds and runs, not yet extensively tested
Windowsx86_64Builds and runs, not yet extensively tested
FreeBSDx86_64Cross-compiles, not yet tested on real hardware
OpenBSDx86_64Cross-compiles, not yet tested on real hardware
NetBSDx86_64Cross-compiles, not yet tested on real hardware
Web/WASM-Runs in browser via Emscripten

Known Limitations

  • R7RS Small coverage is not yet complete; full compliance planned for a future release
  • Limited SRFI coverage

Getting Started

See the Getting Started guide for installation and first steps.