How metacall/core works
Main Components
• Core MetaCall Engine: Represent the central runtime component (e.g. the “metacall” core, found in source/metacall) which acts as the central dispatcher. This subsystem is responsible for managing type conversions, error handling, inter-language communication, and overall lifecycle.
• Plugin Architecture: Highlight the plugin system (source/plugin and source/plugins) where additional functionality can be added dynamically.
• Configuration and Environment: Include the configuration system (source/configuration) and environment management (source/environment) that allow customization of runtime behavior.
• Auxiliary Services: Represent supporting layers such as logging (source/log), memory management (source/memory), file system integration (source/filesystem), dynamic linking (source/dynlink), portability (source/portability), and reflection (source/reflect).
• CLI & Tools: Separate out the command-line interface component (source/cli) and developer tools, which include build scripts, CMake configuration, and Docker integration (as seen in Dockerfile, docker-compose files, and tools/).
Relationships and Interactions
• Plugin extension point where additional functionalities or even new loaders can be integrated at runtime.
• Interconnections with configuration management that feeds execution parameters (for instance, the configuration system passes details to the engine and language loaders).
• Interfaces between the memory management, logging, and portability layers with the core engine.
Architectural Patterns and Design Principles
• Modular Design: Emphasize that each language loader is self-contained and designed to interface with the core engine.
• Separation of Concerns: The core engine handles inter-language orchestration while each language loader encapsulates language-specific runtime logic.
• Interoperability: Highlight how the system abstracts language differences, providing a unified API to the developer.