2 ms·
(1) I am writing a new React web-based LaTeX editor for CoCalc, and needed a PDF viewer. I first tried using the https://github.com/wojtekmaj/react-pdf https:/
by williamstein 9y ago
(1) I am writing a new React web-based LaTeX editor for CoCalc, and needed a PDF viewer. I first tried using the https://github.com/wojtekmaj/react-pdf https://github.com/wojtekmaj/react-pdf library, which builds on top of Mozilla's pdf.js. It's useful code, but the library is designed in a way that is fundamentally very inflexible for my use cases. For example, it is critical for me to easily have multiple views of the same document, to easily be able to cache recently loaded PDF's, and to be able to reload a modified PDF with no observable flicker. I found trying to get any of my core requirements to work with this library to be a constant battle involving horrible hacks. So I had to sit down for a very long day and write something similar from scratch directly using pdf.js itself. So my answer: sometimes, at some levels, you have to implement yourself instead of using a library, when the library is not flexible enough and trying to use it gets really hackish.
(2) Another experience I had was when I started the SageMath project. I began with the plan to look at other code and implement everything myself, rather than use existing libraries. That lasted about an hour, since it was way, way too much work (to put it mildly). So I switched to using Python as the user language, then using as much as possible existing C/C++ libraries (like PARI/GP and GAP and Singular) to provide functionality. The result was again a combination of using libraries but also writing a new library.