3 ms·
I'm not a native English speaker. The title got me confused. When looking at the title, I thought the article was about running a WASM module in a separate thr
by billconan 5y ago
I'm not a native English speaker. The title got me confused.
When looking at the title, I thought the article was about running a WASM module in a separate thread from a c/c++/rust program. For example: https://github.com/WebAssembly/wasm-c-api https://github.com/WebAssembly/wasm-c-api
However, after reading it, it seems to be the opposite.
It's about running a WASM module that has thread usage, implemented in c, c++ or rust. Then in that situation, I think the title should be rephrased as:
Running WASM threads written in C, C++ or Rust.
is it me or the use of "from" is misleading? is it "executed by/called from" or "compiled from" ?
Sorry for asking this unrelated question. As a non-native speaker, every time I have this type of situation, I start to self-doubt.
- jacob019 5y agoI am a native english speaker and I thought the same thing.
- TazeTSchnitzel 5y agoYour suggested title makes me (native English speaker) interpret this the opposite of the way you intend. I don't think the original title is bad. The ambiguity as to whether the C/C++/Rust code is guest or host seems natural to me.
- clord 5y agosubstitute "posix threads" to see why it was written this way. WebAssembly is the platform (aside: and an assembly langauge) that provides WebAssembly threads. It makes sense to say "use posix threads from C or C++". Posix is underneath whatever language you use. Saying "running posix threads written in C or C++" seems to suggest that someone is running their own custom threading library in C or C++.
- billconan 5y agoI don't think "use posix threads from C or C++" is a good example, because posix threads are natively available to c and c++. whereas webassembly threads are not. the code has to be compiled into wasm first. That's why I asked if the word "from" was "compiled from or executed from". Yes, wasm is a platform, but c++ runtime can also be a platform. You could build a c++ runtime/compiler into wasm to compile and run c code. Or you could embed a wasm runtime into a c++ program (i.e. the github project I mentioned.) you can run linux vm inside a windows host, or you can run a windows vm inside a linux host, which one is the platform? And what if we say "use posix threads from rust"? I would interpret it as a rust program calling a posix threads, perhaps implemented in c. or a rust program calling a rust crate wrapping posix thread.