lua-users home
lua-l archive

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


Here is a more involved demo using dependencies, lit, and luvit-loader so lit packages can still be used with normal lua require.

https://asciinema.org/a/62yp3wrx0ok7fhz7w5f0sczsa

On Wed, Mar 2, 2016 at 9:32 AM, Tim Caswell <tim@creationix.com> wrote:
I haven't written or added any desktop GUI toolkits yet, but luvi is great for quickly building standalone lua apps that have the lua runtime embedded in them.  See this quick and dirty asciicast for an example https://asciinema.org/a/ac5sha3t0m584w8omawr6l8d3

I regularly publish prebuilt binaries for luvi for Windows (32 and 64 bit), OSX, Linux (i686, amd64, armv6, armv7), and even FreeBSD.  If your target platform doesn't have a prebuilt binary, it's easy to build your own.

Once you (the developer) have a luvi binary, it's trivial to make a single-file lua application by simply concatenating your app as a zip to the binary (or as I show in the asciicast use the -o command in luvi and it will zip the folder for you)

Once you get to larger applications, the Lua Inventors Toolkip (LIT) can manage dependencies and build optimized bundles for you.  It will compile your lua to bytecode if the resulting file is less bytes (it usually is if you write any comments or have license headers in your code) and pull in any dependencies and even let you specify the version and flavor of luvi you want to include (it doesn't have to match the version embedded in lit).

We use this in production at Rackspace and it's very stable and efficient.

As far as batteries included, luvi comes with libuv which provides quite the interesting toolkit for OS interfaces.  This allows for full posix style Filesystem I/O, network and unix sockets (server and client, tcp and udp).  In the regular build, it embeds openssl so you can access all the APIs there which we use mostly for the TLS portion of https clients.  There is an zlib option as well as a customized build of miniz that's used for the zip file asset management.

If you use lit, then the entire lit ecosystem is at your disposal which includes everything from web frameworks with websockets to cross-platform gamepad drivers.  Since you're bundling your lua runtime, you can make assumptions like using luajit ffi interface to call out to OS APIs.

If you're looked at luvit before and were put off by the node.js APIs there, look again.  Luvi and luv and lit can be used independent of that (which is how I always use it.  I personally rarely touch the node.js style libraries).

-Tim Caswell

On Wed, Mar 2, 2016 at 9:19 AM, Tim Caswell <tim@creationix.com> wrote:


On Wed, Mar 2, 2016 at 2:54 AM, Marc Balmer <marc@msys.ch> wrote:

> Am 02.03.2016 um 11:41 schrieb steve donovan <steve.j.donovan@gmail.com>:
>
> On Wed, Mar 2, 2016 at 12:22 PM, Pierre Chapuis <catwell@archlinux.us> wrote:
>> On Windows I don't even recompile IUP: I use the distribution from
>> LuaBinaries and I package it with my Lua code.
>
> Last I tried (on Linux) it was unusually hard to compile. This needs some love.
>
>> It is a very convenient
>> way to write small GUI wrappers around code that is mostly intended
>> for the CLI
>
> Absolutely, it hits the same sweet spot as Tk.  Beauty is sometimes
> not worth the cost ;)
>

Let's add github.com/arcapos/luamotif to the list of GUI options for Unix systems. (We only use it for touchscreen and display applications, not for desktop applications).