3 ms·
It depends upon what's the target you're trying to embed into. If you're trying to put something on a PIC or an 8 bit AVR, you're down to something like assembl
by fundamental 8y ago
It depends upon what's the target you're trying to embed into. If you're trying to put something on a PIC or an 8 bit AVR, you're down to something like assembly, C, or a very low memory language like forth. If you're looking at larger targets like the ESP32, then you can use an embeddable python, ruby, lua, js, etc without being too concerned. On something like a raspberry pi compute time likely ends up being more of a concern than memory or build complexities.
The other target is trying to embed some interpreter in a larger application, which ends up being mostly constrained by how nice the language is as well as how nice the C API barrier ends up being.
C is certainly not going anywhere, but it is pretty cool that other options are being built to lower the barrier of entry for some application domains.
- vvanders 8y agoFWIW there's still a pretty large delta from Lua and JS as far as embedding targets go. We use to run our whole game state in a 800kB fixed block on a 8mb system heap in vanilla Lua(pre-LuaJIT) with good success. I've done some poking at various embedded JS frameworks like Duktape and it's pretty easy to trip on various memory leaks[1] that make it really hard to recommend it as a viable platform for memory constrained spaces. [1] http://point.davidglasser.net/2013/06/27/surprising-javascript-memory-leak.html http://point.davidglasser.net/2013/06/27/surprising-javascri...
- nickpsecurity 8y agoOne project used ATS for an 8-bitter: http://metasepi.org/doc/metasepi-icfp2015-arduino-ats.pdf http://metasepi.org/doc/metasepi-icfp2015-arduino-ats.pdf http://www.ats-lang.org http://www.ats-lang.org Chez Scheme used to run on 8-bit platform, too. Then there's Pascal and BASIC dialects for microcontrollers. Astrobe has Oberon dialect for ARM Cortex's. AVR-Ada lets you use Ada with AVR's. OcaPIC put Ocaml subset on PIC microcontrollers. People are using C because most people already use C with the ecosystem benefits that follow. Although C and assembly are dominant, there are other options available if people think their pro's and con's line up with their needs.
- rurban 8y agoThat's excellent news. ATS is one of the best languages out there. It used to beat C in the shootout benchmarks, and adds much better security and types than C/C++. I'll try to use in my next embedded job, where they do just C.
- PeCaN 8y agoAlways cool to see ATS in the wild. Higher-order functions on an 8-bit CPU makes me happy. :D
- pjmlp 8y agoThere are Basic and Pascal as well, there are a few embedded companies still selling compilers.