-
Notifications
You must be signed in to change notification settings - Fork 165
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? #166
Comments
I have been investigating this a bit since I am quite interested in ways to bring typesetting with TeX sophistication to the web. Based on my initial investigations, I suspect that compiling to WebAssembly will be pretty straightforward. The overall infrastructure can be a bit messy, but seeing as one can compile all sorts of legacy C packages, Tectonic should work too. Making a robust, reliable build system that targets WebAssembly would probably require some effort, but be more a matter of plumbing and infrastructure, not fundamental technical challenges in the code. One area that I don't understand so well is how to interact with existing browser infrastructure. For instance, rather than compiling the Rust HTTP/SSL stack to WebAssembly, it would probably be better to use browser tools like XmlHttpRequest when available (as used in my first foray into this domain, webtex). I am not sure what the "state of the art" is in this area — you could imagine modules that provide unified APIs that either use browser hooks or native Rust code, depending on the target platform. |
I'm curious as well how the network requests from tectonic would behave when executed as WASM. |
@efx Since this issue was originally posted, the web-sys crate has been developed, and I think that would be the basic underlying building block for work here. What I don't know is if there's a crate that could abstract between using web-sys for WASM targets, and something like hyper/reqwest for non-WASM. Trying to provide transparent abstractions between such different backends feels very risky, but I think it might not be totally unreasonable here ... |
This bas been done in swiftlatex with the swiftlatex-engine on github too |
I would also greatly appreciate if the project could be ported to wasm. I've tinkered around a bit, without any success for the last few days. My main issue was that I couldn't get the C dependencies (harfbuzz, icu, etc) to compile when targeting wasm. Probably a skill issue. |
Curious what the latest is here and what the blockers are... I'd be interested in spending some time on this! :) |
I could imagine that the biggest blockers would be file reads and and networking. |
I noticed that the possibility of compiling to webassembly is mentioned in the tectonic docs. Has anyone tried to do this recently? Are there major road blocks in the way? I imagine the C dependencies could be a problem, but a surmountable one.
I'm really interested given that projects like texlive.js and xetex-js have successfully ported the c libraries tex depends on before.
The text was updated successfully, but these errors were encountered: