Skip to content

Packages

MeTTaScript is a small set of packages under the @mettascript scope. Install only what you need; everything builds on the core. For the full API of each, see the detailed reference: core, hyperon, edsl, node and browser, grapher, py, prolog, libraries, debug, and das-client and das-gateway.

PackageWhat it is
@mettascript/coreThe interpreter, parser, type system, and prelude. Zero platform dependencies, runs in any JavaScript runtime.
@mettascript/hyperonA TypeScript class API over the core (atoms, spaces, grounded operations).
@mettascript/edslAn ergonomic, typed eDSL: term builders, special-form combinators, and a tagged template.
@mettascript/nodeThe metta CLI, compatibility aliases, file import!, and the SharedArrayBuffer worker-thread parallel matcher.
@mettascript/browserBrowser entry point with an in-memory virtual file system for import! and optional host-runtime composition.
@mettascript/librariesThe PeTTa standard libraries as importable modules (vector, roman, nars, pln, and more), loaded automatically by node, hyperon, and browser.
@mettascript/pyPython interop: PeTTa's py-call and Hyperon's py-atom, over pythonia in Node or Pyodide in the browser. Opt-in and async.
@mettascript/prologProlog interop: PeTTa-compatible predicate calls, prolog-call, and import_prolog_function over SWI-Prolog or SWI-WASM.
@mettascript/grapherMeTTaGrapher: a visual editor plus browser and headless Node reduction-GIF rendering over the same core trace.
@mettascript/debugThe debugger engine behind metta debug: the execution-trace bus, explainCall/why, and trace summaries. Depends only on the core.
@mettascript/das-clientClient for SingularityNET's Distributed AtomSpace.
@mettascript/das-gatewayA transport-agnostic gateway bridging the browser to a Distributed AtomSpace.

How they fit together

@mettascript/core is the language engine: parse, evaluate, match, type-check, and the prelude. The standard libraries live in @mettascript/libraries, which the node, hyperon, and browser packages load for you, so running MeTTa through any of those resolves (import! &self pln) and the rest. If you use bare core, register the libraries first with registerLibraries() from @mettascript/libraries.

@mettascript/hyperon and @mettascript/edsl are two TypeScript-facing layers over the core. The hyperon package mirrors the Python API (a MeTTa runner, S/V/E/G atom constructors, grounded operations). The eDSL is the more idiomatic, typed way to build and run MeTTa from TypeScript.

@mettascript/node and @mettascript/browser are platform entry points: the Node package adds the CLI, file imports, and the worker-thread matcher; the browser package adds an in-memory file system. Both re-export the core.

@mettascript/grapher is the visual editor, MeTTaGrapher. It renders a program as a node graph or nested blocks and runs it on the core, so it is a view over atoms rather than a second engine. The @mettascript/grapher/node entry exports the same reduction as GIF bytes without mounting the editor or creating a browser DOM.

@mettascript/py and @mettascript/prolog are optional host interop packages. Python reaches CPython through pythonia in Node or Pyodide in the browser. Prolog reaches SWI-Prolog through a local swipl executable in Node or swipl-wasm in the browser. Both run asynchronously, and both keep the normal interpreter path free of host runtimes. See Python interop and Prolog interop.

@mettascript/debug is the engine behind the metta debug CLI: it records the evaluator's trace bus and explains why a call reduced the way it did. It depends only on the core and uses no Node APIs, so an editor or tool can drive it directly.

@mettascript/das-client and @mettascript/das-gateway are optional, for querying a remote Distributed AtomSpace.

Versioning and license

All packages are released together under the @mettascript scope and the MIT license.

Released under the MIT License.