Introducing 𝙃𝙮𝙥𝙚𝙧𝙎𝘿𝙆 𝙋𝙧𝙤𝙜𝙧𝙖𝙢𝙨: A Minimal, Performance-Focused, WASM-Based Smart Contract Framework for @avax@AvaxDevelopersgithub.com/ava-labs/hypersdk/pull/360
Starting 𝙏𝙊𝘿𝘼𝙔, you can write HyperSDK Programs in #Rust using the 𝘿𝙚𝙫𝙚𝙡𝙤𝙥𝙚𝙧 𝙋𝙧𝙚𝙫𝙞𝙚𝙬 🏗️ .
First, why "Programs" and not "Smart Contracts"?
This is about "familiarity". When new developers hear "smart contract" for the first time, they have no idea what I'm talking about.
"Programs" convey that if you know how to code, you can do this. That's exactly what we want.
So, how do these newfangled HyperSDK Programs look? Not newfangled 😉.
It is difficult/expensive to reach mass adoption if devs have to learn a new language/use odd dialects of existing languages to deploy their code.
HyperSDK Programs meet devs where they are. It's minimal.
Everything HyperSDK is performance-driven and Programs are no exception.
To avoid the biggest bottlenecks devs typically run into when using WASM (memory allocation and serialization), complex objs are never injected into the execution environment (just a reference to them).
twitter.com/_patrickogrady/status/1628109794732298241
The primary "learning curve" for HyperSDK Programs relates to storing/interacting with variables in state.
Normally, interacting with complex objects in Rust (or other languages) is just done "in memory" (ex: a map lives on the heap). Not here.
Rust not your jam (hint: don't tell a Rust dev that) ?
WASM compilation is supported by many languages. We only have a Rust SDK for now but look forward to community SDKs that unblock development in C/C++/Zig/TinyGo 🤓 .
What can/can't you do 𝙏𝙊𝘿𝘼𝙔? (i.e. What's a "Developer Preview"?)
You **can** write your own HyperSDK Programs and run them in a basic WASM runtime.
You **can't** deploy HyperSDK Programs on-chain (yet).
With any new framework, community feedback early and often is critical for world-class DX.
Although the runtime isn't complete/performant yet, we wanted to shift development into the open as soon as there was a basic foundation to build on.
Let us know what could be better!
Concurrently, we are working on a minimal (strip out all unnecessary WASM functionality), metered, deterministic, Golang WASM runtime to execute these programs based on Wazero (github.com/ava-labs/wazero).
If you'd like to get involved in this effort, please let us know!
Other future work includes (but not limited to):
* Program Constraints (enforce end conditions to protect against bugs)
* Multi-Dimensional Fee Pricing (charge for each resource independently): github.com/ava-labs/hypersdk/pull/352
* Use State Keys to Create Parallel Execution Tree
Check out my talk at Summit II if you want more context on the HyperSDK and HyperSDK Programs:
Lastly, **HUGE** shoutout to @samlioku and @hexfusion for taking this project from a list of bullets I had on paper into an E2E Developer Preview. ❤️
Stay tuned for @samlioku's deep dive later today!