News for hackers. Stuff that matters.
Re:Forth: A New Way to Program a Mini Computer (1974) by bmacho on Wednesday October 12, 2022 @07:37AM (#33175487)
> "(" should be: Push next word to X-stack

> ")" should be: pop and execute top of X-stack.

> So "(+ m n)" is equal to "m n +"

I don't get it, what is the X-stack? Also can you elaborate this example in more details?

Re:Forth: A New Way to Program a Mini Computer (1974) by timonoko on Wednesday October 12, 2022 @07:52AM (#33175616)
X is separate execution stack. It is very short depending how many brackets you use. When I made such Forth some 50 years ago, the "pop and execute" was one cycle on Nova 1200, no overhead. And x-stack was one 8-bit page.
Re:Forth: A New Way to Program a Mini Computer (1974) by bmacho on Wednesday October 12, 2022 @08:32AM (#33175978)
Thanks. Am I getting right, ( + 1 ( - 2 3 ) ) parses as

    s 
    x +

    s 1
    x +

    s 1
    x + -

    s 1 2
    x + -

    s 1 2 3
    x + -

    s 1 2 3 -
    x +

    s 1 2 3 - +
    x 
which should evaluate to 0?