language for actor programming
Find a file
2026-07-10 16:22:32 +03:00
src parser, fully from llm 2026-07-10 16:22:04 +03:00
tests parser, fully from llm 2026-07-10 16:22:04 +03:00
.gitignore add .gitignore 2026-07-10 16:22:32 +03:00
Cargo.lock first commit 2026-07-10 15:50:35 +03:00
Cargo.toml first commit 2026-07-10 15:50:35 +03:00
LANGUAGE_DESIGN.md first commit 2026-07-10 15:50:35 +03:00
README.md first commit 2026-07-10 15:50:35 +03:00
TODO.md first commit 2026-07-10 15:50:35 +03:00

Chatter

An actor model programming language implementation in Rust.

Language Syntax

Actor Definition

actor <name>(<parameters>) as me = behavior(message) as <behavior_name> ->
  case message of
    <pattern_1> -> {
      <statements>
      <next_behavior>
    }
    <pattern_2> -> {
      <statements>
      <next_behavior>
    }

Statements

Within message handling blocks, three types of statements are allowed:

  1. Send messages: send <message> to <actor>
  2. Spawn actors: spawn <actor_expression> as <local_name>
  3. Behavior transition: <behavior_name> (must be the final statement)

Example: Integer Numbers

actor zero as me = behavior(message) as zero_behavior ->
  case message of
    is_zero(reply_to) -> {
      send true to reply_to
      zero_behavior
    }
    succ(reply_to) -> {
      spawn make_successor(me) as one
      send one to reply_to
      zero_behavior
    }

actor make_successor(prev_number) as me = behavior(message) as succ_behavior ->
  case message of
    is_zero(reply_to) -> {
      send false to reply_to
      succ_behavior
    }
    succ(reply_to) -> {
      spawn make_successor(me) as next
      send next to reply_to
      succ_behavior
    }
    pred(reply_to) -> {
      send prev_number to reply_to
      succ_behavior
    }

Core Concepts

  • Actors are isolated computational units with private state
  • Messages are the only form of communication between actors
  • Behaviors define how actors respond to different message types
  • Pattern matching on message types determines actor responses
  • Each message response ends with a behavior for handling the next message
  • Spawned actors can be bound to local names for reference within the same message handler