luametatex-introduction.tex /size: 10 Kb    last modification: 2023-12-21 09:43
1% language=us runpath=texruns:manuals/luametatex
2
3\environment luametatex-style
4
5\startcomponent luametatex-introduction
6
7\startchapter[title=Introduction]
8
9Around 2005 we started the \LUATEX\ project and it took about a decade to reach
10a state where we could consider the experiments to have reached a stable state.
11Pretty soon \LUATEX\ could be used in production, even if some of the interfaces
12evolved, but \CONTEXT\ was kept in sync so that was not really a problem. In 2018
13the functionality was more or less frozen. Of course we might add some features
14in due time but nothing fundamental will change as we consider version 1.10 to be
15reasonable feature complete. Among the reasons is that this engine is now used
16outside \CONTEXT\ too which means that we cannot simply change much without
17affecting other macro packages.
18
19In reaching that state some decisions were delayed because they didn't go well
20with a current stable version. This is why at the 2018 \CONTEXT\ meeting those
21present agreed that we could move on with a follow up tagged \METATEX, a name we
22already had in mind for a while, but as \LUA\ is an important component, it got
23expanded to \LUAMETATEX. This follow up is a lightweight companion to \LUATEX\
24that will be maintained alongside. More about the reasons for this follow up as
25well as the philosophy behind it can be found in the document(s) describing the
26development. During \LUATEX\ development I kept track of what happened in a
27series of documents, parts of which were published as articles in user group
28journals, but all are in the \CONTEXT\ distribution. I did the same with the
29development of \LUAMETATEX.
30
31The \LUAMETATEX\ engine is, as said, a follow up on \LUATEX. Just as we have
32\CONTEXT\ \MKII\ for \PDFTEX\ and \XETEX, we have \MKIV\ for \LUATEX\ so for
33\LUAMETATEX\ we have yet another version of \CONTEXT: \LMTX. By freezing \MKII,
34and at some point freezing \MKIV, we can move on as we like, but we try to remain
35downward compatible where possible, something that the user interface makes
36possible. Although \LUAMETATEX\ can be used for production we can also use it for
37possibly drastic experiments but without affecting \LUATEX. Because we can easily
38adapt \CONTEXT\ to support both, no other macro package will be harmed when (for
39instance) the interface that the engine provides change as part of an experiment
40or cleanup of code. Of course, when we consider something to be useful, it can be
41ported back to \LUATEX, but only when there are good reasons for doing so and
42when no compatibility issues are involved.
43
44By now the code of these two related engines differs a lot so in retrospect it
45makes less sense to waste time on porting back. When considering this follow up
46one consideration was that a lean and mean version with an extension mechanism is
47a bit closer to original \TEX. Of course, because we also have new primitives,
48this is not entirely true. The basic algorithms remain the same but code got
49reshuffled and because we expose internal names of variables and such that is
50reflected in the code base (like more granularity in nodes and token commands).
51Delegating tasks to \LUA\ already meant that some aspects, especially system
52dependent ones, no longer made sense and therefore had consequences for the
53interface at the system level. In \LUAMETATEX\ more got delegated, like all file
54related operations. The penalty of moving even more responsibility to \LUA\ has
55been compensated by (hopefully) harmless optimization of code in the engine and
56some more core functionality. In the process system dependencies have been
57minimalized.
58
59One side effect of opening up is that what normally is hidden gets exposed and
60this is also true for all kind of codes that are used internally to distinguish
61states and properties of commands, tokens, nodes and more. Especially during
62development these can change but the good news is that they can be queried so on
63can write in code independent ways (in \LUATEX\ node id's are an example). That
64also means more interface related commands, so again lean and mean is not
65applicable here, especially because the detailed control over the text, math,
66font and language subsystems also results in additional commands to query their
67state. And, as the \METAPOST\ got extended, that subsystem is on the one hand
68leaner and meaner because backend code was dropped but on the other hand got a
69larger code base due to opening up the scanner and adding a feedback mechanism.
70
71This manual started as an adaptation of the \LUATEX\ manual and therefore looks
72similar. Some chapters are removed, others were added and the rest has been (and
73will be further) adapted. It also discusses the (main) differences. Some of the
74new primitives or functions that show up in \LUAMETATEX\ might show up in
75\LUATEX\ at some point, but most will be exclusive to \LUAMETATEX, so don't take
76this manual as reference for \LUATEX ! As long as we're experimenting we can
77change things at will but as we keep \CONTEXT\ \LMTX\ synchronized users normally
78won't notice this. Often you can find examples of usage in \CONTEXT\ related
79documents and the source code so that serves a reference too. More detailed
80explanations can be found in documents in the \CONTEXT\ distribution, if only
81because there we can present features in the perspective of useability.
82
83For \CONTEXT\ users the \LUAMETATEX\ engine will become the default. As
84mentioned, the \CONTEXT\ variant for this engine is tagged \LMTX. The pair can be
85used in production, just as with \LUATEX\ and \MKIV. In fact, most users will
86probably not really notice the difference. In some cases there will be a drop in
87performance, due to more work being delegated to \LUA, but on the average
88performance is much be better, due to some changes below the hood of the engine.
89Memory consumption is also less. The timeline of development is roughly: from
902018 upto 2020 engine development, 2019 upto 2021 the stepwise code split between
91\MKIV\ and \LMTX, while in 2021 and 2022 we will (mostly) freeze \MKIV\ and
92\LMTX\ will be the default.
93
94As this follow up is closely related to \CONTEXT\ development, and because we
95expect stock \LUATEX\ to be used outside the \CONTEXT\ proper, there will be no
96special mailing list nor coverage (or pollution) on the \LUATEX\ related mailing
97lists. We have the \CONTEXT\ mailing lists for that. In due time the source code
98will be part of the regular \CONTEXT\ distribution so that is then also the
99reference implementation: if needed users can compile the binary themselves.
100
101This manual sometimes refers to \LUATEX, especially when we talk of features
102common to both engine, as well as to \LUAMETATEX, when it is more specific to the
103follow up. A substantial amount of time went into the transition and more will go
104in, so if you want to complain about \LUAMETATEX, don't bother me. Of course, if
105you really need professional support with these engines (or \TEX\ in general),
106you can always consider contacting the developers.
107
108In 2021|--|2022 the math engine was fundamentally overhauled. As a side effect
109some additional features were added. Not all are yet described in the manual:
110some are still experimental and it just takes time and effort to document and the
111priorities are with implementing their usage. Given the long term stability of
112math and them unlikely to be used in other macro packages there is no real urge
113anyway. It is also easier when we have examples of usage. Of course much is
114discussed in \type {ontarget.pdf} and presentations. The same is true for
115additions to \METAPOST: in due time these will be discussed in the \LUAMETAFUN\
116manual (the official \METAPOST\ manual is maintained elsewhere and should not
117discuss features that are not in the \LUATEX\ version).
118
119This manual is not a tutorial. It is also not a replacement for {\em The \TEX\
120Book}. It just collects (as we go) what is available in \LUAMETATEX, and
121therefore it always is a bit behind; actually the \TEX\ sources of the manuals
122might be ahead of the file you read right now. For new functionality you can look
123at documents (or source files or test files) that come with \CONTEXT\ where it is
124put into perspective. Some new primitives might speak for themselves, especially
125when you are familiar with \TEX. Some might not give a clue at all even with a
126bit of explanation: if so, just forget about them. You can always ask on the
127\CONTEXT\ list for the how, when and why of new features. It all comes for free,
128so keep that in mind when you are going to complain.
129
130\blank[big]
131
132Hans Hagen
133
134\blank[2*big]
135
136\starttabulate[||pl|]
137\NC \LUAMETATEX\ Banner   \EQ \cldcontext{LUATEXENGINE} %
138                              \cldcontext{LUATEXVERSION} / %
139                              \cldcontext{LUATEXFUNCTIONALITY}
140                              \NC \NR
141\NC \LUAMETATEX\ Version  \EQ \currentdate \NC \NR
142\NC \CONTEXT\    Version  \EQ LMTX \contextversion \NC \NR
143\NC \LUATEX\     Team     \EQ Hans Hagen, Hartmut Henkel, Taco Hoekwater, Luigi Scarso \NC \NR
144\NC \LUAMETATEX\ Team     \EQ Hans Hagen, Alan Braslau, Mojca Miklavec, Wolfgang Schuster and Mikael Sundqvist \NC \NR
145\NC resources and info at \EQ www.contextgarden.net\space\vl\space
146                              www.pragma-ade.nl\space\vl\space
147                              www.luametatex.org\space\vl\space
148                              ntg-context@ntg.nl (http://www.ntg.nl/mailman/listinfo/ntg-context) \NC \NR
149\stoptabulate
150
151\stopchapter
152
153\stopcomponent
154
155% I'm not that strict with incrementing numbers, but let's occasionally bump the
156% number. Once we're stable it might happen more systematically. For sure I don't
157% want to end up with these 0.99999999 kind of numbers.
158
159% We started with 2.00.0 and kept that number till November 2019, after Alan
160% Braslau and I did the initial beta release at April 1, 2019. After more than a
161% year working on the code base after the \CONTEXT\ 2019 meeting a state was
162% reached where nothing fundamental got added for a while. When \LUATEX\ needs a
163% patch, I check the \LUAMETATEX\ code base as the same patch might be needed
164% there. On the other hand, we don't need a strict compatibility, so some patched
165% in \LUATEX\ are not applied here.
166%
167% In November 2019 I started wondering if we should bump the number, just for the
168% sake of showing that there's still some progress. So I decided to bump to 2.01.0
169% then. Just as a reminder for myself: it was the day when I watched Jacob Collier
170% perform \LUA\ (feat. MARO) live on YouTube (of course that is not about the
171% language at all, but still a nice coincidence). Just for the fun of it the number
172% bumped a few more times, just to catch up, so end 2019 we're at 2.03.5.
173%
174% Thanks to the patient \CONTEXT\ users we were able to apply the new macro scanner
175% and protection mechanisms that were introduced mid 2020.
176