Hey everyone,
I’ve been working on incremental compilation for Crystal and I’m at the point where I need people with real projects to try it out and tell me what they see.
What is this?
crystal-alpha is a build of the Crystal compiler from my incremental-compilation branch. It tracks dependency changes at the file level and skips recompilation of files that haven’t changed. The result is that after your first compile, subsequent compiles while you’re developing should be significantly faster.
It also includes WASM compilation support (wasm32-wasi target), but the main thing I’m looking for feedback on right now is the incremental compilation experience during active development.
Install (macOS only right now)
brew tap crimson-knight/crystal-alpha
brew install crystal-alpha
That’s it. This installs alongside your existing crystal compiler - it doesn’t replace it.
Usage
It works exactly like crystal but the command is crystal-alpha:
# Build your project
crystal-alpha build src/my_app.cr -o bin/my_app
# Run specs
crystal-alpha spec
# Watch mode - recompiles on file changes
crystal-alpha watch src/my_app.cr
Watch Mode
This is where incremental compilation really shines. Instead of manually rebuilding after every change, run:
crystal-alpha watch src/my_app.cr -o bin/my_app
Watch mode uses macOS native kqueue file monitoring — it detects the moment you save a file and triggers an incremental rebuild automatically. Only the files you changed (and anything that depends on them) get recompiled. Everything else is cached.
A few things that make this practical for real development:
--run— Executes your binary after each successful compile. When you save a file, it kills the running process, recompiles, and restarts it. This is the one you want for web apps:
crystal-alpha watch src/my_app.cr -o bin/my_app --run
-
--clear— Clears the terminal before each compile so you get a clean output -
Debouncing — Waits 300ms after a save before compiling, so rapid saves from your editor don’t cause repeated builds
-
Error recovery — If your code has an error, it prints the error and keeps watching. Fix the file, save, and it tries again immediately
The point of watch mode is that you leave it running in a terminal while you work. Save a file, see the result in seconds. For a project that normally takes 30+ seconds to compile from scratch, you should see incremental rebuilds in the low single digits.
What I want you to do
-
Install it
-
Go to your project directory
-
Do a cold compile:
crystal-alpha build src/your_app.cr -o bin/my_app -
Change a file - any file, even just add a comment
-
Compile again
-
Tell me how long both compiles took
You don’t need precise benchmarks. Even just “cold compile took about 30 seconds, second compile took about 4 seconds” is exactly what I’m looking for.
If you have a larger project, that’s even better. The bigger the project, the more dramatic the difference should be.
Bonus: Try watch mode for a real development session. Start crystal-alpha watch src/my_app.cr -o bin/my_app --run, make some edits, and tell me what the experience feels like compared to your normal workflow.
What to report back
-
What project you tested with (rough size is fine - “small CLI tool” vs “web app with 50 models”)
-
Cold compile time (rough is fine,
timeoutput works too) -
Incremental compile time after a small change
-
Did it produce a correct binary? (aka Does your app still work?)
-
Any errors or weird behavior
Known limitations
-
macOS only (Apple Silicon and Intel) for now
-
This is an alpha - if something breaks, I want to hear about it
-
The first compile will always be the same speed as normal Crystal since there’s nothing cached yet
Thanks for helping test this. The goal is to make Crystal development feel as fast as editing a scripting language while keeping all the performance benefits of a compiled language.


