Home
This documentation (and the entire package) is a work in progress.
Public functions
WebAssemblyText.jl2wat — Functionjl2wat(path::AbstractString)Convert contents of a julia source code file to WebAssembly text.
Examples
julia> using WebAssemblyText
julia> wat = jl2wat("example.jl")
julia> println(wat)WebAssemblyText.jlstring2wat — Functionjlstring2wat(str::AbstractString)Convert a string of julia source code to WebAssembly text.
Examples
julia> using WebAssemblyText
julia> str="
hello(x) = 2.0*x
hello(1.0)
";
julia> wat = jlstring2wat(str);
julia> println(wat)(module
(func $hello (export "hello") (param $x f32) (result f32)
( return ( f32.mul (f32.const 2.0) (local.get $x) ) ))
)WebAssemblyText.@code_wat — Macro@code_wat expressionMacro for translating a single function without adding on imports and builtins.
Examples
julia> hello(x) = 3.1*x
julia> @code_wat hello(1.2)
(func $hello (export "hello") (param $x f32) (result f32)
(return (f32.mul (f32.const 3.1) (local.get $x))))