The Nesting Is the Interface: Recursive Evaluator Composition for Whole-Program Polyglot Execution

Real software is polyglot, but composing languages inside a single program forces a choice between three unsatisfying regimes. The first reimplements every language on a shared virtual machine (GraalVM/Truffle), which buys tight interoperation at the cost of using reimplementations rather than the real, independently evolved runtimes. The second compiles many surface languages down to one host runtime (Racket's language-oriented programming), which is expressive, but the result is one runtime wearing different syntax, selected one language per module. The third coordinates real runtimes as loosely coupled notebook cells with cross-cell variable sharing (.NET Interactive and Polyglot Notebooks), which uses the genuine runtimes but offers no expression-level composition and no whole-program structure. None of the three treats the choice of evaluator as a compositional property of the expression syntax itself. We present Ostadix-lang, a runtime built on recursive evaluator composition. A typed delimiter, LANG^( ... )_LANG, names the interpreter for its body, so heterogeneous language blocks nest to arbitrary depth over a registry-extensible family of independently implemented real runtimes, with no privileged host language. Values cross language boundaries through one language-neutral value type (OValue) that carries explicit, conservative fidelity accounting: a lattice recording what structure survives a crossing and what is lost, rather than assuming the crossing is free. We relate this lattice to a companion information-theoretic treatment of compilation as a channel, showing it is a sound one-directional bound on source information destroyed at a crossing and stating precisely where it is a bound rather than an equivalence. Programs lower to a unified intermediate representation, from which the runtime derives, validates and schedules a whole-program execution hypergraph. We describe the mechanism, the value-crossing model and its soundness posture, and the implementation: an authoritative Rust runtime (approximately 43,000 lines, excluding a separate, out-of-scope native systems subsystem in the same repository), a C17 interpreter and ahead-of-time compiler, and a Python semantic reference, together registering 21 language backends. We report a reproduced evaluation in a deliberately minimal environment (Python, Node.js, Bash and SQLite only): of a 40-program example corpus, 33 pass and 7 are correctly skipped for one absent optional dependency (Nix), with no failures. With Nix installed and its virtual-machine test suite explicitly enabled, the same corpus was reproduced again: all 40 programs pass, 0 fail, 0 skip. The full test suite is 582 tests. We are explicit about scope throughout, most importantly that the runtime already identifies independent, simultaneously-ready operations across the whole hypergraph, but concurrent execution of that independence is currently restricted to inline renderers verified pure; arbitrary cross-language operations still execute one at a time.

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-07-25
DOI
https://doi.org/10.5281/zenodo.21544345
Primary Topic
Logic, programming, and type systems
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

The Nesting Is the Interface: Recursive Evaluator Composition for Whole-Program Polyglot Execution

Lee Daghlar Ostadi
Zenodo (CERN European Organization for Nuclear Research)
Logic, programming, and type systems
preprint

The Nesting Is the Interface: Recursive Evaluator Composition for Whole-Program Polyglot Execution

Lee Daghlar Ostadi
preprint en

Abstract

Real software is polyglot, but composing languages inside a single program forces a choice between three unsatisfying regimes. The first reimplements every language on a shared virtual machine (GraalVM/Truffle), which buys tight interoperation at the cost of using reimplementations rather than the real, independently evolved runtimes. The second compiles many surface languages down to one host runtime (Racket's language-oriented programming), which is expressive, but the result is one runtime wearing different syntax, selected one language per module. The third coordinates real runtimes as loosely coupled notebook cells with cross-cell variable sharing (.NET Interactive and Polyglot Notebooks), which uses the genuine runtimes but offers no expression-level composition and no whole-program structure. None of the three treats the choice of evaluator as a compositional property of the expression syntax itself. We present Ostadix-lang, a runtime built on recursive evaluator composition. A typed delimiter, LANG^( ... )_LANG, names the interpreter for its body, so heterogeneous language blocks nest to arbitrary depth over a registry-extensible family of independently implemented real runtimes, with no privileged host language. Values cross language boundaries through one language-neutral value type (OValue) that carries explicit, conservative fidelity accounting: a lattice recording what structure survives a crossing and what is lost, rather than assuming the crossing is free. We relate this lattice to a companion information-theoretic treatment of compilation as a channel, showing it is a sound one-directional bound on source information destroyed at a crossing and stating precisely where it is a bound rather than an equivalence. Programs lower to a unified intermediate representation, from which the runtime derives, validates and schedules a whole-program execution hypergraph. We describe the mechanism, the value-crossing model and its soundness posture, and the implementation: an authoritative Rust runtime (approximately 43,000 lines, excluding a separate, out-of-scope native systems subsystem in the same repository), a C17 interpreter and ahead-of-time compiler, and a Python semantic reference, together registering 21 language backends. We report a reproduced evaluation in a deliberately minimal environment (Python, Node.js, Bash and SQLite only): of a 40-program example corpus, 33 pass and 7 are correctly skipped for one absent optional dependency (Nix), with no failures. With Nix installed and its virtual-machine test suite explicitly enabled, the same corpus was reproduced again: all 40 programs pass, 0 fail, 0 skip. The full test suite is 582 tests. We are explicit about scope throughout, most importantly that the runtime already identifies independent, simultaneously-ready operations across the whole hypergraph, but concurrent execution of that independence is currently restricted to inline renderers verified pure; arbitrary cross-language operations still execute one at a time.

Zenodo (CERN European Organization for Nuclear Research)
East Carolina University (US)
Logic, programming, and type systems
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.