Draft 1 for Jon, 30 Oct 2026, written by design chat's writer from your outline and the page shapes. Not live. Mine, not yours, and worth checking: your closure-and-struct analogy is in my words; the paragraph on what Pony taught you (I wrote what the Pony pages say, not what you took from it); the history paragraph's dates ("the last ten years"); and the three reasons an actor beats a task, which are my reading of the manual. I left out the offered additions that did not fit simply: the GPU and Vector ladder, and the I/O scheduling story. Per-actor collection gets one sentence. [pending: 31 Oct re-run] the ping-pong figures, so the page says "first" and gives no numbers; actors against tasks on memory per worker, and one scheduler against two pools, are unmeasured and not claimed. Not claimed on purpose: that parallel each scales with the core count (at risk in the ledger). Links not yet fixed: the manual links under "Try it" are copied from the short actors page and unchecked; modularity.html and performance.html are being drafted tonight; "Rust" does not appear on this page.
Every program I wrote for a 3D engine ended up asking the same question: how do I use all the cores without breaking the program? This page is how Cone answers, in the order the pieces fit together. The detail lives in the manual; here I want you to see the whole shape.
Why it got hard
For decades, each new computer ran one program faster than the last, and nobody had to change how they wrote it. Then clock speeds stopped climbing. The industry kept adding transistors anyway, but as more cores: eight to sixteen in a phone or a laptop, and a graphics processor beside them. The speed is still there. It is now yours to collect, one core at a time, and getting it out is hard.
How the industry answered
Each answer bought speed and charged for it:
- Processes are perfectly isolated, and expensive: separate memory maps, and every message serialized to cross between them.
- Threads share memory, so they are quick to talk. But each has a big stack, and switching between them is costly, so you cannot have very many.
- Green threads and async tasks are cheap and cooperative. Because they only switch when they wait, all your input and output has to be non-blocking. In the last decade async and await became the standard way to write them.
None of those removed the real hazard: two pieces of a program reaching the same value at the same moment.
Two kinds of work
When I looked at what a 3D engine does, the work came in two kinds, and Cone has a tool for each.
The same work over many items. Move every particle. Discount every order. A bakery's ledger holds a year of orders, and at year's end every order of $50 or more takes ten percent off. Here is the loop on one core:
each o in orders.mutItems() {
if *o >= 50 { *o -= *o / 10; }
}
To put every core on it, add one word:
parallel each o in orders.mutItems() {
if *o >= 50 { *o -= *o / 10; }
}
first orders now: 40 54 81
examples\concurrency_ledger.cone (a copy of c_ledger.cone), compiled and run with the default compiler on 30 Oct. The loop sits inside an actor's behavior; main records orders of $40, $60 and $90, and the output lists them after the discount. Only the word parallel separates the two loops above.
No threads to start, no work to share out by hand, and the body does not change. The orders keep their places, just as a plain loop would leave them. (Three orders only show the shape; the page claims nothing about how it scales.)
Different kinds of work at once. Physics, the network, an avatar deciding where to go, a loader fetching a mesh. These are not a set of identical passes. They are different jobs, each with its own state, that wait on each other and on the world. For this, a scheduler spreads the jobs over the cores, and an idle core steals work from a busy one.
I wanted both to be safe and fast together: no race the compiler cannot see, and almost no bookkeeping between the work and the machine.
Actors, the step past tasks
An async task is like a closure: one shot, one thing to do. You start it, it finishes, you collect the answer. That is the right tool for a one-off.
But much of a running system is not a one-off. A stock room has state, and a standing job: to take whatever requests come, and answer each, for as long as the shop is open. An actor is like a struct with methods. It owns its state, there are several things you can ask of it, and you ask asynchronously. Each ask is a message in the actor's mailbox, handled one at a time, so nothing else is inside the actor while it works, and no lock is needed.
Here are two tills in a bakery selling from one stock room, both at once. With shared data and threads, this is where two tills read "50 loaves" and each sells 40. Here the loaves belong to the stock room:
actor StockRoom {
loaves: i32 = 50;
pub async fn take(self, wanted: i32) i32 {
let given = if wanted <= loaves { wanted } else { loaves };
loaves -= given;
given // the answer, sent back
}
}
actor Till {
stock: StockRoom;
pub async fn serve(self, wanted: i32) i32 {
// await: ask the stock room, and carry on when it answers
let got = await stock.take(wanted);
got * price // what the customer pays
}
}
actor Shop {
east: Till;
west: Till;
pub async fn open(self) {
// Two customers, served at once, one at each till
let ana = east.serve(30);
let ben = west.serve(40);
print <- "Ana pays $", await ana, "\n";
print <- "Ben pays $", await ben, "\n";
}
}
Ana pays $90 Ben pays $60
examples\concurrency_bakery.cone, compiled and run, with price, main and the imports left out here. Which customer goes short can change from run to run; the tills never sell more than 50 loaves between them.
Three things make an actor a step up from a task:
- It has state that outlives any one message, and still needs no lock.
- It has several behaviors. A new one is one more async fn; nothing that already calls the actor changes.
- It can wait without holding a core. At an await the worker goes off to other actors until the answer comes, and the till's code still reads from top to bottom.
In a 3D world, the natural actors are the long-lived things: an avatar, a physics island, a loader, a connection. Each has its own state and several things you ask of it.
How the pieces fit
Cone puts the two kinds of work in a fixed order. Actors are on the outside. They are the standing parts of the program, and they talk by messages. Parallel loops are inside them. When one actor's behavior has a big loop, it puts parallel in front, and every core helps. One scheduler runs both, the same worker threads, one for each core. An actor with a message waiting gets a free worker, and a parallel loop's pieces go to the idle ones.
actor Island {
bodies: List[Body];
// The same work over many items: every core moves some of the bodies
pub async fn step(self, dt: f32) {
parallel each b in bodies.mutItems() {
b.x += b.vx * dt;
}
// every body has moved here: the same behavior carries on
}
pub async fn position(self, i: usize) f32 { bodies[i].x }
}
actor Avatar {
island: Island;
pub async fn look(self) {
island.step(0.5f32);
print <- "the island's first body is at ", await island.position(0), "\n";
}
}
the island's first body is at 1
examples\concurrency_island.cone, compiled and run, with the Body struct and main left out here. The avatar's two messages reach the island in the order they were sent, so the position it hears is the position after the step.
The avatar is a standing role. The island is another, and inside its step the big loop spreads over the machine. The behavior pauses where the loop ends, the island's other messages wait their turn, and the rest of the behavior carries on. Work can move between a standing actor and an all-cores loop without rewiring either.
Safe, and fast
A data race needs two threads reaching one value, with at least one changing it. Cone's rules each take one of those away, and the compiler checks them before the program runs.
- An actor's state is its own. Code outside that reaches for it is refused.
- What travels in a message is checked from the behavior's declaration. A number is copied. A value with a single owner moves whole, and the sender can no longer touch it. Data nobody changes may be shared by every actor at once. A value whose bookkeeping only one thread may keep is refused:
actor Till {
pub async fn sell(self, prices: Rc[imm, Prices], loaves: i32) i32 {
loaves * prices.loaf
}
}
Error 1194: Actor Till's behaviour sell takes prices, a Rc[imm, Prices], which is not Sendable: it is an owner that may be copied, and Rc does not declare ThreadSafe: its copies could not be made and dropped on several threads at once. It may cross as a uni owner, which moves it, or as an owner of a region declaring ThreadSafe, such as Arc. A message carries its arguments to the thread the actor runs on, so each must be Sendable.
examples\concurrency_send_refused.cone, refused on purpose; the compiler's message, whole.
- A parallel each body may only read what lies outside the loop. Add up a total the risky way, and:
parallel each o in orders {
total = total + *o;
}
Error 1382: A 'parallel each' body may not write total, which is declared outside the loop: the passes run at the same time. Outside variables are read-only for the loop. Hand results back with the parallel builder, or 'mutItems()' on the items, or count with an Atomic.
examples\concurrency_par_refused.cone, refused on purpose; the compiler's message, whole.
Where a static rule does not fit, because several threads must change one value, Cone offers a lock as a permission: a borrow takes the lock, and its last use gives it back. That is a runtime check, and the manual says so. What the compiler does not prevent is a deadlock, or a race in the wider sense (which customer goes short is your program's own logic). Cone does not prevent those, and I will not pretend it does.
The same rules are why the machinery can be cheap. Actors need no wiring: the mailbox, the channel, is built for you when you name the actor, and a message is just a call. A value that moves into a message is handed over, not copied: in my test a 1 MiB payload hops from actor to actor as fast as eight words do. Data nobody changes is shared with no lock, because the compiler has already shown nobody writes it. Each actor can also keep its own garbage collector, which runs between that actor's messages and stops no one else (see memory). And in a ping-pong test, two actors bouncing a message back and forth, Cone came first of the four languages I compared, at every worker count I tried [pending: figures from the 31 Oct re-run]. The rest of the numbers are on the performance page.
What I learned from Pony
I did not invent actors, and Pony taught me most of how to run a system of them. From Pony I took the shape: a mailbox for each actor, one message handled at a time, a pool of workers that pick up whichever actor has work, and references that say what they may do, which is how the compiler knows what is safe to send. Pony's behaviors send a message and carry on. I added await, so a behavior can ask another actor and continue when the answer arrives, and the request-and-reply that follows reads like ordinary code.
Try it
The actors package runs on Windows and Linux (x86-64) today, not yet on macOS. These links point at the Cone manual.
- Actors, the bakery in full, and Actors in depth.
- parallel each, and Data parallelism in depth.
- What may cross a thread.
Why I built Cone · Related: Safety, Memory, Modularity, Data in and out