Prisma Logo Prisma v0.1.0
Prisma 3D Crystal Logo
Up to 6.3× Faster than Dialyzer • 20.8× Less CPU • Erlang & Elixir 1st Class

Static Type Analysis Without the Wait.

Prisma brings together the sound pragmatism of Success Typing, the contract guarantees of Gradual Typing, and isolated .pplt tables for sub-second static verification, with errors it can prove.

RabbitMQ Core (234 modules) — rebar3 prisma build & check
Prisma terminal demo on RabbitMQ
Modular .pplt cache (1 MB for RabbitMQ's dependencies, loaded in 70 ms) 234 modules analyzed in real time Errors are proven; what the code handles is a separate warning

Generated with VHS from assets/prisma_demo.tape: the git clone is replayed from a local mirror to keep it short; the analysis is the real one.

6.3×
Faster Wall-Clock
20.8×
Less CPU Time
2.7×
Less Peak RAM
100%
Faults Caught (125/125)

Core Capabilities

Proven on Production Codebases

Engineered for immediate CI feedback, full developer trust, and zero workflow interruptions.

Sub-Second Speed

As seen in the demo on RabbitMQ (234 modules), Prisma builds its index and finishes static verification in seconds. Full CI runs complete up to 6.3× faster with 20.8× less CPU than Dialyzer.

Modular .pplt Tables

Eliminates monolithic rebuilds. rebar3 prisma build compiles applications and dependencies into isolated, portable binary .pplt files (RabbitMQ's 27 dependencies, 644 modules: 1 MB, built once in 2.4 s and loaded in 70 ms; all of OTP: 3 MB, 7.6 s once, 0.2 s to load). A library can ship its own .pplt in its Hex package.

Zero-Friction Tooling

Add {plugins, [prisma]}. to rebar.config or {:prisma, ...} to mix.exs. Zero external runtime dependencies, no global server setups, and no ceremony.

Errors You Can Trust

An error is what Prisma proves: it fails when it runs, and in discrepancy mode no false positive is known on RabbitMQ (440 modules, every warning read). A warning is certain but does not fail: dead code, an unused parameter, or a missing function inside a try that catches everything. Contract mismatches ([gradual_mismatch]) are strict by design and say so.

Hybrid Verification

Combines Success Typing (inferring true failure conditions without annotations) with strict Gradual Typing across -spec and @spec contracts.

Native Elixir & Erlang

Written in pure Erlang, directly parsing BEAM abstract code and Elixir Dbgi chunks with full support for SSA variable versions, struct patterns %_{}, and Mix tasks.

Architecture

Monolithic PLT vs. Modular .pplt

Eliminating the bottleneck of monolithic PLT rebuilds with isolated per-package contracts.

Dialyzer: Monolithic PLT Minutes
  • ✕ Single Monolithic Blob: Erlang base + all dependencies baked into one 100MB+ file.
  • ✕ Full Invalidation: Bumping 1 transitive dependency invalidates the entire cache in CI.
  • ✕ Heavy Resource Footprint: 1.46 GB RAM and 67.5s CPU time on 440 RabbitMQ modules.
Prisma: Modular .pplt Sub-Second
  • ✔ Isolated Package Tables: Each dependency in lockfile has its own portable .pplt.
  • ✔ Zero Redundant Work: Clean dependencies are reused directly from disk cache.
  • ✔ Dynamic In-Memory Merge: Contracts are loaded and merged in memory (70 ms for RabbitMQ's dependencies), focusing CPU purely on your app.

The 5-Stage Verification Pipeline

01 / AST
Extraction
Abstract code & Elixir Dbgi chunks.
02 / PPLT
Resolution
Lockfile parsing & 15ms in-memory merge.
03 / INFER
Success Typing
Fixpoint inference over guards & calls.
04 / CHECK
Gradual Subtyping
Consistency relation (~) against -spec.
05 / PRUNE
Oxbow Detection
Unused functions & dead parameters.
🔬 Measured with Hyperfine 2.0.0

Performance on Real Code

Audited against RabbitMQ (commit 5dacb85, 234 and 440 BEAM modules) on Apple M1 macOS 27 (Erlang/OTP 29, 64-bit, JIT).

Loading benchmark metrics...

Measured Telemetry Summary

RabbitMQ commit 5dacb85
Metric Prisma (234 mod) Dialyzer (234 mod) Prisma (440 mod) Dialyzer (440 mod) Advantage
Wall-Clock Time 1.08 s 6.75 s 3.02 s 17.27 s 5.7× — 6.3× faster
Total CPU Time 1.25 s 26.0 s 3.25 s 67.55 s 20.8× less CPU
Peak RAM (RSS) 295.5 MiB 405.1 MiB 536.0 MiB 1,456.7 MiB 1.4× — 2.7× less RAM
Instructions Retired 11.4 B 176.1 B 33.7 B 467.2 B 13.9× — 15.4× fewer
Seeded Faults (125 mutants) 125 / 125 (100%) 123 / 125 (98.4%) 125 / 125 (100%) 123 / 125 (98.4%) 100% caught, 0 spurious
* Measured with hyperfine 2.0.0 --metrics all on Apple M1 (8 cores), macOS 27, Erlang/OTP 29. Gradual mode vs Gradualizer: 5.3× faster on 440 modules (6.78s vs 35.89s, 100% vs 54% faults caught). Details: DISCREPANCIES.md, GRADUAL.md.

Quickstart

Zero-Config Integration

Add Prisma to your existing project with a single line of configuration.

Erlang (Rebar3) Plugin

Add to rebar.config:

{project_plugins, [
    {prisma, "0.1.0"}
]}.
Run in project:
rebar3 prisma
Elixir (Mix) Dependency

Add to deps in mix.exs:

defp deps do
  [
    {:prisma, "~> 0.1.0",
     only: [:dev, :test],
     runtime: false}
  ]
end
Run in project:
mix prisma
Standalone CLI Escript

Install globally via escript:

git clone https://github.com/altenwald/prisma
cd prisma
rebar3 escriptize
cp _build/default/bin/prisma /usr/local/bin/
Analyze any BEAM path:
prisma check _build/default/lib/*/ebin
❤️ Community Backed

Sponsors & Partners

Prisma is open source software supported by founding engineering teams and community sponsors.

Altenwald Ecosystem

Explore companion developer tools

Check out Portolan (OpenAPI for Phoenix), Plotto (pure Elixir charts & SVG/PNG), and Press (zero-dependency PDF rendering).

github.com/altenwald