[texworks] A request about lpeg

Christophe Devalland christophe.devalland at gmail.com
Tue Dec 23 16:59:08 CET 2014


2014-12-23 15:46 GMT+01:00 Stefan Löffler <st.loeffler at gmail.com>:

> 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 Stefan,
Ok, I understand.

That said, lpeg seems like a very general and useful extension in the
> context of an editor such as TeXworks (providing text parsing
> functionality).


Yes indeed.


> Therefore, I changed the build process for Lua to now
> use dlls. This again somewhat contradicts the idea of having everything
> in a single exe file to avoid "dll hell", but seemed the only (easy)
> way. lpeg is not included by default, but a suitable dll can be
> downloaded from Google Drive
> (
> https://drive.google.com/folderview?id=0B5iVT8Q7W44pNDlQVm9uRGpEWHc&tid=0B5iVT8Q7W44pMkNLblFjUzdQUVE
> > Lua 5.2 Modules). Just drop the dll in the same directory as
> TeXworks.exe and lua52.dll and it should work.
>

Great, thank you.
I've already tried to add a lpeg.dll file (that I compiled against lua5.2)
into the texworks directory but I had an error.
With your latest release (r1390) I have the same lua5.2's error : "multiple
Lua VMs detected". But there is no crash.
Other users had this error and solved it :
http://stackoverflow.com/questions/14213559/lua5-2s-error-multiple-lua-vms-detected
If I understand, you statically included lua5.2 library in texworks.exe and
lpeg.dll call lua52.dll, so there is now two lua engines.
There are probably two ways to solve this issue :
1) statically include lpeg.dll in teworks ! (only 40KB when I compile it
and, as you said, very usefull to parse expressions with texworks !)
2) dynamically link texworks.exe against lua52.dll, then there will be only
one lua engine for both texworks.exe and lpeg.dll. But you would have to
add lua52.dll in your package.


> Note that it should in principle be possible to use other modules as
> well, but I don't know exactly about the possible compatibility issues
> (e.g., does it need to be compiled with the same compiler? Does it need
> to be the same Lua version?). I tried briefly with some precompiled Lua
> 5.1 libraries I got off the internet which caused Tw to crash.
>

idem for me. You used lua52 for texworks (isn't it ?) and it crash with a
lua51 dll

Thank's again,
kind regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texworks/attachments/20141223/6fae87c5/attachment.html>


More information about the texworks mailing list