Stream: git-wasmtime

Topic: wasmtime / issue #7960 .wat


view this post on Zulip Wasmtime GitHub notifications bot (Feb 20 2024 at 12:24):

996ccs opened issue #7960:

I have a question. There are many .wats in the example, such as gcd.wat.
(module
(func $gcd (param i32 i32) (result i32)
(local i32)
block ;; label = @1
block ;; label = @2
local.get 0
br_if 0 (;@2;)
local.get 1
local.set 2
br 1 (;@1;)
end
loop ;; label = @2
local.get 1
local.get 0
local.tee 2
i32.rem_u
local.set 0
local.get 2
local.set 1
local.get 0
br_if 0 (;@2;)
end
end
local.get 2
)
(export "gcd" (func $gcd))
)

how is it generated? I tried to use the wasm file to convert it into a .wat file, but the content code of the converted .wat file was very long and large. Running will also report an error

I use golang and rust to compile wasm
How can I generate a short and concise .wat code like gcd.wat?


Last updated: Oct 23 2024 at 20:03 UTC