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

Guest language support: Zig #549

Open
jakehemmerle opened this issue Mar 28, 2023 · 2 comments
Open

Guest language support: Zig #549

jakehemmerle opened this issue Mar 28, 2023 · 2 comments

Comments

@jakehemmerle
Copy link

jakehemmerle commented Mar 28, 2023

Zig is a great source language, and shows Wasm a lot of love in many different ways. I'd like to be able to use seperately-compiled Wasm components in Zig, so I wanted to open this issue to gauge demand.

@alexcrichton
Copy link
Member

Development of wit-bindgen I believe has settled down to the point that having a suite of guest languages makes sense. That being said I think it's still best for each guest language to determine how best to integrate bindings generation into the toolchain. For example with Rust it'll be through a crate on crates.io, not with the wit-bindgen CLI. I don't know myself how best Zig would integrate the code generation story.

That being said though while there's not a strict written down set of requirements of adding new guest languages to this repository one significant one I think we'd want is for a maintainer to "be on the hook". Changes regularly break other languages in often minor ways, and while I can personally take care of languages like Rust and C I often don't know how to handle Java and Go, for example. This means that new tests may be added which break on other bindings generators and they'll frequently be disabled for new bindings generators and someone will need to be on the hook for getting it passing.

All that to say that if a PR is presented with Zig support (or any other language, really), we'd need more than simply just that but additionally someone willing to be on the hook for continued maintenance of the generator.

@jakehemmerle
Copy link
Author

jakehemmerle commented Mar 29, 2023

Thanks for elaborating, a maintainer sounds reasonable.

Related to your above comments, I'll include some notes for the implementor (or me):

  • The best way to integrate wit-bindgen into Zig's toolchain is likely through Zig's new package manager (note, this is not yet in the official release, as of 0.10.1)
  • As Zig operates intimately with C code, it might be easier to write/maintain a Zig wrapper around Alex's C implementation. That package manager PR show how to build ffmpeg while using Zig's package manager to depend on libz and libmp3lame, so reading that PR would be a great starting point.

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

No branches or pull requests

2 participants