fermyon / spin-go-sdk

Spin Go SDK
5 stars 4 forks source link

Use `wit-bindgen-go` to generate go bindings given WIT interfaces #2

Open Mossaka opened 1 year ago

Mossaka commented 1 year ago

Hey there, I just want to throw an idea here and see if you like it.

wit-bindgen 0.8.0 release has the newest WIT syntax that comes with a go-bindgen, which I've contributed to. In addition, it seems to me that preview2 WIT interfaces in Spin are also updated to the newest syntax. It feels nautral to me that we should be starting using wit-bindgen-go to generate go bindings and then build a go SDK on top of them. It reduces maintainence cost, and reduces the time to write the bindings manually. The benefit of a SDk is that this could go completely transparent to the users of the Spin Go SDKs.

Does this sound like a good idea?

Disclaimer: I am the author of wit-bindgen-go crate in wit-bindgen

rylev commented 1 year ago

I think we'd definitely be in favor of that. We need to make sure that switching to wit-bindgen 0.8 is in working order which is being done in fermyon/spin#1599. I'll try to move the Go SDK over to using the Go support in wit-bindgen in that branch.

Mossaka commented 1 year ago

That's great to hear, @rylev ! Let me know if you ran into any issues with the generated bindings and feel free to raise issues to the wit-bindgen repo.

rajatjindal commented 1 week ago

I think this issue can be closed now in favor of using wasm-tools-go