Hi, Recently i've started looking into Lua, a language meant for embedding in programs. It has a small footprint, and by reading themanukl i get the impression that it's a pretty well designed and clever language. So (after playing with lua and scite, which has it embedded) i started wondering about including lua in pdftex. Of course i'm dependent on others but i'm curious abotu wat members of this list think of it. It has quite a clever function model. Especially because it has a small footprint (some 100-150 k) it would add a lot to pdftex but at little cost. think of on the one hand: \dimen0=\lua{tex.todimen(tex.thedimen(0)+tex.thedimen(2)} kind of things, or \setbox2=\hbox to \lua{tex.todimen(somevar)} {\lua{tex.text("abcde")}} and alike. Of course the interface is to be determined, but a startingpoint can be access to box dimensions and registers and the ability to pipe text (strings) back into teh tex inpt stream. whatdoyouthink ... Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen wrote: [Extending pdftex with lua] Heh, extending a language with another one... I guess it could have its uses. I'd rather use Ruby, but it has a larger footprint and perhaps heavy OO wouldn't be a real merit for this type of extension. I don't quite see the usefulness from the examples you have included. Could you perhaps give a couple more? I like to see more of the stuff you're envisioning. Thanks, nikolai -- Nikolai Weibull: now available free of charge at http://bitwi.se/! Born in Chicago, IL USA; currently residing in Gothenburg, Sweden. main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
Nikolai Weibull wrote:
Hans Hagen wrote:
[Extending pdftex with lua]
Heh, extending a language with another one...
combining a typographic language with a procedural/oo/functional one -)
I guess it could have its uses. I'd rather use Ruby, but it has a larger footprint and perhaps heavy OO wouldn't be a real merit for this type of extension.
sure, ruby may be better, but it's getting so large .. .
I don't quite see the usefulness from the examples you have included.
that's just interfacing quite some low level messing around can be done more elegant if we have 'normal' datatypes (like floating points), multiple hash support, string processing, etc if there is a complete interface to the mvl for instance (access to tex's internal lists), we can built better routines e.g. multi column handling, catching border cases, etc
Could you perhaps give a couple more? I like to see more of the stuff you're envisioning.
the latest pdftex has a few new primitives, think of hex conversion, regular expressions and such, and there will never be enough of that; could be done more conveniently with a real language Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen wrote:
Nikolai Weibull wrote:
I don't quite see the usefulness from the examples you have included.
that's just interfacing
quite some low level messing around can be done more elegant if we have 'normal' datatypes (like floating points), multiple hash support, string processing, etc
if there is a complete interface to the mvl for instance (access to tex's internal lists), we can built better routines e.g. multi column handling, catching border cases, etc
And perhaps easier handling of stuff like references, indexes, lists, and so on?, nikolai -- Nikolai Weibull: now available free of charge at http://bitwi.se/! Born in Chicago, IL USA; currently residing in Gothenburg, Sweden. main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
Nikolai Weibull wrote:
Hans Hagen wrote:
Nikolai Weibull wrote:
I don't quite see the usefulness from the examples you have included.
that's just interfacing
quite some low level messing around can be done more elegant if we have 'normal' datatypes (like floating points), multiple hash support, string processing, etc
if there is a complete interface to the mvl for instance (access to tex's internal lists), we can built better routines e.g. multi column handling, catching border cases, etc
And perhaps easier handling of stuff like references, indexes, lists, and so on?,
right, all those manipulation related things Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Mon, 8 Aug 2005, Hans Hagen wrote:
Recently i've started looking into Lua, a language meant for embedding in programs. It has a small footprint, and by reading themanukl i get the impression that it's a pretty well designed and clever language. So (after playing with lua and scite, which has it embedded) i started wondering about including lua in pdftex. Of course i'm dependent on others but i'm curious abotu wat members of this list think of it. It has quite a clever function model. Especially because it has a small footprint (some 100-150 k) it would add a lot to pdftex but at little cost.
think of on the one hand:
\dimen0=\lua{tex.todimen(tex.thedimen(0)+tex.thedimen(2)}
or maybe \lua{tex.dimen(7) = tex.dimen(0)+tex.dimen(2)}
and alike. Of course the interface is to be determined, but a startingpoint can be access to box dimensions and registers and the ability to pipe text (strings) back into teh tex inpt stream.
whatdoyouthink ...
looks interesting. Lua is part of debian sarge, have to play with it. Seems regexs are not POSIX. Something similar but with a larger footprint, > 750 kByte, you would get from another language familiar to you :-) Embedding a Ruby Interpreter In addition to extending Ruby by adding C code, you can also turn the problem around and embed Ruby itself within your application. Here's an example... Similar principle. rubypdftex, luapdftex,... Regards, Hartmut
Hartmut Henkel wrote:
On Mon, 8 Aug 2005, Hans Hagen wrote:
Recently i've started looking into Lua, a language meant for embedding in programs. It has a small footprint, and by reading themanukl i get the impression that it's a pretty well designed and clever language. So (after playing with lua and scite, which has it embedded) i started wondering about including lua in pdftex. Of course i'm dependent on others but i'm curious abotu wat members of this list think of it. It has quite a clever function model. Especially because it has a small footprint (some 100-150 k) it would add a lot to pdftex but at little cost.
think of on the one hand:
\dimen0=\lua{tex.todimen(tex.thedimen(0)+tex.thedimen(2)}
or maybe \lua{tex.dimen(7) = tex.dimen(0)+tex.dimen(2)}
indeed, think it depends on the low level system, if we move scaled points (abstract) around
and alike. Of course the interface is to be determined, but a startingpoint can be access to box dimensions and registers and the ability to pipe text (strings) back into teh tex inpt stream.
whatdoyouthink ...
looks interesting. Lua is part of debian sarge, have to play with it. Seems regexs are not POSIX. Something similar but with a larger
no, but they are ok and pretty good;
footprint, > 750 kByte, you would get from another language familiar to you :-)
Embedding a Ruby Interpreter
sure, but too big and getting bigger; could be a next step -) the problem with ruby, python, perl is that it keeps growing and one needs to ship everything while lua is and remains small and (imo) is rather well suited forthe purpose actually, once we have an api, it's relatively easy to access it from ruby
In addition to extending Ruby by adding C code, you can also turn the problem around and embed Ruby itself within your application. Here's an example...
Similar principle. rubypdftex, luapdftex,...
indeed, Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Hartmut Henkel
-
Nikolai Weibull