-- Leo's gemini proxy

-- Connecting to freeshell.de:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini;lang=en-GB

Having looked into Forth (a bit)

I previously wondered how much Forth was like Whitespace assembler...

...so I got a Forth interpreter and had a go. I didn't get much beyond beginner level, so take all I say with a pinch of salt.


Similarities

Both have painful stack manipulation. This sucks.

Both let you define your own instructions in terms of the existing primitives.


Differences

Forth heap has named variables, Whitespace has numeric address.

Whitespace can delve as far down the stack as you like. Forth can only look at the top 6 (I think) and even that gets convoluted.

Forth looks (a bit) like a 3GL. Whitespace assembler looks like... assembler?

Forth has function pointers (well, "word pointers" I suppose). I don't think that's possible in Whitespace.

Forth word definitions are a bit like Whitespace assembler macros, but some stuff is executed when definitions are compiled. Not sure I grok'd this too well.


Not sure

I said that Forth looks a bit like like a 3GL but feels a lot like assembler because it seems you are dealing with implementation details rather thn abstractions. But maybe that gets better is you have defined enough of your own words.


#CodeLayout

#Whitespace

#Forth


back to gemlog

-- Response ended

-- Page fetched on Fri May 3 16:31:57 2024