cargo
Rust package manager (36 subcommands).
chemical-abstract-machine
Berry & Boudol''s CHAM: computation as chemical reactions on multisets.
Full skill instructions
"Computation as chemistry: molecules floating in solution, reacting when they meet."
The Chemical Abstract Machine (CHAM) models computation as:
Solution: {A, A, B, C, D}
Reaction: A + B → E
After reaction: {A, C, D, E} (one A, one B consumed)
Solution S ::= ∅ | m | S, S (multiset of molecules)
Molecule m ::= ... (domain-specific)
Reaction: m₁, ..., mₙ ⟶ m'₁, ..., m'ₖ
Heating: S ⟷ S' (structural equivalence)
Molecules:
(λx.M) — abstraction
M N — application
Reaction (β-reduction):
(λx.M), N ⟶ M[N/x]
Solution: {(λx.x+1), 5, (λy.y*2), 3}
Possible reactions (parallel!):
{(λx.x+1), 5} ⟶ {6}
{(λy.y*2), 3} ⟶ {6}
Result: {6, 6}
Hierarchical compartments:
┌─────────────────────────────────┐
│ Skin membrane │
│ ┌─────────────┐ ┌───────────┐ │
│ │ {A, B, C} │ │ {D, E} │ │
│ │ membrane 1 │ │ membrane 2│ │
│ └─────────────┘ └───────────┘ │
│ │
│ {F, G} (in skin, outside 1&2) │
└─────────────────────────────────┘
Rules can:
- React within membrane
- Send molecules OUT (to parent)
- Send molecules IN (to child)
- Dissolve membrane
from collections import Counter
import random
class CHAM:
def __init__(self):
self.solution = Counter() # Multiset
self.reactions = []
def add(self, molecule, count=1):
self.solution[molecule] += count
def add_reaction(self, reactants, products):
"""reactants and products are Counters"""
self.reactions.append((Counter(reactants), Counter(products)))
def step(self):
"""Fire one random applicable reaction."""
applicable = []
for reactants, products in self.reactions:
if all(self.solution[m] >= c for m, c in reactants.items()):
applicable.append((reactants, products))
if not applicable:
return False # No reaction possible
reactants, products = random.choice(applicable)
self.solution -= reactants
self.solution += products
return True
def run(self, max_steps=1000):
"""Run until no reactions possible."""
for _ in range(max_steps):
if not self.step():
break
return self.solution
# Example: A + B → C, A + C → D
cham = CHAM()
cham.add('A', 3)
cham.add('B', 2)
cham.add_reaction(['A', 'B'], ['C'])
cham.add_reaction(['A', 'C'], ['D'])
result = cham.run()
print(result) # e.g., Counter({'D': 2, 'C': 0, 'A': 0, 'B': 0})
// Agents with sites
%agent: A(x, y)
%agent: B(z)
// Rules
A(x[.]), B(z[.]) -> A(x[1]), B(z[1]) // Binding
A(x[1]), B(z[1]) -> A(x[.]), B(z[.]) // Unbinding
// Rates
A(x[.]), B(z[.]) -> A(x[1]), B(z[1]) @ 0.1
import math
import random
def gillespie_step(solution, reactions, rates):
"""One step of Gillespie's stochastic simulation."""
# Calculate propensities
propensities = []
for (reactants, products), rate in zip(reactions, rates):
# Count ways to choose reactants
ways = 1
for mol, count in Counter(reactants).items():
ways *= math.comb(solution[mol], count)
propensities.append(rate * ways)
total = sum(propensities)
if total == 0:
return None, None
# Time until next reaction
tau = random.expovariate(total)
# Which reaction
r = random.uniform(0, total)
cumsum = 0
for i, prop in enumerate(propensities):
cumsum += prop
if r <= cumsum:
return tau, i
return tau, len(reactions) - 1
| Domain | Use Case |
|---|---|
| Biology | Metabolic networks, signaling |
| Concurrency | Process calculi (π-calculus) |
| Chemistry | Reaction kinetics |
| Computing | DNA computing, molecular programming |
| Model | Relationship |
|---|---|
| Petri Nets | CHAM is a textual Petri net |
| π-calculus | Can be encoded in CHAM |
| Ambient Calculus | Membrane = ambient |
| CRN | Chemical Reaction Networks |
# Assign trits to molecule species
MOLECULE_TRITS = {
'A': 1,
'B': -1,
'C': 0,
}
# Conservation: reactions preserve GF(3) sum
def verify_reaction_gf3(reactants, products):
r_sum = sum(MOLECULE_TRITS[m] for m in reactants)
p_sum = sum(MOLECULE_TRITS[m] for m in products)
return r_sum % 3 == p_sum % 3
# A(+1) + B(-1) → C(0) ✓ (0 = 0 mod 3)
| Speaker | Relevance | Repository/Talk |
|---|---|---|
| condret | ESIL multiset semantics | radare2 ESIL |
| alkalinesec | ESILSolve reactions | esilsolve |
| pancake | r2pipe chemistry | radare2 |
petri-nets - Graphical versionprocess-calculus - π-calculus connectionsystems-biology - Main application domainstochastic-simulation - Gillespie algorithmThe interaction IS the skill improving itself.
Every use of this skill is an opportunity for worlding:
Add Interaction Exemplars here as the skill is used.
Part of: alife-commons. Family: chemical-reaction-networks. Canonical: catalyst-chemical.
Rust package manager (36 subcommands).
Translate Figma nodes into production-ready code with 1:1 visual fidelity using the Figma MCP workflow (design context, screenshots, assets, and project-convention translation). Trigger when the user provides Figma URLs or node IDs, or asks to implement designs or components that must match Figma...
**Status**: 🌳 Production Ready (upstream in StringZilla v3+) **Type**: High-Performance String Operations / SIMD-Accelerated Text Processing **Principle**: Zero-copy views, SIMD/SWAR acceleration, deterministic hashing **Frame**: Cross-language interoperability (C, C++, Python, Rust, Go, Swift, ...
Conformal Geometric Algebra (CGA) for circles, spheres, and Möbius transformations
Verifies code implements exactly what documentation specifies for blockchain audits. Use when comparing code against whitepapers, finding gaps between specs and implementation, or performing compliance checks for protocol implementations.
Systems programming and performance optimization using Zig. Provides low-level abstractions, memory-safe compiled code, and performance benchmarking. Use for system-level operations, optimization, and interoperability with C/POSIX APIs.
PayPal MCP server integration for invoices, payments, subscriptions, disputes, and transaction reporting via @paypal/mcp.
Unison language - content-addressed functional programming with abilities for effects, distributed computing, and structural types. Use for pure functional code, effect management, distributed systems, and refactoring-safe codebases.
Google Tasks management via TasksACSet. Transforms task operations into GF(3)-typed Interactions, routes to triadic queues, detects saturation for task-zero-as-condensed-state.
World C Skill
Syrup binary serialization for OCapN/CapTP wire format. Canonical encoding for capability messages.
Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience