3 ms·
One language that seldom gets mentioned is Postscript. People tend to think of it as just a page descriptor language, but really that is just the built-in grap
by derekp7 7y ago
One language that seldom gets mentioned is Postscript. People tend to think of it as just a page descriptor language, but really that is just the built-in graphic functions.
So we have a post fix (RPN, similar to HP calculators) expression style, which is really a mirror image of Lisp. You have genuine first class functions, introspection, and something I don't see that often is first class environments. That is you can, within any part of the code, activate an environment (they call it a dictionary, which is very similar to a C structure). And they stack, so that something not in the active environment can be automatically looked up in a parent environment.
- dannas 7y agoI remember being surprised when I read an interview with Robert Sedgewick where he listed the PostScript Language Reference Manual on his list of top ten programming books. I've never read it though.
- derekp7 7y agoThey are also available free online -- "PostScript Language Tutorial & Cookbook", also known as the PostScript Blue Book, is at https://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF https://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF. There is also the Red Book (useful to fully understand the language, to the point of writing a PostScript interpreter), and Green Book (more of a reference book than a cookbook).
- protomyth 7y agoI have often wanted a Postscript without the drawing functions to be my quick and dirty language. It really is the nicest stack language I have ever programmed in.
- RodgerTheGreat 7y agoYou can use GhostScript as a repl: $ gs GPL Ghostscript 9.19 (2016-03-23) Copyright (C) 2016 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. GS>2 3 add stack pop 5 GS> Many of you probably already have it installed on your machines!
- protomyth 7y agoGhostScript is a little too heavy weight for what I want and I would need stdio access. Good tip though, thanks.
- Terretta 7y agoIt’s mentioned in the article.