3 ms·
PostScript is a bit like .Net CLR or WASM: while widely used, it's basically never written by humans directly. Forth is a wonderful way to build a high-ish lev
by nine_k 1y ago
PostScript is a bit like .Net CLR or WASM: while widely used, it's basically never written by humans directly.
Forth is a wonderful way to build a high-ish level self-contained programming environment on very low-resource hardware, like a 8-bit MCU. But thinking in terns of the stack is useless mental gymnastics, this is something a machine should do instead.
- zzo38computer 1y agoPeople do write in PostScript directly (and I have seen .NET and WASM code written directly, too). I use PostScript directly and so do some other people.
- jrapdx3 1y agoAbsolutely. Years ago writing programs for *BSD/Linux, PS was the natural, most direct way to implement printing to printers equipped with a PS interpreter. Fortunately the PS language was very well documented. That made writing PS pretty straightforward, at least for the reasons I was using it. Curiously other concatenative languages have been harder for me to grasp. Maybe that's because I regarded PS as a specific-use tool vs. a general purpose language. If nothing else PS showed the value of excellent documentation. Lack of it probably accounts for many software project failures, particularly in the open-source world.
- zzo38computer 1y agoYou can also run PostScript programs on the computer; you do not need a PostScript printer. > Maybe that's because I regarded PS as a specific-use tool vs. a general purpose language. In my opinion, it is both. Many of the programs I write in PostScript do not involve a printer at all. > If nothing else PS showed the value of excellent documentation. Lack of it probably accounts for many software project failures, particularly in the open-source world. I also find a problem with many programs that do not have good documentation. When I write my own, I try to provide documentation.
- ofalkaed 1y agoFrom what I can tell the mental gymnastics are leaning how to think in terms of Forth instead of how to think in terms of the stack, which is the stack effect and not the stack itself. You only think about the stack itself with your base words (when stack and stack effect are essentially the same), after that it is the stack effect; a single word may push and pop thousands of times but you don't need to think about that, just make sure that it leaves the stack (or stacks) in the state you want it (them). Once you have built up a few layers from the base words I find it more like having a single variable which you store the current state in than a stack, so functional stateless programming but with a tiny dash of state? There are mental gymnastics but they are far from useless and not just thinking in terms of the stack. I don't quite have it down yet but I am getting closer and can see the sense in it, I haven't quite figured out how to plan and structure a program in Forth.