Hacker News new | ask | show | jobs
by needlepont 2866 days ago
Interesting. I tried Lua about 6 years ago and found myself unable to see an upside to the language in comparative perspective with python and tcl.

This is for full featured *nix systems programming in the HPC world so ymmv.

2 comments

Lua's niche is absolutely as an embedded extension language for C/C++ programs. It's core benefits is how tiny and yet expressive it is (and it looks like C if you squint.) I've seen it show up in a variety of projects in that role, for games or embedded testing environments.

I indeed don't see it having any benefit over Python or TCL in more sophisticated environments.

The programming model for c ffi that lua uses is, I think, a little nicer.
I have a soft corner for Tcl. Tcl was a pioneer. Lua is smaller, faster and more tightly and coherently designed. Lua had coroutines right from the start. With Lua you have the option of using LuaJIT. I enjoy both, but I would be more wary of using Tcl in critical systems. But when its play time, i happily break out tclsh.
I've used TCL in production for 15 years. The only thing to really worry about is a consistent policy on language usage. Keeping to the base features of the language and extensions in tcllib/tclx is a pretty solid recipe.

That said here are things I advise.

* No upvar/uplevel. Use a namespace. * Use apply wisely. * No ad-hoc (say swig inline wrappers) extensions without deep review. * If you are writing a front end in tk - think twice. * If you are doing OOP with TCL choose wisely.