catalyx

Crates.iocatalyx
lib.rscatalyx
version0.1.0
created_at2025-12-27 12:47:16.003241+00
updated_at2025-12-27 12:47:16.003241+00
descriptionA reactive streaming runtime inspired by join calculus and chemical reaction models
homepagehttps://catalyx.dev
repositoryhttps://github.com/singaraiona/catalyx
max_upload_size
id2007154
size53,025
Hetoku (singaraiona)

documentation

README

โš—๏ธ Catalyx

A reactive streaming runtime built on RayforceDB, inspired by join calculus and chemical reaction models.

Catalyx brings the elegance of chemical metaphors to reactive programming. Define molecules, reactions, and watch your data flow through a reactive substrate powered by RayforceDB's ultra-fast columnar engine.

๐Ÿงฌ Concepts

Chemical Metaphor Programming Concept
Molecule Message/Event with typed payload
Reaction Join pattern matching multiple molecules
Solution Reactive context/namespace
Catalyst Persistent trigger that isn't consumed
Substrate Underlying RayforceDB storage

๐Ÿš€ Quick Start

# Build and run the REPL
cargo run

# Or install globally
cargo install --path .

โšก REPL Features

  • Syntax Highlighting - Molecules, reactions, and keywords beautifully colored
  • Auto-completion - Tab completion for all Catalyx constructs
  • Persistent History - Command history saved across sessions
  • Multi-line Editing - Continue expressions across lines
  • Inline Hints - Ghost text suggestions as you type

๐Ÿงช Example Session

โฏ mol ping(x: int)
โŠ› Molecule `ping` defined

โฏ mol pong(y: int)  
โŠ› Molecule `pong` defined

โฏ react ping(a) & pong(b) => show (+ a b)
โŠ› Reaction defined: ping โŠ— pong โ†’ ฮป

โฏ emit ping(21) pong(21)
42

๐Ÿ“– Commands

Command Description
:? Show help
:q Quit REPL
:m List molecules
:r List reactions
:s Show solution state
:c Clear screen
:t Toggle timing

๐Ÿ”ฌ Language

Molecules

# Define a molecule type
mol request(id: guid, payload: string)

# Emit molecules into the solution
emit request(guid(), "hello world")

Reactions

# Simple reaction consuming two molecules
react request(id, p) & response(id, r) => 
    show "Got response" r "for request" id

# Reaction with guard
react tick(t) & buffer(data) where (> (count data) 100) =>
    flush data

Catalysts

# Catalysts persist and trigger reactions without being consumed
catalyst config(settings: dict)

react request(r) & config(c) =>
    process r (get c `timeout)

๐Ÿ“„ License

MIT License - see LICENSE

๐Ÿ”— Links

Commit count: 0

cargo fmt