Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was infected by the Lua mind virus 15 years ago and I have not recovered.

I simply don't see any reason not to use it .. for everything.

I've built games with it. I've built GUI's with it. I've built scientific analysis tools with it. I've used it as a total solution for previously-impossible embedded problems. I've used it for desktop applications and mobile apps. I've automated entire production lines with it. It has huge appeal as a general purpose software development ecosystem - but those who know how to do this, tend to keep it to themselves for some reason.

It can do everything.

There's just nothing I want to do with computers that I can't, legitimately do, with Lua - or its VM. Or, LuaJIT. Or, all of the above and a bit of luarocks built in. Throw some luastatic in while we're at it, bundle it all up as a .deb, and nobody needs to know a thing.

Its just so versatile. I hope someone builds an OS around it some day, making everything and anything the user wants to do, accessible through a Lua module, or some smart libffi wrappers around a handful of .so's, somewhere ..

In my retirement, I'll take antirez' LOAD81, turn it into a proper Lua editor, add integration with luarocks and luastatic and maybe a shit-tonne of IPFS, and then there won't be any need, ever again, to deal with anything else.



This happened to me about 6 months ago. (I didn't seek it out, just ended up working on something where lua was involved). So thanks for the warning. I didn't realise it could last for 15 years or more. The big thing for me is how easy it is to make something that feels like a DSL while it's still just Lua when you debug it.


How do you debug it? I tried a little bit and kept running into issues due to the dynamic typing.


I've found different ways .. if its a simple Lua situation, where you just want to debug pure Lua code, Zerobraine Studio is a pretty good environment to do it and comes with a debugger.

I've tried various other Lua debuggers over the years, these are useful:

https://github.com/slembcke/debugger.lua

https://slembcke.github.io/DebuggerLua

You can also use the debug module:

https://www.tutorialspoint.com/lua/lua_debugging.htm

Otherwise, I just use gdb if needed (JIT/FFI stuff) and printf's.

However, I don't really need to debug much these days - more just testing. Its also kind of important to have automated tests and run them frequently with every major change.

Another thing I use frequently in my Lua projects, which I think cuts down a lot of the common bugs that might require debugging, is the lua_enumerable.lua utility module:

https://github.com/mikelovesrobots/lua-enumerable/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: