4 ms·
Here's some stuff I wrote about a HyperCard-inspired system called HyperLook (nee HyperNeWS (nee GoodNeWS)) and some stuff I developed with it: SimCity, Cellul
by DonHopkins 8y ago
Here's some stuff I wrote about a HyperCard-inspired system called HyperLook (nee HyperNeWS (nee GoodNeWS)) and some stuff I developed with it:
SimCity, Cellular Automata, and Happy Tool for HyperLook (nee HyperNeWS (nee GoodNeWS))
HyperLook was like HyperCard for NeWS, with PostScript graphics and scripting plus networking. Here are three unique and wacky examples that plug together to show what HyperNeWS was all about, and where we could go in the future!
https://medium.com/@donhopkins/hyperlook-nee-hypernews-nee-goodnews-99f411e58ce4 https://medium.com/@donhopkins/hyperlook-nee-hypernews-nee-g...
Some highlights:
The Three Axis of AJAX, Which NeWS Also Has To Grind!!!
NeWS was architecturally similar to what is now called AJAX, except that NeWS coherently:
…(drum roll)…
1) Used PostScript CODE instead of JavaScript
for PROGRAMMING.
2) Used PostScript GRAPHICS instead of DHTML and CSS
for RENDERING.
3) Used PostScript DATA instead of XML and JSON
for DATA REPRESENTATION.
The Axis of Eval: Code, Graphics and Data
We will return to these three important dimensions of Code, Graphics and Data as a recurring theme throughout this article. But which way to go from here?
Alan Kay on NeWS:
“I thought NeWS was ‘the right way to go’ (except it missed the live system underneath). It was also very early in commercial personal computing to be able to do a UI using Postscript, so it was impressive that the implementation worked at all.” -Alan Kay
What’s the Big Deal About HyperCard?
"I thought HyperCard was quite brilliant in the end-user problems it solved. (It would have been wonderfully better with a deep dynamic language underneath, but I think part of the success of the design is that they didn’t have all the degrees of freedom to worry about, and were just able to concentrate on their end-user’s direct needs."
"HyperCard is an especially good example of a system that was “finished and smoothed and documented” beautifully. It deserved to be successful. And Apple blew it by not making the design framework the basis of a web browser (as old Parc hands advised in the early 90s …)" -Alan Kay
- leoh 8y agoYikes, am I reading this right? That PostScript here is implied as a good thing? Here is xeyes implemented in PostScript. It was probably better than the X Windows implementation of the era, but compared to JavaScript... I shudder. https://groups.google.com/forum/#!original/comp.windows.news/pIoof2p2eew/HSBV2prw3CoJ https://groups.google.com/forum/#!original/comp.windows.news...
- vanderZwan 8y agoWell, given that you notice that it "was probably better than the X Windows implementation of the era" it looks like you are in some sense reading this right but are nevertheless making a comparison to a language with many decades worth of modernization improvements, for some unclear reason.
- jcelerier 8y agowell, it looks frankly beautiful. The code is 100% declarative. It's a pure dataflow graph, right before your eyes. Sure, the syntax feels old, but the ideas beneath will always be the ones underneath reactive and user interface programming.
- DonHopkins 8y agoHere's the PostScript source code to PizzaTool, which shipped with OpenWindows 3.0 and Solaris 2.0 (SVR4), which is well commented and organized so you can follow what's going on: https://donhopkins.com/home/archive/NeWS/pizzatool https://donhopkins.com/home/archive/NeWS/pizzatool And the manual entry: https://donhopkins.com/home/archive/NeWS/pizzatool.6 https://donhopkins.com/home/archive/NeWS/pizzatool.6 More on the sordid history of PizzaTool and the Window System Wars at Sun Microsystems: https://medium.com/@donhopkins/the-story-of-sun-microsystems-pizzatool-2a7992b4c797 https://medium.com/@donhopkins/the-story-of-sun-microsystems... This is a taste of what multi threaded object oriented PostScript code looks like: % Paint the pizza, forking off a processes to paint every topping. % /Paint { % - => - PizzaLock { % monitor: /reset self send /PaintProcess { % fork: pause /PaintNewPizza self send % Wait a second until things settle down ... % If /paint is called again within the next second, % this process will be killed and a new paint process % will sleep for a second. [1 0] SLEEP % If our parent window frame isn't opened, % then it's hiding and we shouldn't draw the toppings. /opened? Parent send { % if: % Draw all the toppings at once! Weeee! 4 { % Lots of cheese, repeat: Cheese /StartSprinkle self send } repeat /toppings Pizza send { % forall: /StartSprinkle self send } forall % Wait around for all the sprinklers to finish. { % loop: Sprinklers length 0 eq { exit } if % push one of the sprinklers, doesn't matter which. Sprinklers { pop exit } forall waitprocess pop } loop } if /StopPaint self send } fork def PaintProcess /ProcessName (Pizza Painter) put } monitor } def
- triska 8y agoPostScript is an amazing programming language for describing scalable graphics and interfaces! I especially enjoy the ability to very concisely represent information, using dedicated PostScript facilities to construct domain-specific languages, and I have used it to illustrate many situations that would otherwise be quite difficult to show. I hope that an example can illustrate this point: In Volume 4 of The Art of Computer Programming, Donald Knuth explains how we can find kernels with maximum weight in C_{100}, the cycle graph with 100 nodes. In that example, the weight he assigns to each node is the Thue-Morse code, i.e., (-1)^ν, where ν is the number of occurrences of 1 in the binary encoding of the node number. So for example, the weight of node 2 is -1, and the weight of node 3 is 1. We can easily determine the Thue-Morse weight of an integer in PostScript: /weight { 1 dict begin /nu 0 def { dup 0 eq { pop exit } if dup 1 and 1 eq { /nu nu 1 add def } if -1 bitshift } loop -1 nu exp end } bind def Example: 8 weight ⇒ -1 Now, how might we compactly lay out the cycle graph with 100 nodes? Using PostScript lets us easily play with different layouts. For example, let us use r, u, l and d to move right, up, left and down, respectively: /instrs { { r r r r r r r r r r r r r r r r d l l l l l l l l l l l l l l d r r r r r r r r r r r r r r r d l l l l l l l l l l l l l l d r r r r r r r r r r r r r d l l l l l l l l l l l l l l l l u r u l u u u } } def We can see what the described path looks like by interpreting this mini-language: 30 dup scale 1 15 translate /r { 1 0 translate } bind def /d { 0 -1 translate } bind def /l { -1 0 translate } bind def /u { 0 1 translate } bind def 0.06 setlinewidth 0 0 moveto gsave instrs { cvx exec 0 0 lineto } forall closepath stroke grestore Now, we only have to draw the nodes themselves on top of this path. First, let us define which nodes are actually part of a kernel with maximum weight, found with the methods outlined by Knuth (operations on reduced and ordered Binary Decision Diagrams): /inkernel [101 { false } repeat] def [1 3 6 9 12 15 18 20 23 25 27 30 33 36 39 41 43 46 48 51 54 57 60 63 66 68 71 73 75 78 80 83 86 89 92 95 97 99] { inkernel exch true put } forall And now we can simply draw the nodes by interpreting the instructions again, and indicating whether a node is part of the kernel, and whether its weight is positive: /Palatino-Roman 0.4 selectfont 0.04 setlinewidth 1 1 instrs length { /num exch def newpath num weight -1 eq { -0.4 -0.4 0.8 0.8 4 copy inkernel num get { 0.8 } { 1 } ifelse gsave setgray rectfill grestore rectstroke } { 0 0 0.4 0 360 arc inkernel num get { 0.8 } { 1 } ifelse gsave setgray fill grestore stroke } ifelse 0 0 moveto num 5 string cvs dup stringwidth pop -2 div -0.12 moveto show instrs num 1 sub get cvx exec } for In this case, I am using circles for nodes with positive weight.