Examples show the Memeforth code and the resulting stack.
All of these push either
false onto the stack as their result.
>=Greater than or equal
<=Less than or equal
DO Performs looping based on a start and end value.
10 0 DO I . LOOP outputs
0 1 2 3 4 5 6 7 8 9
I Used to access the current loop index value.
IF Performs based on the top value on the stack.
IF YEET ELSE NOYEET THEN will result in “YEET” being on the stack if the top stack value is
true before the
: Defines a new word.
: DNSYEET yeet DNS ; compiles to a word
DNSYEET that becomes
DNS over yeet on the stack.
NOTE: See JS docs for how output is handled and how to access it. It is not printed to the console!
TYPEPrint the top item of the stack to
output. Discards the top stack element.
.Synonym for TYPE.
.sPrint the contents of the stack to
output. Does not affect the stack.
Integers are automatically pushed onto the stack.
Starts defining a literal string and pushes it to the stack.
s" my string here" ⇒
"my string here"
Note: The space after
s" is necessary. Extra spaces will become leading spaces on the defined string.
Push an empty string to the stack.
Push a single space character to the stack.
Push a single newline character to the stack.
( Starts a comment until a closing
Not sure why this is in literals, but there's nowhere else that it really fits, so who cares.
Add the top two elements of the stack.
Add directly to a memory variable. For instance, if the variable
3 X +! will result in
8 in memory.
1 2 + ⇒
Subtract the top two elements of the stack.
2 1 - ⇒
Multiply the top two numbers on the stack.
2 2 * ⇒
Alternatively, can be used to multiply strings. For instance:
test 3 * ⇒
Perform division and modulus and place the results on the stack.
10 3 /MOD ⇒
Divide the top two numbers on the stack, returning the integer quotient.
7 2 / ⇒
Perform the modulus operation on the top two numbers on the stack.
7 2 MOD => 1
Generate a random integer between a min and a max.
1 10 RAND => a random number between 1 and 10.
This is what you're really here for.
Generates an “as a service” meme.
Yeet AAS ⇒
"YaaS (Yeet as a Service)"
Generates an “as a bit” meme.
s" yeeting" BIT ⇒
"yeeting, as a bit"
Pushes “🅱️” to the stack.
Replaces the first letter of a string with 🅱️.
Pushes “👏” to the stack.
Converts a string into
yeet COOLKIDS ⇒
"all the cool kids are getting into yeet"
Generates a “DNS over” meme.
s" carrier pigeon" DNS ⇒
"DNS over carrier pigeon
Generate a Drake like/dislike meme with Mastodon :drake_like: and :drake_dislike: emotes.
Pushes the text
fuckign to the stack.
Pushes the text
lmao gottem to the stack.
Generates Mastodon Hacker Text emotes from a string.
s" yeet" HACKER ⇒
":hacker_y: :hacker_e: :hacker_e: :hacker_t:"
Generate a “Just another hard day's work” meme.
s" meme" HARDWORK ⇒
"Just another hard day's work at the 'meme' factory."
Generates a “jorts” meme.
s" yeet" JORTS ⇒
"jeet (jean yeet)"
Generate a “It's more likely than you think” meme.
s" Memes" s" FORTH" MORELIKELY ⇒
"Memes? In my FORTH? It's more likely than you think"
Generates an “OK Google” meme.
s" run Memeforth" OKGOOG ⇒
"OK Google, run Memeforth"
Generates an “owning the...” meme.
boomers weed smartphones OWNING ⇒
"owning the boomers with weed and smartphones"
Generate a “Sure hope it does” meme.
s" Markdown ⇒
"Markdown? I sure hope it does!"
Generates Mastodon SM64 Text emotes from a string.
s" yeet" SM64 ⇒
":sm64_y: :sm64_e: :sm64_e: :sm64_t:"
Generates an arbitrary “jorts” meme with root and subject.
s" blob" s" cat" XORTS ⇒
"bat (blob cat)"
Keywords that operate on the program's memory array.
Stores a stack element into memory.
s" mystring" 42 ! ⇒ Stores
"mystring" at address 42 in memory.
Fetches a memory location and puts it on the stack.
42 @ given that memory location 42 =
"test" will result in
being on the stack.
DEFVAR MYVAR creates a variable called
MYVAR that is a word that resolves to the memory location where
MYVAR is stored.
DEFARR MYARR 10 creates a variable called
MYARR that resolves to a pointer to the start of the array, which is of length 10.
Duplicates the top element of the stack.
1 DUP ⇒
Duplicates the top pair of elements on the stack.
1 2 2DUP ⇒
1 2 1 2
Drops the top element from the stack.
1 2 DROP ⇒
Drops the top two elements from the stack.
1 2 3 2DROP ⇒
Copies the second element over the first.
1 2 OVER ⇒
1 2 1
Swaps the top two elements of the stack.
1 2 SWAP ⇒
Rotates the stack.
1 2 3 ROT ⇒
2 3 1
Rotates the stack the other way.
1 2 3 -ROT ⇒
3 1 2
Concatenates the top two strings on the stack.
s" string1" s" string2" CONCAT ⇒
Replaces the top string on the stack with its length.
s" stringy" LEN ⇒
Slices a string.
yeet 1 3 SLICE =>
Splits a string into individual stack elements based on a delimiter. It also pushes the number of split elements to the stack for later rejoining.
s" split-me-up" s" -" SPLIT =>
split me up 4 (Each a separate word on the stack).
Joins multiple stack elements into a single string.
join me up 3 s" " JOIN =>
"join me up" (As a single string on the stack)
ISUPPER Test if the top string on the stack is entirely uppercase.
ISLOWER Test if the top string on the stack is entirely lowercase.
TOUPPER Convert the top string on the stack to uppercase.
TOLOWER Convert the top string on the stack to lowercase.