2 ms·
Looking at this from an Assembler point of view, isn't everything really just a GOTO? Instruction Register + 1 = GOTO next memory location If A then B = Branc
by jsrjenkins 8y ago
Looking at this from an Assembler point of view, isn't everything really just a GOTO?
Instruction Register + 1 = GOTO next memory location
If A then B = Branch if equal = GOTO ADDR B
call function = put currebt address in stack and GOTO this address, then GOTO address on stack.
It seems to me that it is just GOTO all the way down. In fact there really is nothing else but Memory and GOTO.
Sort of ironic that the very foundations of machine computing is not a very good idea....
- lucozade 8y ago> Sort of ironic that the very foundations of machine computing is not a very good idea.... I'm not sure anyone (knowledgable) has ever said that they are a fundamentally bad idea. The argument has always been, effectively, that they are prone to producing code that is hard to reason about. Specifically, they are prone to producing code that requires non-local reasoning. That's something that people tend to find hard. You can find variations of the same issue with such things as the actor model of threading or structured concurrency. They're all attempts to localise activity, at the expense of some power. And similarly, they almost always get translated to a more powerful, non-local construct further down the stack.
- taejo 8y ago"GOTO considered harmful" doesn't mean you should program in assembler without JMP (and without CALL, for that matter, since the ability to CALL into the middle of a function is equally problematic). All flow control is really just GOTO in the same sense that all programming languages are just assembler. By beginning of the century, most programmers had realized that this is not the case.
- goto11 8y agoYou can be sure that Dijkstra understood that control structures are implemented in terms of jumps in the underlying machine language. He probably also assumed the reader would know that.