{"id":13892958,"url":"https://github.com/fluencelabs/aquavm","last_synced_at":"2025-07-17T06:31:53.718Z","repository":{"id":37744333,"uuid":"296596748","full_name":"fluencelabs/aquavm","owner":"fluencelabs","description":"AquaVM interprets AIR – a π-calculus-derived set of instructions that the Aqua language compiles to","archived":false,"fork":false,"pushed_at":"2024-09-28T01:17:58.000Z","size":22467,"stargazers_count":147,"open_issues_count":34,"forks_count":14,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-15T10:33:11.560Z","etag":null,"topics":["interpreter","pi-calculus","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fluencelabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-18T11:05:41.000Z","updated_at":"2024-09-07T08:56:43.000Z","dependencies_parsed_at":"2023-10-14T03:06:25.335Z","dependency_job_id":"867be3f9-67cf-4774-af18-d22268de425b","html_url":"https://github.com/fluencelabs/aquavm","commit_stats":{"total_commits":728,"total_committers":21,"mean_commits":"34.666666666666664","dds":0.8186813186813187,"last_synced_commit":"db96111c37ed615b50592ba2a6c9954386a42cfc"},"previous_names":["fluencelabs/aquamarine","fluencelabs/air"],"tags_count":628,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluencelabs%2Faquavm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluencelabs%2Faquavm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluencelabs%2Faquavm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluencelabs%2Faquavm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluencelabs","download_url":"https://codeload.github.com/fluencelabs/aquavm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226226465,"owners_count":17592382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["interpreter","pi-calculus","webassembly"],"created_at":"2024-08-06T17:01:20.961Z","updated_at":"2024-11-24T20:31:57.344Z","avatar_url":"https://github.com/fluencelabs.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# AquaVM\n\n[![crates.io version](https://img.shields.io/crates/v/air-interpreter-wasm?style=flat-square)](https://crates.io/crates/air-interpreter-wasm)\n[![npm version](https://img.shields.io/npm/v/@fluencelabs/avm)](https://www.npmjs.com/package/@fluencelabs/avm)\n[![Coverage Status](https://coveralls.io/repos/github/fluencelabs/aquavm/badge.svg?branch=master)](https://coveralls.io/github/fluencelabs/aquavm?branch=master)\n\nAquaVM executes compiled [Aqua](https://github.com/fluencelabs/aqua), i.e., Aqua\nIntermediate Representation (AIR) scripts, and plays an integral role in the\nimplementation of the [Fluence](https://fluence.network) peer-to-peer compute\nprotocol. Specifically, AquaVM allows expressing network choreography in scripts\nand composing distributed, peer-to-peer hosted services. Moreover, AquaVM plays\na significant role in facilitating _function addressability_ in the Fluence\nnetwork, see Figure\u0026nbsp;1.\n\n\u003cimg alt=\"AquaVM \u0026 AIR model\" src=\"images/aquavm_air_model.png\" /\u003e\n\n**Figure 1: Stylized AquaVM And AIR Model**\n\nSince AquaVM compiles to Wasm, it can run in both client, such as browsers and\nNode.js apps, and server environments.\n\n## AquaVM: Interpreter Execution Model\n\nAquaVM's execution model facilitates Fluence protocol's data push model\nimplemented as a _particle_, i.e., a smart packet comprised of data, AIR, and\nsome metadata. In this context, AquaVM can be viewed as a pure state transition\nfunction that facilitates particle updates, which includes state management of\nparticle data by taking previous and current state to produce a new state and an\nupdated list of peers and call requests in the remaining AIR workflow. In\naddition to local service call execution, AquaVM handles requests from remote\npeers, e.g., as a part of a parallel execution block, to call local services and\nhandle the future response, see Figure\u0026nbsp;2.\n\n\u003cimg alt=\"interpreter execution model\" src=\"images/interpreter_execution_model.png\"/\u003e\n\n**Figure 2: AquaVM Interpreter Execution Model**\n\nIn summary, the AquaVM execution model handles the topological hops for simple\nand advanced composition patterns, such as (async) parallel service execution on\none or multiple peers.\n\n## Aquamarine Intermediate Representation (AIR): IR for P2P Systems\n\nAIR is an [S-expression](https://www.s-expressions.org/home)-based low-level\nlanguage with binary form to come. It currently consists of fourteen\ninstructions with more instructions to come. Semantics of AIR is inspired by\n[π-calculus](https://en.wikipedia.org/wiki/%CE%A0-calculus),\n[λ-calculus](https://en.wikipedia.org/wiki/Lambda_calculus), and\n[category theory](https://en.wikipedia.org/wiki/Category_theory). Its syntax is\ninspired by\n[Wasm Text Format](https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format)\n(WAT) and [Lisp](https://en.wikipedia.org/wiki/Lisp_(programming_language)). AIR\nscripts control the Fluence peer-to-peer network, its peers and even resources\non other (p2p) networks, such as IPFS and Filecoin, e.g.,\n[Fluence IPFS library](https://fluence.dev/docs/aqua-book/libraries/aqua-ipfs)\nthrough Marine adapter services.\n\nA description of AIR values and a list of AIR instructions together with\nexamples of their usage can be found [here](./docs/AIR.md). The main properties\nof AIR and its interface are discussed [here](./air/README.md).\n\nA complete list of AIR instructions with examples of their usage can be found\n[here](./docs/AIR.md). The fundamental contracts of the AquaVM interface, along\nwith a more detailed interaction scheme can be found [here](./air/README.md).\n\n## Repository Structure\n\n- [**air**](./air) is the core of AquaVM\n- [**air-interpreter**](./air-interpreter) is a crate to support different\n  compilation targets (Marine and wasm-bindgen)\n- [**avm**](./avm)\n  - [client](./avm/client) is an AquaVM launcher for browser and Node.js targets\n  - [server](./avm/server) is an AquaVM launcher for server-side targets\n- [**crates**](./crates)\n  - [air-lib](./crates/air-lib) contains all main crates for the core of AquaVM\n  - [beautifier](./crates/beautifier) is an implementation of AIR-beautifier\n  - [data-store](./crates/data-store) defines a `DataStore` trait used by the\n    Fluence node\n  - [interpreter-wasm](./crates/interpreter-wasm) is a crate for better\n    integration of compiled Wasm code into the Fluence node\n  - [testing-framework](./crates/testing-framework) is an implementation of the\n    framework that improves test writing experience\n- [**tools**](./tools) contains AquaVM-related tools\n\n## Support\n\nPlease, file an [issue](https://github.com/fluencelabs/aquavm/issues) if you\nfind a bug. You can also contact us at\n[Discord](https://discord.com/invite/5qSnPZKh7u) or\n[Telegram](https://t.me/fluence_project). We will do our best to resolve the\nissue ASAP.\n\n## Contributing\n\nAny interested person is welcome to contribute to the project. Please, make sure\nyou read and follow some basic [rules](./CONTRIBUTING.md).\n\n## License\n\nAll software code is copyright (c) Fluence DAO under the\n[AGPLv3](./LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluencelabs%2Faquavm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluencelabs%2Faquavm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluencelabs%2Faquavm/lists"}