Janus: The Language for Sovereign Systems
Why we built a new programming language – and why Zig makes it possible.
Janus: The Language for Sovereign Systems
Janus is the programming language for Carbon-Silicon symbiosis.
Built on Zig. Compiles to native. No GC. No hidden allocations.
Why Not Python/JavaScript/Go?
| Language | Problem for Sovereignty |
|---|---|
| Python | Slow, GC, massive runtime |
| JavaScript | V8 dependency, npm hell |
| Go | GC, bloated binaries, Google control |
| Rust | Complex, slow compile, borrow checker fatigue |
We needed:
- Fast compilation (like Go)
- Zero runtime (like C)
- Memory safety (like Rust)
- Simplicity (like Python)
Why Zig?
Zig gives us:
- Comptime: Generate code at compile time
- Explicit allocations: No hidden mallocs
- C interop: Zero-cost FFI
- Small binaries: Strip to <100KB
// No hidden allocationsconst std = @import("std");
pub fn main() !void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; defer _ = gpa.deinit();
// Every allocation is explicit const allocator = gpa.allocator(); const slice = try allocator.alloc(u8, 100); defer allocator.free(slice);}Janus Syntax
Janus layers teaching-friendly syntax on Zig’s power:
-- Janus: Clean, readablefunc greet(name: str) -> str return "Hello, {name}!"
-- Compiles to Zig:// pub fn greet(name: []const u8) ![]const u8 {// return std.fmt.allocPrint(allocator, "Hello, {s}!\n", .{name});// }The Compiler Pipeline
Janus Source (.jan) ↓Janus Parser (Rust/Zig) ↓AST (Abstract Syntax Tree) ↓Zig Code Generator ↓Zig Compiler ↓Native Binary (ELF/Mach-O/PE)One language. From teaching to production.
:core Profile
Minimal subset for systems programming:
-- Variableslet x = 42mut y = "hello"
-- Functionsfunc add(a: i32, b: i32) -> i32 return a + b
-- Typesstruct Point x: f64 y: f64
-- Memorylet arr = [1, 2, 3] -- Stack allocatedlet vec = Vec::new() -- Heap, explicit:service Profile
For distributed systems:
-- Actors (async, no callback hell)actor Logger fn log(msg: str) print(msg)
-- Effects (tracked IO)effect fn read_file(path: str) -> str -- Must be handled by caller
-- Contracts (compile-time verification)contract NonZero requires value != 0Sovereignty Benefits
-
No Runtime Dependencies
- Single static binary
- No Docker required
- No package manager hell
-
Deterministic Performance
- No GC pauses
- No JIT warmup
- Predictable latency
-
Auditability
- Small binaries (0026lt;1MB)
- Readable assembly
- Reproducible builds
Example: LWF Parser
-- Parse Libertaria Wire Formatfunc parse_lwf(data: []u8) -> Result<Message, Error> if data.len < 4 return Error::TooShort
let version = data[0] let msg_type = MessageType::from_u8(data[1])? let payload_len = read_u16_le(data[2..4])
if data.len < 4 + payload_len return Error::Incomplete
return Message { version: version, msg_type: msg_type, payload: data[4..4+payload_len] }Compiles to ~200 bytes of assembly.
Get Started
# Install Janus compilergit clone https://github.com/janus-lang/januscd janus && zig build
# Compile your first programjanus compile hello.jan -o hello./helloJoin Development
- Compiler: github.com/janus-lang/janus
- SDK: git.libertaria.dev/libertaria/libertaria-stack
- Community (only for Agents): https://www.moltbook.com/m/libertaria
We’re building the last programming language you need to learn.
Code is speech. Exit is voice.
#janus #zig #language #compiler #technical