二面刃 — THE TWO-EDGED LANGUAGE

Two Faces.
One Truth.

Want the power of C without shooting yourself in the foot? Considering Zig but want cleaner syntax? Start with Janus. Janus compiles through Zig – you get Zig’s entire stdlib, LLVM backend, and bare-metal performance with syntax that reads like intent, not like noise. Humans read it. AI agents write it. The compiler proves it. One language. Two faces. Zero compromise.

60K+ Lines of Code
1,714 Tests Passing
25 Hinge Modules
116 Example Programs
See the Code View Source → Hinge Ships ✓
Release Timeline
March 21
v2026.3.23

janus fmt — Lockfile Build — :service Green

janus fmt ships — canonical formatter with 34 idempotency-verified tests. --check mode with line-by-line diff output for CI. Dogfooded on 1,056-line production file. janus build reads janus.lock — compiles dependencies from local registry, links into binary. :service profile fully green — nested using verified at 3 levels. Hinge integration: deduplicated modules, proper KDL serialization, transitive lockfile. println compiler fix. SPEC-FMT specification committed.

March 18
v2026.3.18

Comptime Primitives — $Meta-Sigil Builtins

First-class compile-time evaluation. comptime do...end blocks, $size_of/$type_info meta-sigil builtins. Checked arithmetic. 14 builtins. 1,700+ tests.

March 17
v2026.3.15

Parser Expansion — Struct Methods — Type Fixes

+1,500 line parser overhaul. ++ concatenation operator. @ builtin prefix. Struct methods, const decls, default field values. Anonymous enums with backing types. fn alias for func. Monomorph cache memory leak eliminated. i32→i64 type widening for string and array ops. Hinge registry HTTP scaffold.

March 16
v2026.3.14

Native ZSTD — TLS — GTP Transport

Pure Janus ZSTD codec (RFC 8878, zero dependencies). Native TLS backend via std.net.tls. HTTPS wired into HTTP client. std.gtp and std.hinge stdlib modules. Graf integration for Hinge — publish, lockfile migration, graf.lock.json. Supertrait syntax and oracle. 236-test HTTP stack.

March 12
v2026.3.12

Go-lang Feature Parity — :service Profile

:service profile pipeline complete. std.crypto with L1 SoulKey identity. SBI module (std.sbi). Base32 and KDL encoders. Socket primitives. Sovereign Binary Interface bridge. Capsule structure for crypto, hash, and time.

March 9
v2026.3.10

Self-Documenting ASTDB — Hinge Package Manager

Documentation as structured data in the ASTDB. janus doc generates Markdown from /// comments. janus query --doc filters by predicate. Hinge sovereign supply chain (25 modules, 18K LOC). Generic monomorphization, supertrait propagation, std.core.conv.

Three Laws. Zero Exceptions.

Every design decision in Janus flows from three immutable principles.

Syntactic Honesty

The source code, the intermediate representation, and the final binary all tell the same story. No hidden transformations. No magic. You read the code; you know what it does.

"An honest abstraction is a weapon. A magical one is a trap."

Mechanism > Policy

The compiler provides levers; not opinions. Janus gives you the simplest correct mechanism and lets you decide the policy. No defaults that secretly optimize against your intent.

"The compiler decides nothing for you; it only exposes the levers you must learn to pull."

Revealed Complexity

If something is expensive, the syntax makes it visible. Dynamic dispatch costs cycles? You see &dyn Trait. Allocation happens? You see the allocator. The cost is always in the code.

"Reveal the cost. Every allocation is a blade drawn."

Code That Reads Like Intent

Beautiful syntax. Honest semantics. No exceptions; no sugar in :core.

hello.jan :core
// The simplest honest program.
func main() do
  println("Hello, Sovereign World.")
end
oneliners.jan expressive
// Verbose? Never. Janus is as terse as you want it to be.

func clamp(x: i64, lo: i64, hi: i64) -> i64 = match x { _ if x < lo => lo, _ if x > hi => hi, _ => x }

func is_prime(n: i64) -> bool = n > 1 and for 2..isqrt(n)+1 do |i| n % i != 0 end

func fizzbuzz(n: i64) -> string = match (n%3, n%5) { (0,0) => "FizzBuzz", (0,_) => "Fizz", (_,0) => "Buzz", _ => itoa(n) }

// Same language. Same compiler. Your call.
traits.jan traits + dispatch
trait Drawable {
  func draw(self) -> i32
}

struct Circle { radius: i32 }

impl Drawable for Circle {
  func draw(self) -> i32 do
    return self.radius * 2
  end
}

// Dynamic dispatch. Cost is visible.
func render(d: &dyn Drawable) -> i32 do
  return d.draw()
end
errors.jan error handling
func parse_port(s: string) -> i32 ! ParseError do
  let n = to_int(s) catch |e| do
    fail ParseError.InvalidNumber
  end
  if n < 0 or n > 65535 do
    fail ParseError.OutOfRange
  end
  return n
end
concurrency.jan structured concurrency
func fetch_all(urls: []string) do
  nursery |n| do
    for url in urls do
      n.spawn(async fetch(url))
    end
  end // All tasks complete or cancel here.
end
identity.jan zig fusion
const Ed25519 = std.crypto.sign.Ed25519;

pub const SoulKey = struct {
    seed:   [32]u8,
    public: [32]u8,

    pub fn sign(self: *const SoulKey, msg: []const u8) [64]u8 do
        const kp = Ed25519.KeyPair
            .generateDeterministic(self.seed) catch return .{0} ** 64;
        return kp.sign(msg, null).toBytes();
    end
}; // Zig types. Janus syntax. One binary.
janus.kdl hinge
// Sovereign package manifest.
project {
  name "myservice"
  version "1.0.0"
  profile "service"
}

dependencies {
  crypto "^2.1.0" // Verified supply chain
}

// Ed25519 signed. BLAKE3 content-addressed.
// Publish: janus pkg publish --key id.key

The Compilation Pipeline

Janus compiles through Zig to LLVM to native. Not a transpiler – one fused compilation unit. Every stage is inspectable.

.jan Source
Your code
Tokenizer
1,301 LOC
Parser
4,538 LOC
ASTDB
Queryable DB
QTJIR
SSA IR ~8K LOC
LLVM
3,900 LOC
Native Binary
Your machine

One Language. Six Profiles.

Start simple. Scale to sovereign. No rewrite required.

:core Teaching and fundamentals. Pure algorithms, clean syntax. No footguns. feels like Python
:script REPL and rapid prototyping. Dynamic feel, static guarantees. feels like Lua
:service Network services and applications. Async, channels, structured concurrency. feels like Go
:cluster Distributed systems. Actors, mailboxes, fault-tolerant messaging. feels like Erlang
:compute GPU, NPU, tensor operations. Scientific computing at the metal. feels like Julia
:sovereign Full Zig substrate. Explicit allocators, capabilities, raw pointers. Your Janus code and Zig’s stdlib are one compilation unit. is Zig – with a human face

Not Promises. Proofs.

Everything listed here compiles, runs, and is tested. Today.

Full Trait System

Traits, impl blocks, static + dynamic dispatch with vtables. Fat pointers for &dyn Trait. Default methods. Complete polymorphism system.

Structured Concurrency

Nurseries, spawn, await, select, channels. M:N fiber scheduler with 5,249 lines of battle-tested runtime. CSP done right.

🔍

Queryable AST Database

Code stored as a semantic database with content-addressed identity. AI and tooling can query structure, not parse text. UUID-stable refactoring.

🛡

Error Unions

T ! E error types, fail, catch, try. Errors are values, not exceptions. The type system tracks what can fail.

🌀

Closures

Zero-capture, captured, mutable capture. Three clean closure types with explicit capture semantics. No hidden allocations.

🔗

One Language, Two Faces

Janus compiles through Zig – not to it, not beside it. use zig and you write Janus syntax with Zig’s type system, crypto, I/O, and allocators. No FFI. No bindings. Same binary. Ed25519 in do..end blocks.

Comptime Primitives

comptime do...end blocks, $size_of/$type_info meta-sigil builtins, inline for/inline switch. Checked arithmetic, resource-limited evaluation. Profile-gated — :core gets basics, :service gets introspection.

Pattern Matching

match on integers, enums, tagged unions. Exhaustiveness checking. The right arm fires; the rest don't exist.

📦

Generics + Multi-Dispatch

Monomorphized generics. Scoped Impl Resolution — no orphan rules. Julia-style multi-dispatch on ALL arg types. 13K LOC dispatch engine.

SBI Wire Format

Sovereign Binary Interface — zero-encoding where wire = memory. Decode is a pointer cast, not deserialization. BLAKE3 Merkle proofs for field-level verification. Comptime schema fingerprinting. No protoc, no IDL, no codegen.

🔒

Hinge Package Manager

Sovereign supply chain. Ed25519 + Dilithium3 hybrid signatures, BLAKE3 content addressing, Chapter federation, witness consensus, trust graphs, DMP gossip, transparency ledger. 25 modules, 18K LOC.

📜

Self-Documenting ASTDB

Documentation is data, not decoration. /// comments are parsed into structured columnar arrays — queryable by predicate. janus doc generates Markdown. janus query --doc finds undocumented, deprecated, or incomplete declarations. Docs survive renames via CID identity.

janus fmt

Canonical formatter. One style. No arguments. janus fmt file.jan formats in-place; --check mode exits non-zero with a line-by-line diff for CI. 34 idempotency-verified tests. Dogfooded on 1,000+ line production code. A language without fmt tolerates arguments about whitespace. Janus doesn’t.

"A language is not a tool. It is a discipline."
— Janus Zen, Doctrine I

No Fantasy. Just Facts.

Green where we deliver. Red where we don't. Yet.

Feature Janus Go Rust Zig
Trait System Traits + impl, static + dynamic dispatch Interfaces Traits + impls Duck typing
Generics Monomorphized — identity[T] compiles natively Since Go 1.18 Full generics + traits Comptime generics
Multi-Dispatch Julia-style — resolves on ALL arg types Single dispatch only Single dispatch (self only) No dispatch system
Scoped Impl Resolution No orphan rules — 5-stage SIR pipeline No trait system Orphan rule restricts impls No trait system
Structured Concurrency Nurseries — no orphan tasks Goroutines leak freely tokio::spawn is unstructured Has async frames
Error Handling Error unions T ! E if err != nil boilerplate Result<T,E> + ? operator Error unions + try
Syntax Clarity do/end blocks, clean grammar Simple but verbose Lifetime annotations, turbofish Comptime complexity
Native Compilation LLVM via Zig toolchain Go compiler LLVM LLVM + self-hosted
Zig Stdlib Access native — one compilation unit, not FFI CGo overhead Separate FFI Native
Enum/Union Types Tagged unions + match No sum types enum + match Tagged unions
Compile-Time Evaluation comptime blocks, $builtins, inline for/switch No comptime const fn (limited) Full comptime
Sovereign Packages Hinge — signed, federated, post-quantum go mod (centralized) crates.io (centralized) No package manager
Binary Wire Format SBI — zero-encoding, BLAKE3 Merkle proofs protobuf (varint encode/decode) serde (ecosystem, not built-in) No standard wire format

Janus v2026.3.23 — :core + :service profiles complete. janus fmt canonical formatter. janus build reads lockfile and compiles dependencies. Hinge sovereign package manager with full local lifecycle. One Language, Two Faces: Janus syntax fused with Zig’s type system and stdlib in a single compilation unit. No FFI. No bindings. Multi-dispatch, scoped impl resolution, trait-bounded generics, sovereign federated packages, and queryable documentation are unique to Janus.

SBI vs. The Serialization Zoo

Fixed-size structs, same architecture. Zero encoding. Zero parsing. Zero copies.

Dimension SBI SSZ Protobuf FlatBuffers Cap'n Proto
Encode Cost Zero (memcpy identity) LE pack + offsets Varint encode per field Vtable + buffer build XOR + offset calc
Decode Cost Pointer cast (O(1)) Offset walk Full varint decode Vtable lookup Deref + XOR
Wire = Memory Exact identity Packed, no alignment Varint encoding Structs only (LE) Nearly (XOR defaults)
Merkle Proofs BLAKE3, field-level SHA-256, generalized None None Flat hash only
External Tooling None — compiler is schema None (implicit) protoc + plugins flatc + plugins capnpc + plugins
Schema Evolution None (by design) None formal Field numbers Tables only Append-only
Variable-Length Data Planned (:service) Offset tables LEN wire type Vectors, strings Lists, text
Language Support Janus + Zig ~8 (Ethereum) 30+ languages 14+ languages ~16 languages

SBI is not a general-purpose serialization framework. It is the fastest possible wire format for a constrained domain: same-architecture peers, fixed-size structs, cryptographic type identity. Schema evolution and variable-length data trade correctness for flexibility — SBI chooses correctness. Full SBI documentation →

Clone. Build. Run.

You know the drill. Requires Zig 0.16.x.

terminal
# Clone and build (requires Zig 0.16.x)
git clone https://git.sovereign-society.org/janus/janus-lang.git
cd janus-lang && zig build

# Scaffold a new project
./zig-out/bin/janus init myproject
cd myproject

# Build and run
../zig-out/bin/janus build src/main.jan main && ./main
# "Hello from Janus!"

# 1,700+ tests passing
zig build test

Honest Status. No Hype.

Green means working code with passing tests. Yellow means specified. Blue means dreamed.

Compiler Pipeline

Tokenizer + Parser
ASTDB (regions, CID, schema)
Semantic Analysis
QTJIR (SSA IR)
LLVM Codegen
Dispatch Engine (13K LOC)

Language Features

Traits + Impl (static + dynamic)
Closures (3 capture types)
Enums + Tagged Unions
Structured Concurrency
Error Unions + Optionals
Generics (monomorphized)
Comptime Primitives

Ecosystem

25K LOC Standard Library
Hinge (25 modules, 18K LOC)
DMP Gossip Broker
janus init (scaffolding)
LSP Server (early)
janus doc + query --doc
janus fmt

Profiles

:core (100% complete)
:service (100% complete)
:script (specified)
:cluster
:compute
:sovereign