go:wasmexport: unsupported parameter type
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start with the supported and unsupported parameter-type test linked in Go change 611315, then review the wasmexport signatures shown in this issue. Validate any proposed direction through the reactor host setup and a call to the exported function; done means the affected bindings can use the needed parameter types successfully.
Written by the indexing model from the issue text.
Description
Work is being done in Go 1.24 to support go:wasmexport.
However, there are a handful of unsupported parameter types. The following test shows the supported and unsupported types https://go-review.googlesource.com/c/go/+/611315
*string, and *uint8 are examples I have run into with the current wit-bindgen-go bindings.
Is it a possible solution to use unsafe.Pointer and convert the parameters to their necessary types?
I.e
Breaking
//go:wasmexport count
//export count
func wasmexport_Count(s0 *uint8, s1 uint32, sub0 *uint8, sub1 uint32) (result0 uint32) {
s := cm.LiftString[string]((*uint8)(s0), (uint32)(s1))
sub := cm.LiftString[string]((*uint8)(sub0), (uint32)(sub1))
result := Exports.Count(s, sub)
result0 = (uint32)(result)
return
}
Possible workaround
//go:wasmexport count
//export count
func wasmexport_Count(s0 unsafe.Pointer, s1 uint32, sub0 unsafe.Pointer, sub1 uint32) (result0 uint32) {
s := cm.LiftString[string]((*uint8)(s0), (uint32)(s1))
sub := cm.LiftString[string]((*uint8)(sub0), (uint32)(sub1))
result := Exports.Count(s, sub)
result0 = (uint32)(result)
return
}
I am still working through a test to ensure this functionality works. I am currently working through the reactor host setup to call the exported function.
- Dominant language
- Go
- Stars
- 148
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bytecodealliance/go-modules
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
bytecodealliance/go-modules#428 · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
bytecodealliance/go-modules#411 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
bytecodealliance/go-modules#410 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
bytecodealliance/go-modules#394 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
bytecodealliance/go-modules#377 · 1 comment ·
All issues in bytecodealliance/go-modules
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·