[HN Gopher] Investigating MacPaint's Source Code
       ___________________________________________________________________
        
       Investigating MacPaint's Source Code
        
       Author : zdw
       Score  : 78 points
       Date   : 2025-04-05 00:25 UTC (22 hours ago)
        
 (HTM) web link (ztoz.blog)
 (TXT) w3m dump (ztoz.blog)
        
       | DesertVarnish wrote:
       | My wife has been working on a pixel accurate recreation of
       | MacPaint on the web, and one of the things that I've learned from
       | on-and-off helping with it was just how much of the magic in it
       | is actually just handled by QuickDraw.
       | 
       | Also, the text styling has a _lot_ more complexity than you would
       | expect.
        
         | jwstarr wrote:
         | By "pixel accurate", do you mean the user interface or the
         | rendering? Is she able to leverage the HTML 2D Canvas API or
         | does she have to go lower level than that?
        
           | allthreespies wrote:
           | I'm using a buffer pool and raw bitmaps with calls to
           | drawImage - the canvas api doesn't play very well with trying
           | to do things in a pixel perfect way.
           | 
           | I've gone on a lot of rabbit holes digging into original
           | source code and dev manuals for this project, hopefully one
           | day I'll write some of it up somewhere. I think what's been
           | interesting is iterating towards the most elegant solutions
           | has often meant ending up with pretty similar approaches to
           | what Atkinson originally used.
        
         | userbinator wrote:
         | MSPaint (which I wish MS would officially open-source) heavily
         | relies on GDI too.
        
         | gblargg wrote:
         | QuickDraw's regions always impressed me. They could cover an
         | arbitrary area, and most operations could be masked to a
         | region. This was important for updating a window behind another
         | efficiently, just mask to the visible portion and draw its
         | contents normally.
        
           | JKCalhoun wrote:
           | Me as well.
           | 
           | As I recall, regions were essentially something akin to an
           | array of run-length-encodings for each scan line (where,
           | additionally, there was a sentinel or some way to indicate
           | the next n rows are the same as the previous). The fun part
           | is then writing a set of routines to union, difference, etc.
           | pairs of these RLE region objects (and here I use the word
           | 'object' loosely).
        
       | userbinator wrote:
       | Something felt a little "off" about the text of this article, but
       | this fragment raised the most suspicion:
       | 
       |  _demonstrate mechanical empathy with the 68k platform_
        
         | garbagewoman wrote:
         | Suspicion of what?
        
           | userbinator wrote:
           | Doesn't sound like something a native nor non-native English
           | speaker would write.
        
             | TickleSteve wrote:
             | The correct phrase is "mechanical sympathy" but it means
             | effectively the same. Its relatively well known in software
             | optimisation and means tailoring the design of the software
             | to match the characteristics of the hardware.
        
               | fragmede wrote:
               | Sympathy involves understanding someone's feelings from
               | your own perspective and feeling sorry for their
               | situation. Empathy means putting yourself in someone
               | else's shoes, imagining their feelings and experiencing
               | their emotions as if they were your own.
               | 
               | Based on those definitions, mechanical empathy seems more
               | correct. It describes the ability to understand and
               | intuitively sense how machines or mechanical systems
               | work, almost like understanding.
        
             | fragmede wrote:
             | Your detector is off. Mechanical empathy and sympathy;
             | whichever is correct, both predate ChatGPT.
             | 
             | https://trends.google.com/trends/explore?date=all&geo=US&q=
             | m...
             | 
             | It's a good phrase that describes when someone _really_
             | knows their car and can just tell how its  "feeling".
        
         | astrange wrote:
         | Correct phrase is "mechanical sympathy" but I think this is an
         | intentional joke.
        
         | ghusbands wrote:
         | What are you trying to imply? That is was written entirely by
         | LLMs or such? It has none of the usual tells. Or perhaps that
         | an LLM was used to help? Yeah, that is possible, but not
         | problematic.
         | 
         | I think it is mostly just a somewhat dry, academic style.
        
       | peterbmarks wrote:
       | Bill Atkinson unfortunately has been diagnosed with Pancreatic
       | cancer. https://daringfireball.net/linked/2024/11/13/atkinson-
       | prayer... I'm sure everyone wishes him well.
        
       | JKCalhoun wrote:
       | Atkinson writes QuickDraw, then writes an app, MacPaint, that
       | essentially uses every aspect of it, then has Susan Kare using
       | MacPaint. What a fantastic feedback loop for readying a framework
       | before shipping.
       | 
       | Contrast this with the "I Don't Know How To Count That Low" meme.
        
       ___________________________________________________________________
       (page generated 2025-04-05 23:02 UTC)