4 ms·
I hope something like `ArrayBuffer` and `TypedArray` would be added to Lua, like to JavaScript.
by chirsz 5y ago
I hope something like `ArrayBuffer` and `TypedArray` would be added to Lua, like to JavaScript.
- anonymoushn 5y agoFor better or worse, the language devs have a goal of keeping things simple, so this would have to be provided by a library. It's pretty easy to implement this sort of thing in luajit or provide that library to other luas though.
- edflsafoiewq 5y agoYou can use LuaJIT's FFI. local ffi = require 'ffi' local arr = ffi.new('float[?]', 100) LuaJIT's FFI is pretty great. It puts even a lot of compiled languages to shame.