Live data from Hacker News

The price of a messy codebase: No LaTeX on the iPad

vallettaventures.tumblr.com

41–50 of 247 posts

Re: The price of a messy codebase: No LaTeX on the iPad

#41
post #2

I was agog when I downloaded the LaTeX binary install for my new Mac a few years ago and discovered how massive it was. LaTeX is almost as big as the entire operating system disk! What on earth is in there?

The full TexLive distribution contains all officially accepted packages ever written (this includes fonts, iconography, compiled documentation and other heavy stuff), most of the compilers, the LaTeX and Context (MK II and IV) packages and a huge toolchain. For compatibility reasons, packages are (almost) never removed. Also for compatibility reasons, the LPPL (Latex Project Public License) discourages[1] the release of a modified package under the same name, so there are copies within the distribution.

So, the TexLive distribution is the "fire-and-forget"-package in the LaTeX world, thats why it is so big. I use it for around 10 years now and I never had to install an additional package.

[1] It even prohibited that for a while, see Wikipedia.

Re: The price of a messy codebase: No LaTeX on the iPad

#42

The price of a LaTeX rewrite would be even higher: incompatibility. If one tries to rewrite TeX, the problem gets much much worse, since TeX is, for all intents and purposes, bug-free. A new implementation will certainly not be. Joel Spolsky said it very well http://www.joelonsoftware.com/articles/fog0000000069.html I disagree that the current situation is LaTeX developers' fault. TeX and LaTeX are complex pieces of…

The big problem on tablet devices is constraints in memory. Yes the unix way is to have various small utilities work together through pipes and interprocess communications. The big challenge at that point is how to do you manage memory? What if a single process in that huge chain uses up all of the memory and another process gets killed by the OS which was part of that chain (do note, no swap on mobile devices)... Ho…

A current tablet device, even a cheap one, has about 256Mb of main memory. Android (at least the cyanogen mod kernel) has also the ability to use a part of the main memory to store compressed swap partition data. That leaves about 80 Megabytes to userspace programs (on Android). About the amount a normal desktop computer had in 1998.

LaTex dates back to the beginning of the 80s. Given that it has the ability to create large documents, I doubt that the required amount of main memory scales linearly with the size of the document.

Also, when you use subprocesses, besides checking their return value, you have some sort of interprocess communication which should detect when one process failed to finish his job.

It looks more like the smartphone runtimes and their sandboxes just don't support it at all, because modern GUI applications rarely build upon multiple executables in the background.

Re: The price of a messy codebase: No LaTeX on the iPad

#44

"iPad is the most beautiful platform out there" Sorry, but I fail to understand, why any serious TeX-Head would say that. The platform is crippled and your problem shows it. You are ranting in the wrong direction. -jsl

The author is not a TeX-head, or he wouldn't be surprised about WEB, Pascal and wouldn't confuse Plain TeX with LaTeX (the documentation of TeX is the former not the latter).

Re: The price of a messy codebase: No LaTeX on the iPad

#45
post #38

Earlier quoted context omitted.

The LaTeX executable isn't 4GB, it's 3MB or so (pdflatex/pdftex) or 16MB in the case of XeLaTeX. The 4GB consists of billions of extension/modules/packages for typesetting documents.

Yes I noticed that in the comments before I posted which is why I was careful to specifically say "The executable described here is 4GB" so as to refer to whatever it is he was trying to work with. I suppose whether all of the 4GB is needed for what he wanted, whether it could easily be taken apart, or could now be remade in a much smaller package, are all valid questions.

4G is a bit over the top. My install (TeXLive 2010 on OpenBSD) is ~2G, and that includes gobs of rarely-used packages and documentation.

Really, borrowing MikTeX's install-on-first-use for packages and making documentation optional should result in a much more reasonable size. If you want to get fancy, teach LaTeX how to decompress packages on demand.

Re: The price of a messy codebase: No LaTeX on the iPad

#47

Earlier quoted context omitted.

The big problem on tablet devices is constraints in memory. Yes the unix way is to have various small utilities work together through pipes and interprocess communications. The big challenge at that point is how to do you manage memory? What if a single process in that huge chain uses up all of the memory and another process gets killed by the OS which was part of that chain (do note, no swap on mobile devices)... Ho…

A current tablet device, even a cheap one, has about 256Mb of main memory. Android (at least the cyanogen mod kernel) has also the ability to use a part of the main memory to store compressed swap partition data. That leaves about 80 Megabytes to userspace programs (on Android). About the amount a normal desktop computer had in 1998. LaTex dates back to the beginning of the 80s. Given that it has the ability to creat…

Android does have IPC mechanisms (Intents and remote methods) that can be used to have another process do work in the background. The difference is that even if you use them, you're still not likely to wind up with something that looks like a set of cooperating command-line utilities.

In any case, I absolutely agree that resource constraints aren't keeping LaTeX off of our mobile devices.

Re: The price of a messy codebase: No LaTeX on the iPad

#48

* First of all, the OP mixes up LaTeX and TeX. TeX is written in a very portable language and has been ported to more platforms than most other software, including PDP-10 and others. * LaTeX is working on the iPad, see for example: http://meeting.contextgarden.net/2010/talks/2010-09-14-arthu... * LuaTeX ( http://luatex.org ) is written in C, not WEB. * You only need one binary to work with TeX. Either PDFTeX or LuaTe…

> * You only need one binary to work with TeX. Either PDFTeX or LuaTeX. All other binaries are just glue code (for example to generate missing Metafont fonts, but who wants them these days anyway?

A lot of TeX uses Computer Modern to typeset the body (a metafont font) and I don't think I have ever see a TeX document that doesn't use Computer Modern or Euler (another metafont font) for equation typesetting.

I also wonder whether it's possible to achieve the excellent equation typesetting capabilities of TeX without metafont.

Re: The price of a messy codebase: No LaTeX on the iPad

#49

In this paper[1], they say that much of the latex running time is eaten up in the startup and shutdown of the program and the actual typesetting time is in the microseconds. A long-running process (daemon) is therefore a much more efficient way to run (La)TeX. [1] www.tug.org/TUGboat/tb27-0/fine.pdf """ On my current 800 MHz PC, the command $ tex story \\end takes about 0.137 seconds, while $ tex \\end takes 0.133 se…

It strikes me that TeX ought to take a page from Lisp interpreters and dump core after loading all the standard configuration files, so that future runs won't need to waste so much time on initialization.

Re: The price of a messy codebase: No LaTeX on the iPad

#50

* First of all, the OP mixes up LaTeX and TeX. TeX is written in a very portable language and has been ported to more platforms than most other software, including PDP-10 and others. * LaTeX is working on the iPad, see for example: http://meeting.contextgarden.net/2010/talks/2010-09-14-arthu... * LuaTeX ( http://luatex.org ) is written in C, not WEB. * You only need one binary to work with TeX. Either PDFTeX or LuaTe…

"One binary" is a bit optimistic; even if you never do anything fancy with fonts, you'll want bibtex. And makeindex, if you're writing a large work. PSTricks does not work with PDFLaTeX (Tikz is arguably better than PSTricks, but PSTricks won't be dead anytime soon). XeLaTeX is required to use system fonts easily.

And that's before getting into anything truly gross.

Post reply on HN