summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/onandon
diff options
context:
space:
mode:
Diffstat (limited to 'doc/context/sources/general/manuals/onandon')
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-53.tex25
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-execute.tex28
2 files changed, 48 insertions, 5 deletions
diff --git a/doc/context/sources/general/manuals/onandon/onandon-53.tex b/doc/context/sources/general/manuals/onandon/onandon-53.tex
index 0d5dc1b9c..46eac3510 100644
--- a/doc/context/sources/general/manuals/onandon/onandon-53.tex
+++ b/doc/context/sources/general/manuals/onandon/onandon-53.tex
@@ -281,6 +281,31 @@ intermediate versions of the \LUA\ 5.3 binary will end up on the \CONTEXT\
garden, probably with number 1.08 and 1.09 (who knows what else we will add or
change in the meantime).
+\subsubject{addendum}
+
+Around the 2018 meeting I started with what is to become the next major upgrade
+of \CONTEXT, this time using \LUAMETATEX. When working on that I decided to try
+\LUA\ 5.4 and see what consequences that would have for us. There are no real
+conceptual changes, as with the number model in 5.3, so the tests didn't reveal
+any issues. But as an additional step towards a bit cleaner distinction between
+strings and numbers, I disabled the casting so that mixing them in expression for
+instance is no longer permitted. If I remember right only in one place I had to
+adapt the source (and in the meantime we're talking of a pretty large code base).
+
+There is a new mechanism for freezing constants but I'm not yet sure if it makes
+much sense to use it. It goes along with some other restrictions, like the
+possibility to adapt loop counters inside the loop. Inside the body of a loop one
+could always adapt such a variable, which (I can imagine) can come in handy. I
+didn't check yet the source code for that, but probably I don't do that.
+
+Another new features is an alternative garbage collector which seems to perform
+better when there are many variables with s short live span. For now I decided
+to default to this variant in future releases.
+
+Overall the performance of \LUA\ 5.4 is better than its predecessors which means
+that the gape between \LUATEX\ and \LUAJITTEX\ is closing. This is good because
+in \LUAMETATEX\ I will not support that variant.
+
\stopchapter
\stopcomponent
diff --git a/doc/context/sources/general/manuals/onandon/onandon-execute.tex b/doc/context/sources/general/manuals/onandon/onandon-execute.tex
index abb3b4d8a..bd11dfa73 100644
--- a/doc/context/sources/general/manuals/onandon/onandon-execute.tex
+++ b/doc/context/sources/general/manuals/onandon/onandon-execute.tex
@@ -134,14 +134,17 @@ which can also be achieved by
\directlua{print("Hi there!")}
\stoptyping
-which sometimes can be more convenient. Anyway, a function call is what we can
-use for our purpose as it doesn't involve interpretation and effectively behaves
-like a tail call. The following snippet shows what we have in mind:
+which sometimes can be more convenient. Don't overestimate the gain in speed
+because \type {directlua} is quite efficient too, and on an average run a user
+doesn't call it that often (millions of times that is). Anyway, a function call
+is what we can use for our purpose as it doesn't involve interpretation and
+effectively behaves like a tail call. The following snippet shows what we have in
+mind:
\startbuffer[code]
local stepper = nil
local stack = { }
-local fid = 0xFFFFFF
+local fid = 2 -- make sure to take a frees slot
local goback = "\\luafunction" .. fid .. "\\relax"
function tex.resume()
@@ -166,6 +169,14 @@ function tex.routine(f)
stepper = coroutine.create(f)
tex.sprint(goback)
end
+
+-- Because we protect against abuse and overload of functions, in ConTeXt we
+-- need to do the following:
+
+if context then
+ fid = context.functions.register(tex.resume)
+ goback = "\\luafunction" .. fid .. "\\relax"
+end
\stopbuffer
\ctxluabuffer[code]
@@ -238,7 +249,7 @@ course figuring it out took a while):
\startbuffer[code]
local stepper = nil
local stack = { }
-local fid = 0xFFFFFF
+local fid = 3 -- make sure to take a frees slot
local goback = "\\luafunction" .. fid .. "\\relax"
function tex.resume()
@@ -270,6 +281,13 @@ function tex.routine(f)
stepper = coroutine.create(f)
tex.sprint(goback)
end
+
+-- Again we need to do it as follows in ConTeXt:
+
+if context then
+ fid = context.functions.register(tex.resume)
+ goback = "\\luafunction" .. fid .. "\\relax"
+end
\stopbuffer
\ctxluabuffer[code]