Introduction
v0.2What PrinciPL 0.2 is, which features are available, and where to start.
On this page
PrinciPL (usually called Princi) is a statically typed programming language and compiler project. The v0.2 compiler is written in Rust, uses LLVM for native code generation, and targets Windows x86-64.
The language combines a compact procedural core with generics, classes, value-oriented structs, interfaces, traits, algebraic enums, pattern matching, Result<T, E>, and List<T>. The compiler checks types before generating a native Windows executable.
#One language, two extensions
Princi source files may end in .prnc or .princi. These suffixes are exact aliases: both are loaded, parsed, type-checked, and compiled as the same language. Neither extension enables a different syntax or behavior.
#Build a Windows executable
The CLI has one user-facing command, build:
princi build hello.prnc
This writes hello.exe beside hello.prnc. An input named hello.princi produces the same hello.exe output. Use -o to select a different path:
princi build hello.prnc -o app.exe
The build requires Windows x86-64 native tooling. Start with Getting started for the setup sequence, then follow the detailed Installation guide and Hello, world walkthrough.
#What v0.2 can compile
The compiler supports Int, Float, Bool, String, and Void; local let/var; functions, recursion, control flow, strings, generic functions/classes/structs/enums, generic bounds, interfaces with dynamic dispatch, traits with defaults, enum matching with exhaustiveness checks, Result<T, E> and ?, lists, built-in imports, and a restricted primitive C ABI.
#What's new in v0.2
v0.2 adds compile-time generics, behavioral contracts, algebraic data, and explicit error propagation while preserving the v0.1 build workflow and language features:
| Addition | What it provides |
|---|---|
| Generics and bounds | Generic functions, classes, structs, and enums; argument inference; monomorphization; trait and interface constraints. |
| Interfaces | Required method contracts and runtime dispatch for class values. |
| Traits | Required methods, default implementations, trait values, and class/struct implementations. |
| Enums and matching | Generic payload enums plus scoped destructuring and exhaustiveness-checked match. |
Result<T, E> and ? | A prelude enum and postfix propagation for functions with an exactly matching error type. |
These additions do not change the target: Princi still builds Windows x86-64 executables only. The limitations reference lists unsupported combinations and features.
The v0.2 limitations page describes the current boundary. The repository's canonical v0.2 scope records precise semantics and compatibility expectations.