-
Notifications
You must be signed in to change notification settings - Fork 149
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
WebAssembly support is required #109
Comments
no - it isn't |
Thanks for the fast answer! Is it possible? If possible then I think it's good idea to add support. I've found
|
I think it can be possible via emscripten_coroutine_create, emscripten_coroutine_next and emscripten_yield.
|
clang can now target webassembly, does that change things on this front? |
If we could easily make boost fibers work on clang/webassembly, a plethora of opportunities would be opened up. In addition, I think the emscripten ASYNCIFY stuff might have issues. |
I'm not familiar with webassembly... |
Any idea who we could ping? I'm trying to reach Gor Nishanov, not sure if anyone else might know? |
Perhaps we could write a test using emscripten? |
It's hard for me to put in words what a huge deal this could be, all kinds of projects become possible within the web browser, all legacy code bases containing threads can be leveraged in the browser using fibers. |
Supporitng WebAssembly requires patching LLVM and Emscripten - I think this hughe amount of work is only justified if fcontext's std-equivalent in P0876R10 has been accepted. |
I wonder if it would be easier to implement initially in wasm3? |
This can now be implemented for Emscripten with the new fibers API. |
you are welcome to provide a patch |
I think this is not possible. |
The feature is not planned more? |
I think it is not possible to implement support for WebAssembly. |
Can we leave this open for some brave soul who might come along later? |
boost.context accesses/uses the registers of the CPU while webassembly is bytecode running in a virtual machine - therefore your request makes no sense. |
@olk the vm doesn't have a way to mimick registers? |
It's possible with the Asyncify transform and some help from the embedder/runtime — which is what the emscripten fibers feature is all about. An emscripten-specific backend is perfectly feasible. Here is the implementation in my own C coroutine library. |
I'll take a look at it. |
emscripten fiber seams not to be used - at least Google couldn't find examples/usage of emscripten fibers. |
I literally just linked you a usage example (we use it in the web port of Taisei Project). Here is another one from an emscripten port of the byuu emulator. Another emulator. Here is another multi-backend coroutine library that uses emscripten fibers. And another one. And here it is used in Ruby. I also linked the documentation earlier. |
Is WebAssembly (WASM) (https://webassembly.org/) supported?
C++ to WASM can be used via https://emscripten.org/.
The text was updated successfully, but these errors were encountered: