How jazzbox35/metta-wam works
Out the Major Components
• WAM Integration: The project is specifically designed to run on the Warren Abstract Machine using a SWI–Prolog base (often with Janus support). This runtime is integrated with the core engine.
• REPL/CLI Interface: The command–line front end is provided by the “mettalog” (or “metta_repl”) command. This interface accepts user input, runs scripts (e.g., from examples/ and scripts/), and shows interactive evaluations.
• Test and Development Suite: There is a comprehensive set of tests and examples (in directories like tests/, examples/, notebooks/) that serve for both validation and demonstration. Continuously integrated reports and Docker support further affirm a robust testing pipeline.
• External & Integration Layers:
– Python Integration: The python/ folder contains modules (hyperon_ref, mettalog, sandbox directories, integration tests) that provide wrappers and extensions to run or interoperate with MeTTa code.
– Jupyter Kernel: There is a dedicated “metta_jupyter_kernel.py” so that developers can work in notebooks, leveraging the language interactively.
– Additional Libraries: Various libraries (e.g., bioAS, dictoo, logicmoo_utils, swicli, predicate_streams) extend or support functionalities (sometimes domain–specific, like integration with FlyBase or graph loaders) and allow for extensibility.
• Docker & Installation: The presence of the Dockerfile, INSTALL.sh/INSTALL.BAT and CI scripts means the project supports containerized runs and multiple-platform deployment.
• Language Server (LSP): There is an LSP component (see libraries/lsp_server_metta) that helps with editor integration and better developer experience.
Interactions and Data Flow
• The user (via CLI, IDE, or Jupyter) interacts with the REPL/CLI front end.
• Input “.metta” files are parsed and handed off to the Core Engine for compilation and/or interpretation.
• The Compiler component takes code, translates it (possibly with optimizations or transpilation routines), and passes it to the interpreter.
• The Interpreter evaluates code on the WAM backend supported by SWI–Prolog libraries.
• Testing modules, continuous integration scripts and Docker scripts interact with the core engine to run automated tests and generate reports.
• Integration layers (Python, LSP, notebooks) serve as adapters that bridge MeTTa functionalities with external ecosystems.
Architectural Patterns and Design Principles
• Modular Separation: The design clearly separates the interpreter, compiler, debugger, loader and other utility routines. Each of these is its own module (or group of modules), often written in Prolog or in Python.
• Extensibility and Interoperability: In addition to its core functionality, the project is designed to support language extensions, external integrations (via Python bindings, Jupyter kernel, LSP) and external libraries.
• Containerization & Automated Testing: The Dockerfile and various CI scripts indicate an agile development approach based on containerized, repeatable builds and test runs.
• Multi-language Support: Although the core language is implemented in Prolog/Metta, there is strong interoperability with Python (as evidenced by the extensive python folder structure) and even hints of Rust support (e.g., the rust-wam directory).
Final Checklist for the Principal Software Engineer
• Notes on key design principles (modular separation, containerization, automated testing, multi–language support).
• External services (like Docker, version control/CI, external libraries) with additional annotations.