(2024-03-27) Functions Everywhere Only Once Writing Functions For The Everywhere Computer
Functions Everywhere, Only Once: Writing Functions for the Everywhere Computer. Written by Fission's Brian Ginsburg and Zeeshan Lakhani.... The Everywhere Computer is a decentralized platform that aims to distribute computational tasks across a vast, open network. This network spans from your personal machine to other devices on your LAN, a cluster of cloud nodes, and even to PoPs (points of presence) located at the edge of the Internet.
At its core, the Everywhere Computer is built on the InterPlanetary Virtual Machine (IPVM) protocol
This system is powered by nodes running Fission's Homestar runtime, an engine that runs WebAssembly (Wasm) based workflows composed of Wasm components with runnable functions that can be scheduled and executed by any Homestar peer throughout the network.
Wasm components can be written in several different programming languages— including C/C++, Java (TeaVM Java), Go (TinyGo), and C#—but we'll focus on Rust, JavaScript, and Python for this post
Background: Wasm components, WIT, & WASI logging
Unlike core modules, components may not export Wasm memory, reinforcing Wasm sandboxing and enabling interoperation between languages with different memory assumptions.
In addition, while our Homestar runtime utilizes alternate formats as internal intermediate representations, by adopting WIT, we can interpret between WIT values and other data models at runtime
In the following sections, we will use WIT interfaces to define the types of our functions
In this post, we will write arithmetic operations in each source language
Our functions will be compiled into Wasm components using tools from or built upon the excellent work of the Bytecode Alliance
Rust
JavaScript
Python
For writing a function in Python, we will use componentize-py to generate a Wasm component
We recommend reading the Introducing Componentize-Py blog post for more information on writing Python-sourced components. Also, Introducing Componentize-Py: A Tool for Packaging Python Apps as Components is an excellent talk that explains how componentize-py works.
Workflows
Install EveryCLI, and then we'll write a workflow
Let's try a workflow that uses all four arithmetic operations from our Rust, JavaScript, and Python-sourced components
Conclusion
We have much more to share! We will write about the Control Panel, offloading compute to other nodes in a network based on their capability or a scheduling policy, and working with non-determinism like network requests and persistent state in a workflow in future posts.
Edited: | Tweet this! | Search Twitter for discussion