4. It gets worse...
● If ? For ? While ?
● Map ? Reduce ? Filter ?
● Try ? Catch ? Except ? Finally ?
● Tail call, what?
● Tons of ways to do the SAME! things
● This is like JavaScript…
● We’re not monkeys !!!
● SERIOUSLY?
5. It gets MUCH worse...
● Object oriented
● Functional?
● Scala?
Real programmers use COBOL or FORTRAN
6. Solution: The goto Statement
Provides automatic, well understood transformations
● Eliminates recursion
● Eliminates unneeded structure
● Offers infinite branching
● Keeps life interesting with fall throughs dead ends
7. But it doesn’t go far
enough
Seriously. Why should you have to tell
your code where to go?
10. Introducing COMEFROM
“In computer programming, COMEFROM (or COME FROM)
is an obscure control flow structure used in some
programming languages, originally as a joke. COMEFROM is
roughly the opposite of GOTO in that it can take the execution
state from any arbitrary point in code to a COMEFROM
statement.”
11. Using COMEFROM
func add(a, b int) int {
return a + b
}
comefrom add
func double(a, b *int) {
*a *= 2
*b *= 2
}
// elsewhere in the code.
comefrom add
func triple(a, b *int) {
*a *= 3
*b *= 3
15. Hardware optimizations coming
LCNTR=42;
DO x UNTIL LCE; /* COMEFROM x, unless the loop counter is zero */
F12=F0*F4, F8=F8+F12, F0=dm(I0,M3), F4=pm(I8,M9);
IF NZ dm(I2,M2) = F12;
IF ZF dm(I2,M2) = F1;
x: R2 = R3 + 76; /* the label "x" does not exist in the machine code */