(no title)
romforth | 1 year ago
Given how close Forth is to assembly (seen from an implementer's point of view) it makes sense to write Forth in a "vertical" style which reflects the "vertical" style in which assembly code is written. This has the advantage that the "stack picture comments" on each line of code can stand in for Hoare triplets so that the code and its - I'll call it - "proof" can be written hand in hand at the same time.
This is how all of the Forth code that I've written in https://github.com/romforth/romforth is structured.
It does make the code appear less compact though so you are not going to win any code golf prizes.
Lerc|1 year ago
A text display with an auto pretty printed view would serve people who like both code styles well.
A newline per stack reducing operation with the next line indented by stack depth would make it close to your style and could be quite automatic.
cess11|1 year ago
https://factorcode.org/
romforth|1 year ago
These might be famous last words, but if switching between compile/interpret modes is ignored, I think it shouldn't be too hard to implement it though.
volemo|1 year ago