[texworks] Scripting: Any Windowed Application that Can Write to the Console

Stefan Löffler st.loeffler at gmail.com
Thu Apr 22 08:05:03 CEST 2010


Am 2010-04-22 04:29, schrieb Paul A Norman:
> I was all fired up when your initial QTwebkit patch arrived out of the
> blue. Seemed like the answer to a range of things for me.

I didn't intend to demotivate anyone, and I'm sure Jonathan felt the
same way. Getting more active contributers to Tw is a very good things
and different opinions/points of view generally broaden our own
horizons. Nevertheless, some words of caution are sometimes in order.

> So when that appeared to fall over for incorporation in Tw, Jonathan's
> reasons in the Issues List were very sound, being all fired up I
> trialed this alternative approach in Delphi but only for proof of
> concept (ease of doing such a trial in Delphi- immeadite native
> support for windowed environments from console) and it was not yet
> clear how to do it in the open source alternative, but mentioned it
> for Mac Linux and Win as it would actually be implemented if I were to
> continue down that line, in Lazarus and FreePascal, opesource IDE and
> Open Source implementation in all of those OSs (Mac Linux Win ... BSD
> etc ), write cross-platform code once -- compile OS specifically.

Compiling OS specifically is a noble goal - it's just not as easy as it
sounds. First of all, you need access to all OSs. Secondly, different
versions of the same OS may require separate compilations (think of
Linux and its dozens of distributions - all of which have subtle
differences which often makes using an application from one distribution
on another difficult to near-impossible (without recompilation)).

The Tw codebase itself will hopefully (one day) be compiled by dozens of
different maintainers for all the OSs and versions that are out there
(as a matter of fact, this already happens through the TL maintainers
and some others to a degree). As long as your applications are provided
separately, people will not necessarily maintain your scripts/apps, too.
So you'd have to do that yourself.

I don't say it's impossible, it's just a lot of work - that may be
avoidable if you are able to implement the same thing with an
interpreted (scripting) language supported by Tw.

> The one benefit I kept thinking of in putting effort in through
> Lazarus (or more particualry the console 'interface' - development
> environment-independant in concept) was that the effort put in would
> help any other opensource LaTeX editors as well, no matter what
> environement they were written in.

Agreed. On the other hand, python scripts for example can be converted
to executables. I've never done this myself before, but maybe Alain has
gained some experience (I think he asked me about it some time ago).

> A console connection is genreally the most vanilla and useful, being
> no respector of developent environments in either direction, and not
> being an OS dependant technology like COM. And only exchanging plain
> text through a specifically opened and filtered pipe has a nice secure
> / security  feeling about it. And JSON, also plain text, even helps us
> with transfering whole data structures to the Tw scripting back ends.
> No hiddens possible if the Tw (or whatever) auxialary helper's code is
> opensource!

I don't want to sound too pessimistic, but there are some problems with
the console as well. In particular, there are encoding issues. Some
consoles (I believe in particular on Windows?) use the system's local
encoding - which means that some uncommon symbols (Russian, Chinese, ...
unless you have the corresponding version of Windows) may cause garbage
output. Again, this won't be a big issue in most cases, but I think it's
worth mentioning.

> Reading in the Issues area that the Qt ui generator is being
> considered for direct use with Js and Tw objects, that also sounds
> great -- even with the additional learning curve of some Qt specific
> commands for people, and may provide as good an opening and  the same
> oppertuniy for the same range of people who wish to put the effort in
> to up-skill themselves, as a css html DOM Js approach would have.
>  It feels appealing to me for some reason, and may be less complicated
> for Tw development in the long run.

Indeed (hopefully). AFAIK, Jonathan is currently working on combining
his own code changes and my patch - so this may come in the near future.
There will still be a couple of limitations, but for basic user
interface issues this should provide all you need.

> In that case, whjile still weighing up the merits of availablility of
> functiuonality to other OpenSource LaTeX projects,  I would genreally
> look to a Lazarus -> Tw console uptake, or simllar type approach,
> primarily to accomplish things that may not be possible or available
> in any other provided approach in Tw or Qt ui.

By all means. I'd still suggest looking at interpreted languages (lua,
python, or suggest another one for inclusion in Tw ;)) before using one
that needs compilation - but that's your decision, of course.


More information about the texworks mailing list