A Rust framework for building modern, concurrent and resilient applications

Live Demo: Living City

Every car, junction, traffic light and district in this city is a Picard actor. Spawn thousands of vehicles, crash an actor and watch supervision restart it, or add a whole district at runtime. The simulation runs entirely in your browser: Picard compiled to WebAssembly, no server involved.

Screenshot of the Living City demo
Launch the demo

Actor Based Concurrency

Actors expose a message based API resulting in fast, non-blocking code execution while also eliminating race conditions to make concurrent code a breeze to write.

Self Healing

Build applications that isolate and recover from failures. Actors provide a Supervision Strategy that form the core of resilient application design in Picard.

CQRS Entity Management

The separate picard-cqrs crate routes commands by entity ID and manages active entity actors. Your application supplies any persistence and state recovery.

General Purpose

In the Cloud, Microservices, IoT, Drones, AI and more. Rust compiles to OS binaries, has no VM or GC overhead, and requires only a few megabytes of memory.

Modular Framework

The runtime includes actor dispatch, logging, message scheduling, and configurable mailboxes. Optional features add diagnostics, serialization, a runtime console, and remote messaging.

Modern Rust Design

Execute Rust Futures with ease and no unsafe code used.

Example Code

1use picard::actors::*;
2
3#[derive(Default)]
4struct MyActor;
5
6impl Actor for MyActor {
7 type Msg = String;
8
9 fn recv(&mut self, _ctx: &Context<Self::Msg>, msg: Self::Msg, _sender: Sender) {
10 println!("received {msg}");
11 }
12}
13
14fn main() {
15 let sys = ActorSystem::new().unwrap();
16 let actor = sys.actor_of::<MyActor>("my-actor").unwrap();
17
18 actor.tell("Hello actor!".to_string(), None);
19}
20