'Alan von Palladium' - Palladium Programming Language
August 30, 2026 ยท View on GitHub
_ __ ______ ____ _ _ _
/ \ \ \ / / _ \ / ___|___ _ __ ___ _ __ (_) | ___ _ __
/ _ \ \ \ / /| |_) || | / _ \| '_ ` _ \| '_ \| | |/ _ \ '__|
/ ___ \ \ V / | __/ | |__| (_) | | | | | | |_) | | | __/ |
/_/ \_\ \_/ |_| \____\___/|_| |_| |_| .__/|_|_|\___|_|
|_|
"When Turing's Proofs Meet von Neumann's Performance"
โ ๏ธ Alpha Software: Palladium is in active development (v0.1.1). APIs and language features are subject to change.
Palladium is a systems programming language that combines Turing's correctness with von Neumann's performance.
๐ Features
-
Memory Safety: Ownership and borrow checking at compile time
-
Type Safety: Strong static typing
-
Performance: Compiles to C, then to native code
-
Simplicity: Clean, readable syntax
-
Self-Hosting: achieved as a fixed point (see below)
Self-hosting
bootstrap/pdc.pd is a Palladium compiler written in Palladium. It is verified as a fixed
point, not a demo โ the C emitted by the stage-1 compiler and by the stage-2 compiler are
byte-identical:
$ make selfhost
== stage0: Rust pdc compiles bootstrap/pdc.pd ==
== stage1: pdc1 compiles bootstrap/pdc.pd == -> c1.c (993 lines) -> pdc2
== stage2: pdc2 compiles bootstrap/pdc.pd == -> c2.c (993 lines)
โ
SELF-HOSTING ACHIEVED โ fixed point reached.
e8bd8cdac5460a250fe40bb80e1f9e9f3be20453 c1.c
e8bd8cdac5460a250fe40bb80e1f9e9f3be20453 c2.c
Earlier versions of this README claimed "100% bootstrap" while no Palladium-written compiler
had ever compiled itself; that claim was false and the compilers it pointed at could not have
worked. The language subset the bootstrap compiler is written in โ and implements โ is
specified in docs/specification/bootstrap-subset.md.
๐ฆ Installation
From crates.io (Recommended)
cargo install alan-von-palladium
From Source
git clone https://github.com/labforadvancedstudy/palladium-a.git
cd palladium-a
cargo build --release
# Add to PATH
export PATH="$PATH:$(pwd)/target/release"
๐ฏ Quick Start
Hello World
Create hello.pd:
fn main() {
print("Hello, World!");
}
Compile and run:
pdc compile hello.pd -o hello
./build_output/hello
Output:
Hello, World!
๐ Language Tour
Variables and Types
fn main() {
// Immutable by default
let x = 42;
let y: i64 = 100;
// Mutable variables
let mut count = 0;
count = count + 1;
// Strings
let message = "Hello, Palladium!";
print(message);
}
Functions
fn add(a: i64, b: i64) -> i64 {
return a + b; // Explicit return required
}
fn greet(name: String) {
print("Hello, ");
print(name);
print("!");
}
fn main() {
let sum = add(10, 20);
print_int(sum); // Output: 30
greet("Palladium");
}
Control Flow
fn main() {
// if-else
let x = 10;
if x > 5 {
print("x is greater than 5");
} else {
print("x is 5 or less");
}
// for loops
for i in 0..5 {
print_int(i);
}
// while loops
let mut count = 5;
while count > 0 {
print_int(count);
count = count - 1;
}
}
Structs and Enums
struct Point {
x: i64,
y: i64,
}
enum Result {
Ok(i64),
Err(String),
}
fn divide(a: i64, b: i64) -> Result {
if b == 0 {
return Result::Err("Division by zero");
}
return Result::Ok(a / b);
}
fn main() {
let p = Point { x: 10, y: 20 };
print_int(p.x);
let result = divide(10, 2);
match result {
Result::Ok(value) => {
print_int(value);
}
Result::Err(msg) => {
print(msg);
}
}
}
Arrays
fn main() {
// Fixed-size arrays
let numbers = [1, 2, 3, 4, 5];
let zeros = [0; 10]; // Array of 10 zeros
// Array access
let first = numbers[0];
print_int(first);
// Iteration
for i in 0..5 {
print_int(numbers[i]);
}
}
Memory Safety
fn main() {
let x: i64 = 42;
let y: &i64 = &x; // immutable borrow โ annotate it
print_int(*y);
let mut z: i64 = 10;
let w: &mut i64 = &mut z;
*w = 20;
print_int(z); // 20
}
๐ ๏ธ Compiler Usage
Basic Commands
# Compile a file
pdc compile program.pd -o program
# Compile with optimization
pdc compile program.pd -o program -O
# Show help
pdc --help
There is one working backend: the default, which compiles to C. The --llvm
flag exists and refuses โ the LLVM text backend is a skeleton kept for
development, not something you can build with. See
the specification ยง1.
Compilation Process
When you compile, you'll see detailed progress:
๐จ Compiling program.pd...
๐ Lexing...
๐ณ Parsing...
๐ Type checking...
๐ Borrow checking...
๐ Analyzing effects...
โ ๏ธ Checking unsafe operations...
๐ง Optimizing...
โก Generating C code...
โ
Compilation successful!
๐ Linking...
๐ Current Status
โ Works end-to-end
- Functions,
let/assignment,if/else,while,for-over-range i32/i64/u32/u64,bool,String, fixed-size arrays- Structs; enums with unit/tuple/struct variants;
matchon enums - Top-level
constandstaticitems, withstatic mutfor writable storage - Ownership and borrow checking
- C code generation and linking
โ ๏ธ Parses but is broken downstream
?operator โ emits C referencing astruct Resultlayout codegen never definesasync/.awaitโ emits a call to apollmember that is never generated- Generic types in a struct field, and tuples in a struct field or an enum payload โ refused by name
- Generics โ generic arguments that are all-uppercase are misparsed as const generics
forover an array parameter โ usessizeofon a decayed pointer
โ Not implemented
This list is older than the compiler in places. The pattern and tuple entries were corrected when issue #41 landed; the entries marked (stale) were falsified by earlier branches and are left standing rather than quietly deleted, because correcting them is that branch's receipt to write, not this one's.
docs/specification/language-spec.md's A-sections are the measured status.
- Traits (parse, then emit nothing โ no dispatch mechanism exists)
- Closures
- (stale) method call syntax
obj.method(),else if,loopโ all implemented byfeat/m2-expressions - (stale) floats, bitwise operators, compound assignment (
+=),ascasts โ same branch - Chars as a distinct TYPE (
'a'lexes and carries its scalar; its type isi64) - Slice patterns,
ref/mutbindings, field shorthand in a struct-variant pattern, destructuringlet - String interpolation
- Macro hygiene โ expansion is textual and a macro body reads the CALL SITE's names. The macro
system itself works for a token template with
$namesubstitution (macro double!(x) { $x * 2 }). What a macro BODY or ARGUMENT may contain is a closed set and everything outside it is refused by name โ non-integer literals, two-character operators, a bare parameter name, an unknown$name, a nested invocation. The three unusable builtins are NOT in that set:println!,assert!anddbg!fail with ordinary parse errors from their own expansions, whichA4.6of the specification lists shape by shape
โ ๏ธ Known Limitations
- A
matchon any type other than an enum or aboolneeds a_or binding arm: no set of literal or range arms is complete, and coverage by ranges is not checked - A chained tuple index needs parentheses โ
(p.0).1, because.0.1lexes as one float literal - A one-element tuple
(e,)is not a form this language has;(e)is grouping printandprint_intoutput on separate linespdcmust be run from the repository root: it linksruntime/palladium_runtime.cby relative path
Feature-by-feature status with evidence: docs/specification/language-spec.md.
Run scripts/conformance.sh to reproduce the current numbers.
๐๏ธ Building from Source
# Clone repository
git clone https://github.com/labforadvancedstudy/palladium-a.git
cd palladium-a
# Build in release mode
cargo build --release
# Run tests
cargo test
# Install locally
cargo install --path .
๐ Documentation
- Getting Started Guide
- Language Specification โ what the compiler actually implements
- Bootstrap Subset (PBS-1) โ the self-hosting target
- User Guide
- Examples
๐งช Examples
Check out the examples/ directory:
examples/tutorial/- Step-by-step tutorialsexamples/practical/- Real-world examples
# Run an example
pdc compile examples/tutorial/01_variables.pd -o vars
./build_output/vars
๐ค Contributing
We welcome contributions! Areas where help is needed:
- Standard library implementation
- Documentation improvements
- Bug fixes
- Test coverage
- LLVM backend improvements
Please see our Contributing Guide for details.
๐ Benchmarks
Performance comparisons coming soon. Goal: within 10% of C performance.
๐ Philosophy
Palladium aims to be:
- Safe: Memory and type safety by default
- Fast: Zero-cost abstractions, optimal performance
- Simple: Clear syntax, minimal complexity
- Practical: Designed for real systems programming
๐ License
Palladium is released under the MIT License โ see LICENSE.
(Earlier revisions of this section advertised a dual MIT/Apache-2.0 licence and linked to
LICENSE-MIT and LICENSE-APACHE. Neither file has ever existed in this repository, and
Cargo.toml declares MIT.)
๐ Acknowledgments
Special thanks to:
- All contributors to the compiler and standard library
- The Rust community for inspiration
- Alan Turing and John von Neumann for their legendary contributions to computing
Project Status: Alpha (v0.1.1) | Self-hosting: not achieved โ see docs/specification/bootstrap-subset.md
"Combining Turing's correctness with von Neumann's performance"