How is performance? Last time I checked LuaLaTeX was significantly slower than XeLaTeX was significantly slower than pdfLaTeX (on the order of 5s > 1s > 0.1s for the same document).
As if LaTex wasn't slow enough already. I'm always amazed at how long it takes to generate a PDF vs how quickly a browser can render a seemingly arbitrary HTML document.
The book A Gentle Introduction to TeX is 97 pages long (number of pages in the output). To produce the typeset output from `gentle.tex`, on my laptop,
- tex takes 0.15 seconds
- pdftex takes 0.37 seconds
- luatex (1.0.4) takes 0.46 seconds
All of these are reasonably fast, and I think getting a full book in less than half a second is acceptable. (My browser takes longer than that to render most things.)
What's the catch? This book is written in plain TeX. The slowness comes when you use LaTeX: it's not unusual to have even single-page documents that take longer for LaTeX to generate. The whole LaTeX approach is to have a package for everything, load everything you may want, providing all the features, etc — and all of this implemented in TeX macro expansion in painful and hard-to-refactor ways.
This is something LuaTeX will help with actually: LuaTeX makes TeX less monolithic by providing hooks (callbacks), and many things can now be implemented in easier-to-read Lua code as hooks into the right parts of TeX's execution, rather than setting everything up at the start so that after macros are expanded the right thing happens. If there's less use of LaTeX and elaborate macros, things should get faster.
Do you have embedded graphics? My experience with many documents including a 300 page book was that (re-)encoding/compressing graphics was the bulk of the processing time (>90%).
There is an easy fix: specify a lower compression setting. It defaults to the highest or close to the highest setting, which is inordinately more expensive.
Indeed. You should be aware of the extensive computation that the TeX engine is doing in order to produce a typographically pleasing result - browsers do none of this.
First you need to learn a bit about how to use LaTeX. I learned this decades ago and am not sure what is the best introduction now, but this is sometimes recommended:
If you want to start with TeX, I highly recommend the book A Beginner's Book of TeX by Seroul and Levy. One of the developers behind LuaTeX also strongly recommends it (in the preface to the ConTeXt manual), and calls it "the book that turns every beginner into an expert". This one is more readable than the TeXbook, and builds up your intuition nicely. Learning LuaTeX is relatively easier after you understand the basic design of TeX.
Sure, if you want to use plain TeX, and not LaTeX. To get a really thorough grounding, you can read Donald Knuth's TexBook. I'm sure there are also briefer guides online.
If you are an ordinary producer of documents (plain text, articles,tech reports, letters, mathematical documents, etc.) you should start with LaTeX, not TeX. It is uncommon to write in plain TeX and this has been so for many years. In practice, you will use mostly LaTeX constructs, and the simplest TeX ones, which the LaTeX guide would include.
FWIW, I started with LaTeX a few years ago, and Overleaf.com really helped. Even though I prefer local development and generally work that way, Overleaf has Git integration, sharing features, and works when I've messed up my development environment.
It appears the largest benefits is embedding Lua code into TeX (found at [1] in "Programmability").
The example they present from that page:
\documentclass{article}
\usepackage{luacode}
\begin{document}
\pagestyle{empty}
\begin{luacode*}
function esn (n)
return (1 + 1/n)^n
end
function etn (n)
tex.print(string.format('%5d & %1.8f \\\\', n, esn(n)))
end
\end{luacode*}
Convergence to $e$:
\begin{tabular}{ll}
\rule[-2mm]{0pt}{4mm}$n$ & $(1 + \frac{1}{n})^n$ \\
\hline
\luadirect{
for n = 10, 110, 10 do
tex.print(etn(n))
end
}
\hline
\end{tabular}
\end{document}
which allows a pretty table to be printed in the document.
That one simply inserts Lua code into TeX, and it's definitely a benefit (alternative to complicated macros). IMO an even bigger benefit (not yet widely used) are the various hooks and callbacks that LuaTeX provides -- you can influence the operation of TeX by writing some callback code in Lua at the right layer, instead of having to write everything in the input layer as macros to be expanded so that things are set up for later when TeX rolls around to do the thing you care about.
This also results in cleaner code (even beyond Lua being more readable than TeX macros), and smaller/faster code as you don't have to account for as many different kinds of things in your "input".
The "fade lines" callback example in the linked article is a good one. Here's another example of mine (not a great one) where you can influence TeX's linebreaking algorithm to avoid short words at line boundaries: https://tex.stackexchange.com/questions/378704/how-to-avoid-... -- the solution with macros is not so great.
Now, if only all of microtype's features were available in Lua(La)Tex. They're the sole reason I'm still using pdfLaTeX, even though I end up not able to use opentype fonts. :/