Garnet — half mechanical-rust lattice, half faceted ruby gem, glowing neural-graph core

GARNET

Rust Rigor. Ruby Velocity. One Coherent Language.

The Three Pillars

Two languages, one grammar.

Rust gives you mathematical rigor at the cost of cognitive load. Ruby gives you conversational beauty at the cost of runtime surprise. Garnet gives you both — within a single coherent language whose mode boundary is the reconciliation.

Rust

Rigor

Mathematical correctness. Memory discipline. Zero-cost abstractions. Performance to the metal.

But — cognitive load, lifetimes-as-mental-stack, ceremony.

Garnet

Reconciliation

Managed mode (def + ARC + exceptions) feels Ruby-like. Safe mode (@safe + fn + ownership + Result) feels Rust-like.

The mode boundary auto-bridges errors and ARC ↔ affine.

Ruby

Velocity

Conversational beauty. High velocity. Joyful to read, fast to write. DSLs flow.

But — ambient authority, runtime surprise, no compile-time net.

Every team eventually picks: Rust for the hot path, Ruby for the orchestration, and writes a painful FFI between them. Or picks one language and swallows its weakness.

Garnet's dual-mode design makes the same source file velocity-first at the top level and rigor-first in the safe modules — with no FFI in between.
— The Reconciliation, Paper III §1

Side By Side

Same logic. Three cognitive profiles.

Switch between examples to see how Garnet inherits Rust's shape and Ruby's brevity. The keyword chooses the register: def = managed, fn = safe.

RUST
fn greet(name: &str)
    -> String {
  format!(
    "Hello, {}!", name)
}
RUBY
def greet(name)
  "Hello, #{name}!"
end
GARNET
# Managed — Ruby feel
def greet(name) {
  "Hello, #{name}!"
}

# Safe — Rust rigor
@safe
fn greet(
  borrow name: String)
  -> String {
  "Hello, #{name}!"
}
RUST
fn read_config(
  path: &Path)
  -> Result<Config, io::Error> {
  let content =
    fs::read_to_string(path)?;
  toml::from_str(&content)
    .map_err(convert_err)
}
RUBY
def read_config(path)
  content = File.read(path)
  TOML.parse(content)
rescue Errno::ENOENT
  nil
end
GARNET
@caps(fs)
def read_config(path) {
  try {
    TOML.parse(
      fs::read_file(path))
  } rescue e: FileNotFound {
    nil
  }
}
RUST
let names: Vec<String> =
  users.iter()
    .filter(|u| u.active)
    .map(|u| u.name.clone())
    .collect();
RUBY
names = users
  .select(&:active)
  .map(&:name)
GARNET
# Pipeline style
let names = users
  |> filter(|u| u.active)
  |> map(|u| u.name)

# Ruby block style
let names = users
  .filter do |u| u.active end
  .map    do |u| u.name  end
RUST
use some_vector_db::*;
use some_episodic_log::*;

struct Agent {
  events:
    EventLog<Event>,
  facts:
    VectorStore<Fact>,
}

impl Agent {
  // ...setup ceremony...
}
RUBY
class Agent
  def initialize
    @events = []
    @facts  = {}
  end

  def remember(e)
    @events << e
  end
end
GARNET
actor Agent {
  memory episodic
    events : EpisodeStore<Event>
  memory semantic
    facts  : VectorIndex<Fact>

  protocol remember(e: Event)
    -> Bool
  protocol recall(q: String)
    -> Array<Fact>

  on remember(e) {
    events.append(e); true
  }
}

Six Pillars

What Garnet adds at the language layer.

These are not libraries. They are first-class language constructs — checked at compile time, integrated through the whole toolchain, designed to compose.

def · fn

Dual-Mode Reconciliation

Same grammar, two registers. Managed mode (def) reads like Ruby. Safe mode (@safe fn) reads like Rust. The boundary auto-bridges errors + ownership.

@safe

Visible Mode Boundary

Every managed↔safe call is logged via ModeAuditLog. Reviewers read one file to enumerate every trust crossing in the program.

@caps(fs)

Capability Model

Every function declares its OS-authority budget. CapCaps propagator verifies transitively at compile time — no ambient authority, ever.

memory · 4

Agent-Native Memory

First-class memory working|episodic|semantic|procedural keywords. The runtime picks the allocator. Paper VI Contribution 4.

Ed25519

Signed Hot-Reload

actor.reload_signed(&sig, ...) with BLAKE3 schema fingerprint catches type mismatches. Zero message loss at 1000 cycles.

--sign

Deterministic Signed Manifests

garnet build --deterministic --sign emits a byte-identical manifest plus Ed25519 signature. Verify any binary you downloaded.

The Capability Model

Read one token. Know the function's authority.

@caps(fs) is a semantic beacon: a single annotation that front-loads the function's OS-authority budget. Both humans and language models can scan a file and reason about what it can — and cannot — do.

GARNET
@caps(fs)
def get_user_summary(path, id) {
  let data = JSON.parse(
    fs::read_file(path))
  let user = data["users"][id]
  "#{user.name}: #{user.email}"
}

# compile-time error: caps coverage:
# function `bad` does not declare
# `fs` but transitively calls
# `read_file` which requires it
@caps()
def bad() {
  fs::read_file("/etc/passwd")
}
@caps(fs)
Filesystem read/write/list. Required by every fs::* primitive.
@caps(net)
Outbound TCP/UDP. NetDefaults gate denies RFC1918 / loopback / link-local by default.
@caps(time)
Wall + monotonic clocks, sleep.
@caps(proc)
Subprocess spawn.
@caps(ffi)
C FFI. Always logged.
@caps(*)
Wildcard trust. Managed mode only — safe-mode wildcard is a hard error.

Migrate at Your Pace

Convert Rust · Ruby · Python · Go source to Garnet.

The garnet convert tool reads four source languages and emits Garnet — every output starts @sandbox + @caps(). Human audit lifts the sandbox. A lineage JSON maps every emitted node back to its source span.

RUBY — source
def parse_config(text)
  text.split("\n").map do |line|
    k, v = line.split("=", 2)
    [k.strip, v.strip]
  end.to_h
end
GARNET — converted
@sandbox
@caps()
module Config {

def parse_config(text) {
  let out = {}
  for line in text.split("\n") {
    let parts = line.split("=", 2)
    out.insert(
      parts[0].trim(),
      parts[1].trim())
  }
  out
}

}
Rust
Ruby
Python
Go

Get Garnet

Install in under 60 seconds.

Native packages for every major platform plus a universal shell installer. Every release is signed with the project's Ed25519 key; SHA256SUMS verifies asset integrity.

curl --proto '=https' --tlsv1.2 -sSf https://sh.garnet-lang.org | sh
# Universal installer (recommended):
curl --proto '=https' --tlsv1.2 -sSf https://sh.garnet-lang.org | sh

# Or download the signed .pkg directly:
# From CDN:    https://releases.garnet-lang.org/0.4.2/garnet-0.4.2-universal.pkg
# From GitHub: https://github.com/IslandDevCrew/garnet/releases/latest
# (Apple Developer ID signed + notarized + stapled)
# Universal (auto-detects .deb / .rpm / tar):
curl --proto '=https' --tlsv1.2 -sSf https://sh.garnet-lang.org | sh

# Or grab the .deb / .rpm from GitHub Releases:
#   https://github.com/IslandDevCrew/garnet/releases/latest

# Debian/Ubuntu (direct):
sudo apt install ./garnet_0.4.2-1_amd64.deb

# Fedora/RHEL (direct):
sudo dnf install ./garnet-0.4.2-1.x86_64.rpm
# Winget (when published):
winget install IslandDevCrew.Garnet

# Or download the signed .msi directly:
# From CDN:    https://releases.garnet-lang.org/0.4.2/garnet-0.4.2-x86_64.msi
# From GitHub: https://github.com/IslandDevCrew/garnet/releases/latest
# (Authenticode-signed + timestamped)

After install, scaffold a project:

garnet new --template cli my_app
cd my_app
garnet test           # 2 starter tests pass green
garnet run src/main.garnet

By the Numbers

Substance behind the surface.

1244
Tests committed
136
Security tests
22
Stdlib primitives
10
MVP programs
7
Research papers
0.93×
Expressiveness ratio

Documentation & Research

The work, the proofs, the honest scorecard.

Garnet ships seven research papers plus four addenda. Every claim is traceable to a reproducer; every empirical experiment was pre-registered before measurement; partial outcomes were honestly downgraded in the v4.0 revisions.