Show HN: Wyzer Programming Language
🌌 The Wyzer Programming Language
"Simplicity is not the absence of power. It is power without pretense." — Atiksh Sharma (Feel free to use this quote wherever you like!)
Wyzer is a compiled, statically typed language centered around resource-oriented programming. It uniquely integrates a Perceus memory model with choreographic programming to ensure safety across distributed systems.
🎯 The Motivation
While languages like Rust provide excellent safety guarantees within a single process, they leave several gaps unaddressed:
Distributed deadlocksProtocol mismatchesCross-service correctness
Wyzer aims to bridge this gap by implementing choreographic programming, a sophisticated approach to ensuring that distributed components interact flawlessly.
🤝 Get Involved
We welcome all contributors! If you are interested in helping develop the language, please review the RESEARCH.md file.
- Community: Join our Discord Server
📚 Documentation & Syntax
To dive deeper, explore the official guides on Introduction, Variables, Control Flow, Structs, and the Memory Model.
🛠️ Coding in Wyzer
Wyzer emphasizes explicitness, readability, and simplicity.
1. Types and Variables
Every element has a defined type. By default, variables are immutable. To allow mutation, you must use the var keyword instead of let.
fn main() {
const MAX: u32 = 100; // A constant defined at compile-time
let x: u32 = 10; // Immutable: cannot be altered
var y: u32 = 20; // Mutable: can be changed
y = y + x;
std::io::println(y);
}
2. Data Structures
Custom data can be organized using struct definitions, with fields accessed via dot notation.
struct Point {
x: u32,
y: u32
}
fn main() {
let p: Point = Point { x: 10, y: 20 };
std::io::println(p.x);
}
3. Logic and Control Flow
Wyzer utilizes standard if/else blocks, as well as while and for loops.
fn main() {
var i: u32 = 0;
while i < 3 {
std::io::println(i);
i = i + 1;
}
}
4. Pattern Matching
The match expression is used to handle Result types (either Ok or Err).
Note: Because match is an expression, it requires a trailing semicolon when used as a standalone statement.
fn main() {
let result: Result<u32, str> = Ok(42);
match (result) {
Ok(value) => std::io::println(value),
Err(err_msg) => std::io::println("Error occurred"),
};
}
❓ FAQ: The "What, Why, and How"
What is Wyzer?
In short: Wyzer posits that the most grueling bugs—network failures, deadlocks, and memory leaks—stem from unclear resource ownership. Wyzer replaces fragmented tools for memory and concurrency with a single, unified ownership rule.
Why does it exist?
We acknowledge the strengths of current languages but seek to improve upon them:
| Language Type | Strength | Weakness |
|---|---|---|
| Rust | Memory safety without GC | Steep learning curve; rigid structures |
| GC Languages | Ease of use | Slower; unpredictable performance |
| Distributed | Scalability | Relying on "hope" that two programs sync |
Wyzer's Goal: Combine Rust's safety with a lower barrier to entry, extending those same rules to network communication.
What is actually new?
- Perceus Reference Counting: High-performance memory management that avoids the complexity of Rust's borrow checker.
- Choreographic Programming: A method where one network rule generates the necessary code for all participating machines.
- Unified Theory: The same logic governs memory, interrupts, and networks.
🏗️ Core Design & Semantics
Design Principles
- Minimalism: If two ways to do one thing exist, one is removed.
- Explicitness: Critical logic is visible; boilerplate is minimized.
- Compiler-Driven: The compiler handles the heavy lifting but follows strict rules.
- Transparency: Unresolved issues are documented openly.
How it Works (Plain Language)
- Memory: You write functional code. If the compiler detects a piece of data has only one owner, it performs an in-place mutation. This achieves C-like speed without a GC.
- Ownership: The golden rule is: Once a resource is used, it is gone. This applies to memory, hardware interrupts, and network packets.
- Networking: You write standard functions; the types define ownership. The compiler then validates the choreography to prevent dropped messages or deadlocks before execution.
- Error Handling: No hidden exceptions; errors are returned as explicit types.
The Unified Ownership Flow
🏁 Final Questions
"Is this just Rust with extra steps?" No. The memory management (Perceus) is fundamentally different, and the native network choreography is a feature Rust lacks.
"Isn't choreographic programming just academic research?" While the mathematical foundation exists in research, Wyzer is bringing those concepts into a practical, usable language.
"Why not use async-await or a Garbage Collector?"
Because we want predictability and safety across distributed boundaries, which GCs and standard async patterns don't inherently guarantee.
📋 Project Status
- Basic Syntax
- Perceus Memory Model
- Full ABI Specification
- Expanded Standard Library
- Community Beta Testing