| 1 |
-------------------------------------------------------------------------------- |
| 2 |
welcome |
| 3 |
-------------------------------------------------------------------------------- |
| 4 |
|
| 5 |
There is not much information here. I normally keep track of developments in |
| 6 |
articles or chapters in the history documents. These can (sometimes with a delay |
| 7 |
when it's an article) be found in the ConTeXt distribution. The history and |
| 8 |
development of LuaTeX is also documented there, often with examples or usage. |
| 9 |
|
| 10 |
The ideas behind this project are discussed in documents in the regular ConTeXt |
| 11 |
distribution. A short summary is: in order to make sure ConTeXt will work as |
| 12 |
intended, we distribute an engine with it. That way we can control stability, |
| 13 |
performance and features. It also permits experiments without the danger of |
| 14 |
interference with the engines used in other macro packages. Also, we don't want |
| 15 |
dependencies on large subsystems so we have a well defined set of libraries: we |
| 16 |
want to stay lean and mean. Eventually the same applies as to original TeX: we |
| 17 |
fix bugs and don't add all kind of stuff we don't (want or) need. Just that. |
| 18 |
|
| 19 |
-------------------------------------------------------------------------------- |
| 20 |
codebase |
| 21 |
-------------------------------------------------------------------------------- |
| 22 |
|
| 23 |
This codebase is a follow up on LuaTeX. It all started with a merge of files |
| 24 |
that came from the Pascal to C converter (CWEB) plus some C libraries. That code |
| 25 |
base evolved over time and there were the usual side effects of the translation |
| 26 |
and merge of (also other engine) code, plus successive extensions as well as Lua |
| 27 |
interfaces. In LuaMetaTeX I tried to smooth things a bit. The idea was to stay |
| 28 |
close to the original (which in the end is TeX itself) so that is why many |
| 29 |
variables, functions etc are named the way they are. Of course I reshuffled, and |
| 30 |
renamed but I also tried to stay close to the original naming. More work needs |
| 31 |
to be done to get it all right but it happens stepwise as I don't want to |
| 32 |
introduce bugs. In the meantime the LuaTeX and LuaMetaTeX code bases differ |
| 33 |
substantially but apart from some new features and stripping away backend and |
| 34 |
font code, the core should work the same. |
| 35 |
|
| 36 |
tex etex pdftex aleph: |
| 37 |
|
| 38 |
Of course the main body of code comes from its ancestors. We started with pdfTeX |
| 39 |
which has its frontend taken from standard TeX, later extended with the eTeX |
| 40 |
additions. Some additional features from pdfTeX were rewritten to become core |
| 41 |
functionality. We also took some from Aleph (Omega) but only some (in the |
| 42 |
meantime adapted) r2l code is left (so we're not compatible). |
| 43 |
|
| 44 |
mp: |
| 45 |
|
| 46 |
The maintainance of MetaPost was delegated to the same people who do luaTeX and |
| 47 |
as a step indevelopment a library was written. This library is used in |
| 48 |
LuaMetaTeX but has been adapted a bit for it. In principle some of the additions |
| 49 |
can be backported, but that is yet undecided. |
| 50 |
|
| 51 |
lua: |
| 52 |
|
| 53 |
This is the third major component of LuaMetaTeX. In LuaTeX a slightly patched |
| 54 |
version has been used but here we use an unchanged version, although the version |
| 55 |
number of the bytecode blob is adapted so that we can use intermediate versions |
| 56 |
of lua 5.4 that expect different bytecode without crashing on existing bytecode; |
| 57 |
this trick has been dropped but I hope at some point Lua will add a define for |
| 58 |
this. |
| 59 |
|
| 60 |
For the record: when we started with LuaTeX I'd gone through a pascal, modula 2, |
| 61 |
perl, ruby with respect to the management helpers for ConTeXt, like dealing with |
| 62 |
indexes, managing metapost subruns, and all kind of goodies that evolved over time. |
| 63 |
I ran into Lua in the SciTE editor and the language and the concept of a small and |
| 64 |
efficient embedded language. The language orginates in academia and is not under |
| 65 |
the influence of (company and commercial driven) marketing. A lot of effort goes |
| 66 |
into stepwise evolution. The authors are clear about the way they work on the |
| 67 |
language: |
| 68 |
|
| 69 |
http://lua-users.org/lists/lua-l/2008-06/msg00407.html |
| 70 |
|
| 71 |
which fits nicely in our philosophy. Just in case one wonders if other scripting |
| 72 |
languages were considered the answer is: no, they were not. The alternatives all |
| 73 |
are large and growing and come with large ecosystems (read: dependencies) and some |
| 74 |
had (seemingly) drastic changes in the design over time. Of course Lua also evolves |
| 75 |
but that is easy to deal with. And in the meantime also the performance of Lua made |
| 76 |
it clear that it was the right choice. |
| 77 |
|
| 78 |
avl: |
| 79 |
|
| 80 |
This library has been in use in the backend code of LuaTeX but is currently only |
| 81 |
used in the MP library. I'm not sure to what extend this (originally meant for |
| 82 |
Python) module has been adapted for pdfTeX/LuaTeX but afaiks it has been stable |
| 83 |
for a long time. It won't be updated but I might adapt it for instance wrt error |
| 84 |
messages so that it fits in. |
| 85 |
|
| 86 |
decnumber: |
| 87 |
|
| 88 |
This is used in one of the additional number models that the mp library supports. |
| 89 |
In LuaMetaTeX there is no support for the binary model. No one uses it and it |
| 90 |
would add quite a bit to the codebase. |
| 91 |
|
| 92 |
hnj: |
| 93 |
|
| 94 |
This GPL licensed module is used in the hyphenation machinery. It has been |
| 95 |
slightly adapted so that error messages and such fit in. I don't expect it to |
| 96 |
change much in the future. |
| 97 |
|
| 98 |
pplib: |
| 99 |
|
| 100 |
This library is made for Lua(Meta)TeX and provides an efficient PDF parser in |
| 101 |
pure C. In LuaTeX it was introduced a replacement for a larger library that |
| 102 |
was overkill for our purpose, depended on C++ and kept changing. This library |
| 103 |
itself uses libraries but that code is shipped with it. We use some of that |
| 104 |
for additional Lua modules (like md5, sha2 and decoding). |
| 105 |
|
| 106 |
lz4 | lzo | zstd: |
| 107 |
|
| 108 |
For years this library was in the code base and even interfaced but not enabled |
| 109 |
by default. When I played with zstd support as optional libary I decided that |
| 110 |
these two should move out of the code base and also be done the optional way. The |
| 111 |
amount of code was not that large, but the binary grew by some 10%. I also played |
| 112 |
with the foreign module and zstd and there is no real difference in peformance. The |
| 113 |
optionals are actually always enabled, but foreign is controlled by the command |
| 114 |
line option that enables loading libraries, and it al;so depends on libffi. |
| 115 |
|
| 116 |
zlib | miniz: |
| 117 |
|
| 118 |
I started with the code taken from LuaTeX, which itself was a copy that saw some |
| 119 |
adaptions over time (irr there were border case issues, like dealing with zero |
| 120 |
length streams and so). It doesn't change so in due time I might strip away some |
| 121 |
unused code. For a while libdeflate was used but because pplib also depends on |
| 122 |
zlib and because libdeflate doesn't do streams that was abandoned (it might come |
| 123 |
back as it is very nice and clean code.). One issue with (de)compression libraries |
| 124 |
is that they use tricks that can be architecture dependent and we stay away from |
| 125 |
that. I try to stay away from those and prefer to let the compiler sort things out. |
| 126 |
|
| 127 |
Early 2021 we switched to miniz. One reason is that the codebase is smaller because |
| 128 |
it doesn't deal with very old or rare platforms and architectures. Its performance |
| 129 |
is comparable, definitely for our purpose, and sometimes even a bit better. I looked |
| 130 |
at other alternatives but as soon as processor specific tricks are used, we end up |
| 131 |
with architecture specific header files and code so it's a no-go for a presumed |
| 132 |
long term stable and easy to compile program like luametatex. There is no gain in it |
| 133 |
anyway. |
| 134 |
|
| 135 |
complex: |
| 136 |
|
| 137 |
There is a complex number interface inspired by the complex number lua module by |
| 138 |
lhf. It also wraps libcerf usage. |
| 139 |
|
| 140 |
lfs: |
| 141 |
|
| 142 |
In LuaTeX we use a patched version of this library. In LuaMetaTeX I rewrote the |
| 143 |
code because too many patches were needed to deal with mswindows properly. |
| 144 |
|
| 145 |
socket: |
| 146 |
|
| 147 |
The core library is used. The library is seldom adapted but I keep an eye on it. |
| 148 |
We used to have a patched version in LuaTeX, but here we stay closer. I might |
| 149 |
eventually do some rewrite (less code) or decide to make it an external library. |
| 150 |
The related Lua code is not in the binary and context uses its own (derived) |
| 151 |
variant so that it uses our helpers as well as fits in the reporting system. I |
| 152 |
need to keep an eye on improvements upstream. We also need to keep an eye on |
| 153 |
copas as we use that code in context. |
| 154 |
|
| 155 |
luasec: |
| 156 |
|
| 157 |
This is not used but here as a reference for a possible future use (maybe as |
| 158 |
library). |
| 159 |
|
| 160 |
curl, ghostscript, graphicmagick, zint, mujs, mysql, postgress, sqlite, ...: |
| 161 |
|
| 162 |
The optional module mechamism supports some external libraries but we don't keep |
| 163 |
their code in the luametatex codebase. We might come up with a separate source |
| 164 |
tree for that, but only for some smaller ones. The large ones, those depending |
| 165 |
on other libraries, or c++, or whatever resources, will just be taken from the |
| 166 |
system. |
| 167 |
|
| 168 |
libcerf: |
| 169 |
|
| 170 |
This library might become external but is now in use as a plug into the complex |
| 171 |
number support that itself is meant for MetaPost use. The code here has been |
| 172 |
adapted to support the Microsoft compiler. I will keep an eye on what happens |
| 173 |
upstream and I reconsider matters later. (There is no real need to bloat the |
| 174 |
LuaMetaTeX binary with something that is rarely used.) |
| 175 |
|
| 176 |
kpse: |
| 177 |
|
| 178 |
There is optional library support for the KPSE library used in WEB2C. Although |
| 179 |
it does provide the methods that make sense, it is not meant for usage in |
| 180 |
ConTeXt, but more as a toolkit to identify issues and conflicts with parallel |
| 181 |
installations like TeXLive. |
| 182 |
|
| 183 |
posit: |
| 184 |
|
| 185 |
This is an experiment with compact high resolution 32 bit floating point |
| 186 |
numbers. We have a Lua interface but also a number moder in MetaPost. |
| 187 |
|
| 188 |
potrace: |
| 189 |
|
| 190 |
This library permmits us to play with bitmaps turned outlines, especially in |
| 191 |
MetaPost. It's little code for much fun. |
| 192 |
|
| 193 |
hb: |
| 194 |
|
| 195 |
I have a module that works the same as the ffi variant from a couple of years |
| 196 |
ago and I might add it when it's needed (for oriental tex font development |
| 197 |
checking purposes, but then I also need to cleanup and add some test styles for |
| 198 |
that purpose). Looking at the many LuaTeX subversion checkins it looks a bit |
| 199 |
like a moving target. It's also written in C++ which we don't (want to) use in |
| 200 |
LuaMetaTeX. But the library comes with other programs so it's likely you can |
| 201 |
find it on you system someplace. |
| 202 |
|
| 203 |
general: |
| 204 |
|
| 205 |
It's really nice to see all these libraries popping up on the web but in the |
| 206 |
perspective of something like TeX one should be careful. Quite often what is hip |
| 207 |
today is old fashioned tomorrow. And quite often the selling point of the new |
| 208 |
thing comes with bashing the old, which can be a sign of something being a |
| 209 |
temporary thing or itself something ot be superseded soon. Now, get me right: |
| 210 |
TeX in itself is great, and so are successors. In that sense LuaMetaTeX is just |
| 211 |
a follow up with no claims made for it being better. It just makes things easier |
| 212 |
for ConTeXt. You can kick in libraries but be aware of the fact that they can |
| 213 |
change, so if you have long running projects, make sure you save them. Or run a |
| 214 |
virtual machine that can last forever. TeX systems can run for ages that way. We |
| 215 |
might eventually add support for generating libs to the compile farm. The older |
| 216 |
a library gets, the bigger the change that its api is stable. Compression |
| 217 |
libraries are great examples, while libraries that deal with images, conversion |
| 218 |
and rendering are more moving (and have way more dependencies too). Actually, |
| 219 |
for the later category, in ConTeXt we prefer to call the command line variants |
| 220 |
instead of using libraries, also because it seldom influences performance. |
| 221 |
|
| 222 |
licenses: |
| 223 |
|
| 224 |
Most files contain some notice about a the license and most are quite liberal. |
| 225 |
I had to add some (notes) that were missing from LuaTeX. There is an occasional |
| 226 |
readme file that tells a bit more. |
| 227 |
|
| 228 |
explanations: |
| 229 |
|
| 230 |
The TeX derived source code contains many comments that came with the code when |
| 231 |
it was moved from "Pascal Web" to "C Web" (with web2c) to "C plus comments" (by |
| 232 |
Taco). These comments are mostly from Don Knuth as they were part of TeX The |
| 233 |
Program. However, some comments were added (or changed) in the perspective of |
| 234 |
eTeX, pdfTeX, Aleph, etc. We also added some in LuaTeX and LuaMetaTeX. So, in |
| 235 |
the meantime it's a mix. It us who made the mess, not Don! In due time I hope |
| 236 |
to go over all the comments and let them fit the (extended) code. |
| 237 |
|
| 238 |
dependencies: |
| 239 |
|
| 240 |
Often the files here include more h files than needed but given the speed of |
| 241 |
compilation that is no problem. It also helps to identify potential name clashes |
| 242 |
and such. |
| 243 |
|
| 244 |
legacy: |
| 245 |
|
| 246 |
Occasionally there is a file texlegacy.c that has some older (maybe reworked) |
| 247 |
code but I move it to another place when It gets too large and its code no |
| 248 |
longer can be retrofit. For me is shows a bit what got done in the (many) |
| 249 |
intermediate steps. |
| 250 |
|
| 251 |
-------------------------------------------------------------------------------- |
| 252 |
documentation |
| 253 |
-------------------------------------------------------------------------------- |
| 254 |
|
| 255 |
The code will be stepwise cleaned up a it (removing the web2c side effects), |
| 256 |
making the many branches stand out etc so that some aspects can be documented |
| 257 |
a bit better (in due time). All this will take time (and already quite some time |
| 258 |
went into it.) The official interface of LuaMetaTeX is described in the manual |
| 259 |
and examples of usage can be seen in ConTeXt. Of course TeX behaves as such. |
| 260 |
|
| 261 |
The organization of files, names of functions can change as we progress but when |
| 262 |
possible the knuthian naming is followed so that the documentation of "TeX The |
| 263 |
Program" still (mostly) applies. Some of the improvements in LuaMetaTeX can |
| 264 |
eventually trickle back into LuaTeX although we need to guard stability. The |
| 265 |
files here can *not* be dropped into the LuaTeX source tree! |
| 266 |
|
| 267 |
-------------------------------------------------------------------------------- |
| 268 |
reboot |
| 269 |
-------------------------------------------------------------------------------- |
| 270 |
|
| 271 |
I'll experiment with a reboot engine option but for sure that also interferes |
| 272 |
with a macro package initialization so it's a long term experiment. Quite |
| 273 |
certainly it will not pay off anyway so it might never happen. But there are |
| 274 |
some pending ideas so ... |
| 275 |
|
| 276 |
-------------------------------------------------------------------------------- |
| 277 |
libraries | ffi | luajit |
| 278 |
-------------------------------------------------------------------------------- |
| 279 |
|
| 280 |
We use optional libraries instead of ffi which is not supported because it is |
| 281 |
cpu and platform bound and the project that the code was taken from seems to |
| 282 |
be orphaned. Also luajit is not supported as that projects is stalled and uses |
| 283 |
an old lua. |
| 284 |
|
| 285 |
-------------------------------------------------------------------------------- |
| 286 |
cmake |
| 287 |
-------------------------------------------------------------------------------- |
| 288 |
|
| 289 |
We (Mojca and Hans) try to make the build as simple as possible with a minimum |
| 290 |
of depencies. There are some differences with respect to unix and windows (we |
| 291 |
support msvc, crosscompiled mingw and clang). The code of libraries that we use |
| 292 |
is included, apart from optional libraries. It can only get better. |
| 293 |
|
| 294 |
We really try to make all compilers happy and minimize the number of messages, |
| 295 |
even if that makes the code a bit less nice. It's a bit unfortunate that over |
| 296 |
time the demands and default change a bit (what was needed before triggers a |
| 297 |
warning later). |
| 298 |
|
| 299 |
-------------------------------------------------------------------------------- |
| 300 |
experiments |
| 301 |
-------------------------------------------------------------------------------- |
| 302 |
|
| 303 |
I've done quite some experiments but those that in the end didn't make sense, or |
| 304 |
complicated the code, or where nice but not that useful after all were simply |
| 305 |
deleted so that no traces are left that can clutter the codebase. I'll probably |
| 306 |
for get (and for sure already have forgotten) about most of them so maybe some |
| 307 |
day they will show up as (different) experiments. We'll see how that goes. |
| 308 |
|
| 309 |
-- miniz : smaller pdf files, less code, similar performance |
| 310 |
-- mimalloc : especially faster for the lua subsystem |
| 311 |
|
| 312 |
-------------------------------------------------------------------------------- |
| 313 |
performance |
| 314 |
-------------------------------------------------------------------------------- |
| 315 |
|
| 316 |
By now the codebase is different from the LuaTeX one and as a consequence the |
| 317 |
performance can also differ. But it's hard to measure in ConTeXt because much |
| 318 |
more has to be done in Lua and that comes at a price. The native LuaTeX backend |
| 319 |
is for instance much faster (last time meausred the penalty can be up to 20%). |
| 320 |
On the Internet one can run into complaints about performance of LuaTeX with |
| 321 |
other macro packages, so one might wonder why we made this move but speed is |
| 322 |
not everything. On the average ConTeXt has not become less efficient, or |
| 323 |
at least I don't see its users complain much about it, so we just moved on. |
| 324 |
|
| 325 |
The memory footprint at the engine end is somewhat smaller but of course that |
| 326 |
gets compensated by memory consumption at the Lua end. We also sacrifice the |
| 327 |
significate gain of the faster LuaJIT virtual machine (although at some point |
| 328 |
supporting that variant makes not much sense any more as it lacks some Lua |
| 329 |
features). Because, contrary to other TeX's the Lua(Meta)TeX frontend code |
| 330 |
is split up in separate units, compilers can probably do less optimization, |
| 331 |
although we use large compilations units that are mostly independent of each |
| 332 |
other. |
| 333 |
|
| 334 |
Eventually, in a next stage, I might be able to compentate it but don't expect |
| 335 |
miracles: I already explored all kind of variations. Buying a faster machine is |
| 336 |
always an option. Multiple cores don't help, faster memory and caching of files |
| 337 |
does. Already early in the LuaTeX development we found that a CPU cache matters |
| 338 |
but (definitely on server with many a virtual machines) there LuaMetaTeX has to |
| 339 |
compete. |
| 340 |
|
| 341 |
So, at this point my objective is not so much to make LuaMetaTeX run faster but |
| 342 |
more to make sure that it keeps the same performance, even if more functionality |
| 343 |
gets added to the TeX, MetaPost and/or Lua parts. Also keep in mind that in the |
| 344 |
end inefficient macros and styles play a bigger role that the already pretty |
| 345 |
fast engine. |
| 346 |
|
| 347 |
-------------------------------------------------------------------------------- |
| 348 |
rapid development cycle |
| 349 |
-------------------------------------------------------------------------------- |
| 350 |
|
| 351 |
Because I don't want to divert too much (and fast) from the way traditional TeX |
| 352 |
is coded, the transition is a stepwise process. This also means that much code |
| 353 |
that first has been abstracted and cleaned up, later goes. The extra work that |
| 354 |
is involved, combined with a fast test cycle with the help of ConTeXt users |
| 355 |
ensures that we keep a working ConTeXt although there occasionally are periods |
| 356 |
with issues, especially when fundamentals change or are extended. However, the |
| 357 |
number of temporary bugs is small compared to the number of changes and |
| 358 |
extensions and worth the risk. The alternative is to have long periods where we |
| 359 |
don't update the engine, but that makes testing the related changes in ConTeXt |
| 360 |
rather cumbersome. After all, the engine targets at ConTeXt. But of course it is |
| 361 |
kind of a pity that no one sees what steps were used to get there. |
| 362 |
|
| 363 |
-------------------------------------------------------------------------------- |
| 364 |
api |
| 365 |
-------------------------------------------------------------------------------- |
| 366 |
|
| 367 |
Although some symbols can be visible due to the fact that we maek them extern as |
| 368 |
past of a code splitup, there is no api at all. Don't expect the names of the |
| 369 |
functions and variables that this applies to to remain the same. Blame yourself |
| 370 |
for abusing this partial exposure. The abstraction is in the \LUA\ interface and |
| 371 |
when possible that one stays the same. Adding more and more access (callbacks) |
| 372 |
won't happen because it has an impact on performance. |
| 373 |
|
| 374 |
Because we want to stay close to original TeX in many aspects, the names of |
| 375 |
functions try to match those in ttp. However, because we're now in pure C, we |
| 376 |
have more functions (and less macros). The compiler will inline many of them, |
| 377 |
but plenty will show up in the symbols table, when exposed. For that reason we |
| 378 |
prefix all functions in categories so that they at least show up in groups. It |
| 379 |
is also the reason why in for instance the optional modules code we collect all |
| 380 |
visible locals in structs. It's all a stepwise process. |
| 381 |
|
| 382 |
The split in tex* modules is mostly for convenience. The original program is |
| 383 |
monolithic (you can get an idea when you look at mp.c) so in a sense they should |
| 384 |
all be seen as a whole. As a consequence we have tex_run_* as externals as well |
| 385 |
as locals. It's just an on-purpose side effect, not a matter of inconsistency: |
| 386 |
there is no tex api. |
| 387 |
|
| 388 |
-------------------------------------------------------------------------------- |
| 389 |
todo (ongoing) |
| 390 |
-------------------------------------------------------------------------------- |
| 391 |
|
| 392 |
- All errors and warnings (lua|tex|fatal) have to be checked; what is critital |
| 393 |
and what not. |
| 394 |
- I need to figure out why filetime differs between msvc and mingw (daylight |
| 395 |
correction probably). |
| 396 |
- Nested runtime measurement is currently not working on unix (but it works ok |
| 397 |
on microsoft windows). |
| 398 |
- I will check the manual for obsolete, removed and added functionality. This |
| 399 |
is an ongoing effort. |
| 400 |
- Eventually I might do some more cleanup of the mp*.w code. For now we keep |
| 401 |
w files, but who knows ... |
| 402 |
- A bit more reshuffling of functions to functional units is possible but that |
| 403 |
happens stepwise as it's easy to introduce bug(let)s. I will occasionally go |
| 404 |
over all code. |
| 405 |
- I might turn some more macros into functions (needs some reshuffling too) |
| 406 |
because it's nicer wrt tracing issues. When we started with LuaTeX macros |
| 407 |
made more sense but compilers got better. In the meantime whole program |
| 408 |
optimization works okay, but we cannot do that when one also wants to load |
| 409 |
modules. |
| 410 |
- A side track of the lack of stripping (see previous note) is that we need to |
| 411 |
namespace locals more agressive ... most is done. |
| 412 |
- We can clean up the dependency chain i.e. header files and such but this is |
| 413 |
a long term activity. It's also not that important. |
| 414 |
- Maybe nodememoryword vs tokenmemoryword so that the compiler can warn for a |
| 415 |
mixup. |
| 416 |
- Remove some more (also cosmetic) side effects of mp library conversion. |
| 417 |
- Replace some more of the print* chains by the more compact print_format call |
| 418 |
(no hurry with that one). |
| 419 |
- The naming between modules (token, tex, node) of functions is (historically) |
| 420 |
a bit inconsistent (getfoo, get_foo etc) so I might make that better. It does |
| 421 |
have some impact on compatibility but one can alias (we can provide a file). |
| 422 |
- Some more interface related code might get abstracted (much already done). |
| 423 |
- I don't mention other (either or not already rejected) ideas and experiments |
| 424 |
here (like pushing/popping pagebuilder states which is messy and also demands |
| 425 |
too much from the macro package end.) |
| 426 |
- Stepwise I'll make the complete split of command codes (chr) and subtypes. |
| 427 |
This is mostly done but there are some leftovers. It also means that we no |
| 428 |
longer are completely in sync with the internal original \TEX\ naming but I'll |
| 429 |
try to remain close. |
| 430 |
- The glyph and math scale features do not yet check for overflow of maxdimen |
| 431 |
but I'll add some more checks and/or impose some limitations on the scale |
| 432 |
values. We have to keep in mind that TeX itself also hapilly accepts some |
| 433 |
wrap around because it doesn't really crash the engine; it just can have side |
| 434 |
effects. |
| 435 |
|
| 436 |
-------------------------------------------------------------------------------- |
| 437 |
todo (second phase) |
| 438 |
-------------------------------------------------------------------------------- |
| 439 |
|
| 440 |
Ideally we'd like to see more local variables (like some cur_val and such) but |
| 441 |
it's kind of tricky because these globals are all over the place and sometimes |
| 442 |
get saved and restored (so that needs careful checking), and sometimes such a |
| 443 |
variable is expected to be set in a nested call. It also spoils the (still |
| 444 |
mostly original) documentation. So, some will happen, some won't. I actually |
| 445 |
tested some rather drastic localization and even with tripple checking there |
| 446 |
were side effects, so I reverted that. (We probably end up with a mix that |
| 447 |
shows the intention.) |
| 448 |
|
| 449 |
Anyway, there are (and will be) some changes (return values instead of accessing |
| 450 |
global) that give a bit less code on the one hand (and therefore look somewhat |
| 451 |
cleaner) but are not always more efficient. It's all a matter of taste. |
| 452 |
|
| 453 |
I'm on and off looking at the files and their internal documentation and in the |
| 454 |
process rename some variables, do some extra checking, and remove unused code. |
| 455 |
This is a bit random activity that I started doing pending the first official |
| 456 |
release. |
| 457 |
|
| 458 |
Now that the math engine has been partly redone the question is: should we keep |
| 459 |
the font related control options? They might go away at some point and even |
| 460 |
support for traditional eight bit fonts might be dropped. We'll see about that. |
| 461 |
|
| 462 |
That is: we saw about it. End 2021 and beginning of 2022 Mikael Sundqvist and I |
| 463 |
spent quite a few months on playing around with new features: more classes, inter |
| 464 |
atom spacing, inter atom penalties, atom rules, a few more FontParameters, a bit |
| 465 |
more control on top of what we already had, etc. In the end some of the control |
| 466 |
already present became standardized in a way that now prefers OpenType fonts. |
| 467 |
Persistent issues with fonts are now dealt with on a per font basis in ConteXt |
| 468 |
using existing as well as new tweaking features. We started talking micro math |
| 469 |
typography. Old fonts are still supported but one has to configure the engine |
| 470 |
with respecty to the used technology. Another side effect is that we now store |
| 471 |
math character specifications in nodes instead of a number. |
| 472 |
|
| 473 |
It makes sense to simplify delimiters (just make them a mathchar) and get rid of |
| 474 |
the large family and char. These next in size and extensibles are to be related |
| 475 |
anyway so one can always make a (runtime) virtual font. The main problem is that |
| 476 |
we then need to refactor some tex (format) code too becuase we no longer have |
| 477 |
delimiters there too. |
| 478 |
|
| 479 |
-------------------------------------------------------------------------------- |
| 480 |
dependencies |
| 481 |
-------------------------------------------------------------------------------- |
| 482 |
|
| 483 |
There are no depencies on code outside this tree and we keep it that way. If you |
| 484 |
follow the TeXLive (LuaTeX) source update you'll notice that there are quite |
| 485 |
often updates of libraries and sometimes they give (initial) issues when being |
| 486 |
compiled, also because there can be further dependencies on compilers as well as |
| 487 |
libraries specific to a (version of) an operating system. This is not something |
| 488 |
that users should be bothered with. |
| 489 |
|
| 490 |
Optional libraries are really optional and although an API can change we will |
| 491 |
not include related code in the formal LuaMetaTeX code base. We might offer some |
| 492 |
in the build farm (for building libraries) but that is not a formal dependency. |
| 493 |
We will of course adapt code to changes in API's but also never provide more |
| 494 |
than a minimal interface: use Lua when more is needed. |
| 495 |
|
| 496 |
We keep in sync with Lua development, also because we consider LuaMetaTeX to be |
| 497 |
a nice test case. We never really have issues with Lua anyway. Maybe at some |
| 498 |
point I will replace the socket related code. The mimalloc libraries used gives |
| 499 |
a performance boost but we could do without. The build cerf library might be |
| 500 |
replaced by an optional but it also depends on the complex datatype being more |
| 501 |
mature: there is now a fundamental difference between compilers so we have a |
| 502 |
patched version; the code doesn't change anyway, so maybe it can be stripped. |
| 503 |
|
| 504 |
In practice there have been hardly any updates to the libraries that we do use: |
| 505 |
most changes are in auxiliary programs and make files anyway. When there is an |
| 506 |
update (most are on github) this is what happens: |
| 507 |
|
| 508 |
-- check out code |
| 509 |
-- compare used subset (like /src) with working copy |
| 510 |
-- merge with working copy if it makes sense (otherwise delay) |
| 511 |
-- test for a while (local compilation etc.) |
| 512 |
-- compare used subset again, this time with local repository |
| 513 |
-- merge with local repository |
| 514 |
-- push update to the build farm |
| 515 |
|
| 516 |
So, each change is checked twice which in practice doesn't take much time but |
| 517 |
gives a good idea of the kind of changes. So far we never had to roll back. |
| 518 |
|
| 519 |
We still use CWEB formatting for MetaPost which then involves a conversion to C |
| 520 |
code but the C code is included. This removes a depedency on the WEB toolchain. |
| 521 |
The Lua based converter that is part of this source tree works quite well for |
| 522 |
our purpose (and also gives nicer code). |
| 523 |
|
| 524 |
We don't do any architecture (CPU) or operating system specific optimizations, |
| 525 |
simply because there is no real gain for LuaMetaTeX. It would only introduce |
| 526 |
issues, a more complex build, dependencies on assembly generators, etc. which |
| 527 |
is a no-go. |
| 528 |
|
| 529 |
-------------------------------------------------------------------------------- |
| 530 |
on the agenda |
| 531 |
-------------------------------------------------------------------------------- |
| 532 |
|
| 533 |
I will stepwise adapt some code to C23, like the native boolean types as well as |
| 534 |
decimal64 instead of the decimal library. This can only happen in detail when |
| 535 |
all compilers that we support provide these features. This is mostly a "when I |
| 536 |
see it cq. when I am in the mood I will do it" kind of activity. |
| 537 |
|
| 538 |
-------------------------------------------------------------------------------- |
| 539 |
team / responsibilities |
| 540 |
-------------------------------------------------------------------------------- |
| 541 |
|
| 542 |
The LuaTeX code base is part of the ConTeXt code base. That way we can guarantee |
| 543 |
its working with the ConTeXt macro package and also experiment as much as we |
| 544 |
like without harming this package. The ConTeXt code is maintained by Hans Hagen |
| 545 |
and Wolfgang Schuster with of course help and input from others (those who are |
| 546 |
on the mailing list will have no problem identifying who). Because we see the |
| 547 |
LuaMetaTeX code as part of that effort, starting with its more or less official |
| 548 |
release (version 2.05, early 2020), Hans and Wolfgang will be responsible for |
| 549 |
the code (knowing that we can always fall back on Taco) and explore further |
| 550 |
possibilities. Mojca Miklavec handles the compile farm, coordinates the |
| 551 |
distributions, deals with integration in TeXLive, etc. Alan Braslau is the first |
| 552 |
line tester so that in an early stage we can identify issues with for TeX, |
| 553 |
MetaPost, Lua and compilation on the different platforms that users have. |
| 554 |
|
| 555 |
Math, one of the core building blocks of the TeX engine has been significantly |
| 556 |
upgraded (starting 2021+). Mikael Sundqvist and I spent a lot of time on this |
| 557 |
project which also involves (tweaking) fonts. We also have a MetaPost agenda |
| 558 |
(224+) and diverge in other fundamental improvements (2022+), like the extended |
| 559 |
par builder. |
| 560 |
|
| 561 |
If you run into problems with LuaMetaTeX, the ConTeXt mailing list is the place |
| 562 |
to go to: [email protected]. Of course you can also communicate LuaTeX problems |
| 563 |
there, especially when you suspect that both engines share it, but for specific |
| 564 |
LuaTeX issues there is [email protected] where the LuaTeX team can help you |
| 565 |
further. |
| 566 |
|
| 567 |
This (mid 2018 - begin 2020) is the first stage of the development. Before we |
| 568 |
move on, we (read: users) will first test the current implementation more |
| 569 |
extensively over a longer period of time, something that is really needed because |
| 570 |
there are lots of accumulated changes, and I would not be surprised if subtle |
| 571 |
issues have been introduced. In the meantime we will discuss how to follow up. |
| 572 |
|
| 573 |
The version in the distribution is always tested with the ConteXt test suite, |
| 574 |
which hopefully uncovers issues before users notice. |
| 575 |
|
| 576 |
Stay tuned! |
| 577 |
-------------------------------------------------------------------------------- |
| 578 |
|
| 579 |
-------------------------------------------------------------------------------- |
| 580 |
ConTeXt websites : http://contextgarden.net http://www.pragma-ade.nl |
| 581 |
Development list : [email protected] |
| 582 |
Support list : [email protected] |
| 583 |
User groups : http://ntg.nl http://tug.org etc |
| 584 |
-------------------------------------------------------------------------------- |
| 585 |
|
| 586 |
-------------------------------------------------------------------------------- |
| 587 |
Hans Hagen : [email protected] |
| 588 |
-------------------------------------------------------------------------------- |