BPL3
A statically typed compiled programming language targeting LLVM, exploring native compilation, modern language features, and developer tooling.
BPL (Best Programming Language) is a statically typed, compiled language, and BPL3 is its third complete iteration. Earlier versions were an interpreted language built on TypeScript and an experiment in C#; this one compiles to LLVM IR and produces native executables through Clang.
The project is a deep dive into how programming languages actually work — parsing, type checking, generics, code generation and runtime support — and into everything a language needs to feel usable day to day: a formatter, a package manager, clear diagnostics and editor integration. It is meant both as a practical systems language and as a readable reference for anyone curious about building a compiler end to end.
import [IO] from "std/io.bpl";
struct Point {
x: int,
y: int
}
frame main() ret int {
local p: Point;
p.x = 10;
p.y = 20;
IO.log("Hello from BPL!");
return 0;
}
The compiler is written in TypeScript and runs on Bun, with native runtime builds on Linux and macOS. It has grown to more than 2,000 commits.
Key features
- LLVM backend with native compilation and manual memory management
- Static typing with generics (full monomorphization) and runtime null checks on checked access paths
- Language features: structs with methods, single and multiple inheritance, modules with imports/exports, try/catch, pattern matching, tuples, function pointers and string interpolation
- Tooling: formatter with a CI check mode, watch mode, incremental compilation, a package manager and machine-readable JSON diagnostics
- Editor support: VS Code extension with a language server (completion, go-to-definition, hover)
- Runtime diagnostics: formatted errors with stack traces for null access, bounds checks, division by zero and integer overflow
Updates
Started BPL3
First commit of the third iteration of my programming language, now compiling to LLVM IR. It has grown past 2,000 commits since.