[Dev-luatex] Module searching
Heiko Oberdiek
oberdiek at uni-freiburg.de
Tue Dec 11 12:03:44 CET 2007
On Tue, Dec 11, 2007 at 10:25:57AM +0100, Hans Hagen wrote:
> Heiko Oberdiek wrote:
>
> > Reimplementing kpse library in Lua with analyzing texmf.cnf
> > files, path expansion, ls-R lookup, ...?
>
> in this case i was more thinking of looking in the paths reported by
> kpse (given that the path variable can be expanded), so, no lookup, but
> looling at the file system; another option is that you just put the file
> alongside the tex file, lookup the tex file, replace the suffix and load
> the file; personally i see no need to put lua files that belong to tex
> in the scripts path;
That is not the ide behind TDS. File searching in large trees
is expensive. Thus the directory structure of TDS differentiates
between file types to reduce the search space.
> > The other file types are covered: TeX files, tfm files, type 1 files, ...
> > Missing is a proper support for lua scripts.
>
> lua scripts as such are like perl, ruby, whatever scripts; the
> texmfscript path is not for tex related (runtime embedded or whatever)
> scripts ... makes packaging a mess when we get a duplicate tree there,
> apart from clashes
A TeX distribution could precompile lua scripts and put them
in a definite place, e.g.
TDS:scripts/lua-compiled//
(eventually adding a os component, afaik precompiled scripts
aren't portable).
Then texmf.cnf could contain:
TEXMFSCRIPTS.lua = $TEXMF/scripts/lua-compiled//:$TEXMF/scripts//
Then as first component only contains compiled lua files, few
files, compared to all files below TDS:/scripts// or even
TDS:tex//.
Also not all Lua scripts must depend on LuaTeX. There could be
standalone variants, libraries for stuff not directly related to TeX.
> a solution indeed, but as said ... i wonder if texmfscripts is meant for
> that [...]
Using TDS:tex// you will have the same problem, if a module wants
to have path components. At least TDS has stricter unique constraints
below TDS:tex//. Two packages of the same format must not share
same file names.
Yours sincerely
Heiko <oberdiek at uni-freiburg.de>
More information about the dev-luatex
mailing list