Are there any languages other than C and C++ that can be used explicitly without dynamic memory allocation (i.e. heap) features. In some mission critical embedded systems, use of the heap is prohibited to eliminate memory leak problems for software that may run continuously for many years. Some special purpose compilers also explicitly disable new
and malloc
to enforce this practice.
I've looked at some of the functional languages, namely Timber and Erlang for their embedded emphasis, but both seem to use heaps with a garbage collector. OCaml and Haskell also use garbage collectors despite static typing, and obviously Python, Ruby, and other dynamically typed languages rely heavily on garbage collection and heap space.
- Do any high-level languages support this requirement of not dynamically allocating memory?
- Is this even possible for compilers of functional statically typed languages to do so given their language semantics?