[texworks] Lua scripting

Jérome Laurens jerome.laurens at u-bourgogne.fr
Tue Jun 16 11:56:07 CEST 2009

Le 15 juin 09 à 22:39, Reinhard Kotucha a écrit :

> On 15 June 2009 Jérome Laurens wrote:
>> Le 14 juin 09 à 23:45, Reinhard Kotucha a écrit :
>>> On 14 June 2009 Jérome Laurens wrote:
>>>> Things are not that simple.
>>>> TeXWorks natural audience is the beginner in TeX, and most probably
>>>> in
>>>> scripting too. [...]
>>> I never had in mind that users should be bothered with scripting at
>>> all.  They should neither be forced nor encouraged to write their  
>>> own
>>> scripts or to install arbitrary scripts they find in the internet.
>> [...]
>> This point of view is definitely valuable, and one can add that the
>> users should not be bothered with the underlying xetex, luatex,
>> pdftex, latex, context neither.
>> In fact, there are 2 different approaches
>> 1) TeXWorks lowers the barrier to entry and nothing else
>> 2) TeXWorks also adapts to the user need
>> This discussion about scripting (and indirectly plugins) is related  
>> to
>> point 2.
>> If we restrict ourselves to point 1, then there is nothing to add.
>> My opinion is that we should have (in a longer term) TeXWorks for
>> point 1 and TeXWorks pro for point 2.
>> Both should have exactly the same underlying code (with very few
>> branching points), but the first one would have a very simple user
>> interface (no scripting for example).  When people feel limited
>> with TeXWorks, they just "switch" to TeXWorks pro.
> Hmm, I suggested Lua because a lot of features needed by beginners
> could better be written in Lua.  What I have in mind is a
> log-analyzer, interfaces to texdoc and to Robin's FAQ, for example.
> With a Lua engine and a reasonable interface things could be done
> easier and faster.  It's easier to contribute code because you don't
> have to compile the binary if you add a new feature.  You also don't
> have to worry so much about platform dependencies if you provide Lua
> code.  And it's less dangerous because if your script doesn't work, it
> can simply be removed, without changing the binary.
> The idea is to have a program which can be extended easily without
> changing the program itself.  For instance, a C compiler provides only
> the absolutely necessary functionality, everything else comes from
> external libraries.  TeX, the program, only provides the primitives
> which are absolutely necessary, everything else comes from macro
> packages.  There are many other examples.  It's easier and much safer
> if you don't have to change the binary in order to add new features.
> But why do you think that the presence of a scripting language makes
> TeXworks more difficult to use?  As I said, I regard this as something
> internal, not as something the user should be aware of.
> So, I don't think that it's very useful to have two versions.  If the
> version for beginners doesn't contain a Lua engine, then all the
> functions a beginner needs have to be written in C.  And exactly this
> is what I'd like to avoid in order to make things easier for  
> volunteers.

To understand things, take a TeXWorks Pro, then remove from the user  
interface all the menu items, panels and widgets that are over  
complicated for a beginner,
then you obtain TeXWorks. Same C code, same Lua scripts and so on.  
Only the user interface changes.

No need to have some kind of TeXWorks Pro by now, just a neat lua  
scripting implementation that will not require a lot of rework when  
scripting will be open to the user.
But such a neat implementation must anticipate further enhancements,  
this is where the security problem pops up.


More information about the texworks mailing list