

Ask HN: high-level languages w/static allocation - vbtemp

Simply: I mainly develop for embedded systems (that must not use any type of non-deterministic memory allocation). For associated projects, I've started to use Python quite a bit and have fallen in love with the tuple and list primitives built into the language (among other features). Naturally, I <i>only</i> use C for the embedded work, and C++ is not used on our projects - and I am somewhat embarrassed to say I've only briefly fooled around with it.<p>My question is this: are there any embedded friendly languages that have some of the same high level features of more interesting languages (e.g., reflection, generic programming, first-class functions, extensive list libraries) that can be compiled without a runtime and strictly without any calls to malloc? Are any of these even possible? I've tried sketching out possible solutions to this, but I suspect they may only work in very limited cases. Thanks.
======
stonemetal
C++ is the only one I can think of. The reflection is week. The generics are
powerful but ugly. First-class functions technically don't exist but function
objects make a useful if verbose replacement. Their lists still use malloc,
but all of their list manipulation functions work on arrays as well.

The only other language I can think of that is both high and low level at the
same time is Forth. I am not quite as familiar with it as I am with C++ but I
am pretty sure it meets your feature list.

~~~
vbtemp
Interesting. Thanks!

