agentleFS
ryanmacleanryanmaclean/skills/arena-actors/SKILL.md

arena-actors

Skill1 starsChanged 50 days agoMITView on GitHub

Arena-per-actor pattern: Ericsson 1986 Erlang heaps = Zig/Rust arena allocators. Zero-GC actor model. Trigger: arena allocator, per-process heap, zero GC, wisp memory, ephemeral allocation, bumpalo, let it crash memory, Ericsson pattern

The file

Files
SKILL.md

Arena Actors — Zero-GC Actor Pattern

Ericsson 1986: each Erlang process gets its own heap. Process dies = free heap. No tracing GC. Same pattern in Rust/Zig: arena-per-actor, allocate freely, free everything at once.

The Pattern

spawn actor → create arena
actor runs  → allocate in arena (fast, no bookkeeping)
actor dies  → free arena (one operation, instant)

Zero tracing GC. Zero reference counting. Zero stop-the-world pauses.

Rust: bumpalo (MIT)

use bumpalo::Bump;

let arena = Bump::new();
let data = arena.alloc_slice_copy(&embedding_vector);
let result = cosine_similarity(data, query);
// arena dropped here — everything freed at once

Zig: ArenaAllocator

var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena.deinit(); // free everything
const alloc = arena.allocator();
const data = try alloc.alloc(f32, 1024);

Applied to Fleet Wisps

Each wisp (ephemeral bead):

  1. Arena created (spawn)
  2. Work done — allocations in arena only
  3. Result sent to caller (message passing)
  4. Arena freed (wisp dies)

1GB Pi budget: 100 concurrent wisps × ~10KB each = 1MB total. Nothing.

vs BEAM

BEAM does the same thing — per-process heap, freed on process exit. The difference: BEAM has a runtime VM (~40MB). Arena in Rust = 0 bytes overhead.

Key Libraries

  • bumpalo (Rust, MIT) — bump allocator, fast, 0 fragmentation
  • typed-arena (Rust, MIT) — typed variant
  • std.heap.ArenaAllocator (Zig) — built-in, zero deps

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.