lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Jan 16, 2014 at 2:35 PM, <cad_2009@gmx.com> wrote:

Hello everyone,

 

I just wanted to point out what appears to be a very interesting trend in the Lua community: Lua applications are quietly and slowly, but surely, entering the arena of end-user applications. Of course, for at least 10-15 years Lua has been immensely popular, but that was only as glue language and as an embedded language, with hundreds/thousands of scripts being used all over the world. 

 

But what about end-user programs? I am particularly interested in minimalist programs and I remember looking for minimalist Lua-based programs a few years ago, and barely finding any. That was odd, as I was expecting for find lots of small end-user programs written in Lua, which is itself minimalist. I was rather disappointed.

 

But now, things seem to have changed. Hopefully there is a new trend coming up.

 

WordGrinder [1], a nice Lua-based console word-processor, was a pioneer among small Lua programs for the average end-user. It has been around for quite some time, and it is still developed.

More recently I discovered lumail [2], a minimalist console-based email client scripted in Lua (along the lines of mutt and and of the Ruby-based sup).

And now I see the file manager CFM [3] which, as mentioned in a recent message, consists of a single Lua file!

I am overwhelmed and overjoyed.

 

These late developments are really encouraging.  I do hope that this trend continues, with new simple end-user applications being created, so we will be able to dump a lot of those bloated and slow programs that are currently the only choice available.

 

Bye

 

Carlito

 

 

[1] http://wordgrinder.sourceforge.net

[2] http://www.lumail.org

I think the increase in the number of useful libraries has helped a lot. For example now there's https://github.com/pavouk/lgi/ , which is a little awkward to get used to at first[1], but provides all of GTK, GDK, Glib, Webkit, etc for Lua to use. It wraps things in a Lua-friendly form too[2], so it's really easy to throw together a quick GTK app using Lua. (I just wish their manuals were more complete and less full of broken links, grumble grumble...)

[1] The names are not always what you'd expect because of namespacing. For example in C you'd write GTK_WINDOW_TOPLEVEL, but the obvious translations to lgi.Gtk.WINDOW_TOPLEVEL or lgi.Gtk.Window.TOPLEVEL don't work. If you look at the manual you'll see GTK_WINDOW_TOPLEVEL is a member of an enum GtkWindowType and so the actual symbol you want is lgi.Gtk.WindowType.TOPLEVEL. This took me a little getting used to, but it's easy once you get the hang of it.

[2] e.g. you can write myWindow = lgi.Gtk.Window {
    title = "My WIndow",
    type = lgi.Gtk.WindowType.TOPLEVEL,
    decorated = true,
    resizable = true,
    width = 400, height = 300,
    _on_destroy_ = function(win) os.exit(true) end,
   
    lgi.Gtk.Label { id = 'my_label', label = "Hello" },
}
even though gtk_window_new() accepts only the "type" parameter; lgi will take care of setting all those other properties and signals for you. Then you can use myWindow like a Lua object:
    myWindow:show_all()
    myWindow.title = "My Super Cool Window"
    myWindow.child.my_lavek.label = "My label text"
so, lgi makes Gnome libraries available in a very Lua-friendly manner, so it becomes quite easy to develop GUI applications in Lua. It reads the libraries at runtime too, so it's forward-compatible with new versions. Makes me wish this kind of introspection magic worked with all libraries, and not just Gnome.

Of course, some might debate about whether using GTK disqualifies your app from being considered minimalist... :-)

--
Sent from my Game Boy.