-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PoC: WebAssembly API #2760
base: master
Are you sure you want to change the base?
PoC: WebAssembly API #2760
Conversation
allow instantiating a module without imports and allow access to function exports
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:master commit a56e521 Collapsed results for better readability
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2760 +/- ##
==========================================
- Coverage 80.33% 80.33% -0.01%
==========================================
Files 390 393 +3
Lines 95921 96338 +417
==========================================
+ Hits 77060 77390 +330
- Misses 16138 16206 +68
- Partials 2723 2742 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
hi @turbolent thank you for adding a WebAssembly API to Cadence. |
Work towards #2853
Description
This PoC explores the idea of adding a WebAssembly API to Cadence, i.e. exposing a WebAssembly VM to Cadence programs.
The PRs adds:
A
WebAssembly
contract with an API inspired by the WebAssembly JavaScript Interface. The beginnings of the API support module instantiation, without imports, and access to function exports withi32
andi64
types.An implementation of the WebAssembly API based on wasmtime. The VM has been configured with some reasonable settings and limits, but need to be refined.
A test case which demonstrates loading a simple
add
(i32, i32) -> i32
function, calling it with CadenceUInt32
values, and getting back the result as a CadenceUInt32
.https://github.com/onflow/cadence/pull/2760/files#diff-27b18491bc5b8a8ea5aabf7d9453695aef776c0858db4c84eea0963717c296b5R201-R216
master
branchFiles changed
in the Github PR explorer