Skip to content

Janus

The Paradox Engine – fusing low-level control with high-level ergonomics for sovereign computing.

Janus is Libertaria’s application-tier programming language. It has achieved Go-lang parity and is the standard for all new application code in the ecosystem.

  • Sovereign by design – capabilities gate every effect (IO, network, allocation)
  • Zero ambient authority – nothing is implicit, everything is auditable
  • Profile system – same language, different power levels for different contexts
  • Bridge pattern – seamlessly orchestrates Zig, C, and system-level code
ProfileAnalogyUse CaseStatus
:coreThe MonasteryTypes, control flow, structs, enums, traits, generics, closuresComplete
:serviceThe BazaarChannels, select, nursery, spawn, row polymorphismFunctionally Complete
:sovereignThe CitadelCapabilities, pledges, distributed identityIn Development

The Libertaria Transport Protocol (LTP) is the largest Janus :service application – 19 demos proving real networked systems:

CapabilityDemoWhat It Proves
Structured ConcurrencyNursery/spawn/channelsReal OS threads with CSP messaging
Multi-Bridge Loading5 Zig bridges simultaneously95+ C-exported functions loaded
Encrypted TransportNoise XX + XChaCha20-Poly1305Session-encrypted L0 frames
Encrypted Relay2-hop DMP relayHop-by-hop encryption across TCP links
Pub/Sub MessagingDMP broker over TCPMQTT-style wildcards, retained values
Will-MessagesClean vs unclean disconnectLast Will and Testament pattern
Mesh Networking5-node ring topologyShortest-path routing + connection promotion
DID-Bound CryptoSBI identity + Noise XXIdentity-authenticated handshake with DID verification
CBOR EnvelopesSigned structured messagesRFC 8949 encoding with Ed25519 signatures
Dynamic PortsPort 0 + getsocknameZero port conflicts between concurrent runs

Janus orchestrates Zig through C-exported handle-based APIs:

use lib.tcp
use lib.l0
use lib.sbi
// Create sovereign identity
let alice = sbi_create(seed)?
// Noise XX handshake with DID-bound keys
let hs = l0_noise_handshake_init(0, alice.sbi_x25519_sk_ptr(), alice.sbi_x25519_pk_ptr())
// ... 3-message exchange ...
let channel = l0_noise_finish(hs)
// Verify peer DID post-handshake
let ok = l0_noise_verify_peer_did(channel, peer_ed25519_ptr, expected_did_ptr)
// Send encrypted frame
let frame = l0_new(16, SERVICE_TYPE_DMP)?
frame.l0_set_payload("sovereign data!", 15)
frame.l0_noise_encrypt(channel)
conn.tcp_write_framed(frame.l0_get_encode_ptr(), frame.l0_encode())

All values are i64 at the FFI boundary. Handle pools are fixed-size with spinlock mutexes. No garbage collection. No hidden allocations.

Janus :service provides structured concurrency:

nursery do
spawn server_task(ready_ch)
spawn client_task(ready_ch)
end
// All tasks complete before nursery exits
  • Nursery – structured concurrency boundary (all spawned tasks must complete)
  • Spawn – real OS threads (not green threads)
  • Channels – CSP-style buffered message passing
  • Blocking I/O – safe with real threads (no cooperative scheduling needed)

Janus is one tool – compiler, runner, tester, and package manager:

CommandPurpose
janus build src/app.jan binaryCompile to native binary
janus testRun test suite
janus --profile=service build ...Compile with :service features

Libraries in Janus are Capsules – atomic units containing source, tests, and capability manifests:

lib/sbi.jan (Sovereign Index – public API)
lib/sbi/types.jan (Type definitions)
lib/sbi/identity.jan (Identity operations)
lib/sbi/cbor.jan (CBOR encode/decode)
lib/sbi/janus.kdl (Capsule manifest)

Every capsule follows the Panopticum Architecture – one feature, one folder, one index. An AI agent with limited context can enter a single folder and understand the entire feature.

ToolRoleStatus
HingePackage manager (capsule registry)In Development
GrafVersion control (sovereign VCS)Active
Nexus OSOperating system (L1 kernel in Nim)In Development