{"id":38412,"date":"2023-02-09T16:56:00","date_gmt":"2023-02-09T21:56:00","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=38412"},"modified":"2023-02-09T16:59:06","modified_gmt":"2023-02-09T21:59:06","slug":"clascal-in-the-lisa-source-code","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2023\/02\/09\/clascal-in-the-lisa-source-code\/","title":{"rendered":"Clascal in the Lisa Source Code"},"content":{"rendered":"<p><a href=\"http:\/\/eschatologist.net\/blog\/?p=314\">Chris Hanson<\/a>:<\/p>\n<blockquote cite=\"http:\/\/eschatologist.net\/blog\/?p=314\">\n<p>While Lisa appears to have an underlying procedural API similar to that of the Macintosh Toolbox, the Office System applications were primarily written in the <em>Clascal<\/em> language&mdash;an object-oriented dialect of Pascal designed by Apple with Niklaus Wirth&mdash;using the <em>Lisa Application ToolKit<\/em> so they could share as much code as possible between all of them. This framework is the forerunner of most modern frameworks, including MacApp and the NeXT frameworks, which in turn were huge influences on the Java and .NET frameworks.<\/p>\n<p>[&#8230;]<\/p>\n<p>You define a class and its methods as an interface, and then its implementation doesn&rsquo;t require repetition. This may <em>sound<\/em> convenient but in the end it means you don&rsquo;t see the argument lists and return types at definition sites, so everyone wound up just <em>copying &amp; pasting them into comments next to the definition<\/em>!<\/p>\n<p>[&#8230;]<\/p>\n<p>Just like Macintosh, Lisa has a Memory Manager whose heap is largely organized in terms of <em>relocatable<\/em> blocks referenced by <em>handles<\/em> rather than <em>fixed<\/em> blocks referenced by <em>pointers<\/em>. Thus normally in Pascal one would write <code>SELF^^.h := h;<\/code> to dereference the <code>SELF<\/code> handle and pointer when accessing the object. However, since Clascal knows <code>SELF<\/code> and <code>myPoint<\/code> and so on are objects, it just assumes the dereference&mdash;making it hard to get wrong. What I find interesting is that, unlike the Memory Manager on Macintosh, I&rsquo;ve not seen any references to locking handles so they don&rsquo;t move during operations. However, since there isn&rsquo;t any saving and passing around of <em>partially<\/em> dereferenced handles most of the time, I suspect it isn&rsquo;t actually necessary!<\/p>\n<\/blockquote>\n\n<p><a href=\"http:\/\/eschatologist.net\/blog\/?p=335\">Chris Hanson<\/a> (<a href=\"https:\/\/mastodon.social\/@eschaton\/109816304707758146\">Mastodon<\/a>):<\/p>\n<blockquote cite=\"http:\/\/eschatologist.net\/blog\/?p=335\">\n<p>Here&rsquo;s another interesting thing I&rsquo;ve learned about Clascal and Object Pascal: It went through <em>exactly the same<\/em> evolution from combining object allocation &amp; initialization to separating them <em>that Objective-C did<\/em> a decade later!<\/p>\n<\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2023\/01\/26\/lisa-source-code-on-40th-anniversary\/\">Lisa Source Code on 40th Anniversary<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Chris Hanson: While Lisa appears to have an underlying procedural API similar to that of the Macintosh Toolbox, the Office System applications were primarily written in the Clascal language&mdash;an object-oriented dialect of Pascal designed by Apple with Niklaus Wirth&mdash;using the Lisa Application ToolKit so they could share as much code as possible between all of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2023-02-09T21:56:03Z","apple_news_api_id":"a017ca18-272a-473b-86c2-16b39d84b02c","apple_news_api_modified_at":"2023-02-09T21:59:08Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/AoBfKGCcqRzuGwhaznYSwLA","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[295,46,516,30,571,330,71],"class_list":["post-38412","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-history","tag-languagedesign","tag-lisa","tag-mac","tag-memory-management","tag-pascal","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/38412","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=38412"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/38412\/revisions"}],"predecessor-version":[{"id":38413,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/38412\/revisions\/38413"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=38412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=38412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=38412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}