Janus: The Language for Sovereign Systems

Why we built a new programming language – and why Zig makes it possible.

janusziglanguagecompilertechnical

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?

LanguageProblem for Sovereignty
PythonSlow, GC, massive runtime
JavaScriptV8 dependency, npm hell
GoGC, bloated binaries, Google control
RustComplex, 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 allocations
const 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, readable
func 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:

-- Variables
let x = 42
mut y = "hello"
-- Functions
func add(a: i32, b: i32) -> i32
return a + b
-- Types
struct Point
x: f64
y: f64
-- Memory
let arr = [1, 2, 3] -- Stack allocated
let 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 != 0

Sovereignty Benefits

  1. No Runtime Dependencies

    • Single static binary
    • No Docker required
    • No package manager hell
  2. Deterministic Performance

    • No GC pauses
    • No JIT warmup
    • Predictable latency
  3. Auditability

    • Small binaries (0026lt;1MB)
    • Readable assembly
    • Reproducible builds

Example: LWF Parser

-- Parse Libertaria Wire Format
func 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

Terminal window
# Install Janus compiler
git clone https://github.com/janus-lang/janus
cd janus && zig build
# Compile your first program
janus compile hello.jan -o hello
./hello

Join Development

We’re building the last programming language you need to learn.


Code is speech. Exit is voice.

#janus #zig #language #compiler #technical