简体   繁体   English

是否有无堆栈和无堆栈的编程语言?

[英]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). 纯x86机器语言适合您的无堆栈和无堆栈约束(在实模式约束下)。 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) 便携性是不可能的,除非编译器可以访问每一个内存位置被固定于支持的所有平台的所有硬件IO(存储单元)(此条件排除所有动态接口,包括即插即用,USB和PCI / PCIE总线)

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. 完全有可能在严格的硬件限制内创建这样的结构(每个设备都必须在启动时进行编译和分配,例如在诸如c64或Apple II之类的较旧计算机中),但是所有功能都必须预先编译到OS中,例如每个可能在平台上运行的程序

This is not a general computing platform anymore. 这不再是通用的计算平台。 Program a micro-controller, GPU, or ASIC to solve the task instead. 编写一个微控制器,GPU或ASIC来解决该任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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