Hacker News new | ask | show | jobs
by RodgerTheGreat 5600 days ago
Factor's heterogenous stack (complex objects rather than integers) definitely reminds me more of PostScript than Forth, and I agree it can make programming much more straightforward. I also liked how PS handles flow control- while Forth uses rather traditional looking left-to-right reading constructs:

  3 5 > if ." greater" else ." less" then
PostScript goes with operators like "if" and "ifelse" that consume code literals from the stack (enclosed in curly braces):

  3 5 gt { (greater) print } { (less) print } ifelse
It's a little heavier weight, but very flexible and it feels like a natural way to handle postfix conditionals.