MeTTa Programming Language

MeTTa (Meta-Type Talk) is a programming language designed to be the native "language of thought" for AGI. Rooted in principles of both neural networks and symbolic reasoning, MeTTa unifies elements of functional programming, logic programming, and dependent typing. Unlike general-purpose languages, MeTTa operates natively over cognitive structures — atoms, types, and transformations — stored in a dynamic knowledge metagraph known as an Atomspace.

Hyperon Experimental

Responsible: Vitaly Bogdanov, Alexey Potapov

Hyperon-Experimental is the original reference implementation of MeTTa, built in Rust for maximum extensibility. It features deep Python integration for hybrid development and a C API for integration with other languages. It prioritizes flexibility and semantic correctness over raw execution speed.

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
</> Example Implementation
Hello World in MeTTa
A simple introduction to MeTTa syntax showing expression evaluation and pattern matching over a knowledge base.
; Basic MeTTa expression evaluation !(+ 1 2) ; => 3 ; Define a knowledge base (= (parent Tom Bob)) (= (parent Bob Sam)) ; Query relationships !(match &self (= (parent Tom $x)) $x) ; => Bob
Type-checked functions
Demonstrates MeTTa's dependent type system with a recursive factorial function.
; Define typed functions (: factorial (-> Number Number)) (= (factorial 0) 1) (= (factorial $n) (* $n (factorial (- $n 1)))) !(factorial 5) ; => 120
Atom manipulation
Shows how to dynamically add and query atoms in the Atomspace.
; Add atoms to the space !(add-atom &self (likes Alice Chess)) !(add-atom &self (likes Bob Music)) ; Query all likes !(match &self (likes $who $what) ($who enjoys $what))

Technical Deep Dive: Hyperon Experimental Full — Rust core architecture, Python bindings, C API, dependent type system, and implementation findings.

Responsible: Patrick Hammer

PeTTa is a high-performance compiler and runtime for MeTTa, translating source code into optimized Prolog. Its 'Smart Dispatch' compiler eliminates slow dynamic dispatch methods, achieving execution speeds comparable to handwritten Prolog while fully adhering to Hyperon-Experimental semantics.

</> Example Implementation
PeTTa smart dispatch
PeTTa's Smart Dispatch compiler translates MeTTa patterns directly into indexed Prolog clauses for maximum performance.
; PeTTa compiles MeTTa to optimized Prolog ; Smart Dispatch eliminates dynamic overhead (= (fibonacci 0) 0) (= (fibonacci 1) 1) (= (fibonacci $n) (+ (fibonacci (- $n 1)) (fibonacci (- $n 2)))) !(fibonacci 10) ; => 55 ; Runs at native Prolog speed

MeTTaLog (Legacy)

Responsible: Douglas Miles

MeTTaLog served as a vital intermediate engine grounded in the Warren Abstract Machine (WAM). It validated concurrent symbolic execution potential but inspired the strategic pivot to PeTTa's ZIP Virtual Machine architecture for superior handling of dynamic, non-deterministic workloads.

</> Example Implementation
WAM-based execution
Demonstrates MeTTaLog's WAM-grounded execution model for concurrent symbolic computation.
; MeTTaLog executes on the Warren Abstract Machine ; Concurrent symbolic evaluation !(sequential (add-atom &self (concept A)) (add-atom &self (concept B)) (match &self (concept $x) $x)) ; => [A, B]

Responsible: Vitaly Khudobakhshov, Vita Potapova, Alexey Potapov

JeTTa is an experimental MeTTa compiler for the JVM using Kotlin. It leverages the JVM's mature architecture for high-performance multithreading and custom Space implementations, offering a pathway to deploy Hyperon in enterprise environments.

</> Example Implementation
JVM-based MeTTa
Shows JeTTa's approach to parallel computation using JVM's mature threading infrastructure.
; JeTTa runs MeTTa on the JVM via Kotlin ; Leverages JVM threading and GC (= (parallel-map $f ()) ()) (= (parallel-map $f ($x . $rest)) ((apply $f $x) . (parallel-map $f $rest))) !(parallel-map (lambda $x (* $x $x)) (1 2 3 4 5)) ; => (1 4 9 16 25)

Responsible: Patrick Hammer, Peter Isaev

MeTTa-Morph is a macro-based translator from MeTTa to Chicken Scheme, achieving ~100x speedups. The generated Scheme code can be compiled to C and native machine code, loaded into the HE runtime as ordinary MeTTa functions with native-level performance.

</> Example Implementation
MeTTa to Scheme compilation
MeTTa-Morph achieves dramatic speedups by compiling MeTTa through Scheme to native machine code.
; MeTTa-Morph translates to Chicken Scheme ; Then compiles to C -> native code (= (sum-list ()) 0) (= (sum-list ($h . $t)) (+ $h (sum-list $t))) !(sum-list (1 2 3 4 5)) ; => 15 ; ~100x speedup via native compilation

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