amuck-landowner

LUA Thoughts

Mun

Never Forget
I am thinking of setting up an application like buyvmstatus, but with a backend built on LUA. I wanted some thoughts, suggestions, concerns etc.

Thanks.
 

telephone

New Member
Can you give us some more information:

- Is this local? (Status of your own stock)

- Are you querying external sites?

- "like buyvmstatus"? Are you going to mirror BuyVM status?

Honestly almost any other language would be better than LUA for this type of project.
 

Chronic

Member
I've worked with Lua before and it's very enjoyable to program in. That being said, you should probably work in whatever you're comfortable with - I'm sure you can accomplish this in most languages.
 

Mun

Never Forget
Can you give us some more information:

- Is this local? (Status of your own stock)

- Are you querying external sites?

- "like buyvmstatus"? Are you going to mirror BuyVM status?

Honestly almost any other language would be better than LUA for this type of project.
No it isn't local.

Yes I am querying external sites

no it isn't a mirror of buyvmstatus.

Mainly im just getting pissy with the require sockets being so picky against other OSes. 

That being said i'm just curious if there is a suggestion for a better programing language.

What Lua was meant to be used for was the backend query setup. It was intended to query the server. Parse the data and import the data into MYSQL. As well as later possibly to post if there was downtime.
 

acd

New Member
Couldn't you modify an existing network monitor to do what you want (nagios, et.al.)? I'm not sure you can even send a ping packet in lua, I don't recall lua sockets allowing raw packets; you'd have to roll-your-own bindings with raw socket support. I'd probably try python, perl, js/nodejs,  php in that order, if you prefer scripting languages. I know that each of these at least exposes a raw socket interface. python has many ping examples and perl has net::ping (don't know if this gets you latency). If those aren't sufficient, I'd consider C/C++, depending on how many servers you intend to query. Considering that your process latecy will directly affect your results, it might be hard to tune this app in a scripting language. Things like GC could unexpectedly surprise you.
 
Last edited by a moderator:

willie

Active Member
Lua is cute as a lightweight extension language that (with LuaJIT) can compile to very fast code. But the language is rather stripped down in order to keep the memory footprint small and the interpreter embeddable. It also has too many automatic conversions in my opinion (trading reliability for convenience), though that's a subjective matter.

Lua is mostly used as an extension language in C and C++ programs, possibly running in quite small systems (meaning like 1 meg). If you've got a big machine (32MB counts as big in the embedded world) you are probably better off with a language with more creature comforts. PHP has a lot of built-in libraries including database connectivity. I hate the language but I have to concede that it's very easy to get started with.

Next up would be something like Django/Python, or Ruby on Rails. Node.js was trendy for a while but I'd suggest staying away from it as it will rot your mind. Go (golang.org), now trending up, is much saner and should give performance at least as good. I'd consider it a bit more "advanced" than something like Ruby though.  I don't think you really have to worry about performance for an app like this, due to its expected relatively light workload. A simple Python or Ruby CGI might be the lowest fuss implementation technique.
 
Top
amuck-landowner