Comments (8)
WASI doesn't currently have general networking support. We're aware this is an important feature and are working on it.
from wasi.
@leonwanghui yes in that case try with wasi.
But right now crates like reqwest, hyper, web3, rpc
are not webassembly compatible. You may end up with some socket error etc.
from wasi.
not all rust crates, but probably most rust crates. it's more of a question of what rust's stdlib supports (with the exception of stuff like random).
from wasi.
It is important to note that WASI is not yet standardized, so any final answer to this question is impossible until it is.
It is also important to note that certain crates are built specifically for certain platforms, i.e. posix or windows. While wasi aims to create a "conceptual operating system" that attempts to be able to emulate most operating systems, it will certainly not support every possible syscall.
So to (maybe) answer your question: most rust crates that are pure logic should work -- which is probably most rust crates.
from wasi.
Quite interesting topic. I am learning rust and wasm these days, and here are some conclusions from my side:
- Not support all crates. When I tried to compile some crates like
reqwest
, some errors occurred with bad network layer support. - Currently for latest Rust (v1.37), there should be three targets supporting wasm which are
wasm32-unknown-unknown
,wasm32-unknown-emscripten
andwasm32-wasi
. So I think this could make users confused when choosing target to build the code. - I found there are also many wasm compilers, so it's also confusing which one is better.
from wasi.
Agree. All rust crates not supported. But most of crates having webassembly support i.e wasm32-unknown-unknown
will support (have tested with 5-10 crates).
wasm32-unknown-unknown
and wasm32-wasi
is almost similar. It is light-weight. wasi
is having additional functionality as it is POSIX compliant.
But another target with emscripten, it contains a JS glue code. if you wan't to use syscalls/Filesystems you may use that. And again the code is not optimized you may require external tools to optimize it like wasm-gc
from wasi.
@AchalaSB If I get it right, if I want to try some system programming with wasi, the best option is wasm32-wasi
target.
from wasi.
Found some issues on hyper
and reqwest
about wasm support: hyperium/hyper#1245 seanmonstar/reqwest#288
from wasi.
Related Issues (20)
- WebAssembly/WASI Native Messaging host HOT 4
- WIT standardization HOT 11
- Filesystem path inference in Preview2 HOT 11
- Integration of streams HOT 10
- Why does WASI use a global export "_start" instead of the start section as the entrypoint? HOT 5
- Consider publishing an mdbook HOT 3
- setjmp support HOT 2
- Stream `media_type` should be Option<String> HOT 1
- Does Function that return buffer with string should include trailling 0 or not HOT 9
- command and extra exports HOT 14
- Confusion about WASI's function types. HOT 5
- What is the ABI of the Result<> type? HOT 2
- memory export vs import HOT 8
- preview2 questions HOT 5
- EFAULT or trap for out of range memory access during a wasi call? HOT 5
- What module will _start, args, env, and pre-opens be defined in? HOT 7
- A command World proposal HOT 7
- WASI proposal for eBPF related API HOT 1
- Make clear for WASI implementation HOT 3
- Proposing a framework for Preview3 and WASI 1.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasi.