WebAssembly / stringref

Other
37 stars 2 forks source link

Does the interpreter support `stringref` yet? #52

Closed yviansu closed 2 years ago

yviansu commented 2 years ago

I have written a wast file according to the stringref spec.

(module
    (memory 10 10)
    (type $stringref_=>_none (func (param stringref)))
    (func $string.concat (param $a stringref)
        (drop
            (local.set $a 
                (string.concat
                    (local.get $a)
                    (string.const "foo")
                )
            )
        )
    )
)

However, when I run the wast file through the interpreter provided in the repo, it throws an error ../tests/stringref.wast:5.41-5.50: syntax error: unknown operator stringref, it seems that this interpreter does not support stringref.

Is there any other interpreter which support stringref?

jakobkummerow commented 2 years ago

Binaryen supports stringref (with --enable-strings); you can use that to convert .wast text to .wasm binary. V8 supports stringref (with --experimental-wasm-stringref); you can use that to execute .wasm binaries.

AFAIK the reference interpreter has not been updated yet.

yviansu commented 2 years ago

Got it! Thanks for your reply!