lua-users home
lua-l archive

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




On Tue, Apr 30, 2019 at 8:54 PM Russell Haley <russ.haley@gmail.com> wrote:


On Tue, Apr 30, 2019 at 7:31 PM Andrew Starks <andrew@starksfam.org> wrote:
Hello All,

At work, we are selecting a Lua environment to run on our embedded ARM 7 device. We have limited memory and we want to keep the footprint small, hence Lua in the first place. Our requirements include:

* Lua 5.3 preferred because of the need to work with INT64
* TCP-IP Sockets
* HTTP/S, HLS/TLS
* WebSockets
* DNS / mDNS
* REST Plumbing
* Nice async / concurrency behavior
* Integrates well with main loops
* Works on Windows a nice plus
* Capitalist friendly licensing

My current interest is in lua-http with cqueues, but we aren't sure about compatible REST frameworks and which one the cool kids are using. Any recommendations?
lua-http runs great on my beaglebone. 
Sorry, I was going to write something and got jumped on by my kids. 

Lua-http runs great on my beaglebone, which is a Cortex A-8 (Arm v7a). The memory usage is a little high IMHO, coming in around 7 MB due to a rather large LPEG library. I wouldn't think writing a URL handler for a REST API would be all that difficult seeing as lua-http has many of the other bells and whistles you're looking for. Cqueues provides DNS as well: see section 3.2.7 in the cqueues manual here: https://www.25thandclement.com/~william/projects/cqueues.pdf
 
I run everything on FreeBSD, making the whole stack "capitalist friendly".

Here is my websocket endpoints prototypes: 

I also created an application to run minecraft servers in lpty and serve out the console output via a websocket (albeit on amd64). So, effectively it's a lua/cqueues application that runs lua-http within it. 

I would say the difficulty for me using cqueues is that everything runs in a loop so it's not a programming model that I was terribly familiar with (lua-http abstracts that away for the most part). I haven't touched my minecraft runner for some time, but I was having problems with exceptions causing cqueues to jump out of the loop. I'm sure a more skilled programmer that has time to work on these things would be able to deal with that (these are all hobby projects that I do in the 1 1/2 hours I have after putting kids to bed). 

FWIW,
Russ
 

Luvit would be a great option, except that it only works with LuaJIT. We're wary of the daunting task of compiling LuaJIT on this platform and we will miss native 64Bit integers. Our team is familiar with Node.js, hence the appeal.

Other lightweight suggestions?

-- Andrew