Closed tshort closed 6 years ago
This is a start at adding import and export sections to a wasm module. Imports could look something like the following on the Charlotte side:
@import env.sin(Float64)::Float64
This would become:
function sin(::Float64) Expr(:meta, (:env, :sin, Float64, Tuple{Float64})) nothing end
Then, that would be transformed into a call in wasm when sin is parsed. Instead of Julia types given above, those could be wasm types.
call
sin
Exports could be picked up as follows:
function mathfun(x) x + sin(x) end m = @wasm begin mathfun(Float64) # Enter more functions here... end write("test.wat", m)
Closing in favor of #6.
This is a start at adding import and export sections to a wasm module. Imports could look something like the following on the Charlotte side:
This would become:
Then, that would be transformed into a
call
in wasm whensin
is parsed. Instead of Julia types given above, those could be wasm types.Exports could be picked up as follows: