[texworks] A request about lpeg

Reinhard Kotucha reinhard.kotucha at web.de
Sat Dec 27 01:47:10 CET 2014


On 2014-12-23 at 15:46:35 +0100, Stefan Löffler wrote:

 > Hi,
 > 
 > On 16.12.2014 23:37, Christophe Devalland wrote:
 > > it's nice to provide lua scripts inside texworks but it would be great
 > > to be able to use the lpeg library (a parsing expression grammars for
 > > lua) in lua scripts.
 > 
 > Good to hear that Lua is actually used ;).
 > 
 > > On linux there is no problem because texworks-lua scripts use the lua
 > > installed by the user.
 > > On windows, the lua interpreter is included in texworks executable
 > > during compilation but without lpeg. Would it be possible you compile
 > > the next version with lpeg inside ? Many windows users tell me they
 > > can't use my package because of this library missing.
 > 
 > Generally, I don't want to compile in (too many) modules because it
 > somewhat contradicts the idea of modules (i.e., something that you can
 > plug in and out depending on what you need). Also, it increases the
 > download size with something that is probably not used by a majority of
 > users.

Hi,
admittedly there are a few things I don't understand.

 > > On linux there is no problem because texworks-lua scripts use the
 > > lua installed by the user.

Does it mean that /usr/bin/lua is invoked by TeXworks in order to
process external lua scripts or does it mean that the Lua sources
present on a Linux system are compiled into the TeXworks binary?

I hope that the latter is true, otherwise it's impossible to make
internal data structures of TeXworks available to Lua.

Assumed that Lua is compiled into TeXworks, what I don't understand is
why different platforms are treated differently.  IMO platform
independency is a must.

I'm not convinced that it's a good idea to use the original Lua
sources and libraries at all.  A better choice is texlua, a LuaTeX
without TeX.  It's already present in all TeX distributions.  You'll
find the sources in the TeX Live SVN repository.

The main advantages of texlua is that it contains many Lua libraries,
extensions written by Taco (in order to make things more
platform-independent), and, very important, an interface to kpathsea.
texlua provides lpeg of course.

You said

 > I don't want to compile in (too many) modules because it somewhat
 > contradicts the idea of modules

What is the idea of modules?  All binaries in TeX Live are statically
linked.  They are highly portable.  Even the ancient teTeX binaries
from the mid-nineties still run on modern machines.  TeXworks isn't
portable at all because it depends on particular versions of Qt which
are not necessarily present on all systems.  Making things modular
(using .so and .dll files) is certainly a bad idea.  IMO the only
reasonable approach is to statically link texlua into TeXworks.

Regards,
  Reinhard

-- 
------------------------------------------------------------------
Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de
------------------------------------------------------------------



More information about the texworks mailing list