4 ms·
ck.k was my first attempt to design a concatenative language with array semantics. much more interesting in my opinion is the XY language, here: https://nsl.c
by nostinkingloops 4y ago
ck.k was my first attempt to design a concatenative language with array semantics.
much more interesting in my opinion is the XY language, here:
https://nsl.com/k/xy/xy.txt https://nsl.com/k/xy/xy.txt
XY contains the primitives of k + 9 core primitives, in terms of which all the stack operations of joy can be defined:
-> queue [X^z Y] -> [X z]
<- stack [X^z Y] -> [z Y]
=> cache [X^z Y] -> [X Y^z]
<= uncache [X Y^z] -> [X^z Y]
/ use [X^z Y] -> [X z,Y]
\ mention [X z^Y] -> [X^z Y]
` enclose [X^z Y] -> [X^{z} Y]
disclose [X^{z} Y] -> [X^z Y]
( stack* [X Y] -> [X^[X] Y]
) queue* [X Y] -> [X^[Y] Y]
i've implemented the following modules:
stack the basic Joy stack words, e.g. 'dup'
list list manipulation words, e.g. 'cons'
general general operators, e.g. 'pred'
predicates predicates, e.g. 'false?'
queue queue manipulation words, e.g. 'clear'
monads keywords for K monads, e.g. 'where' for '&:'
dot K amend and dmend
adverbs XY definitions for K adverbs, e.g. 'each/'
joy XY definitions for Joy combinators, e.g. 'linrec'
call call with current/partial continuation
io input-output convenience words
misc miscellaneous