Architecture
Marine
follows the layered architecture pattern allowing developers to use components with different abstraction layers to fit their purpose:
In this chapter, we briefly discuss these Marine components.
Core
The core comprises the lower-level component of Marine
to expose the API that allows developers to load
, unload
, and call
modules as well as obtain information concerning their states such as WASI state, module interfaces (all export functions), and heap usage statistics. Internally, it interprets interface-types instructions providing module-module and module-host value passing scheme.
The runtime component compiles to Wasm and is used in marine-js as a so-called control module sharing the same code for marine and marine-js targets.
This component is also used in the Rust and Javascript environments as well as Marine and Marine-JS.
Marine
Marine extends the core component with the following features:
- can be called with json-based arguments (
call_with_json
API) - provides an internal mechanism for handling host imports
- defines three host imports for logging, call parameters, and mounted binary interface
Marine-js
Provides the basic Marine functionality for the browser and node.js targets. Marine-js is currently under active development and exposes only a basic core API and supports only single-module service.