{"id":9,"date":"2005-01-31T19:35:24","date_gmt":"2005-02-01T00:35:24","guid":{"rendered":"\/?p=9"},"modified":"2006-07-28T09:29:20","modified_gmt":"2006-07-28T14:29:20","slug":"structure-oriented-programming","status":"publish","type":"post","link":"https:\/\/alarmingdevelopment.org\/?p=9","title":{"rendered":"Structure-Oriented Programming"},"content":{"rendered":"<p>Mike Lambert <a href=\"http:\/\/alarmingdevelopment.org\/index.php?p=6#comment-17\">asks<\/a> for a clarification to my <a href=\"http:\/\/alarmingdevelopment.org\/index.php?p=6\">Future of Programming<\/a> post, where I say: \u00e2\u20ac\u0153I am exploring the \u00e2\u20ac\u0153dual\u00e2\u20ac\u009d of OO, in which the encapsulation of behavior is replaced by the publication of reactive structure\u00e2\u20ac\u009d.<!--more--><\/p>\n<p>Alan Kay, who invented the term &#8220;Object-Oriented&#8221;, <a href=\"http:\/\/gagne.homedns.org\/%7etgagne\/contrib\/EarlyHistoryST.html\">explains<\/a> it as a model of computation where the fundamental building blocks, called objects, are each like little computers that cooperate by sending messages to each other. Implicit in this metaphor is that the little computers are communicating over a serial channel, by sending series of symbols. <\/p>\n<p>I envision an alternative model of computation, where the fundamental building blocks are called structures. Each of these structures is still a little metaphorical computer, but with a richer interace than a serial channel: structures can be traversed, and edited.  The system operates by reaction: one structure observes another, and modifies it. Modification to one part of a structure may cause a change to another part in response. Any structures observing this change may in turn react by changing themselves or other structures. <\/p>\n<p>The metaphor of little computers can be extended to contrast these styles of computation. The little computers of object-oriented programming communicate over a serial channel that is like a traditional command-line interface. The little computers of structure-oriented programming interact as if using a direct-manipulation GUI. The irony of this metaphor is that object-orientation first flourished in the invention of GUI&#8217;s.<\/p>\n<p>The trick is translating this cute analogy into a simple and powerful model of computation &#8211; one that uses structures &#8220;all the way down&#8221;. My first step towards this goal is <a href=\"http:\/\/subtextual.org\">subtext<\/a>. There are many possible benefits to structure-oriented programming. The common &#8220;observer&#8221; pattern is built-in, as is the semantics of many &#8220;component&#8221; models (which require quite elaborate OO API&#8217;s). Abstraction can be achieved by constructing updateable views of other structures, much like in query languages, which offers a more declarative form of composition. There is one potential benefit that I particularly want to emphasize: making the execution of programs more immediate and visible  to the programmer. The metaphorical GUI presented by every structure can be connected to an actual GUI, letting the programmer observe and modify the structure exactly as the other structures do. This is a completely transparent model of computation. In contrast, objects are black boxes that require sophisticated inspectors\/debuggers\/IDE&#8217;s to be usable, which in turn rely on priviledged meta-access that escapes the normal rules of the computational model.<\/p>\n<p>I do not want to claim that structures are better than objects, only that they have been neglected in the enthusiasm for objects. I see them as complementary ways of understanding and building complex systems. I am exploring a purely structure-oriented style as an experiment to better understand the full spectrum of possibilities. In the end we need to harmoniously integrate structure-oriented and object-oriented styles.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mike Lambert asks for a clarification to my Future of Programming post, where I say: \u00e2\u20ac\u0153I am exploring the \u00e2\u20ac\u0153dual\u00e2\u20ac\u009d of OO, in which the encapsulation of behavior is replaced by the publication of reactive structure\u00e2\u20ac\u009d.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-general"],"jetpack_shortlink":"https:\/\/wp.me\/pfEnU-9","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9"}],"version-history":[{"count":0,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions"}],"wp:attachment":[{"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}