InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.7k stars 923 forks source link

LUA Scripting support #1400

Closed agittins closed 1 year ago

agittins commented 1 year ago

Verification

Pitch us your idea!

Could InfiniTime include a lua scripting engine?

Description

Is it feasible to include a lua scripting engine into infinitime? I don't know anything about the technical aspects of implementing it, only that I have seen a few projects on what I assume is limited hardware (eg: MagicLantern, running on Canon cameras) providing surprisingly capable lua api's. With sufficient work in the api it's possible to do fairly low-level stuff with reasonable efficiency, and for scripts to be loaded/unloaded at runtime on demand.

It strikes me that this would allow for:

As I said, I don't know the technical difficulties that might face such a goal, so there might be dead-simple reasons why this isn't practical - in which case I'd welcome them being spelled out here so that this issue can be closed and serve as an FAQ for the query. Alternately, maybe it's a job only restricted by someone with time+knowledge, in which case this issue can serve as an advertisement to catch anyone skimming around for their next passion project :-)

Please note I am not asking for any one person's opinion if they think lua would not be useful to them personally, more so if it is technically feasible to implement, and what the realities of doing so might involve. Since there are no issues already mentioning lua I assume it's either an obvious answer (like it requires an mmu feature or some other hardware that's lacking) or nobody's thought to ask outside of chat.

Avamander commented 1 year ago

Any interpreted language is quite heavy, probably too heavy in this context. Learning C++ to a sufficient level for creating watchfaces is not that difficult. Using the hardware SWD interface or the simulator already provides fast prototyping.

An interpreter is unlikely to be added (any time soon).

agittins commented 1 year ago

"Any interpreted language" seems a very broad qualification, but I appreciate the quick and unambiguous response. Cheers!