MeTTa Programming Language

MeTTa (Meta-Type Talk) is a programming language designed to be the native “language of thought” for AGI. It was designed to serve as the central cognitive calculus for the Hyperon AGI framework — a universal glue that allows diverse AI components (e.g. neural networks, probabilistic reasoners, evolutionary models, etc.) to communicate, collaborate, and synergistically integrate their capabilities.

Rooted in principles of both neural networks and symbolic reasoning, MeTTa unifies elements of functional programming (drawing inspiration from languages like Haskell, Idris, and Prolog), logic programming, and dependent typing.

Unlike general-purpose languages, MeTTa was designed to operate natively over cognitive structures — atoms (symbolic data representations), types (formal categories), and transformations — which are stored in a dynamic knowledge metagraph known as an Atomspace. Within this framework, code and data are interchangeable. This design enables:

  • Interoperability: MeTTa acts as a shared medium and translator for diverse AI systems — a lingua franca for them to not just “plug in” but seamlessly interoperate. It’s a substrate for any species of AI subsystems or paradigms to flow together and combine, allowing their unique capabilities to be expressed, executed, and coherently orchestrated across distributed, interoperable networks.
  • Concurrency: Leverages a higher-order rho-calculus foundation to treat programs as asynchronous processes that intelligently execute in parallel without blocking. Its systems utilize parallelized backtracking to scale these computations across multi-core and distributed architectures with near-linear performance.
  • Security and Auditability: Employs a “by-construction” security model to ensure access rights are unforgeable and mathematically verifiable. Within decentralized networks, all state updates are fully transactional and atomic, maintaining a high-integrity, auditable record of all cognitive transformations.
  • Reflective Self-Modification: Programs can inspect, analyze, and rewrite themselves at runtime. This “reflection” is critical for an AGI to learn, adapt, and evolve its own cognitive processes.
  • Flexible Reasoning: The language’s structure allows for dynamic type introspection and the programmatic manipulation of its own knowledge and logic.
  • Nondeterminism/Determinism: Operates inherently as a non-deterministic inference engine, enabling massive-scale parallel search and “lazy” incremental answer discovery across the metagraph. Efficiency is achieved through smart compilers that resolve symbolic data versus executable functions, while low-level kernels allow for explicit, deterministic control-flow in compute-intensive tasks.

Hyperon Experimental

Hyperon-Experimental is the original reference implementation of MeTTa, serving as the “master blueprint” for the language and the primary engine for R&D. Built in Rust, it is designed for maximum extensibility.

A notable characteristic is its deep Python integration, which enables a hybrid development model where MeTTa and Python code can interoperate seamlessly within the same application. This provides the leverage of the entire Python ecosystem, including its vast AI, data science, and machine learning libraries, directly within MeTTa’s symbolic reasoning framework.

Furthermore, Hyperon-Experimental is engineered as an extensible library with a C API, allowing it to be integrated with programs written in other languages like C or C++. While this architecture is robust and forward-looking, it intentionally prioritizes flexibility and semantic correctness over raw execution speed. As a result, it has merit for conducting small experiments but does not, at present, provide production-grade performance.

Repositories

ROADMAP
  • Add capability to integrate various expression evaluation mechanisms
  • Integration of Prolog VM-based modules
  • Release Python packages for Windows
  • Address inefficient variable bindings for performance improvement

PeTTa is a high-performance compiler and runtime for the MeTTa language, designed to execute complex symbolic AI code at speeds required for real-time applications like robotics and large-scale reasoning. It achieves this by translating MeTTa source code directly into highly optimized Prolog.

Its core innovation is a “Smart Dispatch” compiler, which intelligently solves the key challenge of deciding whether a piece of MeTTa code is a function to be executed or a piece of data to be structured. By eliminating the slow, “check-at-runtime” (dynamic dispatch) methods used by typical interpreters, PeTTa generates code that achieves execution speeds comparable to handwritten, idiomatic Prolog.

Crucially, it fully adheres to the Hyperon-Experimental (HE) semantics, ensuring it is a correct and compatible implementation while providing a massive performance boost. It is also fully interoperable with high-performance backends, capable of manipulating MORK spaces and executing MM2 expressions directly from MeTTa code.

This makes PeTTa an essential component for running computationally intensive symbolic architectures—like MeTTa-NARS and PLN—in production, bridging the gap from research-grade interpretation to real-world, high-speed deployment.

Repositories

Documentation

Continue Reading

MeTTaLog (Legacy)

MeTTaLog, developed by Douglas Miles and LogicMoo, served as a vital intermediate engine grounded in the Warren Abstract Machine (WAM)—the long-standing standard for logic programming. It successfully validated the potential for concurrent symbolic execution, yet the unique demands of neural-symbolic interoperability eventually exposed the rigidities of a pure WAM approach when scaling for AGI.

This inspired a strategic pivot to PeTTa, which derives its architecture from the ZIP Virtual Machine used by SWI-Prolog. The ZIP model offers superior handling of the dynamic, non-deterministic workloads essential to the Hyperon ecosystem. Consequently, PeTTa’s ZIP-inspired foundation was selected as the optimal path to secure the high-performance integration required for future AGI capabilities.

Papers & Publications

Extends the MeTTa language with concurrent operations and runtime answer pruning, enabling multi-threaded evaluation, dynamic clause filtering, and adaptive control over nondeterministic result sets during inference:

Continue Reading

JeTTa is an experimental MeTTa compiler developed for the Java Virtual Machine (JVM) using Kotlin. It leverages the JVM’s mature architecture to support high-performance multithreading and custom Space implementations. By utilizing extensive program transformations for optimization, JeTTa offers a pathway to deploy Hyperon within scalable, multiprocessor enterprise environments.

Continue Reading

MeTTa-Morph is a macro-based translator from MeTTa to (Chicken) Scheme, designed to significantly accelerate execution of a practical subset of the MeTTa language. Rather than supporting full language coverage, it focuses on compiling a performant core of MeTTa constructs into an efficient Scheme library, achieving speedups on the order of 100x.

MeTTa-Morph transforms MeTTa code into Scheme using macros corresponding to core MeTTa constructs, including function definitions, variable binding, query execution, pattern matching, type-related constructs, and space operations such as collapse and superposition. The generated Scheme code can be compiled to C and ultimately to native machine code.

Continue Reading

Start here — Primer: MeTTa Primer — a plain-language, hands-on course: evaluation, pattern matching, types, the standard library, and using MeTTa from Python.

Technical Deep Dive: MeTTa Programming Language — operational semantics, rho-calculus foundation, MeTTa-IL compilation stack, Space API, and 7 implementation anchors.