4 ms·
I went down many of those routes myself, though not the lisp ones. There's also TCL. But I've settled on Nim as my favorite for embedded (at least for a while).
by elcritch 6y ago
I went down many of those routes myself, though not the lisp ones. There's also TCL. But I've settled on Nim as my favorite for embedded (at least for a while). For the esp2866 Rust (or D) would be tricky. Nim can compile to C, unlike Rust which doesn't support the Xtensa architecture found on most esp chips. Not sure about D bit it seems unlikely to support Xtensa.
There's a Nim Esp2866 sdk: https://github.com/clj/nim-esp8266-sdk https://github.com/clj/nim-esp8266-sdk
And a youtube talk on Programming esp2866: https://youtu.be/eCCrkZI0rVU https://youtu.be/eCCrkZI0rVU
Just be sure to use ARC/ORC. If you're interested in esp32's as well, I wrote a Nim wrapper of the esp-idf: https://github.com/elcritch/nesper https://github.com/elcritch/nesper
- d110af5ccf 6y agoJust to clarify - Gambit, Chicken, and Carp all compile to portable C. I hadn't realized LLVM mainline doesn't support Xtensa. I'm surprised. D does support Xtensa via LDC (https://forum.dlang.org/thread/rpdwiusbevvphqyvjhdj@forum.dlang.org https://forum.dlang.org/thread/rpdwiusbevvphqyvjhdj@forum.dl...). It looks like GDC also nearly supports it, requiring only a minor patch at present. A functioning LLVM backend does exist (https://github.com/espressif/llvm-project/issues/4 https://github.com/espressif/llvm-project/issues/4) and appears to be making very slow progress towards being merged. A quick search shows that it works for Rust. I suspect (but don't know) that it might work for Terra as well. There's also the LLVM C backend (https://github.com/JuliaComputingOSS/llvm-cbe https://github.com/JuliaComputingOSS/llvm-cbe) but I've no idea how efficient such an approach is when applied to real world embedded tasks.