4 ms·
Recursion today is easy to compile, but it's something that is hard to support on some older architectures. For instance, you would have a hard time (if not ou
by spc476 10y ago
Recursion today is easy to compile, but it's something that is hard to support on some older architectures. For instance, you would have a hard time (if not outright impossible) supporting recursion on a PDP-8, which stored return addresses at a fixed location (so subroutines are inherently non-reentrant).
For a fun time, try implementing a C compiler for 6502. 256 byte stack, 8 bit index registers, single accumulator, 64K RAM max (which only became affordable in the mid 80s). Those are the types of constraints compiler writers were facing at the time.
"Features" weren't hard to compile because they were difficult to reason about, they were hard to compile due to physical constraints of the hardware.