5 ms·
I think Burroughs mainframes also used stack architectures. I suspect the architecture wasn't entirely responsible for Burroughs' demise, but they seem to be an
by musicale 4y ago
I think Burroughs mainframes also used stack architectures. I suspect the architecture wasn't entirely responsible for Burroughs' demise, but they seem to be an outlier.
I imagine one potential problem with stack architectures is running out of stack memory and having to spill to main memory. (Presumably using main memory for the stack would be too slow.) This seems unlikely for a single thread but I could imagine it being a big issue with thousands of threads. Context switches where you have to save the whole stack to memory are going to be more like cache misses or page faults.
Another potential issue might be dealing with data that isn't on the top of the stack. A solution could be to add a deep stack addressing mode but then you're basically mixing in a register machine and the simplicity and orthogonality might be lost.
The interesting thing to me is that several stack-oriented interpreters, compilers, and runtimes (including Forth, Pascal, Smalltalk, Java, and WebAssembly systems) have been developed, so maybe a stack-based CPU might be a good match for those systems.
- 082349872349872 4y agoStack-orientation makes sense for interpreters, because decode is expensive in software. Hardware has different tradeoffs.
- Morpholemew 4y agoThe theory that stacks are better than registers for an interpreter was pretty conclusively disproven by the Lua 5.0 interpreter. See https://www.lua.org/doc/jucs05.pdf https://www.lua.org/doc/jucs05.pdf (summary: although decode is slightly more expensive per opcode, you have half as many opcodes to decode on average because you get rid of all the stack manipulation instructions)
- Taniwha 4y agoThe Burroughs mainframes stored most of their stacks in main memory - they have a couple of deep stack addressing modes (and a proper set of display registers). Alternately 29Ks and Sparcs have register windows which are essentially top of stack caches. I think that the RTXs were a thing at a particular point of time that made sense before caches moved on-chip, they didn't catch because they expected you to buy into the forth world-view (rather than providing C and other languages of the day)