11 unstable releases (4 breaking)
|0.5.1||Sep 21, 2023|
|0.4.0||Aug 9, 2023|
|0.3.2||Sep 13, 2022|
|0.3.0||Jul 27, 2022|
|0.1.1||May 14, 2021|
#1084 in Magic Beans
1,402 downloads per month
Used in 10 crates (5 directly)
AquaVM executes compiled Aqua, i.e., Aqua Intermediate Representation (AIR) scripts, and plays an integral role in the implementation of the Fluence peer-to-peer compute protocol. Specifically, AquaVM allows expressing network choreography in scripts and composing distributed, peer-to-peer hosted services. Moreover, AquaVM plays a significant role in facilitating function addressability in the Fluence network, see Figure 1.
Figure 1: Stylized AquaVM And AIR Model
Since AquaVM compiles to Wasm, it can run in both client, such as browsers and Node.js apps, and server environments.
AquaVM: Interpreter Execution Model
AquaVM's execution model facilitates Fluence protocol's data push model implemented as a particle, i.e., a smart packet comprised of data, AIR, and some metadata. In this context, AquaVM can be viewed as a pure state transition function that facilitates particle updates, which includes state management of particle data by taking previous and current state to produce a new state and an updated list of peers and call requests in the remaining AIR workflow. In addition to local service call execution, AquaVM handles requests from remote peers, e.g., as a part of a parallel execution block, to call local services and handle the future response, see Figure 2.
Figure 2: AquaVM Interpreter Execution Model
In summary, the AquaVM execution model handles the topological hops for simple and advanced composition patterns, such as (async) parallel service execution on one or multiple peers.
Aquamarine Intermediate Representation (AIR): IR for P2P Systems
AIR is an S-expression-based low-level language with binary form to come. It currently consists of fourteen instructions with more instructions to come. Semantics of AIR is inspired by π-calculus, λ-calculus, and category theory. Its syntax is inspired by Wasm Text Format (WAT) and Lisp. AIR scripts control the Fluence peer-to-peer network, its peers and even resources on other (p2p) networks, such as IPFS and Filecoin, e.g., Fluence IPFS library through Marine adapter services.
- air is the core of AquaVM
- air-interpreter is a crate to support different compilation targets (Marine and wasm-bindgen)
- air-lib contains all main crates for the core of AquaVM
- beautifier is an implementation of AIR-beautifier
- data-store defines a
DataStoretrait used by the Fluence node
- interpreter-wasm is a crate for better integration of compiled Wasm code into the Fluence node
- testing-framework is an implementation of the framework that improves test writing experience
- tools contains AquaVM-related tools
Any interested person is welcome to contribute to the project. Please, make sure you read and follow some basic rules.
All software code is copyright (c) Fluence Labs, Inc. under the Apache-2.0 license.