-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat: add binding crate integrations #89
Conversation
For the rand integration, would it make sense for the code to eventually live in the getrandom crate? And if so, would the code here cause a circular dependency? |
I'm also wondering how best to place these extensions, either in the The alternative though of a Despite that though I think I'd personally lean a bit more towards an external crate. That feels more along the trajectory of what we eventually want in terms of integrating this crate into other crates (like |
It seems that we have consensus on the following two points:
Assuming that the we agree on the above, here's the scenario I was envisioning for the third-party crate integrations:
From downstream user perspective, update from If, however, the To reiterate, the proposal is to gate every single crate integration with a feature flag - the default With this approach, I'm struggling to see the circular dependency in third-party crates. @sunfishcode @alexcrichton could you help me understand the concern here? |
Definitely agree on the first two points, but the situation I'm worried about is:
The main assumption here is that |
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
b77749a
to
6b2b28f
Compare
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
@sunfishcode @alexcrichton rebased on top of latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me, thanks!
I'll hold off on merging for @sunfishcode as well though
Looks good to me too! |
wasi-ext is now published on crates.io. |
This is just the first step in adding integrations with existing crates in Rust ecosystem to bindings already provided by this crate. I intentionally kept this PR small to gather some feedback on the approach and the direction here.
In particular, this PR:
ext
module, which now contains the stdlib integration (Implement Error for wasi::io::error::Error #86 and the newly-addedstd::io::{Write,Read}
implementations)rand
crate integrationstd::io::{Write, Read}
implementations on streams, enabled by default, which is now also used in the examplesstd
andno_std
versions. This is probably an overkill - I think most users of this crate will usestd
and will compile towasm32-wasi
, but I did not want to remove the existingno_std
examples.Example follow-up for e.g.
http
crate integration could look like: #90