summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals
diff options
context:
space:
mode:
Diffstat (limited to 'doc/context/sources/general/manuals')
-rw-r--r--doc/context/sources/general/manuals/bidi/bidi.tex41
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-53.tex25
-rw-r--r--doc/context/sources/general/manuals/onandon/onandon-execute.tex28
3 files changed, 69 insertions, 25 deletions
diff --git a/doc/context/sources/general/manuals/bidi/bidi.tex b/doc/context/sources/general/manuals/bidi/bidi.tex
index abd3f64fa..fb3705a37 100644
--- a/doc/context/sources/general/manuals/bidi/bidi.tex
+++ b/doc/context/sources/general/manuals/bidi/bidi.tex
@@ -461,38 +461,39 @@ We assume that you run \CONTEXT\ \MKIV\ in combination with \LUATEX. Direction
support in this engine has been improved over time. Originally the \OMEGA\
(\ALEPH) direction model was used but in the meantime it has been stripped to the
basics, and what used to be so called whatsits (extension nodes) are now first
-class nodes. In the \LUA\ interface we still support the:
-
-\startitemize[packed]
-\startitem
- \type {TLT} and \type {TRT} keywords for local par nodes
-\stopitem
-\startitem
- \type {+TLT}, \type {-TLT}, \type {+TRT} and \type {-TRT} keywords for
- direction nodes
-\stopitem
-\stopitemize
-
-However, because we use dedicated nodes, and because nodes actually store numbers
-and not strings we also expose the numeric model:
+class nodes. Of the many directions only four are kept in \LUATEX\ and they are
+indicated by three letters:
\starttabulate[|l|l|l|]
\NC 0 \NC \type {TLT} \NC left to right \NC \NR
\NC 1 \NC \type {TRT} \NC right to left \NC \NR
-\NC 2 \NC \type {LTL} \NC not used in context \NC \NR
-\NC 3 \NC \type {RTT} \NC not used in context \NC \NR
+\NC 2 \NC \type {LTL} \NC not used in context (obsolete) \NC \NR
+\NC 3 \NC \type {RTT} \NC not used in context (obsolete) \NC \NR
\stoptabulate
-These values are used for local par nodes as well as direction nodes. In addition
-a direction node has a subtype:
+In \LUAMETATEX, and therefore \CONTEXT\ \LMTX\ we only have the first two.
+Therefore in \LMTX\ you normally don't have to worry about checking for them at
+the \LUA\ end because they are irrelevant for calculations (the vertical ones
+swapped the horizontal and vertical progression). Also, when really needed, we
+use the \type {direction} keys with numerical indicators, so zero for \type {l2r}
+and one for \type {r2l}. These values are used for local par nodes as well as
+direction nodes. In addition a direction node has a subtype:
\starttabulate[|l|l|l|]
\NC 0 \NC \type {normal} \NC comparable to \type {+} \NC \NR
\NC 1 \NC \type {cancel} \NC comparable to \type {-} \NC \NR
\stoptabulate
-The \type {dir} field uses the strings, the \type {direction} field the number
-(both of course share the same internal node variable).
+\stopchapter
+
+\startchapter[title={Going vertical}]
+
+Normally the term bidi is reserved for horizontal direction swapping but there is
+no reason to limit our view to that. So, here I will spend some words on how we
+can deal with vertical directions.
+
+{\em I will move some (not yet public) explanation from elsewhere to here in due
+time.}
\stopchapter
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]