简体   繁体   中英

Is there a stackless and heapless programming language?

Is there a statically compiled programming language that is both stackless and heapless?

For data, such a language would not have a concept of memory allocation. Instead, the memory requirements of the program would be known completely at compile-time.

For code, there would not be a concept of call stack. There could be functions, but they'd be inlined at every call site.

I am specifically interested by portable languages with some form of implementation or a compiler that produces native binaries.

Pure x86 machine language fits your stackless and heapless constraints(within real mode constraints). Portability is not possible, unless the compiler has access to every memory location for all hardware IO(memory locations) that are Fixed for all supported platforms(this condition excludes all dynamic interfaces including PlugandPlay, USB, and PCI/PCIE busses)

It is completely possible to create such a structure within severe hardware limits(every device must be compiled in and allocated at boot, as in older computers like the c64 or Apple II) but all functionality must be pre-compiled into the OS, as in every program possible that is to run on the platform.

This is not a general computing platform anymore. Program a micro-controller, GPU, or ASIC to solve the task instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM