4 ms·
Arguably, the FFI gives easier access to stuff (TM) than Perl would allow. C would be easier if the aim was clear and you can just write the code down (well, st
by hwh 11y ago
Arguably, the FFI gives easier access to stuff (TM) than Perl would allow. C would be easier if the aim was clear and you can just write the code down (well, string handling is probably easier in Lua, and there's the memory handling with GC). When the way there is what drives you instead, Lua(JIT) is nice. Sprinkle in some print here and there, try this and that without compiling stuff (though that is the smallest gain, I think)...
tonumber() is LuaJITs cast for pointers to integers. There are some arguments for it to stay.
- versteegen 11y agoMake sense, dynamic languages have a lot of conveniences. If having a REPL helps, there are REPLs for interpreted C I meant to refer to "tonumber(oldsize[0])" used to cast from a ctype size_t to a lua number (doubles) (I missed that's it's also used for casting pointers). Now I realise that this is needed because implicit casting from 64 bit ints to a double would reduce precision. It's just a very minor thing that "for" loop bounds must be lua numbers.