Q: Why does LuaTeX embed rather than extend?
I've got a question about a LuaTeX design decision. I'd like to know why LuaTeX embeds Lua in a typesetting program. Perhaps it could instead have extended Lua with a typesetting module. Here's how to embed Lua (in the host program): http://www.lua.org/manual/5.0/manual.html#3 Here's how to extend Lua (with additional 'builtins'): http://www.lua.org/manual/5.0/manual.html#3.16 Here's an example of a Lua extension: http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/ One of the key difference between embed and extend is that Lua socket "is available to any Lua application once it has been properly initialized by the interpreter in use." LuaTeX, because it embeds Lua, is not be similarly available to other Lua applications. -- Jonathan
Jonathan Fine wrote:
I'd like to know why LuaTeX embeds Lua in a typesetting program. Perhaps it could instead have extended Lua with a typesetting module.
the history is (and reasons are) mentioned in several articles in user group journals as well as in presentations writing a typesetting module from scratch is a different kind of projects; also, we don't want to throw away 30 years of macros and tex experience maybe in 2016 we have reached a point that many aspects of tex have been rewritten in more independent c modules that then are glued together by lua but it does not change the principle ... it's still 90% tex then also, our choice for lua, as well as the decisions we make are driven by respect for tex (as it is), lua as it is, the things that the three of us have wanted to see in tex for ages and of course fun
Here's how to embed Lua (in the host program): http://www.lua.org/manual/5.0/manual.html#3
Here's how to extend Lua (with additional 'builtins'): http://www.lua.org/manual/5.0/manual.html#3.16
Here's an example of a Lua extension: http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/
we are aware of all those docs anyhow, in those docs you will read that lua is an extension langauage i.e. it extends an existing system
One of the key difference between embed and extend is that Lua socket "is available to any Lua application once it has been properly initialized by the interpreter in use."
well, that would be true for all games that use lua, editors, adobe progs etc ... it makes no sense to link all of them together ... you miss the whole point lua
LuaTeX, because it embeds Lua, is not be similarly available to other Lua applications.
neither are other applications that use lua as an extension language Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hi Jonathan? Jonathan Fine wrote:
I've got a question about a LuaTeX design decision.
I trust you have read the reference manual and our articles, so think for a bit and then try to answer a very simple rhetorical question: where o where will we find a tex-like reentrant engine to be used as an extension component? You will soon realise that the answer will be: looks like we will have to build one. Which happens to be exactly what we are doing here, slowly. So, you'll just have to be patient for a few years, like everybody else. Best wishes, Taco
participants (3)
-
Hans Hagen
-
Jonathan Fine
-
Taco Hoekwater