COMEFROM
A Humble Programming Construct
The Pain
Writing structure code
is hard.
Structured Code
● Schemas ?
● Types, WTF ??
● No Monkey Patching ???
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?
It gets MUCH worse...
● Object oriented
● Functional?
● Scala?
Real programmers use COBOL or FORTRAN
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
But it doesn’t go far
enough
Seriously. Why should you have to tell
your code where to go?
78%of code is clearly readable
Let’s change that
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.”
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
“It’s already
here”.
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 */
EEEW.
We all hate
legacy code
Let’s use
Python
Such
python
much
pythonic
WOW!
Comefrom

Comefrom