- For anyone who wants to type or paste into the Code textarea:
* https://webdocs.cs.ualberta.ca/~hayward/papers/BLUEBOOK.pdf The PostScript Language Tutorial and Cookbook (the "Blue Book") (principally) by Linda Gass and John Deubert, 1986 (ISBN 0-201-10179-3)
* https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf The PostScript Language Reference (third ed.—a later edition of the "Red Book") (principally) by Ed Taft, Steve Chernicoff and Caroline Rose, 1999 (ISBN 0-201-27922-8)
* https://connor.zip/resources/pdfs/adobe-green-book.pdf PostScript Language Program Design (the "Green Book") by (principally) by Glenn Reid, 1988 (ISBN 0-201-14396-8). A zipfile with Green Book code files: https://web.archive.org/web/20110613223722/http://partners.a...
(At first my retro-ps tab got itself into a state in which it would not run any code entered into the Code textarea, instead timing out and returning an error; and since page reload is soft-disabled you'll have to either force a reload or open a new tab. Also, since the Abobe sample code uses indentation extensively—for example the Blue Book's official "hello world" program is
—it would be nice if the Code textarea handled Tab keyboard inputs. )newpath 144 72 moveto 144 432 lineto stroke showpage - Such a shame that macOS lost all its built-in postscript support including Preview.app in recent versions :(
- This is the single reason I have not upgraded from OS 12.x. Postscript is key to many of my workflows.
- Preview.app in NeXTstep used to have a postscript window where you could type in postscript (or paste it in) and interactively work with it. It was an essential development tool to help write postscript before including it in a source code file as a pswrap.
- I didn't know that! Is it announced somewhere, even buried deep in release notes, or just one of those things that they decided silently to enshittify?
- Oh man. I used PostScript a ton when I worked at hp 20 years ago. It's actually a pretty great language, like lisp/scheme but I found it to be more approachable somehow. Maybe because it's postfix instead of prefix?
https://liucs.net/cs101s13/fixity.html
Anyway, it had several fatal flaws. I don't think it could handle images natively, so instead it encoded them as vectors and those files took up MB. It probably just needed a metaphor like iframe.
I remember when Apple switched to the PDF engine in Quartz in preparation for OS X in the late 90s, I thought it was a mistake then. The QuickDraw it was replacing was actually quite good, in some ways the epitome of C-style rendering. And Cocoa was refreshing at first (it handled stuff like palettes and gamma in a data-driven way instead of through leaky abstractions) but without a way to transition off QuickDraw, it felt like more busywork that had to be done just to keep up.
https://eclecticlight.co/2024/06/01/pdf-on-macs-the-rise-and...
Apple seems to have lost its academic roots, and suffers for it now. Or I should say, its customers suffer while it grosses almost half a trillion dollars per year. At least with vibe coding we can just whip up a Preview app in an afternoon, so maybe none of this matters anymore.
- > Apple seems to have lost its academic roots, and suffers for it now. Or I should say, its customers suffer while it grosses almost half a trillion dollars per year. At least with vibe coding we can just whip up a Preview app in an afternoon, so maybe none of this matters anymore.
Eh, I'm with Apple on this one: we can just use Ghostscript. Apple's move effectively forces the few applications that need to use PostScript on macOS to migrate from a proprietary PostScript implementation to an OSS one, which strikes me as ultimately a good thing.
- Yes, PostScript is a great general purpose high level programming language, kind of like a cross between Forth and Lisp, but a lot more like Lisp, with its polymorphic homoiconic data structures that were essentially JSON.
https://news.ycombinator.com/item?id=41962062
>PostScript is kind of like a cross between Forth and Lisp, but a lot more like Lisp actually. And its data structures, which also represent its code, are essentially s-expressions or JSON (polymorphic dicts, arrays, numbers, booleans, nulls, strings, names (interned strings), operators (internal primitives), etc.)
https://news.ycombinator.com/item?id=21968175
>Kragen is right that PostScript is a lot more like Lisp or Smalltalk than Forth, especially when you use Owen Densmore's object oriented PostScript programming system (which NeWS was based on). PostScript is semantically very different and much higher level that Forth, and syntactically similar to Forth but uses totally different names (exch instead of swap, pop instead of drop, etc).
https://news.ycombinator.com/item?id=21968842
>You're welcome! OOPS (Object Oriented PostScript ;), I meant to say that PostScript and Lisp are homoiconic, but Forth is not. The PSIBER paper on medium goes into that (but doesn't mention the word homoiconic, just describes how PS data structures are PS code, so a data editor is a code editor too).
The Shape of PSIBER Space: PostScript Interactive Bug Eradication Routines — October 1989:
https://donhopkins.medium.com/the-shape-of-psiber-space-octo...
The Story of Sun Microsystems PizzaTool: How I accidentally ordered my first pizza over the internet.
https://donhopkins.medium.com/the-story-of-sun-microsystems-...
PizzaTool Source Code (in object oriented NeWS PostScript using Owen Densmore's "class.ps"):
https://www.donhopkins.com/home/archive/NeWS/pizzatool.txt
NeScheme and Schlumberger's LispScript:
https://donhopkins.com/home/archive/NeWS/NeScheme.txt
>PostScript is often compared to Forth, but what it lacks in relation to Forth is a user-extensible compiler. You can write your own PostScript control structures and whatnot, like case and cond, to which you pass procedures as arguments on the stack, but the PostScript scanner is not smart -- but there is no preprocessing done to the PostScript text being read in, like the way immediate words in Forth can take control and manipulate the contents of the dictionary and stack while the text source is being read in and compiled, or like the way Lisp macros work. This is one of the things I would like to be able to do with something like LispScript.
>"Lisp is the language for people who want everything, and are willing to pay for it." -Russell Brand (the old school Lisp hacker "wuthel" from MIT, not the crazy MAGA rapist)
If you want to efficiently implement a PostScript interpreter with rendering in the web browser (or node), you just have to reach for the canvas 2d rendering context, which is essentially the full PostScript stencil/paint imaging model upgraded to the Porter/Duff compositing model with alpha channels, but without the user defined font rendering and halftoning machinery (which you could implement on top of it).
https://keithp.com/~keithp/porterduff/p253-porter.pdf
PostScript has always had the black and white "image" and "imagemask" operators, but they are clumsy, don't support any kind of image processing, and you have to use "readhexstring" to read hex images, but later versions support color images.
NeWS has "readcanvas" to directly read binary Sun raster files (including color) from files and over the network. It also had memory mapped canvases, which I used for the HyperLook version of SimCity so the C simulator engine could efficiently render the tiles and map views with overlays into memory, and NeWS could scale and render them quickly. I also used memory mapped canvases for my NeWS/HyperLook cellular automata machine, which was implemented in C and scaled and rendered and had a real time painting UI implemented in NeWS PostScript (the client and server took turns "owning" the pixels by ping-ponging messages over the localhost network, so each could draw into the cells in turn, and you could render PostScript directly into the 8-bit color cells for interesting effects, melt people's faces, and clip them on the screen to a window in the shape of a lava lamp).
http://www.art.net/~hopkins/Don/hyperlook/HyperLook-SimCity....
http://www.art.net/~hopkins/Don/art/cam-screen.gif
http://www.art.net/~hopkins/Don/art/RoyalPineAura.gif
The Apple PostScript printer drivers used (and Adobe's Blue Book documented) an indirect but efficient hack that tricked the custom halftone rendering machinery into performing a perfect pattern fill (so you could print MacDraw files, etc).
https://news.ycombinator.com/item?id=22570865
DonHopkins on March 13, 2020 | parent | context | favorite | on: Finding Mona Lisa in the Game of Life
Error diffusion dithering would work very well as initial conditions for many cellular automata rules like Life, especially counting rules (which life is) that stay alive with intermediate numbers of neighbors.
Conway's Life stays alive with 2 or 3 neighbors out of 9, or 2/9 .. 3/9, so gray scales between 22% .. 33% would be the most active.
Halftone screens would have different results, but their regularity might work well with certain CA rules and screens.
PostScript gives you a lot of control over the halftone screen definition.
Halftone screens can use any kind of repeating pattern, there just has to be the proper ratio of white to black pixels to make it look the right brightness. You could even design a set of halftone screen patterns that were precisely matched with a particular cellular automata rule to produce interesting fertile or static patterns. And you can even use any arbitrary pattern for each level, even if they aren't the right brightness, for aesthetic reasons.
The original PostScript LaserWriter was able to efficiently perform pattern fills to print tiled MacDraw images, by defining a custom halftone screen for each tile pixel pattern, that printed precisely the right pixels when you set just the right gray level: the ratio of on pixels to the total number of pixels in the tile. The spot function basically tells the halftone screen machinery what order to turn the dots on as the gray level goes from 1 to 0 (which results is seamless tiling with nearby gray tiles). Take a look at the PostScript header of an old MacDraw file some time to see the really bizarre code that does that by abusing the "setscreen" operator with a contrived spot function. (That was extremely tricky and gave GhostScript problems for years. The trick is documented in Program 15 page 193 of the awesome PostScript "Blue Book", and it uses a lot of memory! It's one of the coolest tricky PostScript hacks I've ever seen!)
https://web.archive.org/web/20210303050038/https://www.adobe...
https://melusine.eu.org/syracuse/postscript/bluebook/?opt=ep...
https://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF
>This program demonstrates how to fill an area with a bitmap pattern using the POSTSCRIPT halftone screen machinery. The setscreen operator is intended for halftones and a reasonable default screen is provided by each POSTSCRIPT implementation. It can also be used for repeating patterns but the device dependent nature of the setscreen operator can produce different results on different printers. As a solution to this problem the procedure, ‘‘setuserscreen,’’ is defined to provide a device independent interface to the device dependent setscreen operator.
>IMPLEMENTATION NOTE: Creating low frequency screens (below 60 lines per inch in device space) may require a great deal of memory. On printing devices with limited memory, a limitcheck error occurs when storage is exceeded. To avoid this error, it is best to minimize memory use by specifying a repeating pattern that is a multiple of 16 bits wide (in the device x-direction) and a screen angle of zero
https://www.grymoire.com/Postscript/Halftones.html
https://en.wikipedia.org/wiki/Halftone#Digital_halftoning
Here is what happened when I mixed PostScript and cellular automata (and HyperLook, like a PostScript version of HyperCard):
Fun with Cellular Automata [...more at https://news.ycombinator.com/item?id=22570865 and http://www.art.net/~hopkins/Don/art/cell.html ...]
- > .. with vibe coding we can just whip up a Preview app
why deflate your own position with this (worthless-untrue-spineless) statement? Which library is doing the work? who writes that library and maintains it?
- I don't know if it was done in an afternoon, but...
https://github.com/mist64/retro-ps
Author: Claude, directed by Michael Steil <mist64@mac.com>.
- OK - HP C2089A "PostScript Cartridge Plus"
that was a real product with ordinary thousands of hours of skilled coding in there.. That is certainly the part that is doing work. Secondly someone really knows what they are doing to slip in those architectural layers / shims / pipes .. Very impressive IMHO
- > 502 Bad Gateway
People must really love PostScript!
- I really liked developing in PostScript within NeWS... had quite a lispy interactive feeling to it.
It was perfectly usable on a early '90s Sun Workstation so I'd love to know what performance would be like on the vastly faster machines we have now.
- The printer's jammed, give them some time.
Meanwhile, more about PostScript:
John Warnock's "linguistic motherboard" and Owen Densmore's "class.ps" smalltalk-like object oriented PostScript programming system, which NeWS and The NeWS toolkit used.
https://news.ycombinator.com/item?id=29295116
Owen Densmore's work with Bill Atkinson and John Warnock on the Mac printing system, and his "linguistic motherboard" email and "Swiss Army NeWS: A Programmable Network Facility" white paper:
https://news.ycombinator.com/item?id=33827923
More history of PostScript, JAM, InterPress, and John Warnock's vision of PostScript as a "Linguistic Motherboard":
- My boss, many years ago, talked about the time he programmed a printer to act as a web server using Postscript. I never asked what happened to other print requests while it was running.
- There is an apocryphal story about some poor sys-admin who after spending several days trying to diagnose mysteries hangs in the new office laser printer. traced it to one user who was sending long print jobs that printed nothing. This enterprising engineer had to be told to knock it off after explaining how the new laser printer had the most powerful computer in the office and as such had rewritten some of his simulation code in postscript to run on the printer.
- They were silently sent to the client browsers... ;-)
- They were routed to the integrated time machine in PS, and sent to the year 2026 when they would be rendered in mobile phones, then the bitmaps would be sent back in time to your boss's printer.
- Thanks for posting this!
I've started looking into the history of Postscript because I was looking into the idea of "sending a program not a data structure".
Some thoughts so far: https://krishna.github.io/posts/send-a-program-not-a-datastr...
- Check out Don Lancaster’s tinaja archive, if it’s still around. He was quite enamored with NeXT style universal postscript and wrote at length about it.
- Don Lancaster passed away in 2023 at 83.
https://en.wikipedia.org/wiki/Don_Lancaster
Don Lancaster has died (gilaherald.com)
https://gilaherald.com/obituary-for-don-lancaster/
HN discussion:
https://news.ycombinator.com/item?id=36545595
Woody Baker was one of his biggest fans on comp.lang.postscript!
https://news.ycombinator.com/item?id=36546584
DonHopkins on July 1, 2023 | parent | context | favorite | on: Don Lancaster has died
I have always been a huge fan of Don Lancaster's wizardly writing about PostScript, who not only regularly published in Computer Shopper, but also generously ran a free PostScript help line at his own personal phone number. But Woody Baker was by far his biggest most enthusiastic fan of all (and highly eccentric in personality and coding style), and he would regularly extol and evangelize Don Lancaster's virtues and ideas on comp.lang.postscript. Once around March 4 1990, I gave Woody Baker some feedback on his comp.lang.postscript faq, including the suggesting that he might consider leaving Don Lancaster's personal phone number out of it, but he replied:
>Again, I want to thank you for your contributions. You and D. Cortesi have been most helpful. The two of you gave me very in depth feedback. I have moved almost all the editorializing to the end. I have moved the style stuff to the end. As for DON LANCASTER, I left his phone number in. Don publishes it regularly in the computer shopper, as a free PostScript help line. He is self-employed, and a widely published Author, for TAB books among other things. He says he averages 80 helpline calls a day. He also sells programs and books that he is self publishing. I can assure you, he won't mind at all.
Woody loved to talk in depth about how amazing and inspirational Don Lancaster was, and defend his well deserved honor and reputation whenever anybody criticized his work.
http://computer-programming-forum.com/36-postscript/ff79f7dd... [broken link, not on archive org]
>True. Don lives in an APPLE II world. You are wrong, however in certain statements. He has (unfortunatly) mentioned what FLXPROC does. It happens to be critical to certain things, that several consultants are working on here and there. He knows enough not to blab some things, and jerk work out from under individuals (at least some of the time). Don has dug pretty deeply into certain areas of PS, and I have dug deeply into other areas of PS. Don is first and formost a writer. He's self employed, and extremely intellegent. I am first and formost a software engineer, and secondly a writer. I tend to write, however for clients. I'm confident that I know what FLXPROC does, and what it is good for. And I'm sure Don does also. I more or less told him about FLXPROC and he more or less told me what it does. After first quarter 1990, some things will be essentially worthless as consulting info, and will rapidly become public knowlege. I don't applogize for keeping the lid on some things. I'm a bit of a mercenary in a way. I like consulting.
>Cheers
>Woody
Their great respect was mutual:
https://archive.org/stream/Ask_the_Guru_v1
https://archive.org/stream/Ask_the_Guru_v1/Ask_the_Guru_v1_d...
>Don Lancaster's ASK THE GURU Selected reprints
>Copyright c. 1987 by Don Lancaster and Synergetics, Box 809, Thatcher, AZ 85552. (520) 428-4073
>Electronically self-published using the Apple //e computer and the LaserWriter Plus. All graphics were done in their entirety by ProDOS Applewriter 2.1.
[...]
>I don't think I was ever more amazed when Woody Baker of The Copier Store mailed me back one of my very own laser printed business cards — redone in real ink in an almost "embossed" gold! Turns out Woody had found an older Omnicrom machine scunging around unsold in the back of his warehouse and fired it up. Lo and behold, the instant conversion of any toner image to real ink in stunning colors!
Example 10 of Don Lancaster's Postscript Show & Tell beautifully illustrates how an Omnicrom printer works:
https://www.tinaja.com/glib/psnt.pdf
>Example ten -- What appears hear as a mild-mannered Postscript technical illustration is really the secret of full color laser printing.
>Omnicrom sheets are real ink applied to a carrier. You place the sheet in contact with your toner image and then run it back through the fusion rollers a second time. The ink gets fused over the toner.
- PostScript was the first language I ever used professionally! :P
At the time, I worked for a printing house in Kyiv that specialized in accidental printing (screen printing, flexo-, tampo- etc. i.e. mostly printing on weird curved surfaces, not paper). The triad (full-color) screen printing was all the rage (early-mid 90s). Part of the process of generating the films that were later used to irradiate the polymer layer covering the screen mold was bound to a bootleg Scitex machines IDF used for printing maps. While we had the machines, we didn't have a proper driver that could take a color image, separate it into channels and instruct the machines to produce the films. So, I'd produce PS files from, eg. Photoshop (also bootleg...) and then edit the PS files by hand to match the requirements from the Scitex machines.
I wasn't a programmer by training, and doing all this stuff absolutely felt like magic. Something I will never experience with computers again :'(
- I didn't have a PostScript file, so I had to find one. I downloaded the test files from here: http://users.fred.net/tds/lab/postscript.html
Minus the colors, they worked and look pretty good.
- It did a nice job on the classic NeWS "PostScript for Poets" t-shirt!
https://donhopkins.com/home/archive/news-tape/pictures/teesh...
- Dropped a .ps in there, it's just stuck "rendering".
- This is pretty sweet. I wonder if this is better than running pdf.js.
I just recently needed jbig2 image support in my web app and using pdf.js wasn't gonna work and be too slow and the wrong interface anyway, so I took the source code for the jbig2 decoder and vibe coded a converter that outputs 1 bit pngs. After some manual culling of code I got the wasm module down to 27kb with no glue.
- postscript hacks are fun! the encryption on Type 1 fonts in 1987 was broken by Harvey Grosser, an ex-IBM System 360 coder, in Palo Alto. NeWS was bad NeWS to many, with a minuscule user base at its peak. Meanwhile, every print publication in existence was faced with "do or die" in digital production. Many ended with the latter, many years later.
- Sun NeWS in the browser would be cool as well.
- Pre-web, and using the NeWS version UniPress Emacs 2.20 (Gosling Emacs, aka NeMACS) as the authoring tool:
Designing to Facilitate Browsing: A Look Back at the Hyperties Workstation Browser
https://donhopkins.medium.com/designing-to-facilitate-browsi...
HyperTIES Discussions from Hacker News
https://donhopkins.medium.com/hyperties-discussions-from-hac...
The Interactive Encyclopedia System
https://en.wikipedia.org/wiki/The_Interactive_Encyclopedia_S...
UniPress Emacs 2.20 (NeMACS) source code:
https://github.com/SimHacker/NeMACS
Here's the Emacs NeWS driver, a "C to PostScript" interface file:
https://github.com/SimHacker/NeMACS/blob/main/src/D.term/Trm...
- [dead]
- [dead]
- Wonderful.
- But does it say "PC LOAD LETTER"?
- How much does a subscription for this website costs per month? After all it says Adobe in the title.