4 ms·
I disagree, I did some Postscript programming, and it was very much oriented around printing documents so I don't think it would be great for a DOM in a browser
by lasereyes136 5y ago
I disagree, I did some Postscript programming, and it was very much oriented around printing documents so I don't think it would be great for a DOM in a browser.
- DonHopkins 5y agoPostScript's native Array/Dictionary data structures are practically identical to JSON and JavaScript's polymorphic Array/Object (or Python's Array/Dict). And NeWS PostScript uses "Magic Dictionaries" that look and feel like dictionaries, but are wrappers around built-in objects implemented in C, like canvases, processes, events, fonts, etc. Sort of like getters and setters that invoke native code. They make it much easier to extend PostScript and implement APIs without adding a lot of operators to the language. And NeWS had an object oriented programming system called "class.ps", designed by Owen Densmore, that represented objects with dictionaries (and magic dictionaries too, with OpenWindows NeWS 2.0 but not the original NeWS 1.x). We used it to write all kinds of user interface toolkits, widgets, applications, and it worked very well. See the Pizzatool source code for a well commented example: https://www.donhopkins.com/home/archive/NeWS/pizzatool.txt https://www.donhopkins.com/home/archive/NeWS/pizzatool.txt Tom Stambaugh described how Smalltalk inspired Owen Densmore's PostScript object oriented system in NeWS. A point he didn't mention is that PostScript is directly descendent from Interpress, which was developed at Xerox PARC and reincarnated as PostScript at Adobe by Chuck Geschke and John Warnock: https://en.wikipedia.org/wiki/Interpress https://en.wikipedia.org/wiki/Interpress Brian Reid's deep detailed historic dive "PostScript and Interpress: a comparison": https://tech-insider.org/unix/research/1985/0301.html https://tech-insider.org/unix/research/1985/0301.html I also think PostScript owes a lot to Lisp (it's dynamic, homoiconic, polymorphic, symbolic), even more so than Forth. http://wiki.c2.com/?ForthPostscriptRelationship http://wiki.c2.com/?ForthPostscriptRelationship Tom Stambaugh wrote: It seems to me that Forth is to stacks what LispLanguage is to lists. Forth demonstrated the advantages of a stack-centric paradigm in which each pushed or popped item could be evaluated as an expression or a primitive. Postscript reflects the application of that paradigm to the world of typography, 2-d graphics, and page layout. My own recollection is that Postscript's primary contribution was the use of splines to describe character glyphs, allowing them to be effectively rendered at virtually any resolution desired. If anything, Postscript owes more to TexLanguage and DonaldKnuth than to Forth. I view the stack-based language paradigm as a convenient afterthought rather than a central organizing principle. I also think we should note the contribution that OwenDensmore, at Sun, made in demonstrating how to use Postscript dictionaries to create a dynamically-bound object-oriented runtime environment. This was the fundamental premise of the Sun window server that ultimately became the NetworkExtensibleWindowSystem. Owen and I discussed his "crazy" idea at a poolside table at the now-demolished Hyatt Palo Alto, on El Camino. I told him that it made sense to me, we scribbled furiously on napkins, and I helped him see how he might adopt some learnings from Smalltalk. It was one of those afternoons that could only have happened at that time in that place in that culture. -- TomStambaugh I've extracted Owen Densmore's paper from the news.tape.tar (marked PD), "Object Oriented programming in NeWS", and uploaded it: https://ia802600.us.archive.org/5/items/pdfy-1U9Ry1_Qj0LPSR6e/monterey86.pdf https://ia802600.us.archive.org/5/items/pdfy-1U9Ry1_Qj0LPSR6... It would require some modification to run in other postscript environments, but not much, I think. It was developed after the 1st Edition Postscript manual but before the second, so it's considered a Level 1.5 Postscript environment. It uses dictionaries freely, but the << /Level-2 (syntax) >> had not yet been invented. So it uses a number of nonstandard operators for dictionary construct. These would need to be simulated or the routines rewritten to use Level 2 syntax. -- luserdroog comp.lang.forth discussion on "Why is Postscript not Forth?": https://donhopkins.com/home/archive/forth/ps-vs-forth.txt https://donhopkins.com/home/archive/forth/ps-vs-forth.txt Forth/PostScript discussion with Mitch Bradley: https://donhopkins.com/home/archive/forth/forth-postscript.txt https://donhopkins.com/home/archive/forth/forth-postscript.t...