3 ms·
Closer to the CPU isn't a valid argument. Most major programming concepts don't exist in a CPU. * CPUs are dynamically scoped * CPUs are weakly typed * CPUs
by hajile 8y ago
Closer to the CPU isn't a valid argument. Most major programming concepts don't exist in a CPU.
* CPUs are dynamically scoped
* CPUs are weakly typed
* CPUs are dynamically typed
* CPUs only compare to zero
* CPUs have no way to represent OOP
and so on
All that said, tail calls are very close to how the CPU works. They are just GOTO with additional parameters. If you implement tail calls with dynamic scoping, the parameters would be registers and the tail call would be a change to the instruction pointer. That would be very close indeed.