-
Since servo/stylo is written in rust and I know rust supports wasm well. So my question is can we compile some components of this project (stylo for example) into wasm? Facebook's open source layout engine yoga is mainly written in C++ and they officially provide pure JS compiled version cross-compiled using emscripten. Does stylo have some heavy dependencies or other potential issues that might block us from compiling it into wasm? PS. It will be cool if a web developer could use a full-featured style engine with JavaScript in the browser 🙈 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
The native dependencies like SpiderMonkey would cause problems. Similarly, all the code that currently depends on GL bindings like the WebGL implementation would interefere, and the networking code. In short, anything that is platform-specific in some way would likely need to be adjusted or rewritten to accomodate the new target. Also, it's not clear to me how easily threads translate to wasm right now, and Servo uses many threads. It would not be an easy project. |
Beta Was this translation helpful? Give feedback.
-
Do I understand this correctly? You want to compile Servo/Stylo to WASM so can run a browser engine inside another browser engine? Nice hack, but where is the use case? |
Beta Was this translation helpful? Give feedback.
-
Checkout shadow, an early stage, mostly javascript implementation of a rendering engine. |
Beta Was this translation helpful? Give feedback.
The native dependencies like SpiderMonkey would cause problems. Similarly, all the code that currently depends on GL bindings like the WebGL implementation would interefere, and the networking code. In short, anything that is platform-specific in some way would likely need to be adjusted or rewritten to accomodate the new target. Also, it's not clear to me how easily threads translate to wasm right now, and Servo uses many threads. It would not be an easy project.