Hi David,
On May 7, 2013, at 1:13 PM, David Kastrup
I've added some rough sketches at the end of the article that should make clear why this can't be done in formats alone but will require primitive support as well if things are supposed to turn out nicely.
My brain is wired such that code in the scheme language never clarifies anything, I fear. Nevertheless, I picked up something interesting from your postscript, and that is the tex:get_dimen() construct. Ignoring the catcode issues for the moment, I feel that the main reason why it is so hard currently to interface TeX -> Lua at the moment is the near-uselessness of the 'token' library. Extending that library (and its embedding) in such a way that it can reliably fetch various 'units' like dimensions and skips and integers from the input (either file or tokenlist), with or without expansion, would help a lot, IMO. The Lua -> TeX route is better covered at the moment, take e.g. ConTeXt's CLD files and Patrick's typesetting engine that is almost completely lua-based. As usual, I am busy with other stuff, but that does not stop me from --at least-- thinking about improving things. Best wishes, Taco