Janus Async Superior
A systems programming language that eliminates function coloring, provides preemptive scheduling, and guarantees structured concurrency — all with zero-cost abstractions.
// Janus: Async without the color
func main() with ctx where ctx.has(.io) do
// Structured concurrency - no orphans
using nursery := Nursery.new() do
nursery.spawn(fetch_user(id: 42))
nursery.spawn(fetch_orders(user_id: 42))
end // Both tasks complete before continuing
// Pipeline operator for clean data flow
users
|> filter(active: true)
|> map(u => u.name)
|> join(", ")
|> print()
end
Why Janus Wins
Direct comparison with Zig 0.16 and Rust (tokio). No marketing fluff — just facts.
Function Coloring
Janus eliminates the async/await color problem entirely. No more "red functions" vs "blue functions."
| Property | Janus (CBC-MN) | Zig 0.16 | Rust (tokio) |
|---|---|---|---|
| Coloring | None — async is profile-gated | "1.5 colors" — Io param | Hard-colored |
Where Janus Is Genuinely Superior
Budget-based Scheduling
Neither Zig nor Rust have this. Your scheduler yields based on operation counts, not time — deterministic + reproducible.
Capability-gated Spawning
Language-level DoS immunity. No other systems language has this.
Language Features
Built for systems programming with modern ergonomics and bulletproof correctness.
Zero-Cost Async
No runtime overhead. No function coloring. Async is just another profile, not a different world.
Capability Security
Explicit capabilities for I/O, spawning, and resource budgets. No ambient authority.
Structured Concurrency
Nurseries ensure no orphaned tasks. Parent always waits for children. No leaks.
Budget Scheduling
Deterministic preemption based on operation budgets, not time slices. Reproducible execution.
Profile System
Three profiles: :core for embedded, :service for backends, :sovereign for distributed systems.
Memory Safety
Ownership and affinity system without the borrow checker fights. Linear types where you need them.
Try Janus
Interactive playground. Explore the syntax and see how Janus code looks in action.
// Janus Hello World in :core profile
profile :core
func main() do
print("Hello, World!")
end
Profile System
Janus adapts to your needs. Three profiles, one language. Scale from microcontrollers to distributed systems.
Core Profile
Minimal runtime, maximum control. For embedded systems, kernels, and bare-metal programming.
Features
- No allocator required
- No async runtime
- Direct memory control
- Interrupt handlers
- Static linking only
Use Cases
profile :core
// No heap allocator - stack only
func main() do
let buffer: [u8; 1024] = undefined
let reader = UartReader.new(&buffer)
loop {
let byte = reader.read()
match byte {
Some(b) => handle_byte(b),
None => break
}
}
end
Structured Concurrency
See how Janus guarantees no orphaned tasks with nursery-based spawning.
Visual Demo
using nursery := Nursery.new() do
// Tasks spawned here
Key Points
- ○ Nursery guarantees no orphans
- ○ Budget-based preemptive scheduling
- ○ Parent waits for all children
Code Examples
Explore Janus syntax and features through practical examples.
Variables & Types
// Immutable by default let name = "Janus" // Type inferred: String let version: f64 = 0.3 // Explicit type // Mutable variables var counter = 0 counter += 1 // Constants at compile time const MAX_SIZE = 1024
Functions
// Function with return type
func add(a: i64, b: i64) -> i64 do
return a + b
end
// Expression-based (no return needed)
func multiply(a: i64, b: i64) -> i64 do
a * b // Last expression is returned
end
// Generic function
func identity<T>(value: T) -> T do
value
end
Control Flow
// If expressions (always return a value)
let max = if a > b then a else b
// Loops
var i = 0
while i < 10 do
print("Iteration {i}")
i += 1
end
// For loops
for item in items do
process(item)
end