Hacker News new | ask | show | jobs
by williamaadams 3557 days ago
I love commentary on LuaJIT, it's like a discussion of the subtleties of an acient game whose practitioners understand and enjoy, and everyone else ignores.

My experience with LuaJIT has similarly been love, not much hate though. My lack of hate stems from the fact that I don't actually use it in production. I've used it as a learning and teaching tool for the past 4 or 5 years.

What I've learned: Co-routines combined with traditional async IO can make for some very fast IO bound programs.

JIT based FFI for interop is the cats meow

The guts of operating systems can be easily explained using such a simple language.

I went as far as creating a collaborative 3D modeling program (ala OpenSCAD) using LuaJIT.

I've created an entire Windows API wrapper (TINN).

I've explored the guts of Linux (using ljsyscall), and done exploration of various bits and pieces (lj2procfs).

I've been able to explore and play with any manner of API from dozens of OpenSource projects and otherwise, simply because LuaJIT (and specifically the FFI) make it possible to quickly wrap them up in such a way that exploration with script is easy.

I never worry about the death of LuaJIT, just like I very rarely look at the guts of my machine that's been running since 2009. The various parts may no longer be supported, but somehow my machines manages to continue to operate. Eventually I'll build another one and move on.

With recent changes to TypeScript, and the emergence of the Chakra engine, I might be tempted to make JavaScript my new thing, but they lack FFI, which I really love. I wish there were a solution for that.

Go has co/goroutines, which I really like, but I don't think their C interop story is particularly compelling, and not quite a scripty thing, which I find to be fairly useful.

I was originally driven to LuaJIT because PUC Lua had a flaw in their OpenGL binding, and it just wasn't robust enough for my needs. I find no value in their current versions, because FFI seems to be the most valuable thing to me I guess.

So, since it's a play thing for me, I find no other language as compelling or useful, for my needs. Some day, I'll use one of the language tool kits to convert my most interesting Lua code to another language, hopefully one with a good FFI. Until then, I'll keep using it.

And, if you've been around the industry long enough, you realize one language won't do it all for all time. I've long since given up on Objective-C (from NeXT days), I no longer write 6502 assembly (although still very popular apparently). I dove into C++ in the past couple of years, and came out with hives! Rust and Go are on the horizon, and who knows what's after that.

1 comments

Wow! Hard to believe I had never stumbled on your blog until now. https://williamaadams.wordpress.com/category/luajit/
heh... I've written a bit about our favorite abandoned language ;-)