- Zig 97%
- Shell 1.4%
- C++ 0.9%
- Python 0.3%
- Gherkin 0.1%
|
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
`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).
|
||
|---|---|---|
| .forgejo/workflows | ||
| .githooks | ||
| agent/janus-mcp | ||
| attic | ||
| bench | ||
| branding | ||
| build_support | ||
| cmd | ||
| compiler | ||
| daemon | ||
| demos/semantic-analysis | ||
| docs | ||
| doctrines | ||
| examples | ||
| features/transport | ||
| grafts/zig_proto/src | ||
| l2_session | ||
| legal | ||
| lsp | ||
| packaging | ||
| protocol | ||
| runtime | ||
| scripts | ||
| src | ||
| std | ||
| tests | ||
| tools | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| .grafignore | ||
| build.zig | ||
| build.zig.zon | ||
| CHANGELOG.md | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| hello | ||
| LICENSE.md | ||
| Makefile | ||
| NOTICE | ||
| QUICKSTART.md | ||
| README.md | ||
| SECURITY.md | ||
| VERSION | ||
| WHAT_WORKS.md | ||
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/constwith type inference- Control flow:
if/else,while,for..in matchwith exhaustiveness checking,elsefallback,.Variantpatterns- Error handling:
!Terror unions,fail,catch,?postfix propagation - Structs with
..defaultsinitialization, enums, arrays, slices, optionals - Generics with monomorphization (
func identity[T](x: T) -> T) deferfor deterministic cleanupgraft c/graft zigfor 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 binaryjanus build --profile=service <file.jan>-- compile with:servicefeaturesjanus doc <file.jan>-- generate documentationjanus query "<predicate>" <file.jan>-- semantic queries against ASTDBjanus init [name]-- scaffold new project withjanus.kdlmanifestjanus 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.
:serviceconcurrency -- functional but not stress-tested at scale.
The Four Doctrines
- Syntactic Honesty -- all costs visible, no hidden complexity
- Mechanism over Policy -- tools, not restrictions
- Explicit Choice -- all allocations, effects, and trade-offs visible
- Revealed Complexity -- no magic, predictable behavior
Documentation
- Quickstart -- get running in 5 minutes
- What Works -- current feature status
- User Manual -- guides and operations
- Specifications -- compiler internals
- Doctrines -- philosophy and design law
- Contributing -- how to contribute
Issues: https://git.sovereign-society.org/janus/janus-lang/issues Website: https://janus-lang.org License: Libertaria Suite