Janus is the last programming language humans need to learn, loved by silicon and carbon alike for it's clarity and honesty. https://janus-lang.org
  • Zig 97%
  • Shell 1.4%
  • C++ 0.9%
  • Python 0.3%
  • Gherkin 0.1%
Find a file
Markus Maiwald 3bc84870d3
Some checks failed
gRPC Smoke / smoke-musl (push) Failing after 2s
Strategic Release Pipeline / 🧪 Sandbox - Experimental Innovation (push) Has been skipped
Strategic Release Pipeline / 🔥 Forge - Alpha Integration (push) Failing after 29s
Strategic Release Pipeline / 🛡️ Crucible - Beta Quality Assurance (push) Has been skipped
Strategic Release Pipeline / 🛡️ Crucible - Beta Quality Assurance-1 (push) Has been skipped
Strategic Release Pipeline / 🛡️ Crucible - Beta Quality Assurance-2 (push) Has been skipped
Strategic Release Pipeline / 🏰 Fortress - Production Release (push) Has been skipped
Strategic Release Pipeline / 🏰 Fortress - Production Release-1 (push) Has been skipped
Strategic Release Pipeline / 🏰 Fortress - Production Release-2 (push) Has been skipped
Strategic Release Pipeline / 🏰 Fortress - Production Release-3 (push) Has been skipped
Strategic Release Pipeline / 🗿 Bedrock - Enterprise LTS (push) Has been skipped
Strategic Release Pipeline / 🚀 Release Orchestration (push) Has been skipped
Forbidden Paths Guard / guard (push) Has been cancelled
gRPC Smoke / smoke (push) Has been cancelled
Validation / test (push) Has been cancelled
fix(qtjir): builtin Optional match payload-binding .Some(v)/.None (Gap 66)
`match opt { .Some(v) => v, .None => -1 }` over a builtin Optional ?T
parsed but tripped Lowering error: UnsupportedCall — lowerMatchExpr had
no .call_expr pattern case (.Some(v) parses as
call_expr[callee=.variant, arg=identifier]).

Three latent layers (IR-diagnosed via janus build --emit=llvm):
 1. no .call_expr dispatch -> UnsupportedCall
 2. binding via Optional_Unwrap emits self-contained
    opt_some_ok/opt_none_panic + merge-jump that hijacks the match
    Branch/Phi CFG -> every Some compiled to 0 (wrong, not error)
 3. routing through Union_Tag_Check exposed emitUnionTagCheck
    hardcoding the expected-tag const as i32, but Optional's tag is
    i8 -> icmp eq i8,i32 -> verifier InvalidModule

Builtin ?T has the SAME {i8 tag, payload} layout as a 2-variant
tagged union. Route .Some(v) -> Union_Tag_Check(scrutinee,1) +
union_bindings{field 0} (reuses the proven struct-literal union
post-true-label Union_Payload_Extract loop; pure icmp/extractvalue,
composes with the match Phi). .None -> Union_Tag_Check(scrutinee,0).
Both gated on findVariantValueInAnyEnum==null so user enums that
declare Some/None keep tag-equality. emitUnionTagCheck now builds the
expected-tag const at LLVMTypeOf(tag)'s own width — identical for
i32 unions (zero regression, test-match-expr-union-destructure green),
width-correct for i8 Optional.

Scope: expression-form match (let x = match ...). Statement-form
lowerMatch has the same .call_expr hole — clean follow-up. Bare
.Ok(v)/.Err(e) user-union call_expr binding falls through unchanged.

Probe matrix 6/6 (alloca Some/None, expr body, call-result
scrutinee). Full ./scripts/zb test: emit-error gate 0 suite-wide;
failed steps a strict subset of the same-day baseline (zero new);
match_expression_tests failure is pre-existing (parser P0001, A/B
confirmed).
2026-05-16 10:25:08 +02:00
.forgejo/workflows fix(astdb/cid): encoder must skip function-name identifier in body fallback (Gap 8) 2026-04-24 23:42:11 +02:00
.githooks feat(release): v2026.1.5 2026-01-06 15:44:08 +01:00
agent/janus-mcp feat(agent): add Janus Language MCP server 2026-05-10 18:22:48 +02:00
attic fix(workspace): Zig 0.17 migration — ** repeat operator → @splat 2026-05-01 17:32:40 +02:00
bench fix(compiler): complete Zig 0.16 API migration — all 4 binaries build, 1713/1714 tests pass 2026-03-20 16:30:32 +01:00
branding 🜏 docs(branding): Add Janus symbol documentation 2026-02-02 21:41:52 +01:00
build_support fix: Zig 0.16 compatibility - replace Io.Mutex/Condition with Thread.Mutex and busy-wait 2026-02-22 15:50:34 +01:00
cmd feat(stdlib): complete Janus syntax migration across std, tools, and examples 2026-04-10 15:58:00 +02:00
compiler fix(qtjir): builtin Optional match payload-binding .Some(v)/.None (Gap 66) 2026-05-16 10:25:08 +02:00
daemon chore(zig-0.17): transitional shims for removed dupeZ / bufPrintZ / allocPrintZ 2026-05-13 15:40:09 +02:00
demos/semantic-analysis fix(compiler): complete Zig 0.16 API migration — all 4 binaries build, 1713/1714 tests pass 2026-03-20 16:30:32 +01:00
docs chore(version): make build version bump explicit 2026-05-14 21:13:49 +02:00
doctrines style(docs): canonicalize do..end delimiters per SPEC-017 2026-02-22 22:49:32 +01:00
examples feat(cluster): enable bare receive arm sugar 2026-05-15 15:32:58 +02:00
features/transport feat(mimic_https): Add MIMIC_HTTPS transport skin with BDD tests 2026-02-15 23:11:00 +01:00
grafts/zig_proto/src fix(tests): restore full green build (238/238, 1107/1107) 2026-02-24 19:02:44 +01:00
l2_session chore: remove ArrayList migration .backup files 2026-02-22 09:19:28 +01:00
legal feat(release): v2026.1.5 2026-01-06 15:44:08 +01:00
lsp refactor(profiles): kill :bare profile, collapse into :sovereign 2026-04-07 17:31:25 +02:00
packaging feat(release): janus release command + packaging recipes 2026-03-31 16:37:53 +02:00
protocol feat(release): v2026.1.5 2026-01-06 15:44:08 +01:00
runtime fix(runtime): restore guard coverage 2026-05-16 02:01:39 +02:00
scripts chore(version): make build version bump explicit 2026-05-14 21:13:49 +02:00
src feat(cluster): close local actor production slice 2026-05-16 01:56:26 +02:00
std fix(runtime): restore guard coverage 2026-05-16 02:01:39 +02:00
tests fix(qtjir): builtin Optional match payload-binding .Some(v)/.None (Gap 66) 2026-05-16 10:25:08 +02:00
tools fix(test): skip local worktrees in ast scan 2026-05-15 16:08:17 +02:00
.gitattributes feat(release): v2026.1.5 2026-01-06 15:44:08 +01:00
.gitignore chore(repo): untrack root binaries + tighten ignore patterns 2026-05-09 14:49:03 +02:00
.gitmodules feat(hash): unified std.hash module with pure-Zig BLAKE3 2026-03-07 02:26:36 +01:00
.grafignore chore(repo): untrack root binaries + tighten ignore patterns 2026-05-09 14:49:03 +02:00
build.zig fix(qtjir): builtin Optional match payload-binding .Some(v)/.None (Gap 66) 2026-05-16 10:25:08 +02:00
build.zig.zon feat(release): v2026.1.5 2026-01-06 15:44:08 +01:00
CHANGELOG.md chore(release): bump to 2026.3.18 -- comptime primitives (SPEC-043) 2026-03-18 00:27:05 +01:00
CODE_OF_CONDUCT.md feat(release): v2026.1.5 2026-01-06 15:44:08 +01:00
CONTRIBUTING.md chore(probe): introduce probe discipline wrapper and convention 2026-05-07 12:12:34 +02:00
hello docs(std.alloc): MVS lane 5 audit — arena 9/10, byte_buffer 6/10, pool deferred 2026-05-10 18:22:49 +02:00
LICENSE.md docs: Add LICENSE.md 2026-02-02 21:36:13 +01:00
Makefile feat(release): v2026.1.5 2026-01-06 15:44:08 +01:00
NOTICE feat(release): v2026.1.5 2026-01-06 15:44:08 +01:00
QUICKSTART.md feat(match): else wildcard + .Variant patterns + parser/lowering fixes 2026-03-31 04:03:51 +02:00
README.md feat(compiler): fix SemanticType union initialization and default_payload namespace 2026-04-02 12:57:13 +02:00
SECURITY.md feat(core): complete :core + :service profiles, stdlib bridges, Hinge specs 2026-03-07 22:01:35 +01:00
VERSION chore(version): bump build version 2026-05-14 21:13:45 +02:00
WHAT_WORKS.md feat(match): else wildcard + .Variant patterns + parser/lowering fixes 2026-03-31 04:03:51 +02:00

JANUS

A systems programming language that combines teaching simplicity with production power.

Status: Alpha -- in heavy development. Breaking changes expected.

Version: 2026.3.31

License: Libertaria Suite (LCL-1.0 / LSL-1.0 / LUL-1.0)

Repository: https://git.sovereign-society.org/janus/janus-lang

New here? Quickstart | What Works | Stdlib Guide


What Is Janus?

Janus is a systems language that compiles natively through Zig and LLVM. It uses a profile system for progressive disclosure -- you start with simple fundamentals (:core) and unlock concurrency, distributed systems, and hardware control as you advance.

The key idea: code you write on day one compiles to a native binary. No interpreter, no VM, no rewrites later.

func main() do
    println("Hello, Janus!")
end

Why Janus Over Go?

Go popularized goroutines and channels. Janus takes the same model and fixes what Go got wrong:

Concern Go Janus
Goroutine leaks Common, silent, hard to debug Impossible -- nurseries enforce structured concurrency
Error handling if err != nil boilerplate everywhere !T error unions, fail, catch, ? propagation
Memory GC pauses, unpredictable latency Explicit allocators, zero GC, deterministic cleanup
Hidden costs Runtime scheduler, GC, reflection -- all invisible All costs visible -- Syntactic Honesty doctrine
Generics Arrived late, limited First-class monomorphization from day one
Pattern matching None Exhaustive match with compile-time coverage checks
Zig stdlib N/A Full access via use zig -- zero FFI overhead
FFI cgo is slow and awkward graft c / graft zig -- native integration

Profile System

Profile Status Scope
:core Functionally complete Types, control flow, structs, enums, generics, error handling, match, defer
:service Functionally complete Channels, select, nursery, spawn, structured concurrency, row polymorphism
:sovereign WIP Capabilities, pledges, distributed identity, hardware declarations
:compute Planned GPU/NPU kernels, tensor IR, data-parallel computation

:core and :service pass their test suites and cover the language features listed above. They are not yet battle-tested in production deployments. Expect rough edges.


Language Features

Core Language

  • Functions, closures, multi-function programs
  • let / var / const with type inference
  • Control flow: if/else, while, for..in
  • match with exhaustiveness checking, else fallback, .Variant patterns
  • Error handling: !T error unions, fail, catch, ? postfix propagation
  • Structs with ..defaults initialization, enums, arrays, slices, optionals
  • Generics with monomorphization (func identity[T](x: T) -> T)
  • defer for deterministic cleanup
  • graft c / graft zig for foreign function integration

Structured Concurrency (:service)

  • Nurseries -- structured concurrency boundaries
  • Spawn -- launch tasks within nursery scope
  • Channels -- CSP-style buffered/unbuffered message passing
  • Select -- multi-channel wait with timeout and default cases

Code Examples

// Error handling
error DivisionError { DivisionByZero }

func divide(a: i64, b: i64) !i64 do
    if b == 0 do
        fail DivisionByZero
    end
    return a / b
end

func main() do
    let result = divide(10, 0) catch |err| do
        println("Caught: division by zero")
        0
    end
    println(result)
end
// Structured concurrency
func main() do
    nursery do
        spawn worker(1)
        spawn worker(2)
        spawn worker(3)
    end
    println("All workers done")
end

func worker(id: i64) do
    println("Worker running")
end

Quick Start

Requirements: Zig 0.16.x, Linux x86_64

git clone https://git.sovereign-society.org/janus/janus-lang.git
cd janus-lang
zig build

./zig-out/bin/janus build examples/hello.jan
./hello

Important: Use ./scripts/zb instead of raw zig build test for the full test suite -- it throttles parallelism to prevent OOM on LLVM-linked tests. If direct Zig commands fail with cache errors on this machine, use ./scripts/zigw ... for Zig commands and ./scripts/janusw ... for the compiler to force known-good cache directories. Targeted regression commands for the current :compute migration: ./scripts/zb test-profile-manager and ./scripts/zb test-tensor-compile.


Compilation Pipeline

Source (.jan) -> Parser -> ASTDB -> Semantic Analysis -> QTJIR (SSA IR) -> LLVM -> Native Binary
  • ASTDB -- Columnar semantic database; query code structure programmatically
  • QTJIR -- SSA intermediate representation with sovereign string ownership
  • Profile enforcement -- Compile-time gating of features by profile level

Toolchain

  • janus build <file.jan> -- compile to native binary
  • janus build --profile=service <file.jan> -- compile with :service features
  • janus doc <file.jan> -- generate documentation
  • janus query "<predicate>" <file.jan> -- semantic queries against ASTDB
  • janus init [name] -- scaffold new project with janus.kdl manifest
  • janus pkg <cmd> -- package management via Hinge

Known Limitations

  • Alpha compiler -- bugs and missing diagnostics are expected. File issues.
  • Linux x86_64 only -- primary development target. Other platforms are untested.
  • No stable ABI -- internal representations change between versions.
  • Early package ecosystem -- Hinge works but the public registry is not live yet.
  • IDE support is basic -- LSP exists but is minimal.
  • :service concurrency -- functional but not stress-tested at scale.

The Four Doctrines

  1. Syntactic Honesty -- all costs visible, no hidden complexity
  2. Mechanism over Policy -- tools, not restrictions
  3. Explicit Choice -- all allocations, effects, and trade-offs visible
  4. Revealed Complexity -- no magic, predictable behavior

Documentation


Issues: https://git.sovereign-society.org/janus/janus-lang/issues Website: https://janus-lang.org License: Libertaria Suite