137
Forth (thelemmy.club)
top 14 comments
sorted by: hot top new old
[-] otacon239@lemmy.world 14 points 1 week ago* (last edited 1 week ago)
[-] davidgro@lemmy.world 5 points 1 week ago

Thisgreatisone! ?

If the operands go the other way, I suppose:

oneisgreatThis!

[-] otacon239@lemmy.world 4 points 6 days ago* (last edited 6 days ago)

The stack doesn’t quite work like that. They would get added like this:

This > buffer
great, is, one > stack

Then, each + pulls the latest off the stack and operates.

First + would pull ‘one’ as it’s the most recent on the stack.

This page does a good job of explaining: https://www.geeksforgeeks.org/dsa/introduction-to-stack-data-structure-and-algorithm-tutorials/

Edit: you can also see this reflected in the Alt-text:

I NOTATION POLISH REVERSE ❤️
[-] davidgro@lemmy.world 4 points 6 days ago* (last edited 6 days ago)

Huh, it's that buffer thing that I didn't know about and isn't mentioned in your link (maybe it's Forth specific?), I use an RPN calculator app, but everything goes on the stack, so "This" would be on the bottom and be popped off last.

[-] otacon239@lemmy.world 2 points 6 days ago

Did Randall get this one wrong?

[-] sukhmel@programming.dev 2 points 5 days ago

It looks to me that it is either Forth, or implementation specific, not RPN in general. But then again, the meme is about Forth, not RPN

[-] AVincentInSpace@pawb.social 1 points 6 days ago

My guess is that POLISH and REVERSE modify the top stack element immediately

[-] Chais@sh.itjust.works 5 points 1 week ago

But just to nitpick, wouldn't this parse into "Forth ❤️ I"? Which is to say, aren't the operands in the wrong order?

[-] JohnnyCanuck@lemmy.ca 10 points 1 week ago

But just to nitpick, wouldn't this parse into "Forth ❤️ I"? Which is to say, aren't the operands in the wrong order?

No, they're correct. You're parsing it wrong.

[-] jdnewmil@lemmy.ca 5 points 1 week ago

RPN

data1 data2 function

Neither Forth nor I are actions.

[-] froh42@lemmy.world 2 points 1 week ago

That's true, but as the Forth is top of stack I'd read it as the subject and I as the object. OFC that's just how you define the heart-word, but still.

[-] jdnewmil@lemmy.ca 1 points 6 days ago

Color me mystified. Why would you map the verb of an English sentence to anything but a function or method in a computer language expression?

[-] victorz@lemmy.world 5 points 1 week ago

The operand at the top of the stack is used as the second operand for binary operators. Second from the top is used as the first operand.

Here illustrated using dc, and doing the calculation 3 - 1 and printing the answer with the command p, getting the result of 2. As we can see here with a noncommutative operation (subtraction), in order to illustrate the point, we get 2, rather than -2.

~ dc
3 1 - p
2
[-] Kojichan@lemmy.world 1 points 1 week ago

Loved playing with a Forth subset (MUF) in MUD and MUCKs.

this post was submitted on 10 Aug 2026
137 points (96.6% liked)

Programmer Humor

32824 readers
822 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS