3 ms·
Yikes, 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 Wind
by leoh 8y ago
Yikes, 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
- DonHopkins 8y agoThat's 93 lines of PostScript code, including comments. And how many lines of C code is XEyes? (Not including the Makefile.am, autogen.sh, configure.ac, and other supporting cruft, to be charitable. I'm counting xeyes.c (141), Eyes.c (642), Eyes.h (56), EyesP.h (56), transform.c (111), transform.h (32), eyemask.bit (22), eyes.bit (22) = 1082 lines of really ugly code -- not easy on the eyes!) http://cgit.freedesktop.org:80/xorg/app/xeyes/snapshot/xeyes-1.1.1.tar.gz http://cgit.freedesktop.org:80/xorg/app/xeyes/snapshot/xeyes... By the way, XEyes was a later imitation of Jeremy Huxtable's original NeWS "Big Brother" eyes. https://web.archive.org/web/20140228084012/http://en.wikipedia.org/wiki/Xeyes https://web.archive.org/web/20140228084012/http://en.wikiped... Here's a much more elaborate version of NeWS eyes, that lets you drag and drop eyes into each other (see "MoveStopSub"), nesting them to any depth (so child eyes recursively move around with their parent eye, and look really creepy), and split eyes in two with a menu (see "SplitEye"), in 375 lines of PostScript code: https://donhopkins.com/home/archive/NeWS/eyes.ps https://donhopkins.com/home/archive/NeWS/eyes.ps Have you ever actually used the X11 SHAPE extension to make a round window, did you know all X11 windows actually have FOUR shapes (client bounding region, client clip region, effective bounding region, effective clip region), and do you understand all the nuances and implications of the ICCCM ("Ice Cubed") window management protocol? https://en.wikipedia.org/wiki/Shape_extension https://en.wikipedia.org/wiki/Shape_extension https://www.x.org/releases/current/doc/libXext/shapelib.html https://www.x.org/releases/current/doc/libXext/shapelib.html https://blog.dshr.org/2018/05/recreational-bugs.html https://blog.dshr.org/2018/05/recreational-bugs.html "You will get a better Gorilla effect if you use as big a piece of paper as possible." -Kunihiko Kasahara, Creative Origami. And what is the net speed velocity of an XConfigureWindow request? https://medium.com/@donhopkins/the-x-windows-disaster-128d398ebd47#5a77 https://medium.com/@donhopkins/the-x-windows-disaster-128d39...
- gilbetron 8y agoApples and Oranges. Postscript itself includes the code for the primitives used in xeyes, whereas the C code implements them first. Take away that code and it is much more illuminating.
- DonHopkins 8y ago
- protomyth 8y agoI truly enjoyed programming in PostScript. I actually like it better than Forth because it had some really nice constructs. If you did Forth programming and enjoyed the paradigm then PostScript is actually pretty good compared to JavaScript.