Skip to content

Safety

How many classes of bugs does the language prevent for you?

Five categories — memory safety, null derefs, data races, integer overflow, and type coercion — each scored by when the protection kicks in: compile-time (best), runtime, or not at all. Weighted by real-world CVE impact. How we score →

Results

LanguageScoreMemoryNullRaceOverflowCoercion
Elixir5compilecompilecompilecompilecompile
Milo5compilecompilecompilecompilecompile
Haskell4.8compilecompilecompileruntimecompile
Rust4.8compilecompilecompileruntimecompile
Erlang4.7compileruntimecompilecompilecompile
Clojure4.3compileruntimeruntimecompileruntime
Swift4.3compilecompileruntimeruntimecompile
Kotlin3.9compilecompileruntimenonecompile
Python3.8compileruntimenonecompileruntime
Ruby3.8compileruntimenonecompileruntime
C#3.7compilecompileruntimeruntimeruntime
Go3.5compileruntimeruntimenonecompile
TypeScript3.3compilecompilenonenonecompile
Zig3.3runtimecompilenoneruntimecompile
Java3.1compileruntimeruntimenoneruntime
JavaScript2.3compilenonenonenonenone
C++1.1runtimeruntimenonenonenone
Objective-C0.8runtimenonenonenonenone
C0nonenonenonenonenone
compile-timeruntimenone

What the categories measure

CategoryWeightWhat it prevents
Memory45%Use-after-free, double-free, buffer overflow, uninitialized reads
Null20%Null/nil pointer dereference
Data Races15%Two threads mutating shared state concurrently
Overflow12%Integer overflow silently wrapping
Coercion8%Implicit type coercions ("5" + 3 → "53")

Weights reflect real-world impact: ~70% of high-severity CVEs are memory safety bugs (Microsoft, Google Chrome). Integer overflow dropped out of the CWE Top 25 in 2025.

Notable tradeoffs

Rust (4.8) — near-perfect but not 5.0. Integer overflow panics in debug mode, wraps in release. The borrow checker prevents memory, null, and race bugs at compile time.

Go (3.1) — GC handles memory, but null panics at runtime (no Option type), race detection is opt-in (-race flag), and no overflow protection.

TypeScript (3.3) — GC handles memory. Null and coercion protection require strict mode (opt-in). No overflow or race protection.

Python (3.8) — GC + arbitrary-precision integers (no overflow possible). But no race protection and coercion is runtime-only (True + 1 → 2).

C (0) — no protection in any category. Every bug class is the programmer's responsibility.