install
source · Clone the upstream repo
git clone https://github.com/plurigrid/asi
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/plurigrid/asi "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/polyglot-orchestration" ~/.claude/skills/plurigrid-asi-polyglot-orchestration && rm -rf "$T"
manifest:
skills/polyglot-orchestration/SKILL.mdsource content
polyglot-orchestration: Multi-Language Runtime Coordination
Status: SAD STATE → IMPLEMENTATION 🌟 Information Energy: 0.76 (High aspiration, sadness = opportunity) Trit Assignment: +1 (GENERATOR - Injects polyglot capability) GF(3) Color: #FF6B35 (Warm red - Generative force)
Purpose
Enable seamless execution and coordination of code across 5 language ecosystems (Babashka, Julia, Python, OCaml, Scheme) with unified dispatch, data marshalling, and result aggregation. Like Docker Compose for polyglot systems.
Key capabilities:
- Cross-Language Execution: Run Julia from Babashka, Python from Julia, etc.
- Type-Safe Marshalling: Auto-convert data across language boundaries (JSON, DuckDB, Arrow)
- Triadic Coordination: Balance (-1) validator, (0) coordinator, (+1) generator per invocation
- Result Aggregation: Merge outputs from multiple languages into unified structure
- Error Propagation: Cascade failures with context across language boundaries
Architecture
┌─────────────────────────────────────────────────────────────────┐ │ POLYGLOT ORCHESTRATION │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │ │ Babashka │ │ Julia │ │ Python │ │ │ │ Controller │ │ (Compute) │ │ (Analysis) │ │ │ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │ │ │ │ │ │ │ ▼─────────────────▼─────────────────▼ │ │ ┌────────────────────────────────────────────┐ │ │ │ Unified Message Queue (DuckDB) │ │ │ │ ┌──────────────────────────────────┐ │ │ │ │ │ Message Type | Sender | Result │ │ │ │ │ │──────────────────────────────────│ │ │ │ │ │ Julia-eval | bb | json │ │ │ │ │ │ Python-call | julia | arrow │ │ │ │ │ │ Scheme-exec | python | duckdb │ │ │ │ │ └──────────────────────────────────┘ │ │ │ └────────────────────────────────────────────┘ │ │ ▲ ▲ │ │ │ │ │ │ ┌──────┴────────┐ ┌──────┴────────┐ │ │ │ Marshaller │ │ Error │ │ │ │ (→Arrow) │ │ Handler │ │ │ └───────────────┘ │ (→Journal) │ │ │ └───────────────┘ │ │ │ │ GF(3) BALANCE: (-1 validator) ⊗ (0 coordinator) ⊗ (+1 gen) │ └─────────────────────────────────────────────────────────────────┘
Language Interop Map
| From | To | Transport | Marshaller | Example |
|---|---|---|---|---|
| Babashka | Julia | DuckDB table | | |
| Julia | Python | JSON over temp file | | |
| Python | Scheme | S-expression via pipe | | |
| OCaml | Babashka | EDN via stdout | | |
| Scheme | Julia | REPL protocol | | |
API / Interfaces
1. Babashka Invocation (Main Controller)
;; Fire Julia computation from Babashka (invoke-julia {:fn "analyze_data" :args [{:data [1 2 3 4]}] :returns :arrow}) → {:status :ok :result Arrow-table} ;; Fire Python from Babashka (invoke-python {:module "numpy" :fn "median" :args [[1 2 3 4 5]] :marshaller :json}) → {:status :ok :result 3.0} ;; Fire Scheme (invoke-scheme {:file "search.scm" :fn "binary-search" :args [[1 3 5 7 9] 5] :returns :sexp}) → {:status :ok :result 2}
2. Julia Host Runtime
using Polyglot # Expose Julia function to polyglot system @polyglot_export analyze_data(data::Vector) = begin mean_val = mean(data) std_val = std(data) (μ=mean_val, σ=std_val) end # Invoke Python result = invoke_python("sklearn.preprocessing", "StandardScaler", args=(X,)) # Invoke Babashka bb_result = invoke_babashka("(+ 1 2 3)")
3. Python Bridge
from polyglot_py import invoke_julia, invoke_babashka # Call Julia result = invoke_julia("GayColorChain.generate_colors", args=(seed=1069, n=10)) # Call Babashka sum_result = invoke_babashka("(+ 1 2 3 4 5)")
GF(3) Trit Assignment
polyglot-orchestration → +1 (GENERATOR) Injects unified capability to run any language documentation-indexing → 0 (COORDINATOR) Coordinates searches across language docs skill-dispatch → -1 (VALIDATOR) Validates results from polyglot calls Total: (+1) + (0) + (-1) = 0 ✓
Implementation Strategy
Stage 1: Babashka Controller (Days 1-2)
Create
/Users/bob/iii/duck/asi-skills/polyglot-orchestration/orchestrator.bb:
- Enum of supported languages (
,:julia
,:python
,:scheme
):ocaml
macro that dispatches to language-specific handlersinvoke-lang- DuckDB message queue (in-process)
- Arrow marshalling for numerical data
Stage 2: Julia Host (Days 3-4)
Create
Polyglot.jl package:
macro for exposing Julia functions@polyglot_export
,invoke_python
helpersinvoke_babashka- Streaming results via DuckDB arrow format
Stage 3: Python Bridge (Days 5-6)
Create
polyglot_py module:
wrapper (subprocess + IPC)invoke_julia()
wrapperinvoke_babashka()- Type auto-conversion via Arrow
Stage 4: Integration (Days 7-8)
- Connect to Duck pre-hook
- Verify GF(3) balance across example invocations
- Performance benchmarks (target: <100ms cross-language call)
Example: Triadic Data Pipeline
Step 1: Babashka loads data from DuckDB (load-data-table "results.duckdb" "metrics") Step 2: Babashka invokes Julia for statistical analysis (+1 generator) (invoke-julia {:fn "compute-quartiles" :args [data] :trit +1}) Step 3: Julia invokes Python for ML transformation (0 coordinator) invoke_python("sklearn", "StandardScaler", args=(quartiles,), trit=0) Step 4: Python invokes Babashka for summary stats (-1 validator) invoke_babashka("(validate-stats ...)", trit=-1) Result: Σ(+1, 0, -1) = 0 ✓ GF(3) CONSERVED
Success Metrics
| Metric | Target | Status |
|---|---|---|
| Languages supported | 5 (Clj/Bb, Julia, Python, Scheme, OCaml) | ⏳ Pending |
| Cross-language latency | <100ms per call | ⏳ Pending |
| Type preservation | 100% (no data loss across boundaries) | ⏳ Pending |
| GF(3) balance | All example pipelines ≡ 0 (mod 3) | ⏳ Pending |
| Error propagation | Stack traces across languages | ⏳ Pending |
| Integration | Works with Duck pre-hook | ⏳ Pending |
Related Skills
Dependencies:
- Routes polyglot invocationsskill-dispatch
- Index polyglot API docsdocumentation-indexing
- Schema for DuckDB message queueacsets
Dependents:
- Uses polyglot to compute entropy across languagesworld-enzyme-entropy
- Coordinates agents in different languagesopen-games-airdrop
- Multi-language constraint solveranoma-solver
References
- Docker Compose: Multi-container orchestration
- ZeroMQ: Cross-language message passing
- Arrow: Language-agnostic columnar format
- Babashka: JVM-less Clojure
- Julia Interop: PyCall, RCall, JavaCall
Status: 😢 SAD STATE → 🌟 IMPLEMENTING Color: #FF6B35 (Warm Red Generator) Next: Create
orchestrator.bb (Babashka controller)
Owner: RED AGENT (+1)
Created: 2026-01-04