class CrystalWamr::WASM

Defined in:

crystal_wamr.cr

Instance Method Summary

Instance Method Detail

def add_to_hash(name, value) #

[View source]
def exec(wasm_file : String, functions = Hash(String, Array(Int32)).new, output = Hash(String, String).new) #
wasm.exec(File.read("lib/crystal_wamr/array.wasm"), {
  "newarr"  => [5],
  "newarra" => [10],
  "newarrb" => [15],
  "count"   => [0],
  "first"   => [0],
  "last"    => [0],
})
p wasm.return_hash # {"newarr" => 5, "newarra" => 10, "newarrb" => 15, "count" => 3, "first" => 5, "last" => 15}

[View source]
def exec_json(config : CrystalWamr::WamrConfig, path : String, functions = Hash(String, Array(Int32)).new, output = Hash(String, String).new) #

[View source]
def exec_once(wasm_file : String, function_name : String, argv : Array(Int32)) #

p wasm.exec_once(File.read("lib/crystal_wamr/spec/fib.wasm"), "fib", [8]) # => 21


[View source]
def function_args(value : Int32, variable : String | Nil, sys, functions, index, output, path) #

[View source]
def function_args(value : Nil, variable : String, sys : CrystalWamr::Sys, functions, index, output, path) #

[View source]
def function_args(value : Nil, variable : String, sys : Nil, functions, index, output, path) #

[View source]
def function_args(value : Nil, variable : String | Nil, sys : Nil, functions, index, output, path) #

[View source]
def function_args(value : Nil, variable : String | Nil, sys, functions, index, output, path) #

[View source]
def native_functions(sys, functions, index, url_path : String) #

[View source]
def native_functions(sys, functions, index, url_path : Array(Int32)) #

[View source]
def return_hash #

[View source]