Comparison of Factor and Joy

The following program demonstrates a feature that is present in Joy and not in Factor:

stdin fgetch [pop feof not] [putch fgetch] while pop pop.

The pop in the condition of the while removes the character that was read with fgetch. This is not a problem in Joy, because at the end of the condition, after the condition code has been read, the stack is restored to what it was before the condition started. Factor does not have this feature, because of performance considerations. This feature also touches the goals of the two languages: Joy wants to be high level, Factor wants to be practical.

This revision created on Sun, 30 Apr 2017 14:43:44 by Wodan58 (fgetch, not getch)