"LuaJIT FFI is a library for Lua. It doesn't change the language at all ... "
This is literally true, of course, but in my ~5 yrs using it now I can say that writing LuaJIT+FFI-data-type code is, for me, both aesthetically and mechanically different from writing plain Lua code. The post captures it quite well:
This is basically the inverse of the old promise that languages like Python came
with: that you would write your whole application in Python, optimise the “hot
spots” with C, and voila! C speed, Python convenience, and money in the bank.
This was always much nicer in theory than practice. In practice, your data
structures have a huge influence on both the efficiency of your code, and how
annoying it is to write.
I often write my LuaJIT programs from the ground up designed around C data types and C-style memory allocation discipline. Bu I can always ditch that in areas where I know I don't care (e.g., configuration loading etc where 10 lines of C become a 1-liner in Lua).
This is literally true, of course, but in my ~5 yrs using it now I can say that writing LuaJIT+FFI-data-type code is, for me, both aesthetically and mechanically different from writing plain Lua code. The post captures it quite well:
I often write my LuaJIT programs from the ground up designed around C data types and C-style memory allocation discipline. Bu I can always ditch that in areas where I know I don't care (e.g., configuration loading etc where 10 lines of C become a 1-liner in Lua).