Page 1 of 1

Can LuaJIT be build for ESP32?

Posted: Tue Feb 19, 2019 2:33 pm
by coollofty
I didn't succeeded, and I cannot find any useful stuff on Google, why?

Re: Can LuaJIT be build for ESP32?

Posted: Tue Feb 19, 2019 11:38 pm
by ESP_Angus
It's probably technically possible to make LuaJIT run on an ESP32, although the extra memory overhead of Just In Time compilation may stretch the available IRAM for doing useful things with the natively compiled Lua routines.

It would still need a lot of complex porting work as the "JIT" part of LuaJIT is platform-specific (emitting native instructions), and AFAIK noone has ported it the Xtensa architecture.

Have you looked at NodeMCU ESP32 support? Not fast enough in some way?

Re: Can LuaJIT be build for ESP32?

Posted: Wed Feb 20, 2019 5:46 am
by coollofty
Yes, not fast enough, and troublesome(I like ffi) to bind C function

Re: Can LuaJIT be build for ESP32?

Posted: Wed Feb 20, 2019 6:14 am
by ESP_Angus
coollofty wrote:
Wed Feb 20, 2019 5:46 am
Yes, not fast enough, and troublesome(I like ffi) to bind C function
Unfortunately "easy" ffi type functionality requires dynamic shared library loading. This is something we also don't have on ESP32 at the moment, any C code needs to be compiled and statically linked into the "final" binary.

That said, it may worth discussing with the NodeMCU developers if there is any way to make integrating C code easier with that project.

Re: Can LuaJIT be build for ESP32?

Posted: Wed Feb 20, 2019 6:58 am
by ESP_igrr
Have you looked at using Sol2 / Sol3 for doing Lua bindings? I've used it (on another MCU platform, not ESP32) and it is pretty awesome.

Re: Can LuaJIT be build for ESP32?

Posted: Fri Mar 08, 2019 3:12 pm
by coollofty
I found the Sol2 on Github, it is great! Thanks :)