:: Re: [DNG] Lua
Góra strony
Delete this message
Reply to this message
Autor: onefang
Data:  
Dla: dng
Nowe tematy: Re: [DNG] What languages are actually used?
Temat: Re: [DNG] Lua
On 2024-10-24 11:49:44, Didier Kryn wrote:
>    Le 24/10/2024 à 04:24, onefang a écrit :

>
> Sooo, I can write Lua in any language. B-)
>
>        AFAIU Lua is one of these few intrepreted languages which allow to add
>    scripting capability to programs written in other languages, like was the
>    IBM Rexx and the more widespread TCL. I mean that the interpreter can be
>    invoqued from within the application and invoque application-provided
>    procedures. TCL is more primitive but it comes with a graphical tool-kit.
>    Any idea of how to create a GUI with Lua?


I have used ARexx on the Amiga, which is based on Rexx.

The languages I picked for my hello world example was the result of
running the file command over /usr/bin to see what scripting languages
are actually being used there. TCL did pop up a few times, but I didn't
quickly find an example hello world that didn't involve GUI elements.
Never used TCL. So in theory this method of mine will work with TCL to
get a GUI into Lua. Contributions in other languages welcome.

I'm well aware of how you can hook Lua up to other languages, that's one
of the reasons I love it. C code can easily include a Lua interpreter, a
tiny bit of code. Then C can call Lua, and Lua can call C.

I was maintainer of the Lua interface for the Enlightenment Foundation
Libraries, which is the basis of the Enlightenment window manager. So I
have used that to create GUIs in the past, with a mixture of C and Lua.

I suspect the PHP example didn't work coz the example I copied from might
have been expecting a web server environment, with a web browser front
end, not just dumping text to stdout. But that might get you a web based
GUI.

LSL, Linden Scripting Language, is a C like scripting language for Second
Life and OpenSim virtual worlds. I wrote C code that translates that
into Lua, and runs it under LuaJIT. LSL has some very basic GUI
elements, but it can control the 3D world and respond to clicks on
objects and such. I barely count it as GUI though. lol

So plenty of ideas. I'm even considering writing my own, but not today.

--
A big old stinking pile of genius that no one wants
coz there are too many silver coated monkeys in the world.