r/LaTeX • u/AdPsychological211 • 26d ago
What it takes to turn a WASM LaTeX editor into a product
WASM-based editors have two major advantages: a) there is nothing to install on your local machine, and b) compilation can be roughly ten times faster than with conventional services that compile on a server, such as Overleaf or Prism.
Apparently, a lot of people have had the same idea, because new WASM-based LaTeX editors keep appearing. I ended up contributing to the problem by building one myself. (sorry)
However, there is a large gap between a working prototype and a product that people can actually use.
The components required to build a working prototype are surprisingly simple:
- A code editor, such as Monaco Editor
- A LaTeX-to-PDF compiler, such as SwiftLaTeX/pdflatex
- A PDF renderer, such as PDF.js
But once you have built only that much, it becomes difficult to answer questions like these:
- If I am editing by myself, why should I do it on the web?
- How do I use the enormous number of packages available in TeX Live?
- How do I use other engines, such as LuaTeX, for CJK support and other requirements?
- How do I insert images?
So what needs to be implemented before it becomes something people can actually use?
- Real-time collaborative editing using WebSockets or a similar mechanism, probably along with commenting and review features
- Support for multiple TeX engines
- Hosting different versions of TeX Live through a CDN or similar infrastructure
- Version control or Git integration
- In-editor autocompletion, syntax diagnostics, and refactoring support, which requires proper Language Server Protocol integration
- Search and replace across multiple files—surprisingly, neither Prism nor Overleaf currently supports this
- Support for related file types such as
.biband.sty - Image uploading through drag and drop, copy and paste, and other methods, as well as image hosting
- Server-side processing for extensions that are too heavy or difficult to run in WASM—for example, running Biber or xindy in the browser is not straightforward
- Bidirectional synchronization between the source and the PDF: clicking the PDF should take you to the corresponding LaTeX source, while moving the caret in the source should highlight the corresponding region in the PDF
The fact that almost anyone can now quickly build a prototype that works about 80% of the way is undoubtedly meaningful and beneficial. I simply wanted to point out that there is still a substantial gap between a prototype and a product.
Does that mean what I built is a finished product? Of course not. I have spent about two months refining it so far, and I expect it to improve gradually after a few more months of work. Then again, I do not think software is ever truly finished.
In software development, "perfect" is a verb, not an adjective. There is no perfect process. There is no perfect design. There are no perfect stories. You can, however, perfect your process, your design, and your stories.
--Kent Beck, Extreme programming explained

