class CrystalWamr::WASM
- CrystalWamr::WASM
- Reference
- Object
Defined in:
crystal_wamr.crInstance Method Summary
- #add_to_hash(name, value)
-
#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}
- #exec_json(config : CrystalWamr::WamrConfig, path : String, functions = Hash(String, Array(Int32)).new, output = Hash(String, String).new)
-
#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 ```
- #function_args(value : Int32, variable : String | Nil, sys, functions, index, output, path)
- #function_args(value : Nil, variable : String, sys : CrystalWamr::Sys, functions, index, output, path)
- #function_args(value : Nil, variable : String, sys : Nil, functions, index, output, path)
- #function_args(value : Nil, variable : String | Nil, sys : Nil, functions, index, output, path)
- #function_args(value : Nil, variable : String | Nil, sys, functions, index, output, path)
- #native_functions(sys, functions, index, url_path : String)
- #native_functions(sys, functions, index, url_path : Array(Int32))
- #return_hash
Instance Method Detail
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}
def exec_json(config : CrystalWamr::WamrConfig, path : String, functions = Hash(String, Array(Int32)).new, output = Hash(String, String).new)
#
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
def function_args(value : Int32, variable : String | Nil, sys, functions, index, output, path)
#
def function_args(value : Nil, variable : String, sys : CrystalWamr::Sys, functions, index, output, path)
#
def function_args(value : Nil, variable : String, sys : Nil, functions, index, output, path)
#
def function_args(value : Nil, variable : String | Nil, sys : Nil, functions, index, output, path)
#
def function_args(value : Nil, variable : String | Nil, sys, functions, index, output, path)
#