<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mark S. Miller on Medium]]></title>
        <description><![CDATA[Stories by Mark S. Miller on Medium]]></description>
        <link>https://medium.com/@erights?source=rss-602038c246e9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*fK85v86QBPG5J6rk9hBuzQ.jpeg</url>
            <title>Stories by Mark S. Miller on Medium</title>
            <link>https://medium.com/@erights?source=rss-602038c246e9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 12:23:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@erights/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Norm Hardy’s Place in History]]></title>
            <link>https://erights.medium.com/norm-hardys-place-in-history-cecf191df641?source=rss-602038c246e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/cecf191df641</guid>
            <category><![CDATA[eulogy]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[usable-security]]></category>
            <category><![CDATA[operating-systems]]></category>
            <category><![CDATA[object-capabilities]]></category>
            <dc:creator><![CDATA[Mark S. Miller]]></dc:creator>
            <pubDate>Thu, 16 Mar 2023 21:03:10 GMT</pubDate>
            <atom:updated>2023-03-16T22:00:28.906Z</atom:updated>
            <content:encoded><![CDATA[<p>by Mark S. Miller</p><p><em>My speech at Norm Hardy’s memorial service, edited for clarity.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l5diyDnEsltX5npiEcPNIg.png" /></figure><p>I am glad this memorial service is at the Computer History Museum. Having known Norm for many years, I have many personal things to say. But today I want to make clear Norm’s place in history. I will focus on my personal journey with Norm, since that is the part of Norm’s history I know best.</p><h3><strong>Solving the Whole Problem</strong></h3><p>In 1988 Eric Drexler and I co-authored a set of papers explaining the <a href="https://papers.agoric.com/papers/markets-and-computation-agoric-open-systems/full-text/#4-foundations">foundational requirements</a> needed for general purpose, secure, distributed, market-based computation. We stated the core requirements as <em>encapsulation and communication of information, access, and resources</em>.</p><p>Encapsulation is essentially a kind of ownership right. Communication is essentially a form of rights transfer. Together they form a foundational rights theory for computational entities to coordinate with each other. Information, access, and resources map cleanly to confidentiality, integrity, and availability. We were not looking for a theory of security to be added to computing by other means, but rather, a theory of computation which is inherently modular and secure.</p><p>When we wrote this, we knew of no systems that met all these requirements; nor did we know how to meet them ourselves. We were not certain that a simultaneous solution was possible.</p><p>In 1988 Norm found the papers and contacted us. Over lunch Norm explained that he, with others at Key Logic, had built <a href="https://web.archive.org/web/20230303160708/http://www.cap-lore.com/CapTheory/upenn/">KeyKOS</a>, an operating system that fully solved the simultaneous problem. Although they had not yet built computational markets on these foundations, Norm designed KeyKOS with this goal in mind. In addition, Norm explained how KeyKOS solves the <a href="https://web.archive.org/web/20221209121646/http://www.cap-lore.com/CapTheory/Confine/">confinement problem</a>, which we had omitted from our papers because I thought it was impossible.</p><p>In the 1990s Norm, together with others in this room today and I, founded <a href="http://cap-lore.com/Agorics/technologies.html">Agorics</a>, to pursue the combined vision we now shared: market-based cooperative computation spanning the world, with no centralized controls or centralized vulnerabilities. (Not to be confused with <a href="https://agoric.com">Agoric</a>.) At Agorics, I shared an office with Norm for two and a half years. In retrospect, that was my apprenticeship. It was the most profound learning experience in my life. It is when I learned to become a really good computer scientist, someone who could think the right way about hard problems.</p><p>During that time, I kept trying to do what I always try to do, find flaws and ways to improve things. I kept poking at the KeyKOS design thinking I could find something to improve, some alternate way that would be better in some dimension. <em>At least a trade-off</em>— at least some way to make it better on one dimension at the price of making it worse on another dimension.</p><p>For two and a half years, I did not find a single flaw or thing to improve, even in the sense of a trade-off. With every suggestion, Norm convinced me that the way KeyKOS already does it was better than my suggestion.</p><p>Norm’s 1985 Operating System review paper, <a href="https://pdos.csail.mit.edu/6.828/2008/readings/keykos-osr.pdf">KeyKOS Architecture</a>, defines everything mutually recursively in terms of everything else. When I first read it I found it completely incomprehensible. I had to read it several times, letting the structure wash over me. Then eventually, there was one reading in which everything fit together perfectly. I understood how everything related to everything else. It was so mutually supportive that afterwards I could never think of building an operating system in any other way.</p><p>KeyKOS is the most perfect jewel of a technological artifact that I have ever seen emerge from a human mind.</p><h3>Many Moments of Genius</h3><p>During the time Norm and I shared an office, Agorics was translating ideas from capability operating system designs into object-capability programming languages. Even though these ideas in the context of operating systems are secure, I worried. How might the differences between operating systems and programming languages introduce new vulnerabilities? For example, the programming languages we were designing had garbage collection. KeyKOS, the operating system, does not.</p><p>I tried asking Norm what additional dangers garbage collection brings in. After several attempts I realized that the way to ask Norm a hard question is to pose it as a question about KeyKOS. “Norm, what if you added garbage collection to KeyKOS? What security problems would you have?” As I expected, I then had to sit through a long lecture about why it would be bad engineering to add garbage collection to KeyKOS. The only way to get to my question was to sit through that, which I did.</p><p>I patiently waited until that ran its course and then I said “Okay Norm, I understand all of that. But if you went ahead and added garbage collection to KeyKOS anyway, what would happen?” Norm closed his eyes for maybe a second or two, opened them, and said “Sensory keys would have to be weak.”</p><p>Please understand how weird this is. Weak references are off in this weird obscure corner of garbage collection. <a href="http://www.cap-lore.com/CapTheory/KK/Arch/Sensory.Keys.html">Sensory keys</a> are off in this weird obscure corner of capability operating systems. It could easily have taken me five years doing object-capability languages before I spotted the information leak, the covert channel through the garbage collector, that Norm spotted closing his eyes for two seconds.</p><p>Dean Tribble and I are now proposing <a href="https://github.com/tc39/proposal-weakrefs">weak references</a> for the JavaScript standard. Our proposal’s security builds on this insight of Norm’s. Without it, we might have introduced a security hole that nobody would have noticed until it was too late.</p><h3>Asking the Right Question</h3><p>When KeyKOS started as Gnosis, it was one of <a href="https://homes.cs.washington.edu/~levy/capabook/">many capability operating systems</a> during the OS golden age of the 1970s. Many of these capability operating systems were very interesting, intellectually fascinating stuff.</p><p>Aside from the line of thinking rooted in Norm, all the others from the OS golden age have withered and fossilized or died out. Only the line of thinking starting with Norm has continued to bear fruit, to grow, to become important in the world, to influence project after project. Why is Norm’s approach to computation so fertile?</p><p>KeyKOS is not just an incredible feat of engineering. KeyKOS is a philosophical achievement. Most people reasoning about computer security might ask: Is this program malicious or not? What permissions does this program have? Does it have adequate permissions to do what it needs to do? Does it have permissions with which it can misbehave? They look at the permission structure alone.</p><p>Norm thought about computation differently. Norm’s 1988 paper, <a href="http://www.cap-lore.com/CapTheory/ConfusedDeputy.html">The Confused Deputy</a>, looked at knowledge, purpose, and permissions together. A “deputy” is any program built to carry out requests from multiple clients for multiple purposes. Norm asked a question about the deputy nobody had ever asked:</p><p><strong><em>In what kind of architecture can the deputy use each permission only for the purpose it was given, without being led to use them for other purposes?</em></strong></p><p>The Confused Deputy is the most important, but still subtle, criticism of the dominant paradigm: identity-based access control. Within that paradigm, by the time the deputy gets permissions, it does not know why it has which permission. Further, when the deputy acts, it cannot choose which permissions will determine if the action is allowed. The architecture co-mingles permissions in a way the deputy <a href="https://web.archive.org/web/20230110234248if_/https://srl.cs.jhu.edu/pubs/SRL2003-02.pdf">cannot</a> untangle. Therefore the deputy <a href="https://web.archive.org/web/20221026003135if_/https://waterken.sourceforge.net/aclsdont/current.pdf"><em>cannot</em></a> act in a way that respects the purposes for which it has been given each permission.</p><p><strong><em>“A capability combines designation with authority.”</em></strong></p><p>To express purposes, a request says what object the request is about. By saying that with a capability, the request grants the deputy permission to that object, so it can carry out that request. When the deputy acts, it says what the action is about by using only the capabilities it holds to serve that purpose. This coupling enables the deputy to know why it has been given each permission, and to use each permission only for its intended purpose.</p><p>We’ve seen subtle anomalies trigger scientific revolutions before. Until the <a href="https://en.wikipedia.org/wiki/Michelson%E2%80%93Morley_experiment">Michelson-Morley experiment</a>, Newtonian physics seemed to have a perfect record. The Michelson-Morley experiment detected a tiny, tiny anomaly in the most precise measurement anyone had ever done. Many kludges were invented to explain away this special case.</p><p>However, with further experiments, this tiny anomaly would always reappear. It ended up destroying the dominant paradigm. Confused Deputy is the anomaly of identity-based access control that will always reappear. Of all the flaws we trot out, this one is irreducible.</p><h3>The Norm Hardy Prize</h3><p>The <a href="https://foresight.org/">Foresight Institute</a> will have an annual Norm Hardy prize in computer security. Norm and I talked about what the prize should be about, what the criteria should be. Norm focused on knowledge, purpose, and permission again, but now with regard to the user.</p><p>How can we build computer systems so that normal human users can understand what their systems can do for them, what their systems can do to them, what the security implications are of the actions they might take? This field is sometimes called secure usability or usable secure computing. Two <a href="https://web.archive.org/web/20221022181648if_/http://www.combex.com/papers/darpa-report/darpaBrowserFinalReport.pdf">seminal</a> <a href="https://web.archive.org/web/20221005202933if_/http://zesty.ca/pubs/icics-2002-uidss.pdf">works</a>, by Marc Stiegler and Ka-Ping Yee, discovered an approach to user interface security that couples knowledge, purpose, and permission much like capabilities do. As Norm explains:</p><p><strong><em>“The clipboard is inherently hostile to capabilities. Drag-and-drop is inherently friendly to capabilities.”</em></strong></p><p>In the user interface, a drag-and-drop action is an act of designation. Our user interfaces are vast engines of designation, of selecting, of pointing, providing all these different rituals for the user to say: <em>this thing </em>should operate on <em>that thing</em>.</p><p>Norm was saying these acts of designation should also be the means by which <em>this thing</em> is given permission to operate on <em>that thing</em>. Applications would be given just the permission needed to carry out the user’s request, and know which permission to use for which purpose, <a href="https://web.archive.org/web/20220101112048if_/https://www.hpl.hp.com/techreports/2009/HPL-2009-341.pdf">without adding security-specific interactions</a> to the user interface.</p><p>This insight, and these seminal works, point the way and give us hope that users may someday be able to securely use secure systems. But they only scratch the surface. We need new research to enable normal inattentive human beings to tacitly understand the security implications of the actions they might take. May the Norm Hardy prize encourage progress.</p><h3>Norm Becomes Persistent</h3><p>Norm is a pioneer of <em>orthogonal persistence</em>, first <a href="https://web.archive.org/web/20220810105133/http://www.cap-lore.com/CapTheory/upenn/Checkpoint.html">technically</a> and then personally.</p><p>To cope with machine failures, today we code in terms of ephemeral processes and persistent files, making software both more complex and less robust. KeyKOS’s orthogonal persistence masks machine failures. KeyKOS software is written as if machines never fail. KeyKOS processes are immortal; they survive the destruction of the hardware they run on.</p><p>To achieve orthogonal persistence, you take a checkpoint, i.e., you snapshot the computation in a consistent and viable state to non-volatile storage. At a later time, you restore the suspended computation from that non-volatile storage onto a working machine.</p><p>Norm practices what he preaches. I refer to Norm in the present tense because he is not dead. Norm is suspended. Norm has been checkpointed to non-volatile storage.</p><p>Norm saw that his body was going to fail. He knew that if he did not checkpoint, the process would be lost. In order to checkpoint in a consistent and viable state, <a href="https://gizmodo.com/california-man-becomes-the-first-death-with-dignity-p-1831652934">Norm is the first to use</a> California’s so-called “<a href="https://www.nolo.com/legal-encyclopedia/california-s-end-life-option-act.html">Death with Dignity</a>” legislation to choose the time of his cryonics suspension. <a href="https://www.alcor.org/blog/alcor-member-a-1990-becomes-alcors-164th-patient-on-october-30-2018/">Alcor reports</a> this is one of the <a href="https://www.alcor.org/Library/pdfs/Alcor-Case-Report-A1990-Norman-Hardy.pdf">best suspensions</a> they have ever had.</p><h3>Our Mission</h3><p>Norm’s situation leads to a mission for all of us. We cannot yet build the machines that can restore the Norm process from this checkpoint. In order to get to a future where we can build those machines, civilization has to survive and thrive long enough.</p><p>Civilization currently rests on the infrastructure that our industry has built. If this infrastructure had been built according to Norm’s prescriptions, I would be much less worried. It was not. Right now, civilization rests on computing systems that are not only insecure, but insecurable.</p><p>Norm showed us a better way. In order to survive into a future where we can revive him and see him again, we must rebuild our infrastructure by the principles Norm has taught us — so when Norm is revived he can look at it, he can appreciate it, and he can tell us what we did wrong.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cecf191df641" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SES: Securing JavaScript in the Real World]]></title>
            <link>https://medium.com/agoric/ses-securing-javascript-in-the-real-world-4f309e6b66a6?source=rss-602038c246e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f309e6b66a6</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ecmascript]]></category>
            <dc:creator><![CDATA[Mark S. Miller]]></dc:creator>
            <pubDate>Thu, 05 Dec 2019 07:29:54 GMT</pubDate>
            <atom:updated>2019-12-05T17:40:07.212Z</atom:updated>
            <content:encoded><![CDATA[<p>JavaScript applications use and rely on a lot of third-party code, including modules, packages, libraries, and in some cases even user-provided code for extensions and plug-ins. Too often, applications are fully vulnerable to these code dependencies, so not only do their current security vulnerabilities impact the applications, so do <em>future</em> vulnerabilities. Over night, any dependency could get “upgraded” into an exploit, resulting in a security breach like <a href="https://medium.com/agoric/pola-would-have-prevented-the-event-stream-incident-45653ecbda99">the event-stream incident</a>.</p><p>This is where SES comes in. SES is a JavaScript runtime library for running such third-party code safely inside a featherweight compartment. SES stands for Secure <a href="https://en.wikipedia.org/wiki/ECMAScript">ECMAScript</a>, where ECMAScript is the standards name for JavaScript. SES addresses JavaScript’s lack of security. SES supports practicing of the Principle of Least Authority (or POLA), so that the risk from most third-party code can be substantially reduced.</p><p>Early JavaScript provided no such compartmentalization. Essentially any software component could completely compromise any other component. However, starting in 2009 with ES5 (ECMAScript version 5), we introduced enablers such as Object.freeze, strict-mode, Promise, and Proxy to start securing JavaScript, so we could use it as an object-capability (ocap) secure programming language. The decade of work since ES5 means you can load a small SES library into any conforming JavaScript system to create a safer programming environment. The library in turn enforces that further JavaScript code loaded into the system must stay within ocap rules.</p><h4><strong>SES in Action</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-_1OHczduStWMRZymQX2DQ.png" /></figure><p>Here are examples of SES case studies, each addressing the need to reduce vulnerabilities to third-party libraries:</p><p><strong>1. Salesforce: </strong>Salesforce uses a SES implementation derived from the SES code they co-developed with Agoric. Salesforce currently supports a five-million developer ecosystem on this implementation, using JavaScript as an ocap language.</p><p><strong>2. MetaMask: </strong>With SES, <a href="https://github.com/MetaMask/metamask-snaps-beta">MetaMask Snaps</a> allows third parties to write plugins for custom behavior in the MetaMask wallet. One example is the Starkware plugin for their custom cryptography. MetaMask’s <a href="https://github.com/LavaMoat/overview">LavaMoat </a>secures JavaScript dependencies in the build process through their SES plugins for Webpack and <a href="https://github.com/LavaMoat/lavamoat-browserify">Browserify</a>.</p><p><strong>3. Moddable: </strong>Moddable’s <a href="https://www.moddable.com/faq.php#what-is-xs">XS JavaScript Engine</a> (its ECMAScript 2018 engine for embedded devices) is the first engine to directly implement SES. Moddable employs SES both to improve the performance and to reduce the attack surface of these devices.</p><p><strong>4. The Internet of Things: </strong>TC53, another standards organization under ECMA, has explicitly adopted SES as the base JavaScript for standardizing modules for home appliances, traffic control, and other devices in the Internet of Things. Name-brand manufacturers of household products in the IoT ecosystem are excited about this. Current device security is a nightmare. Writing IoT devices software in SES is a good starting point for building a safer world.</p><p><strong>5. Node.js: </strong>Node, the leading JavaScript runtime environment for servers, has adopted elements of SES into Node core (e.g., frozen primordials). Node has over a billion downloads and tens of millions of active users.</p><p><strong>Status</strong></p><p>The <a href="https://github.com/tc39/proposal-ses">SES-proposal</a> and related proposals to TC-39 are standards-track enhancements to JavaScript, while the <a href="https://github.com/Agoric/SES">SES-shim</a> is a library that provides those features. With security reviews scheduled in January 2020 SES is headed toward production readiness.</p><p><strong>Further Reading</strong></p><p>For further reading, I recommend Kate Sills’ essay “<a href="https://medium.com/agoric/pola-would-have-prevented-the-event-stream-incident-45653ecbda99">POLA Would Have Prevented the Event-Stream Incident.</a>” An Agoric engineer, Sills looks at how malicious code in the event-stream npm package last year left some Bitcoin users’ private keys vulnerable. Sills explains how SES used to enforce the Principle of Least Authority (POLA), could have avoided this.</p><p><em>Thanks for reading! You can join the Agoric community on </em><a href="http://twitter.com/agoric"><em>Twitter</em></a><em>, </em><a href="http://t.me/agoricsystems"><em>Telegram</em></a><em>, </em><a href="http://linkedin.com/company/agoric"><em>LinkedIn</em></a><em>, and catch us at these upcoming </em><a href="https://agoric.com/events/"><em>events</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f309e6b66a6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/agoric/ses-securing-javascript-in-the-real-world-4f309e6b66a6">SES: Securing JavaScript in the Real World</a> was originally published in <a href="https://medium.com/agoric">Agoric</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Pack of Watchdogs is Cheaper than Gas]]></title>
            <link>https://erights.medium.com/a-pack-of-watchdogs-is-cheaper-than-gas-7e118edfb4cc?source=rss-602038c246e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e118edfb4cc</guid>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Mark S. Miller]]></dc:creator>
            <pubDate>Wed, 06 Nov 2019 05:29:47 GMT</pubDate>
            <atom:updated>2019-11-06T16:43:45.831Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>An engineering shortcut for some blockchains</h4><p>Blockchains that run general programs use gas to abort runaway computations, and to charge for costs of execution. When the only requirement is to abort runaways, the <em>pack of watchdogs</em> mechanism proposed here can serve that purpose with less effort.</p><figure><img alt="A pack of running beagles" src="https://cdn-images-1.medium.com/max/1024/1*iJI9OC8eS9PntrHBEkXvZw.png" /></figure><h4>Background</h4><p>Blockchain computations consume “gas”, decrementing a remaining gas budget until it hits zero. The essential purpose of gas is to abort runaways — computations that take too long. An important, but often inessential, purpose of gas is to approximate the costs of computation, to compensate validators and incentivize efficiency. For both of these purposes, blockchains require gas to be deterministic, so all honest validators agree on whether a transaction completed first or ran out of gas first, and of how much gas it spent.</p><figure><img alt="Two large magellanic gas clouds" src="https://cdn-images-1.medium.com/max/1024/1*Ut8buMHceBPPTFO5svi_6Q.jpeg" /></figure><p>This determinism requirement makes gas expensive to implement. We either instrument our virtual machines, alter our compilers, or do source-to-source or bytecode-to-bytecode translations. Any of these techniques ensure that the gas budget is decremented at least on every function call and backwards branch. This also makes gas expensive to execute.</p><p>Embedded devices abort runaways with a cheaper technique: A watchdog timer is started at the beginning of each transaction, and reset at the end. If the watchdog barks before the transaction completes, the transaction is aborted. Such devices are non-replicated, non-byzantine, resource limited, uninterested in differential pricing to charge costs or encourage efficiency, and tolerant of non-determinism.</p><p>So-called permissioned blockchains, as well as early testnet prototypes of public blockchains, may have requirements somewhere between public blockchains and devices.</p><ul><li>Replicated byzantine computation, assuming only k-of-n validators are honest, where k &gt; 1/2n. Classic byzantine-fault-tolerance, for example, assumes that k = 2/3n+1 validators are honest.</li><li>General purpose computation, but needing to abort runaways.</li><li>No pricing needed.</li><li>Require unambiguously agreed outcomes.</li><li>Tolerant of non-deterministic outcomes.</li></ul><h4>The Idea: A Pack of Watchdogs</h4><p>Say that each validator runs each transaction under its own watchdog timer set approximately to duration T. This is not a time oracle — the validators do not coordinate their time sources. One honest validator might see a transaction complete before its watchdog barks. Another might hear its watchdog bark first. Each honest validator eventually reports one of these two outcomes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*CSwNvSi1QqReAFKxjgFEZA.png" /></figure><p>If k validators (e.g., 2/3n+1) report that their watchdog barked first, each honest validator concludes that the transaction took too long, exhausting its time budget, and is to be aborted — even if their copy had already completed. If instead n-k+1 validators (e.g., 1/3n) report that the computation completed within approximately duration T, then <strong><em>at least one honest validator observed the computation complete in time</em></strong>. Each honest validator concludes that the transaction is <em>not</em> a runaway and so must run it to completion — even if it had earlier reported that its own watchdog had barked.</p><p>An honest validator whose watchdog barks before the transaction completes should report the bark, but should continue running the transaction anyway until it observes one of the above two conditions.</p><h4>Caveat: A Pack of Watchdogs increases latency</h4><p>At <a href="https://twitter.com/mappum/status/1192110050547863552">https://twitter.com/mappum/status/1192110050547863552</a> Matt Bell writes:</p><blockquote>Interesting mechanism. Does this now increase latency since after broadcasting a tx, validators now each have to broadcast their watchdog result and wait for 2/3+ before actually committing the tx’s state changes?</blockquote><p>This is correct and a great point. As a result, the pack of watchdogs technique will often cost more than it saves. Beware of this tradeoff when evaluating whether this technique is suitable for you.</p><p>See <a href="https://twitter.com/mappum/status/1192116613585104896">that twitter thread</a> for Matt’s further thoughts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e118edfb4cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Tragedy of the Common Lisp: Why Large Languages Explode]]></title>
            <link>https://erights.medium.com/the-tragedy-of-the-common-lisp-why-large-languages-explode-4e83096239b9?source=rss-602038c246e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e83096239b9</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[manifesto]]></category>
            <category><![CDATA[ecmascript]]></category>
            <category><![CDATA[standards]]></category>
            <category><![CDATA[programming-languages]]></category>
            <dc:creator><![CDATA[Mark S. Miller]]></dc:creator>
            <pubDate>Mon, 27 May 2019 08:38:41 GMT</pubDate>
            <atom:updated>2019-11-12T23:48:03.007Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h3>The Tragedy of the Common Lisp:</h3><h4>Why Large Languages Explode</h4><p><em>Adapted from a </em><a href="https://esdiscuss.org/topic/the-tragedy-of-the-common-lisp-or-why-large-languages-explode-was-revive-let-blocks"><em>2015 es-discuss thread</em></a><em>. “Common Lisp” is not the topic. It serves only as one of many illustrative counter-examples.</em></p><p>I have been on the JavaScript standards committee (TC39) since 2007. On TC39, we appreciate the value of language simplicity. But over time, we have lost our vigilance against encroaching complexity. We must better understand how that happens naturally, what the costs are if left unchecked, and what to do about it. This essay is addressed not just to TC39, but to all those who wish to influence the trajectory of the JavaScript standard or any standard facing similar pressures. Learn from our mistakes!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k0ENr3JRX6pIm6TSnXoG8w.png" /></figure><p>The Algol, Smalltalk, Pascal, and early Scheme languages were prized for being small and beautiful. The early C and JavaScript languages were justifiably criticized for many things, and rarely mistaken for beautiful. But they were small, and this aspect was properly and widely appreciated. When a language is small, our appreciation of it is often driven by the sense “<em>I can learn the whole thing, and then I will have a mastery of it</em>”, and later “<em>I know the whole thing. I love the fact that there are no corners I don’t know.</em>” For C and JavaScript, few who thought they knew the whole thing actually did — the details were actually fiendishly complex. Nevertheless, this sense drove much of the satisfaction with everyday usage.</p><p>The esthetic of smallness of JavaScript lasted through the EcmaScript-5 standard. I participated heavily in both <a href="https://www.youtube.com/watch?v=Kq4FpMe6cRs&amp;list=PLKr-mvz8uvUg70w0yKGfytaDqxiIBNo_L">EcmaScript-5</a> and EcmaScript-2015 and in both cases I am proud of my contributions. EcmaScript-2015 is much larger, but is nevertheless a better language. Given where we started, we could not have achieved these gains in the utility of JavaScript without such an increase in size. I do not regret most of the additions that grew EcmaScript-5 to EcmaScript-2015. For many of these, had we the EcmaScript-2015 standards process to do over again, I would likely make similar additions.</p><p>Each of the additions that grew EcmaScript-5 to EcmaScript-2015 had to pass a very high bar. Psychologically, this made sense to all of us because we were starting from a language, EcmaScript-5, whose smallness we could still appreciate. When a language is small, every additional feature is viscerally felt as a significant percentage increase in the size of the language. The specific benefits of a feature are always visible to its advocates. For a small language, a new feature’s general costs in added complexity are also still visible to everyone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*7hdOJNbC0g3V2_XHsu0Iew.jpeg" /><figcaption>The future of JavaScript?</figcaption></figure><p>Once a language gets beyond a certain complexity — say LaTeX, Common Lisp, C++, PL/1, modern Java — the experience of programming in it is more like carving out a subset of features for one’s personal use out of what seems like an infinite sea of features, most of which we become resigned to never learning. Once a language feels infinite, the specific benefits of a new feature are still apparent. But the general costs in added complexity are no longer apparent. They are no longer <em>felt</em> by those discussing the new feature. Infinity + 1 === Infinity. Even <em>aLargeNumber</em> + 1 === <em>approximatelyAsLargeANumber</em>. This is the death of a thousand cuts that causes these monstrosities to grow without bound.</p><p>So please, I beg everyone influencing the language, when considering a new feature, please apply a higher bar than “<em>Wouldn’t it be nice if we could also write it this way?</em>”. I believe that EcmaScript-2015 is in that middle territory where unrestrained growth is not yet inevitable, but only if we all restrain each other with high standards for any proposed new feature. As a community, we need more of a shared sense of panic about the size that EcmaScript-2015 has already grown to. Ideally, our panic should increase, not decrease, with further growth from here as our size approaches the point of no return.</p><h4>Some distinctions</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*qJxg8ID297J8ML-p6oVOPg.png" /><figcaption>Non-uniform pressure to stay small</figcaption></figure><p>The urgency of minimalism gets weaker as we move from core language to standardizing libraries. The overall standard language can be seen as consisting of these major parts:</p><ul><li><strong>Fundamental syntax</strong> — the special forms that cannot faithfully be explained by local expansion to other syntax.</li><li><strong>Semantic state</strong> — the state that computation manipulates.</li><li><strong>Kernel builtins</strong> — the portion of the built in library providing functionality that, if it were absent, could not be provided instead by user code.</li><li><strong>Non-kernel intrinsics</strong> — built in libraries that could be implemented in JavaScript, but that semantic state or kernel builtins depend on. For example, with proxies, one might be able to implement <em>Array</em> in user code. But other kernel builtins already have a dependency on <em>Array</em> specifically, giving it a privileged position over any replacement.</li><li><strong>Syntactic sugar</strong> — the syntax that can be explained by local expansion to fundamental syntax.</li><li><strong>Global convenience libraries</strong> — could be implemented by unprivileged user code, but given standard global naming paths in the primordial global namespace.</li><li><strong>Standard convenience modules </strong>— blessing community-developed modules as standard.</li></ul><p>I have listed these in order, according to my sense of the costs of growth and the urgency for minimalism. For all of these we still need to exercise discipline. Only for the last one that we should consider growth of absolute size to be unbounded; restricting only the rate of growth as we wait for candidates to prove themselves first by the <em>de facto</em> process of community adoption. Ideally, TC39 should stop being the bottleneck on the last bullet anyway, as external <em>de facto</em> and <em>de jure</em> processes should be perfectly capable of independently arguing about and evolving standard convenience modules.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e83096239b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>