Forth

(xkcd.com)

157 points | by beardyw 9 hours ago ago

31 comments

  • jihadjihad 6 hours ago ago

    Slightly OT, but nothing can beat DonHopkins’s “About” section here on HN [0].

    0: https://news.ycombinator.com/user?id=DonHopkins

  • dchest 7 hours ago ago

    FORTH LOVE? IF HONK THEN

  • kentbrew 3 hours ago ago

    My dad proudly flew one that said FORTH <3 IF HONK THEN. Yes, people did honk.

  • mikewarot 6 hours ago ago

    I never noticed the disclaimer at the bottom until today

      xkcd.com is best viewed with Netscape Navigator 4.0 or below on a Pentium 3±1 emulated in Javascript on an Apple IIGS
      at a screen resolution of 1024x1. Please enable your ad blockers, disable high-heat drying, and remove your device
      from Airplane Mode and set it to Boat Mode. For security reasons, please leave caps lock on while browsing.
    
    Also, the font chosen is all caps
  • hmokiguess 6 hours ago ago

    Prediction: someone will make a reverse polish notation skill for interacting with claude claiming all sorts of things, like caveman, turn into another markdown as a service company, and make the news.

  • joshu 4 hours ago ago

    is it me or is forth coming up a lot lately? or am i just having a plate-o-shrimp situation?

    • firesteelrain 3 hours ago ago

      It does seem like it the last few days

  • add2 3 hours ago ago

    Iがforthをloveする

  • lhakedal 7 hours ago ago

    Saw the same joke with Postscript many years ago.

  • ajhenrydev 8 hours ago ago

    Can someone explain for me?

    • e12e 7 hours ago ago

      A different way to say the same: in forth, words get pushed on the stack, and popped from the stack by words that take arguments:

          code           stack
          I Forth love
      
          Forth love     I
      
          love           I
                         Forth
      
          ; love presumably pops
          ; subject, object args
          ; from stack - and does something 
          ; perhaps prints as side effect
      • forsalebypwner 6 hours ago ago

        Is that loss?

        • fwip 4 hours ago ago

          No.

        • joshu 4 hours ago ago

          well played

      • DonHopkins 5 hours ago ago

        Here is some inexplicably but meticulously formatted FORTH code that uses right justified indentation! Including reverse polish notation assembley.

        https://donhopkins.com/home/code/tomt-cam-forth-scr.txt

        https://donhopkins.com/home/code/tomt-users-forth-scr.txt

          ( FMOVE -- functional intersegment move                   ) HEX
        
          88 CONSTANT *MOV*  ( fn = 0 )   20 CONSTANT *AND*  ( fn = 1 )
          08 CONSTANT  *OR*  ( fn = 2 )   30 CONSTANT *XOR*  ( fn = 3 )
        
          CODE FMOVE ( fn s.seg s.off d.seg d.off length --)  AX, SI MOV
              CX POP  DI POP  ES POP  SI POP  DS POP  DX POP  AX PUSH
                                AL, # *XOR* MOV  DX, # 3 CMP  1$ JE
                                AL, #  *OR* MOV  DX, # 2 CMP  1$ JE
                                AL, # *AND* MOV  DX, # 1 CMP  1$ JE
                                AL, # *MOV* MOV               1$:
             CS: HERE 5 + , AL MOV  ( modify "[DI], AL MOV" ) 2$:
                              LODS  ES: [DI], AL MOV  DI INC  2$ LOOP
              AX, CS MOV  ES, AX MOV  DS, AX MOV  SI POP  NEXT,  END-CODE
        
                                                                    -->
    • spott 8 hours ago ago

      Forth I assume uses reverse polish notation: arguments before the operator.

      3 4 +

      for example, would return 7.

      • zabzonk 7 hours ago ago

        > would return 7

        more pedantically, it would push 7 onto the stack

        • dbcurtis 6 hours ago ago

          even more pedantically, would remove 3 and 4 from the stack before pushing 7

          • DonHopkins 5 hours ago ago

            Even oddly more pedantically, that's the operand stack, not to be confused with the separate return stack. >R and R> move values between the two stacks.

            On the other hand, PostScript also has a dictionary stack, which you can use to implement a Smalltalk-like object oriented programming system. And its data types and executable code are basically polymorphic homoiconic JSON (like Lisp), not raw untyped bytes like FORTH.

            https://news.ycombinator.com/item?id=22456471

            https://news.ycombinator.com/item?id=47812317

      • argimenes 7 hours ago ago

        The stack is really a convenience that makes pipeline-driven programming possible in the language.

        • nagaiaida 2 hours ago ago

          somewhat relatedly, shell pipelining is very amenable to being massaged into (non stack-based) concatenative programming

    • HFguy 8 hours ago ago

      Forth uses RPN so the "verb" is last.

      That is, you provide the data first (I and Forth) and the command (heart) last.

    • daureg 7 hours ago ago
  • iberator 2 hours ago ago

    FYI: Forth can be very readable!

    IT DOES NOT NEED TO BR ALL IN ONE LINE

    Most commercial forth source code is totally readable and maintainable:

    comments, newlines, macros, high level commands etc

    It's a total myth that its 'write only'. The same nonsense is spreaded by some nerds who actaully never wrote a single program in it.

    ps. same goes to COBOL. 99% of fud by guys who never even wrote a simple program in it.

  • dwheeler 7 hours ago ago

    That beautiful is.

  • perpil 6 hours ago ago

    I first thought this was some spin on May the fourth be with you. As in how Yoda might say it.

    • weikju 2 hours ago ago

      My brain tells me Yoda speak would likely be: love Forth, I do.

      But then he would also say: Forth is the path to the Light Side…

    • sdenton4 4 hours ago ago

      I doubt yoda speak is actually strict enough, but I do enjoy the idea that Yoda comes from a reverse Polish civilization.

    • throw-the-towel 4 hours ago ago

      Master Yoda's speech, secret solved is; an old Forth programmer is he simply.