11 ms·
Although I admire and frequently agree with this blog, I think this article exhibits some common misconceptions about NeWS. NeWS had what amounted to uploadable
by nibbula 7y ago
Although I admire and frequently agree with this blog, I think this article exhibits some common misconceptions about NeWS. NeWS had what amounted to uploadable toolkits, and therefore could and did have multiple toolkits. A client could decide how it wanted to separate processing between the client and server, which seems truly more flexible and allows for much more efficient communication. Also NeWS had threads which if done today would certainly use multiple processors. Clients could, but didn't have to, use a separate address space and language even. But the graphics API was so much better, it's ridiculous, and is basically the same as now in SVG, html canvas, and most other decent things.
The big drawbacks of NeWS in my opinion are not having an MIT license, and being quite difficult to implement well. Also PostScript isn't the nicest language to program in, which I say from years of programming in it. But it's far from the worst, and if one changed the to postfix syntax to prefix, it would be mostly a Lisp.
- kick 7y agoWhat do you not like about PostScript? It's basically a worse Forth, which, when compared to most languages, is comparatively wonderful to write in.
- triska 7y agoHow is PostScript a "worse Forth"? I find PostScript great fun to program in, and I think the type errors one gets from the system to indicate mistakes are a great help when writing PostScript code.
- kick 7y agoIt's much higher level, chooses the worst bits of high-level languages to throw in, NeWS's spin of it was object-oriented which has since been shown to be a mistake, it's not as extensible, has too many stacks, introduces significant complexity for dubious benefit, so forth. Of course, whether or not PostScript is like Forth at all is a matter of debate, some religiously disagree. I'm somewhere in the middle on that. Old flamewar topic: http://wiki.c2.com/?ForthPostscriptRelationship http://wiki.c2.com/?ForthPostscriptRelationship The syntax is also slightly less nice, which is relevant for their question, but less quantifiable.
- arethuza 7y agoI did a fair bit of PostScript development in NeWS/HyperNeWS and while I really liked PostScript I've never been able to get into Forth - I actually thought that PostScript was rather like the Common Lisp that the rest of the project used (one of the things I wrote for the project being the glue code in C to link the PostScript world of NeWS to Common Lisp - which is a nice mix of approaches to syntax!). NB: It was particularly neat that Sun shipped a set of Adobe blue/green/red(?) books with OpenWindows.
- kick 7y agoPostScript does take a lot from Lisp, too. And (kind of) Smalltalk. 'DonHopkins has posted a lot about it on here; I really love hearing him talk about it: https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=by%3ADonHopkins%20postscript&sort=byPopularity&type=comment https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...
- arethuza 7y agoI just found this article by Don about HyperNews and related stuff: https://medium.com/@donhopkins/hyperlook-nee-hypernews-nee-goodnews-99f411e58ce4 https://medium.com/@donhopkins/hyperlook-nee-hypernews-nee-g...
- DonHopkins 7y agoObject oriented programming has since been shown to be a mistake??! That's NeWS to me. Can you provide a citation please? What do you mean that NeWS or PostScript classes are not extensible? The little "e" in NeWS stands for "extensible". And what is the correct number of stacks, in your opinion? Please quantify what you can, and provide examples and links to code, and citations of other people who agree with your personal opinions like the number of stacks a language is supposed to have, the meaning of extensibility, or that object oriented programming languages are a mistake.
- agumonkey 7y ago
- dubya 7y agoI remember that pre-1990, PostScript seemed like a miracle. "Computer Shopper" of all things, used to have a PostScript Guru column with all kinds of interesting stuff. All the computer I had access to was an Atari ST with GFA Basic, so really only the math and ideas translated, but it really was like seeing the future. Path-clipping in particular was mind-blowing. It's partly archived online, and weirder than I remember! https://www.tinaja.com/glair01.shtml https://www.tinaja.com/glair01.shtml
- DonHopkins 7y agoIn what way is PostScript worse than Forth? Please answer with specific details, and provide links to code if you can. I programmed a lot of Forth code before learning and moving on to programming a lot of PostScript code, so I've used each of them extensively, and much prefer PostScript, and I'm happy to show you why and explain by showing you code. PostScript is much higher level than Forth, and a lot more like Lisp than Forth, and has much better data structures than Forth, like polymorphic arrays (that can be used as code), dictionaries (that can be used as objects), strings, floating point numbers, and NeWS "magic dictionaries" that can represent built-in objects like canvases, processes, events, fonts, etc. Yet Forth doesn't even have dynamically allocated memory, although in a few pages of code you can implement it, but it's not standard and very few Forth libraries use it, and instead use the linear Forth dictionary memory (which is terribly limited and can't be freed without FORGETting everything defined after you allocated it): https://donhopkins.com/home/archive/forth/alloc.f https://donhopkins.com/home/archive/forth/alloc.f PostScript is homoiconic. Like Lisp, PostScript code IS first class PostScript data, and you can pass functions around as first class objects and call them later. https://en.wikipedia.org/wiki/Homoiconicity https://en.wikipedia.org/wiki/Homoiconicity PostScript lets you define local variables with names in dictionaries, and use stacks of those dictionaries as objects and classes, while Forth requires you to keep track of everything on the stack without giving it a name. Forth variables are effectively globals. The fact that PostScript is homoiconic means you can write PostScript functions that dynamically create and transform other PostScript functions, like Lisp macros. In October 1986, before I ever used NeWS or learned of Owen Densmore's Smalltalk-like PostScript object system, I had just used PostScript on the LaserWriter and invented my own simple object system like Lisp Machine Flavors (which was quite easy and obvious) for drawing pie menus, I wrote the following to Mitch Bradley comparing Forth and PostScript. (Mitch was the Forth guru at Sun who developed ForthMacs / Sun Forth / CForth / Open Firmware / etc -- I worked with him at Sun on Forth as his summer intern, then later with James Gosling at Sun on NeWS as a full time employee): https://github.com/MitchBradley https://github.com/MitchBradley https://donhopkins.com/home/archive/forth/forth-postscript.txt https://donhopkins.com/home/archive/forth/forth-postscript.t... >After having programmed in PostScript for some time, how do you feel about its relation to Forth? Have your feelings about Forth changed any? >They are somewhat different languages, suitable for different applications, but there is a lot of overlap, however. There are features and problems that each has that the other lacks. I have thought a lot about doing in PostScript some of the things one can do in Forth, as well as Lisp. >In writing the code for the PieMenus on the Laser Writer, I had to come up with some way to make objects, not unlike flavors. It would also be interesting to make objects in the manner of <builds and does>. Objects are obviously implemented as dictionaries. Instance variables and messages are just bindings in the dictionary. The question is how do you build the dictionaries? >You can have PostScript functions that build them by hand, or you can have it more data driven. (Not to say that PostScript functions aren't data. Weee!) But how do you represent the data? You want to specify defaults when creating a class, and values when instantiating objects. >Should the creation of classes and objects be the same operation? (As with XLisp.) The required instance variable values could be taken as arguments when instantiating an object of some class, and the optional ones >How about object instantiation consuming required values? right off the stack? How would inheritance work? By concatinating dictionaries, or by nesting them? >It sure doesn't take much code to do this stuff. This is because PostScript has a very general set of building blocks for just such things. PostScript makes it easy to efficiently implement a flexible dynamic object oriented programming system like Smalltalk's, with multiple inheritance, and prototype objects that you can dynamically promote both methods and instance variables from classes to instances. Tom Stambaugh described how Smalltalk inspired Owen Densmore's PostScript object oriented system in NeWS: https://news.ycombinator.com/item?id=18696116 https://news.ycombinator.com/item?id=18696116 >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... Like Lisp or Scheme, you can easily write a metacircular PostScript evaluator in a few pages of PostScript: https://news.ycombinator.com/item?id=21968842 https://news.ycombinator.com/item?id=21968842 >Also, here is a metacircular PostScript interpreter, ps.ps: a PostScript interpreter written in PostScript! Since PostScript is homoiconic and so much like Lisp, it was as easy as writing a metacircular Lisp interpreter (but quite different in how it works, since PostScript and Lisp have very different execution models). https://www.donhopkins.com/home/code/ps.ps.txt https://www.donhopkins.com/home/code/ps.ps.txt https://donhopkins.com/home/archive/psiber/cyber/ps.ps.reasons https://donhopkins.com/home/archive/psiber/cyber/ps.ps.reaso... Obvious Question: Why would anybody ever write a PostScript interpreter in PostScript? Possible Answers: To use as a debugging tool. To trace and single step through the execution of PostScript code. To serve as a basis for PostScript algorithm animation. To gain a deeper understanding of how PostScript works. To try out some ideas from Structure and Interpreteration. To experiment with extensions to the PostScript language. To demonstrate that PostScript isn't just for breakfast any more. To make PostScript run even slower (but thicker). To avoid programming in C (the portable assembly language of the 80's). To use to interpret its self. To have something nerdish to talk about at parties. And you can use NeWS PostScript to implement a visual programming system and debugger to itself: https://medium.com/@donhopkins/the-shape-of-psiber-space-october-1989-19e2dfa4d91e https://medium.com/@donhopkins/the-shape-of-psiber-space-oct... NeWS not only supported multiple loadable toolkits, but it had "packages" to keep them safely separated and modularized so clients could request whatever versions of whatever toolkits they needed, and the same code and data would be properly shared between all compatible clients. (See "findpackage" / "beginpackage" at the beginning of every X11/NeWS program, like this X11 window manager for NeWS implemented in PostScript:) https://www.donhopkins.com/home/archive/NeWS/owm.ps.txt https://www.donhopkins.com/home/archive/NeWS/owm.ps.txt In case you would rather program in a Lisp-like syntax than PostScript, David Singer and Rafael Bracho at Schlumberger wrote ListScript, a Lisp to PostScript compiler: https://donhopkins.com/home/archive/NeWS/NeScheme.txt 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. And in case you are suffering from poor taste in programming languages, and you don't like Lisp but would rather program in a C- or Java-like syntax than PostScript, Arthur van Hoff at the Turing Institute wrote PdB, an object oriented C to PostScript compiler, which let you subclass PostScript classes in PdB, and also subclass PdB classes in PostScript: https://news.ycombinator.com/item?id=21968842 https://news.ycombinator.com/item?id=21968842 >And later on around 1990-1993, Arthur van Hoff wrote PdB at the Turing Institute in Glasgow, an object oriented C to PostScript compiler called PdB (for Pure dead Brilliant), which is kind of like TypeScript, conceptually. We used PdB to develop HyperLook (Networked PostScript based HyperCard for NeWS), which I used to port SimCity to NeWS on Unix. (A few years after that, Arthur wrote the Java compiler in Java at Sun in 1995, and lot of other cool stuff since then!)
- protomyth 7y agoPostScript is a much more advanced and easier to program language than Forth. Just how you can use def in all its forms makes a lot of things easier. Hand written PostScript code is very easy to read.
- nibbula 7y agoWriting bigger programs I struggled to understand what I wrote without comments on every line describing the stack. One could use more variables to make it easier to understand, but in the old days that would also make it less efficient. I would frequently have to reverse engineer my code. Interestingly, object oriented PostScript would tend to help make your code seem more like prefix code, because it would be like more like "object method argument ... send" rather than "... arg arg function".