Hi everyone! ![]()
Like many in the BEAM community, we’ve often felt the friction of running Dialyzer in our daily development workflow and CI pipelines: monolithic PLT files that take minutes to build, heavy CPU and RAM consumption, and the occasional cryptic warning or false positive on defensive clauses.
To solve this, we’ve been developing Prisma: a modern, hybrid static type analyzer for Elixir and Erlang designed for sub-second feedback, granular caching, and high developer trust.
How is Prisma different?
-
Modular
.ppltTables (No monolithic PLT rebuilds)
Instead of baking Erlang/OTP and all your dependencies into a single 100MB+ monolithic.pltblob, Prisma introduces isolated, binary.pplt(Prisma Persistent Lookup Tables):- Each package in
mix.lockgets its own portable.pplt. - Bumping or changing one dependency only recompiles that specific table.
- At analysis time, Prisma merges dependency tables dynamically in-memory in ~15 ms, so analysis time is spent solely on your application code.
- Package authors can even pre-build and publish
.ppltfiles directly inside their Hex packages (mix prisma.build).
- Each package in
-
Hybrid Verification (Success Typing + Gradual Typing)
- Success Typing: Infers true domain/range contracts to spot impossible paths without requiring annotations everywhere.
- Gradual Subtyping (
~&≲): Strictly verifies your@speccontracts (argument types, return consistency, map shapes). - Oxbow / Dead Code Pruning: Flags dead parameters and impossible guard clauses with the highest degree of certainty. If Prisma flags an issue, you can refactor or remove it with confidence.
-
First-Class Elixir Support
Prisma reads both Erlang AST and Elixir’s nativeDbgi/elixir_v1chunks, with built-in awareness of:- Struct patterns (
%User{}) - Keyword lists (
[key: :val]) - String binaries (
String.t()) and atoms - Multi-clause pattern matches and SSA variable versions
- Struct patterns (
Real-World Benchmarks (Hyperfine on Apple M1, Erlang/OTP 29)
We benchmarked Prisma on real production code using the official RabbitMQ repository (commit 5dacb85), comparing both the core server (234 BEAM modules) and a full monorepo of 7 applications (440 BEAM modules):
| Metric | Prisma (440 mod) | Dialyzer (440 mod) | Advantage |
|---|---|---|---|
| Wall-Clock Time | 3.02 s | 17.27 s | 5.7× — 6.3× faster |
| Total CPU Time | 3.25 s | 67.55 s | 20.8× less CPU |
| Peak RAM (RSS) | 536 MiB | 1,456.7 MiB | 2.7× less memory |
| Instructions Retired | 33.7 B | 467.2 B | 13.9× fewer instructions |
- Fault Detection (125 injected mutants across 5 mutation classes):
- Prisma: Detected 125 / 125 (100%) of faults, with 0 spurious warnings outside mutated functions.
- Dialyzer: Detected 123 / 125 (98.4%), but emitted 201 spurious warnings.
- Gradualizer: Detected 68 / 125 (54.4%), and ran 5.3× slower on 440 modules (35.9s vs 6.8s).
Getting Started with Mix
Adding Prisma to your project is straightforward. In your mix.exs:
def deps do
[
{:prisma, "~> 0.1.0", only: [:dev, :test], runtime: false}
]
end
Then run:
# Analyze your project
mix prisma
# Output formats for CI or editor linters
mix prisma --format human # default rich ANSI output
mix prisma --format oneline # ideal for vim/neovim/vscode diagnostics
mix prisma --format json # for CI automation & bots
You can also customize settings in mix.exs:
def project do
[
app: :my_app,
version: "0.1.0",
prisma: [
mode: :hybrid, # :hybrid | :gradual | :discrepancy
oxbow: true, # dead code / unused parameter detection
format: :human
],
deps: deps()
]
end
Links & Community Feedback
- GitHub:
- Documentation & Web: https://altenwald.github.io/prisma/
We would love for you to try it out on your Elixir applications and libraries! Feel free to share your thoughts, report issues, or suggest improvements. What are your biggest friction points with static typing in Elixir today?


















