esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
402 stars 26 forks source link

Intergrate C runtime interpreter for dynamic lambdas #2707

Open apbodrov opened 1 month ago

apbodrov commented 1 month ago

Describe the problem you have/What new integration you would like Integrate C-based interpreter, like https://github.com/jingoro2112/wrench

Please describe your use case for this integration and alternatives you've tried: I want to make HA and ESPHome automations more "transactional". Now it’s more convenient for me to configure sequential commands through HA automation YAML, but this method is not resistant to communication problems between ESP32 and HA. Using lambdas requires recompiling the config, which is inconvenient for regular updates

Additional context https://home.workshopfriends.com/wrench/www

A full-featured compiler+interpreter that uses a bare minimum of ram and program space.

How little? The wrench Virtual Machine compiles to ~28k on an Arduino, and uses less than 700 Bytes of RAM to operate, it is fully functional on an Uno Mini. Highlights:

Also, https://github.com/esphome/feature-requests/issues/805 (conditions, loops, expressions) https://github.com/esphome/feature-requests/issues/1840 (changing at runtime)

beranm commented 1 month ago

I like that idea. I would like to integrate it in YAML code to be able display GPIO status on 128x128 display for example. Like M5 Atom S3. when device is using ports (RS485 etc) then be able to show wifi status of the ESP and GPIO status as well to the user.