4 ms·
it is really a shame that Lua was chosen as the language to embed in TeX, instead of something sane like a Scheme, Common Lisp or at least Python (today, maybe
by strenholme 5y ago
it is really a shame that Lua was chosen as the language to embed in TeX, instead of something sane like a Scheme, Common Lisp or at least Python (today, maybe Julia)
I personally find Lua to be a completely sane and easy to program language. But, to each their own.
Let’s look at these options and some others:
Scheme/Lisp: It’s true that Scheme and Lisp-like languages are pretty compact and easy to embed, but the syntax of Lisp is, for most modern programmers, pretty esoteric. Asking today’s programmers to program in a Lisp is, for better or worse, like asking secretaries to use Vi to edit documents.
Python: Python is a big, bulky language and one which is not really suitable for embedding inside another program. See this recent discussion for more on this: https://news.ycombinator.com/item?id=29700947 https://news.ycombinator.com/item?id=29700947
Julia: A somewhat non-mainstream language, and, like Python, it doesn’t look to be a language designed for embedding the way Lua is.
Forth: Like Lisp dialects, Forth’s completely stack-based syntax is not intuitive for today’s generation of programmers.
Lua needs batteries, which I know is off putting to some programmers. It turned me off from Lua for a while until Roblox made me give Lua a second chance. Here is my own set of public domain Lua batteries: https://github.com/samboy/LUAstuff https://github.com/samboy/LUAstuff (stuff like a Lua copy.deepcopy(), sorted table/dictionary iteration, split strings based on a regex, etc.)
- charlieyu1 5y agoPython is more like something that should be run alongside LaTeX, not embedded in. PythonTeX already does this