home / skills / plurigrid / asi / scheme

scheme skill

/skills/scheme

This skill helps you explore and integrate the GNU Scheme ecosystem, including guile, goblins, hoot, and fibers, for robust web and concurrency workflows.

npx playbooks add skill plurigrid/asi --skill scheme

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
822 B
---
name: scheme
description: GNU Scheme ecosystem = guile + goblins + hoot + fibers.
metadata:
  trit: 0
---

# scheme

GNU Scheme ecosystem = guile + goblins + hoot + fibers.

## Atomic Skills

| Skill | Lines | Domain |
|-------|-------|--------|
| guile | 67K | Interpreter |
| goblins | 6.5K | Distributed objects |
| hoot | 4K | WebAssembly |
| fibers | 2K | Concurrent ML |
| r5rs | 1K | Standard |

## Compose

```scheme
;; guile + goblins + hoot
(use-modules (goblins)
             (goblins actor-lib methods)
             (hoot compile))

(define-actor (counter bcom count)
  (methods
    ((get) count)
    ((inc) (bcom (counter bcom (+ count 1))))))
```

## Wasm Pipeline

```bash
guile -c '(compile-to-wasm "app.scm")'
```

## FloxHub

```bash
flox pull bmorphism/effective-topos
flox activate -d ~/.topos
```

Overview

This skill packages a compact GNU Scheme ecosystem combining Guile, Goblins, Hoot, and Fibers to build interpreters, distributed objects, WebAssembly targets, and concurrent ML-style workflows. It exposes atomic pieces for interpreter work, actor-based distributed systems, Wasm compilation, and lightweight concurrency. The goal is a practical toolkit for composing Scheme programs across local, distributed, and Wasm execution environments.

How this skill works

It bundles core modules: Guile as the interpreter, Goblins for actor/distributed-object patterns, Hoot for compiling Scheme to WebAssembly, and Fibers for lightweight concurrent ML-style primitives. You can compose actors, compile Scheme sources into Wasm, and orchestrate deployments via flox commands. The skill inspects source modules and pipelines to produce runnable actors, Wasm artifacts, and environment activations.

When to use it

  • Building actor-based distributed systems in Scheme
  • Compiling Scheme applications to WebAssembly for browser or Wasm runtimes
  • Rapid prototyping with Guile as an embedded interpreter
  • Coordinating concurrent tasks using ML-style fibers
  • Deploying or activating Scheme environments with flox

Best practices

  • Keep modules small and focused: separate interpreter logic, actor definitions, and Wasm compilation targets
  • Use actor factories and immutable state transitions for safe distributed concurrency
  • Compile to Wasm only after stabilizing public APIs to reduce iteration time
  • Leverage flox activations for reproducible local environments and dependency isolation
  • Write small testable actor methods for easier debugging and remote inspection

Example use cases

  • Create a distributed counter actor with Goblins and expose increment/get methods for multiple clients
  • Compile a Scheme app to WebAssembly using Hoot and run it in a browser or Wasm runtime
  • Embed Guile as a scripting interpreter in a host application and script behavior with Scheme modules
  • Coordinate concurrent tasks and cooperative scheduling with Fibers for I/O-bound workloads
  • Pull and activate a curated Scheme environment via flox for reproducible development

FAQ

Can I cross-compile any Guile code to Wasm?

Not every Guile feature maps directly to Wasm. Prefer pure Scheme code and avoid platform-specific extensions. Use Hoot for supported compilation paths and test outputs in a Wasm runtime.

How do Goblins actors handle state and concurrency?

Goblins encourages immutable state transitions via actor replacements. Define methods that return new actor instances to safely evolve state across the distributed system.