Page 1 of 1

Embedded Lua for C Apps

Posted: Thu Sep 14, 2017 11:39 am
by Addi2438
Morning everyone,

I'm trying to write a C application for the ESP32 that allows the user to write apps for it.
Imagine it like a gameboy where the user can write games for it by himself without having any knowledge in C or the hardware itself.

Because I dont want to write a whole new programming language I thougth Lua or Python migth be a great solution.

Is there any Lua or Python interpreter for the esp that I can integrate in my C code?

I know there are things like Lua-RTOS, nodeMCU etc. but it seems like I cant integrate them into my C code cause they are standalone solutions.

Thanks in advance :)

Re: Embedded Lua for C Apps

Posted: Thu Sep 14, 2017 3:50 pm
by kolban
Unfortunately, I can't speak to Lua or Python, but for your consideration (even if it is just for elimination), I have had good luck working in a JavaScript mixed mode. In that environment I can mix C and JavaScript quite freely. The engine I have been using is "Duktape".

Re: Embedded Lua for C Apps

Posted: Thu Sep 14, 2017 7:44 pm
by martinayotte
There is Python implementation on ESP32 :
https://esp32.com/viewtopic.php?f=17&t= ... 083#p14083

Re: Embedded Lua for C Apps

Posted: Thu Sep 14, 2017 8:24 pm
by loboris
MicroPython could be quite easily integrated into C application, how it should be done depends on your needs.
Should the user write the 'application' on PC and transfer it to the device, or write the app on the device itself. Both could be done.
The implementation will add some 300K ~ 500K to the code size.

Re: Embedded Lua for C Apps

Posted: Thu Sep 14, 2017 10:07 pm
by Addi2438
Good evening/morning

Thanks for your answers
I will check everything out tomorrow.

The user should be able to write a script on a pc put it on a sd card and load that script via a grapical menu.

At the moment I'm writing drivers for display, touch panel, ble etc.
I need to be able to include those too.