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

Project in Maintenance? Running into JS instead of wasm? #12

Open
fritzsche opened this issue Dec 2, 2024 · 2 comments
Open

Project in Maintenance? Running into JS instead of wasm? #12

fritzsche opened this issue Dec 2, 2024 · 2 comments

Comments

@fritzsche
Copy link

Dear Jim,
web2js is probably one of the coolest project I have seens. I love tex and interested in compiler construction.

However I notice that very little to no process in the last years. Has this project out of maintenance?
I (and others) run into various issues trying to run it on various platform, to create a Dump file.

I would web2js as I was searching for a solution different on emscripten, but found that despite of the name this project also translate to wasm.

The TUGboat article from 2019 indicates a design decision as wasm considered faster?
https://www.tug.org/TUGboat/tb40-1/tb124fowler-js.pdf

Are there any experiences? I could find that web2js seem to be first implemented without wasm:
https://github.com/kisonecat/web2js/tree/255596300f55e8be2fcf8158cf8ebbdb116d8304
This was 6 year ago and maybe not functional complete?

I'm considering to reimplement a version of web2js that is generating actual js or interpreting pascal (in JS) as it seems the performance gain of wasm is not as big any longer and a slight slower TeX in the browser that is readable JS code would make it easier for e.g. debugging and further enhancements and thus make it more stable to run on all platforms.

Thanks so much for your valuable help and work.
Thomas

@kisonecat
Copy link
Owner

Thanks for the kind words. I haven't had as much time as I'd hoped to work on this: my long-term plan was to use this to fix https://ximera.osu.edu/ Ohio State recently received a grant to fund development of that project. So we have some funds for tooling related to that.

Originally I ended up targeting wasm due to speed concerns, but it's an interesting point that perhaps js engines are comparable. Are you interested in writing a pascal compiler that targets javascript? I'm not especially proud of the code in this project, but using a more reasonable language for compiler construction would make for a fun project.

@fritzsche
Copy link
Author

Dear Jim,
you have all good reasons to be proud on this project. I personally Graduated in Math about 25 years ago working in software engineering all the years: But still in love of Math and TeX and LaTex. I'm just looking for a fun project, so speed (execution and project) is not my concern.
Have just recently manually translated an Pascal program to Javascript by hand.
A pascal to javascript transpiler is one of the options I'm considering, have adopted lexer and started parser (where I'm likely take a detour to integrate an hand crafted LALR or LR(1) parser.

An alternative to a transpiler would be a pascal interpreter. It's even more challenge for speed, BUT would it not be cool to directly kind of debug tough the (almost) original WEB source, including all the GOTO's glory?
I have seen how you handle the GOTO's, so I guess a transpiler would still mix the original source quite a bit. Might not we better than wasm.

One concern I have: print. As TeX is a typesetting system some major feature. I recognized your project dvi2html this looks very promising, but after all the last year still PDF seems to be the state of the art for printing in the browser and for TeX pdfTeX system seems to be still the ways to go. Or did you consider alternatives?
Had no time to detail analysis, but the pdfTex source tree is full of C-Files for different purpose, like embedding graphic/fonts etc. . So at the end you might need to run massive C code in the browser, What might point towards emscripten and wasm again.

Thanks so much for your reply and have a good one!
Thomas

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

2 participants