Open jeromesimeon opened 4 years ago
Things we might need to get this working:
I would like to work on this project.
Great @AnalystAbhishek! If you're interested in the GSoC project around WASM, be sure to look into the resources we have pinned in our slack channel.
Yeah I'm already going through the post shared by Dan and Jerome on slack channel.
I'have finished my first task of understanding the whole documentation of Accord Project and has a prior knowledge on WASM as well as Ocaml. I have also set up the enviroment to start work on it, should I start making purposal ?
Some notes from today's discussion on the WASM backend.
ImpWasm = Imp over EJson+SumTypes (i.e., do not encode left/right as objects) @jeromesimeon
Mini compiler: take imp_ejson AST (just constant + a few operators) and compile to WASM AST + (static) link runtime + run @pkel
Grow the runtime supported (& decide which runtime operators can be eliminated by the compiler) @pkel
Grow the subset of imp_ejson AST being compiled
WASM doesn't support block-level scoping (not 'let' only 'var')
Imp supports block-level scoping. e.g.,:
{ let x = 1;
let y = 3;
{ let x = 2;
x + y } }
Maybe removed by renaming/blocks merging:
{ let x1 = 1 ;
let y = 3;
let x2 = 2;
x2 + y }
Examples of runtime operators
concat: [a:1,b:2] + [c:3] ==> [a:1,b:2,c:3]
concat: [a:1,b:2] + [c:3,b:4] ==> [a:1,c:3,b:4]
merge: [a:1,b:2] + [c:3] ==> some([a:1,b:2,c:3])
merge: [a:1,b:2] + [c:3,b:2] ==> some([a:1,b:2,c:3])
merge: [a:1,b:2] + [c:3,b:4] ==> none
nth: [1,2,3] + 0 ==> some(1)
nth: [1,2,3] + 3 ==> none
Todo list, based on latest development in Q*cert (wasm
branch) and Ergo (release-1.0
branch) :
release-1.0
branch of Ergo to build on the wasm
branch of Q*cert (requires per-module extraction)-target wasm
option to the Ergo compiler, hook it up to a corresponding ErgoImptoWasm
translation backed up by your compiler
-target imp_ejson
option to the Ergo compiler? Along with a proper pretty printer consistent with the new imp_ejson
syntax we saw in the demorelease-1.0
of Ergo to use the latest development version of Concerto (alpha of Concerto 1.0)release-1.0
branch of Ergo into masterwasm
branch of Qcert into master
; publish Q\cert ; publish Concerto ; publish Ergo
Is your feature request related to a problem? Please describe.
Would anyone like to call Wasm from Ergo?
Describe the solution you'd like
A way to call Wasm modules from Ergo contracts.
Additional context
WASM specification: https://webassembly.github.io/spec/core/
Reference implementation in OCaml: https://github.com/WebAssembly/spec
WASM/JS interface: https://webassembly.github.io/spec/js-api/index.html
Interesting bits about WASM/JS interop performances: https://hacks.mozilla.org/2018/10/calls-between-javascript-and-webassembly-are-finally-fast-🎉/