Skiforth is a SK-calculus based Forth discovered by User:Orby in April 2020.
K are combinators. If
y are combinators, then
x y ` is a combinator.
z y x S ` ` `is rewritten to
z y ` z x ` `
y x K ` `is rewritten to
All words must be separated by whitespace. All words are case insensitive. Skiforth uses post-fix notation. There are 10 built-in words including the ability to define new ones:
Spushes the S combinator onto the stack.
Kpushes the K combinator onto the stack.
`applies the first combinator on the stack to the second combinator on the stack.
:begins a word definition.
;ends a word definition.
.pops the first combinator off the stack and prints it.
(begins a comment.
)ends a comment.
include fileincludes a file.
listlists the content of the dictionary.
byeexits the interpreter.
The I combinator (SKK) is not a built-in command. We can define it by typing
: I K K S ` ` ; ok
The first token after
: is the name of the word. All subsequent tokens until
; compose the body of the word. Let's look at what we created
I . K K S ` ` ok
We can apply the I combinator to itself and print the result by typing
I I ` . K K S ` ` ok
We can also redefine built-in commands
: S K S ` ` ; ok
And redefine commands we've already defined recursively
: S K S ` ` ; ok : S K S ` ` ; ok S . K K S ` ` ok