points by michaelcampbell 5 days ago | 0 comments
This article reminds me (on the surface, this is deeper than my experience) of how the recent Goose language orients things.
I never worked with it but I seem to recall the old original Mac API's (Pascal based) used "handles" a lot to solve the issue of being able for the system to move allocations and memory out from under a program without it knowing, as a "pointer to pointer to <thing>". I was poring over those manuals in ~1988/1989 with visions of being a full-time Mac developer in my head.
[–] jsrcout 5 days ago
[–] michaelcampbell 4 days ago
thanks for the link(s); "Inside Macintosh" was indeed the set of books/folders I had. Shortly after I bought those, I moved from one state to another and of course the box I packed those in was the one box that got lost in the move =(
The early Macintoshes used the Motorola MC68000 CPU, which lacked an MMU. (Not sure if external MMUs were available then, but in any case Macs didn't have one). And the onboard memory was tiny even for the time (128_K_ for the smaller models).
So the memory management user API was designed to let the system move memory blocks around at will. "Resources" (discrete data blocks such as menu definitions, icons, even code segments, all with static content IIRC) could even be freed entirely, then reloaded from floppy disk when needed again.
To make this work, your code would lock a handle before dereferencing it into a pointer to the memory block, then unlock it when finished accessing it. As an application developer it didn't really feel like a burden or hassle, just another minor thing to remember, and it did the job.
I have my doubts as to how this approach would scale to the larger and more complex software of today, but it would be an interesting experiment.
https://en.wikipedia.org/wiki/Classic_Mac_OS_memory_manageme...
EDIT: The Mac's memory API was a bit more complex than I remembered. But it was all part of being a Mac developer back then - everything on the Mac was new and different. For many of us, it felt like the future had arrived. (Maybe not so much the case for those coming from LISP machines and the like).
https://archive.org/details/inside-macintosh-1992-1994/1992-...