Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update .wit files to allow referencing between host and guest interfaces #271

Open
Forthoney opened this issue Aug 22, 2023 · 2 comments
Open

Comments

@Forthoney
Copy link
Contributor

Currently, we use JsValueTransport to facilitate moving values between the rb-abi-host and rb-abi-guest. Since the introduction of this workaround in #18 (May 2022), the WIT format implemented features such as worlds and import/exports. If we update our .wit files to use these new features I think JsValueTransport would no longer needed because the host and guest .wit can reference each other.

@Forthoney
Copy link
Contributor Author

My proposal is to

  1. Created a single wit directory where we store both .wit files as suggested by the WIT docs
  2. Wrap each file's current content inside an interface
  3. Use a use statement to reference js-abi-value in guest and rb-abi-value host

This may need a good bit of reorganizing of the current project structure. I'm frankly unsure what implications moving files around will have (especially in regards to C files currently in the same directory as the .wit files). I would appreciate some insight on this.

@kateinoigakukun
Copy link
Member

Thank you for your proposal! Yeah, I'm positive for using the latest WIT spec's import/export to describe the hack in the right way. It looks like wit-bindgen now supports resource feature in C. Also we can use jco to import the component from JS host side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants