ComeFrom

ComeFrom is a language made by David Roberts. It is also known as the ComeFrom Language, or CFL for short. Its notable feature is that the only flow-control constructs are comefroms and conditional comefroms. (A comefrom is the opposite of a goto.) In addition, the only storage it has is a variable stack which doubles as returned output. However, you may print variables while the program is running. In event of catastrophic failure, the language only tells why it has crashed, not why your program has crashed. It has one error message to help, but due to implementation details this is impossible to trigger.

This language has been obsoleted by ComeFrom2, which introduces some breaking changes and a nicer syntax. ComeFrom 2 is available through a web-based IDE, at http://ddr0.github.io/side%20projects/cfl/.

Running
ComeFrom was developed in late 2012 in about a day using the scripting language of the game Cube Trains, which was made for Frogatto. The interpreter is downloadable from GitHub. To run, compile the project from GitHub, launch the game with, press ctrl-d for the interactive debug console, and then you can paste in the examples below.

Syntax
All operators work on one stack. Operators themselves may be stacked. Numbers are denoted by a  in front of them, and everything else is a string if it's not an operator listed below. Each element of the code must be preceeded by a line-number, and all elements and line-numbers must be separated by one or more spaces. (Tabs and hard-returns get removed on running, not replaced with spaces.) The program is run in order of line-number, not in order of appearance.

Sum up three numbers (version 1).
This first executes line 10, which adds five to the variable stack (the stack). Then, on line 20, it adds a plus operator to the operator stack (the opstack), which waits for one more variable to be added to the variable stack. Note that it executes line 20 before line 30, which adds a three to the stack. Then the plus operator is popped off the opstack, the 3 and 5 are popped off the stack, and an 8 is put back on the stack. Next, we find another plus operator, wait for the 4 to be added to the stack, and then sum that. At this point, the program exits and returns [12]. cfl(' 		 10 #5  		 30 #3  		 20 +  		 40 +  		 50 #4  	')

Sum up three numbers (version 2).
This version works like the first version, except that we add the 5 and the 3 to the stack, then we add two plusses to the opstack, and when the 4 is read into the stack the second plus adds 4 and 3, then the first plus is popped and adds 7 and 5. I'm not sure what this notation is called. cfl(' 		 10 #5  		 20 #3  		 30 +  		 40 +  		 50 #4  	')

Since order is supplied by line numbers, it is only customary to order the lines by number. An equivalent way of writing the previous example would be: cfl('30 + 40 + 10 #5 50 #4 20 #3')

Hello, world.
Prints "Hello world.". On line 10, we invoke the  function, which will print the next data we have. The next function we invoke causes us to interpret the next two things, in this case a string 'Hello' and a plus operator. The plus operator then waits for 'world.' to be added to the variable stack, then executes (removing itself, 'world.', and 'Hello' from the stack) and returns 'Hello world.' to the stack. Then, the  operator, now satisfied, pops itself off the stack while leaving the variable 'Hello world.' there. then prints the message. Note that it must be implemented this way, since  would separate on the spaces, and then 'world.' would not have a line number. cfl(' 		 10 print 11 ( 20 Hello 30 + 40 world. ')

Print a list of numbers from 1 to 10.
Due to the extreme difficulty involved in concatenating words, this entry replaces the usual '99 bottles of beer' problem. cfl('  10 #0   20 comefrom   25 #120   30 +   40 #1   50 dup   55 dup   60 <   70 #10   80 drop   100 comefromif   110 #75   120 drop   130 comefrom   140 #90   145 drop   ')

Future Developments
It would be easy to add an  and an   statement, which would let you set new comefroms. A  operator would complement it nicely, too.

A  operator, for accessing history in the variable stack, would be useful. eg;  would, when executed, return [1,2,3,1,3].

External resources

 * examples and interpreter