You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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:
Weakly typed, supporting native 32-bit int, float and string.
Code is easy to write with familiar c-syntax
Optimizing compiler and very fast VM
Produces very compact endian-neutral bytecode: compile-anywhere-run-anywhere.
Can execute from ROM, no local copy of the code is made
Multiple concurrent contexts supported
Code is easy to write, imagine c with the typenames removed; that's pretty much it.
Supports everything a good interpreter should: if/then/else/do/while/for/switch/functions/operators/etc..
Yes structs too
Yes switch (and NO it's not if-else sugar)
Can operate directly on data and exposes all static values to be manipulated externally and directly.
Can call back and forth to native code with minimal overhead
API is designed to be easily extended, that's the whole point!
Memory is garbage-collected but only for dynamic arrays. Unless you are allocating/de-allocating arrays the gc never runs.
Includes a handy command-line tool
Also, #805 (conditions, loops, expressions) #1840 (changing at runtime)
The text was updated successfully, but these errors were encountered:
apbodrov
changed the title
Intergrate C runtime interpreter to dynamic lambdas
Intergrate C runtime interpreter for dynamic lambdas
Apr 29, 2024
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.
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:
Weakly typed, supporting native 32-bit int, float and string.
Code is easy to write with familiar c-syntax
Optimizing compiler and very fast VM
Produces very compact endian-neutral bytecode: compile-anywhere-run-anywhere.
Can execute from ROM, no local copy of the code is made
Multiple concurrent contexts supported
Code is easy to write, imagine c with the typenames removed; that's pretty much it.
Supports everything a good interpreter should: if/then/else/do/while/for/switch/functions/operators/etc..
Yes structs too
Yes switch (and NO it's not if-else sugar)
Can operate directly on data and exposes all static values to be manipulated externally and directly.
Can call back and forth to native code with minimal overhead
API is designed to be easily extended, that's the whole point!
Memory is garbage-collected but only for dynamic arrays. Unless you are allocating/de-allocating arrays the gc never runs.
Includes a handy command-line tool
Also, #805 (conditions, loops, expressions) #1840 (changing at runtime)
The text was updated successfully, but these errors were encountered: