COMEFROM was initially seen in lists of joke assembly language instructions (as 'CMFRM'). It was elaborated upon in a Datamation article by R. Lawrence Clark in 1973,2 written in response to Edsger Dijkstra's letter Go To Statement Considered Harmful. COMEFROM was eventually implemented in the C-INTERCAL variant of the esoteric programming language INTERCAL along with the even more obscure 'computed COMEFROM'. There were also Fortran proposals3 for 'assigned COME FROM' and a 'DONT' keyword (to complement the existing 'DO' loop).
On 1 April 2004, Richie Hindle published an implementation of both GOTO and COMEFROM for the Python programming language.4 Despite being released on April Fools' Day and not being intended for serious use, the syntax is valid and the implementation fully works.
The following is an example of a program in a hypothetical BASIC dialect with "COMEFROM" instead of "GOTO".
This program (hypothetically) works by asking the user for their name, greeting them with the same name, and continuing all over again. The instruction "REM" on line 40 is simply a NOP (in this case, a REMark or comment) — the "COMEFROM" statement on line 10 causes a branch back to that line when execution reaches line 40, regardless of its contents.
A fully runnable example in Python with the joke goto module installed (which uses debugger hooks to control program execution) looks like this:
This is an implementation in Ruby of the Intercal COME FROM statement.
The OS/360 Fortran G compiler has a debug packet feature. Its "AT" statement is similar to COMEFROM in that it hands the control flow over to the debug block. Breakpoints in general are similar.5
Serious programming contrivances involving ideas resembling COMEFROM:
Hindle, Richie (1 April 2004), goto for Python, Entrian. http://entrian.com/goto/ ↩
Clarke, Lawrence, "We don't know where to GOTO if we don't know where we've COME FROM. This linguistic innovation lives up to all expectations.", Datamation (article), archived from the original on 2018-07-16, retrieved 2004-09-24. /w/index.php?title=R._Lawrence_Clark&action=edit&redlink=1 ↩
Modell, Howard; Slater, William (April 1978). "Structured programming considered harmful". ACM SIGPLAN Notices. 13 (4): 76–79. doi:10.1145/953411.953418. Retrieved 18 July 2014. http://www.modell.com/Magery/SPharmful.html ↩
IBM System/360 and System/370 Fortran IV Language, GC28-6515-10, May 1974 ↩
F. X. Reid, On the Formal Semantics of the COMEFROM Statement. FACS FACTS, Issue 2006-1, pages 18–20, March 2006. https://www.bcs.org/media/5044/issue-2006-1-march-2006.pdf ↩