| I do think you're better off using ruby, but if you insist. Lots of default functionality missing so you MUST have these packages: inspect, luaposix, lrexlib-pcre, lrexlib-posix, lpeg, luastd/stdlib, luasocket, luahttp, luasec, luacheck, penlight * luajit is unnecessary in almost all cases, you don't need the speed. * use lsp or luacheck whenever you write something, entr -c luacheck file on everything. * patterns are not regex which means they do not support lookups, backtracking or |, so you must install lrexlib-pcre or lrexlib-posix (frankly I never need pcre so I stick to lrexlib-gnu or lrexlib-posix). * overload _ENV so it auto requires unknown things, I have a lua wrapper that does this and it makes it a joy not having all of my scripts with a bunch of require"posix" on all of them * install inspect to inspect tables * os.execute and io.popen only accepts strings as parameters which means you should overload it and make a function that accepts tables as well. * 5.4 is still lacking support for many libraries, 5.3 has most of the libraries. * assignments default to the global environment so you have to use local keyword or set _ENV to error on assignment (or better yet, don't care, just local _ENV = mymodule) Overall, Lua is just a mixture of C with a pascal syntax and garbage collection (and also tables which is a weird data structure) |
I am specifically looking for a language that:
1) is a scripting language (don't have to worry about compiling it)
2) starts up fast (so if I use it in a loop or a sequence of pipes, it won't necessarily be the bottleneck)
3) runs fast
4) is easy to work with and is either ridiculously simple or well-designed (Bash has so many footguns...), and scales up to medium-size code (anything that would take more than 1 file to implement should be promoted to another language)
Awk fit this. So did D, actually. Lua certainly does.
> luajit is unnecessary
Why not use it if it's there, it's faster, and you don't need features beyond 5.1?
> patterns are not regex
They're almost regex, they're faster than regex, and for 90% of use cases, you don't need full regex
> tables which is a weird data structure
Isn't a table basically just a JavaScript object, where metatables are the prototype object? Sort of, at least...