3 ms·
PostScript is really a lot more like Lisp or Smalltalk than Forth. It has GC, blocks for control flow, local variable binding, symbols, mandatory bounds-checkin
by kragen 7y ago
PostScript is really a lot more like Lisp or Smalltalk than Forth. It has GC, blocks for control flow, local variable binding, symbols, mandatory bounds-checking, type-safety, and exception handling. Forth conscientiously abjures such things, and uses compile-time metaprogramming instead in some cases, which is possible in PostScript (and used routinely for raster image data) but less flexible.
However, PostScript not only passes arguments on the stack, it exposes things like the compiler machinery in ways that are more typical of Forth than of the high-level languages it draws so much from. So I feel like it has some Forth inspiration, in the same way Python is influenced by SNOBOL or BASIC.
Nowadays I've mostly given up PostScript in favor of SVG and Reportlab, sad to say.
- DonHopkins 7y ago>Nowadays I've mostly given up PostScript in favor of SVG and Reportlab, sad to say. JavaScript and the canvas 2d api are the moral equivalent of PostScript, these days.
- kragen 7y agoYeah, but the canvas API sucks bad enough (mostly due to the constraints of JS) that PostScript is an appealing alternative. Super verbose and can't even produce a PDF. If you can print it it's all pixelated.