lua-users home
lua-l archive

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


On Tuesday 01 February 2011 13:56:37 Patrick Mc(avery wrote:
> Rather then using a DB or tables & Pluto I was thinking about storing
> information in Lua scripts that would then be executed by other Lua
> scripts via dofile. I was thinking that the executing script could also
> modify the storage script for persistence. This set up would also allow
> me to hand edit the storage script later, bypassing the main limitation
> I see with a DB or a serialization library like Pluto.
> 
> Is there a proper name for this? Is there any code out there that I
> could use as a template?
> 
> Thanks for reading-Patrick

My UMENU program is 12 years old, and for all 12 years, once the user selected 
his menu choice, UMENU created a shellscript to run the chosen, and then ran 
the shellscript. It's worked out remarkably well.

One caveat is security. If a black hat third party can intercept the 
shellscript and change it, all sorts of mischief could be made. But UMENU 
isn't connected to a socket, and I have a firewall, and my wife and kids don't 
have the technical chops to mess with it that way, so I'm pretty happy with 
it.

Be sure you set up your file permissions so the wrong people can't get their 
hands on your child Lua programs or create new, undeleteable once to 
substitute for what you really wanted.

Please be forewarned, when others find out that you're doing data storage and 
logic by spawning child Lua programs, they will call it a "kludge". They'll 
call you a "hack". They'll tell you to do "real programming". They'll demean 
your abilities. Even though they take 5 times as long to implement things as 
you do, they'll act like you're worse than a noob. Just nod gravely at their 
criticisms, tell them you'll take their advice under consideration, and 
quickly turn away so they don't see you laugh.

I can't visualize exactly what you're doing, but always assuming you can avoid 
security issues and get it to work, I like the way you think.

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt