THE CONCATENATIVE LANGUAGE XY * Introduction XY is a direct descendant of the vector language K and the concatenative language Joy. Computation consists of a sequence of evaluation steps over a pair of objects X and Y. X is the stack, and contains the entirety of what has been computed so far. Y is the queue, and contains the entirety of what remains to be computed. A step consists of taking the next element in the queue and applying it to the stack and the remainder of the queue. The result is a new stack and a new queue. The principles of XY are: - The totality of the computational state is available at every step. - A step may produce an arbitrary transformation of computational state. * K The datatypes of XY are those of K: integer, float, character, symbol, null, function, list, and dictionary. The elementary operators of XY are the twenty K verbs: ~ ! @ # $ % ^ & * - _ = + | : , < . > ? Each verb v has three functional forms: v dyad 3 2 - -> 1 subtract v: monad 2 -: -> -2 negate v. commuted dyad 3 2 -. -> -1 commute subtract A verb is atomic if it pervades its argument to iterate over atoms. For example, [1 2 3][4 5 6] + -> [5 7 9] The atomic dyads: ! % ^ & * - = + | < > The atomic monads: $: %: -: _: The six overloaded adverbs of K, ' / \ ': /: \: are mapped to distinct XY words: ' each / over while do converge \ over! while! do! converge! ': prior /: each/ \: each\ K system functions (e.g. _in) and input/output primitives (e.g. 3:) are also supported. * XY The operators of Joy are unary functions of the form stack -> stack' For example, + takes the stack, pops two numbers, adds them, pushes the result onto the stack, and returns the modified stack: X^n^m -> X^n+m where 'x^y' denotes the concatenation of x and y. The operators of XY are unary functions of the form [stack queue] -> [stack' queue'] A description of evaluation in XY will clarify the difference. Initially, the stack X is empty and the queue Y consists of a sequence of elements which are to be pro...
First seen: 2026-01-24 20:52
Last seen: 2026-01-24 21:52