Skip to content
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

Open
samghelms opened this issue Mar 8, 2018 · 7 comments
Open

WebAssembly? #166

samghelms opened this issue Mar 8, 2018 · 7 comments

Comments

@samghelms
Copy link

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.

@pkgw
Copy link
Collaborator

pkgw commented Mar 8, 2018

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.

@ghost
Copy link

ghost commented Aug 14, 2019

I'm curious as well how the network requests from tectonic would behave when executed as WASM.
There is a whole book from rust folks on working with WASM: https://rustwasm.github.io/docs/book/

@pkgw
Copy link
Collaborator

pkgw commented Aug 15, 2019

@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 ...

@benabel
Copy link

benabel commented Mar 17, 2021

This bas been done in swiftlatex with the swiftlatex-engine on github too

@Throvn
Copy link

Throvn commented Aug 20, 2024

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.

@j6k4m8
Copy link

j6k4m8 commented Sep 3, 2024

Curious what the latest is here and what the blockers are... I'd be interested in spending some time on this! :)

@Throvn
Copy link

Throvn commented Sep 9, 2024

I could imagine that the biggest blockers would be file reads and and networking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants