Skip to content

Releases: crimson-knight/crystal

Crystal Alpha 1.21.0 — upstream parity + incremental correctness fix

Choose a tag to compare

Crystal Alpha with Incremental Compilation — 1.21.0 parity

This release brings the fork to full parity with upstream Crystal 1.21.0
(released 2026-07-16). Everything in current public Crystal is here, plus the
fork's additions. That parity is part of this project's promise: the fork
tracks what's publicly available.

Upstream sync:

  • Merged crystal-lang/crystal tag 1.21.0 (316 commits since the previous base)
  • Adopted the new CompilerError-based error reporting in the fork's wasm-opt/wasm-merge integration
  • WASI event loop updated for the 1.21.0 EventLoop interface (pread, sendfile)
  • The fork's main.cr shared-library guard now composes with upstream's new without_main flag

Incremental-compilation correctness fix (new in this release):

  • Fixed a silent stale-binary bug present in v1.20.0-dev-incremental-3: the
    module→source-file mapping only records files whose defs pass through
    codegen_fun, so changes to top-level code or trivial method bodies inlined
    at call sites (e.g. def self.flag; true; end) invalidated no LLVM module.
    All objects were "reused", linking was skipped, and the rebuilt binary kept
    the old behavior — then the fingerprint save poisoned the cache so later
    rebuilds reported "no changes". Module skipping is now disabled for any
    rebuild whose changed files are not fully attributed in the module mapping;
    object reuse falls back to the content-based bitcode comparison (still fast,
    provably correct). Also, forked codegen workers now always report object
    reuse back to the parent — previously only with --stats — which the
    link-skip decision depends on.
  • If you used --incremental with the previous release, clear the cache once
    (crystal clear_cache) in case a stale state was recorded.

Carried forward from v1.20.0-dev-incremental-3:

  • Incremental compilation (M1–M8): --incremental flag, parse cache, signature
    tracking, no-change fast path (semantic + codegen skipped entirely), --no-cache
    / CRYSTAL_NO_CACHE escape hatches, zero overhead when not enabled
  • First-class iOS and Android linker integration and --shared output mode
  • watchOS target support (aarch64-watchos, aarch64-watchos-simulator)
  • WASI/wasm32 frontend improvements and CI

Verified on this release (Apple Silicon, macOS 26, release-built compiler):

  • Bootstraps with brew Crystal 1.20.3 + LLVM 22.1.8
  • 9-check incremental regression matrix passes (body-only, top-level,
    structural, poisoning-recovery, sequential codegen, fast-path, flag guards)
  • Kemal app, full O0 build: stock rebuild ~2.2s; --incremental no-change
    rebuild 0.26s (semantic + codegen + link all skipped); cold-build
    overhead ~6%; rebuild after editing an unmapped (top-level) file ~2.4s —
    the new correctness fallback, on par with stock rather than faster,
    by design

Build it:

git clone --branch v1.21.0-incremental-1 https://github.com/crimson-knight/crystal
cd crystal
LLVM_CONFIG=$(brew --prefix llvm)/bin/llvm-config make crystal release=1
./bin/crystal --version   # Crystal 1.21.0 [...]

Crystal Alpha 1.20.0-dev-incremental-3

Choose a tag to compare

Crystal Alpha with Incremental Compilation

Optimized incremental compilation infrastructure (M1-M8):

  • Gate overhead behind @incremental flag (zero cost in normal mode)
  • Add --no-cache flag + CRYSTAL_NO_CACHE env var
  • Deduplicate cache loads, skip MD5 on cold builds
  • Reuse ParseCache ASTs, eliminate double file reads
  • Fix GC crash in parallel semantic checkers
  • Progress tracker stages for Signatures + Cache save

Benchmark Results (release build, semantic-only):

Framework Files Stock Warm Speedup
Kemal 101 5.5s 1.4s 3.9x
Lucky 363 5.5s 1.6s 3.5x
Athena 888 5.7s 1.8s 3.2x
Amber 2,446 11.5s 2.2s 5.2x

Install: brew install crimsonknight/crystal-alpha

Crystal Alpha 1.20.0-dev (Incremental + WASM)

Choose a tag to compare

Crystal Alpha - Incremental Compilation + WASM Support

Pre-built binary for macOS ARM64 (Apple Silicon) with:

Incremental Compilation

  • File-level dependency graph with smart recompilation
  • Parse caching and signature-based change detection
  • Parallel parsing and semantic analysis
  • Watch mode (crystal-alpha watch)

WASM Support

  • Full wasm32-wasi target with exception handling, GC, fibers
  • Pre-compiled WASM object files eliminated — symbols emitted directly from codegen
  • LLVM 22+ exception model API support (version-gated)

Install via Homebrew

brew tap crimson-knight/crystal-alpha
brew install crystal-alpha

Quick Test

# Native compilation
crystal-alpha build hello.cr -o hello

# WASM compilation
CRYSTAL_LIBRARY_PATH=/tmp/wasm32-wasi-libs crystal-alpha build hello.cr \
  -o hello.wasm --target wasm32-wasi -Dwithout_iconv -Dwithout_openssl
wasmtime run --wasm exceptions hello.wasm

Requirements

  • macOS ARM64 (Apple Silicon)
  • LLVM 21+ (via brew install llvm)
  • For WASM: wasi-sdk libraries, wasmtime, wasm-opt (Binaryen)