<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>Munkherdene</title><link>https://your-moon.github.io</link><description>Notes from trying to understand how computers actually work — from one line of code down to the CPU.</description><item><title>The Only Enemy Is Complexity</title><link>https://your-moon.github.io/craft-1-complexity/</link><guid>https://your-moon.github.io/craft-1-complexity/</guid><pubDate>Thu, 08 Oct 2026 00:00:00 +0000</pubDate><description>&lt;h1 id=&quot;the-only-enemy-is-complexity&quot;&gt;The Only Enemy Is Complexity&lt;a class=&quot;anchor&quot; href=&quot;#the-only-enemy-is-complexity&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Craft · Part 1 of 4: Design&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;There&#x27;s a file in tailscale&#x27;s codebase called &lt;code&gt;local.go&lt;/code&gt; that is 9,287 lines long and holds a single type with 409 methods. Tailscale is one of the most carefully written Go projects I know of, and their own contributor docs call this file a problem. They are migrating code &lt;em&gt;out&lt;/em&gt; of it, one feature at a time.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-46 -106 742 444&quot; width=&quot;742&quot; role=&quot;img&quot; aria-label=&quot;The narrator and local.go&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M45.2 120.5 C49.6 120.2, 56.1 123.3, 59.7 126.2 C63.2 129.2, 65.4 134.2, 66.4 138.4 C67.4 142.6, 67.4 147.7, 65.5 151.5 C63.6 155.2, 59.4 159.4, 54.9 161.1 C50.4 162.7, 43.1 162.5, 38.5 161.4 C33.9 160.2, 29.6 157.9, 27.4 154 C25.1 150.2, 24.2 143, 25 138.3 C25.8 133.6, 28.5 129, 32.2 126 C35.9 123, 44.5 121.3, 47.2 120.5 C49.9 119.6, 48.6 120.3, 48.6 120.9 M49.9 122.9 C54.4 123.2, 60 125.4, 63 128.5 C66 131.6, 68.2 136.8, 68 141.3 C67.9 145.7, 65.1 151.5, 62.1 155.2 C59.1 159, 54.4 162.9, 49.9 163.9 C45.3 164.8, 38.9 163.7, 35 161.1 C31 158.5, 27.6 152.7, 26.1 148.1 C24.7 143.5, 25.1 137.5, 26.4 133.4 C27.7 129.4, 30.1 125.8, 34.1 124 C38.2 122.2, 47.8 123.1, 50.5 122.8 C53.2 122.4, 50.7 121.7, 50.4 122&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M51.7 122.2 C56 123.4, 61.4 127.1, 63.9 130.7 C66.4 134.2, 67.4 139.2, 66.7 143.5 C66.1 147.9, 63 153.7, 59.9 156.8 C56.7 160, 52.3 162.1, 47.9 162.4 C43.5 162.6, 37.5 161.1, 33.6 158.4 C29.7 155.7, 25.7 150.4, 24.5 146 C23.3 141.5, 24.3 135.7, 26.4 131.8 C28.4 127.9, 32.2 124.1, 36.8 122.7 C41.4 121.2, 50.9 122.9, 54.1 123.1 C57.3 123.2, 56.1 123.5, 55.9 123.8 M47.6 121.7 C52 121.4, 58.4 123.1, 61.8 126 C65.2 129, 67.4 135.2, 68.1 139.5 C68.7 143.9, 68 148.7, 65.6 152.3 C63.1 155.8, 58.1 159.5, 53.2 161 C48.4 162.4, 40.8 162.2, 36.7 160.9 C32.5 159.6, 30.3 156.7, 28.4 153.1 C26.5 149.4, 24.6 143.3, 25.4 138.8 C26.2 134.3, 29.7 129, 33.3 126.1 C36.9 123.3, 44.6 122.3, 46.8 121.5 C49 120.7, 46.3 121, 46.3 121.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M39 132.5 C39.9 132.5, 40.4 133, 40.9 133.5 C41.3 134, 41.9 134.8, 41.9 135.6 C41.9 136.4, 41.4 137.3, 40.8 138 C40.2 138.8, 38.7 139.9, 38.1 139.9 C37.6 139.9, 38.1 138.6, 37.6 138 C37 137.4, 35.3 137.1, 35.1 136.5 C34.8 135.9, 35.8 135.1, 36.1 134.5 C36.5 133.8, 36.6 133, 37 132.8 C37.5 132.6, 38.2 133.3, 38.6 133.3 C39 133.4, 39.4 133.1, 39.3 133 M37 133.1 C37.4 132.8, 38.3 132.6, 38.9 133.1 C39.5 133.6, 40.4 135.1, 40.5 135.9 C40.6 136.8, 39.9 137.9, 39.6 138.3 C39.3 138.7, 38.9 138.4, 38.5 138.4 C38.1 138.4, 37.8 138.4, 37.1 138.3 C36.5 138.3, 35.1 138.7, 34.7 138 C34.3 137.4, 34.2 135.4, 34.6 134.5 C35 133.7, 36.5 133.2, 37.2 133 C38 132.9, 38.8 133.6, 39 133.6 C39.2 133.6, 38.9 133, 38.7 132.9&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M38.6 133.5 C39.2 133.5, 40.6 132.8, 41 133.4 C41.4 134.1, 41.2 136.4, 41 137.2 C40.8 138.1, 40.1 138.3, 39.7 138.6 C39.2 138.9, 38.6 139.3, 38.2 139.1 C37.8 139, 37.5 138.2, 37 137.9 C36.5 137.5, 35.5 137.4, 35.1 137 C34.8 136.6, 34.9 136, 35.2 135.4 C35.4 134.8, 36.2 133.6, 36.7 133.2 C37.1 132.9, 37.5 133.5, 38 133.5 C38.6 133.6, 39.6 133.6, 39.9 133.5 M37.9 131.7 C38.3 132, 39 133.4, 39.3 134.3 C39.6 135.3, 39.6 136.9, 39.5 137.4 C39.4 137.9, 38.9 137.2, 38.7 137.3 C38.4 137.4, 38.5 137.6, 38.1 138 C37.7 138.4, 36.5 139.8, 36.1 139.6 C35.8 139.3, 36.1 137.7, 35.9 136.8 C35.8 135.9, 35 134.9, 35.3 134.1 C35.6 133.3, 36.9 132.4, 37.5 132.1 C38 131.9, 38 132.4, 38.4 132.7 C38.8 133, 39.6 133.5, 39.7 133.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M54.2 132.8 C54.5 133.1, 54.9 134.1, 55.4 134.8 C56 135.5, 57.2 136.4, 57.4 137.1 C57.5 137.8, 56.9 138.6, 56.4 138.9 C55.9 139.3, 54.9 139.4, 54.3 139.2 C53.7 139, 53.4 138, 52.9 137.5 C52.4 137, 51.4 136.9, 51.1 136.4 C50.8 135.8, 50.6 134.9, 51 134.2 C51.5 133.5, 52.8 132.7, 53.5 132.4 C54.3 132.2, 55.2 132.4, 55.5 132.8 C55.7 133.1, 55.2 134.5, 55.2 134.6 M54.3 131.8 C54.9 131.3, 55.7 132, 55.8 132.3 C56 132.6, 55 133, 55.4 133.6 C55.8 134.1, 58.4 134.8, 58.3 135.8 C58.1 136.8, 55.1 138.7, 54.4 139.4 C53.7 140, 54.4 140.2, 54.1 139.8 C53.9 139.5, 53.2 137.7, 53 137 C52.7 136.3, 52.6 136.3, 52.5 135.6 C52.4 134.9, 51.7 133.2, 52.1 132.7 C52.5 132.3, 54.3 133.1, 54.7 133.1 C55 133.1, 54.2 133, 54.2 132.9&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M54.8 133.8 C55.3 134, 55.2 134, 55.7 134.5 C56.1 135.1, 57.5 136.6, 57.6 137 C57.7 137.5, 56.8 136.9, 56.1 137.4 C55.4 137.8, 54 139.6, 53.5 139.6 C53 139.7, 53.6 138.1, 53.3 137.5 C53 136.9, 52 136.5, 51.7 136.1 C51.4 135.7, 51.2 135.4, 51.5 134.9 C51.7 134.5, 52.7 133.7, 53.3 133.5 C53.9 133.2, 54.5 133.5, 55 133.6 C55.5 133.6, 56.4 134, 56.3 133.9 M53 132.9 C53.5 132.5, 53.5 133.5, 54 133.5 C54.5 133.5, 55.5 132.6, 55.8 132.9 C56.1 133.2, 56 134.4, 56 135.1 C55.9 135.8, 55.5 136.4, 55.4 137 C55.3 137.6, 55.9 138.6, 55.4 138.7 C54.9 138.8, 53.4 137.7, 52.6 137.5 C51.8 137.3, 50.7 138.1, 50.6 137.7 C50.5 137.3, 51.8 135.9, 52 135 C52.2 134.1, 51.7 132.2, 51.7 132.1 C51.7 132.1, 51.6 134.7, 51.8 134.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M38 153 C40.8 150.3, 44.8 149.2, 44.9 152.7 M38.4 153.9 C39.8 148.1, 45.8 149.9, 47.8 151 M46 151 C46.7 151.3, 52.1 150.9, 54.5 150.7 M46.5 152 C48.3 154.5, 51 154.4, 52.9 148.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M47.2 164.7 C46.3 178.8, 47.6 198.6, 47.4 230.8 M45.1 163.6 C46.4 182.8, 46.9 202.5, 45.3 230.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M47.8 230.6 C41.1 242, 33.9 251.2, 24.8 275 M46 230.8 C39.8 245.8, 32.1 262.8, 26.3 275.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M44.4 230.5 C51.7 240.1, 55 251.6, 66.2 277.2 M46.9 230 C49.8 240, 54.7 251, 65.3 275.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M45 182.3 C41 190.3, 34.5 196.1, 25.6 211.3 M45.8 181.2 C39.8 190.5, 33.3 198.1, 24.3 211.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M46.2 181.7 C53 179.6, 82.3 176.3, 86.1 168.4 C90 160.4, 72 139.9, 69.2 134 M44.8 180.5 C51.5 178.1, 80.8 174, 85.3 166.4 C89.7 158.9, 74.3 140.7, 71.7 135.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M136.8 -66 C150.5 -64.1, 164.7 -59.4, 174.3 -54.2 C183.9 -49.1, 190.8 -41.5, 194.4 -35.2 C198 -28.9, 198.7 -22.5, 196 -16.4 C193.2 -10.3, 186.7 -4, 178.1 1.2 C169.5 6.4, 157 11.3, 144.2 14.7 C131.3 18, 116.1 20.4, 100.9 21.1 C85.8 21.9, 68 21, 53.5 19.1 C38.9 17.3, 25.1 14.1, 13.6 10.2 C2.1 6.3, -8.8 1.4, -15.6 -4.2 C-22.5 -9.9, -27 -17.4, -27.4 -23.7 C-27.8 -30, -24 -36.1, -18.1 -42 C-12.2 -47.8, -2.9 -54.3, 8 -58.7 C18.8 -63.1, 32.6 -66.5, 46.9 -68.3 C61.2 -70.2, 77.2 -70.7, 93.7 -69.9 C110.2 -69.2, 136 -65.4, 145.8 -63.7 C155.7 -62, 153.9 -60.4, 153 -59.8 M104.3 -68.9 C118.8 -68.5, 135.9 -65.4, 148.2 -62 C160.6 -58.7, 170.2 -53.8, 178.2 -48.7 C186.3 -43.5, 194.2 -37, 196.5 -31 C198.9 -25.1, 196.5 -19.2, 192.2 -13.1 C187.9 -7.1, 179.8 0.8, 170.5 5.5 C161.1 10.2, 149.8 12.7, 136.3 15.2 C122.8 17.6, 105 19.7, 89.7 20.2 C74.3 20.6, 58 19.9, 44.1 17.8 C30.2 15.7, 17 12.1, 6.2 7.4 C-4.7 2.8, -15.2 -4.3, -21 -10.1 C-26.7 -15.8, -29.3 -20.7, -28.2 -26.8 C-27 -33, -21.5 -41.4, -14.1 -46.8 C-6.8 -52.3, 4.4 -56, 16.1 -59.6 C27.9 -63.1, 42.1 -66.1, 56.4 -68.2 C70.7 -70.2, 94.2 -71.6, 102.1 -71.8 C109.9 -72.1, 103.1 -70.3, 103.3 -69.6&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M88.4 -71.1 C102.8 -71.8, 120 -69.5, 133.5 -66.7 C147 -63.9, 159.3 -59.3, 169.3 -54.6 C179.2 -49.8, 188.7 -44.2, 193.1 -38.5 C197.5 -32.7, 197.7 -26.3, 195.6 -19.9 C193.6 -13.5, 188.8 -5.6, 181 -0.1 C173.2 5.4, 161.4 9.9, 148.9 13.3 C136.3 16.7, 121 19.2, 105.8 20.4 C90.7 21.5, 73.1 21.9, 58.1 20.3 C43.2 18.8, 28.1 14.7, 16.3 11 C4.5 7.2, -5.5 3.1, -12.5 -2.3 C-19.6 -7.6, -24.5 -14.8, -26 -21.1 C-27.5 -27.4, -26.3 -34, -21.5 -40 C-16.7 -46, -7.9 -52.5, 2.8 -57.3 C13.6 -62, 27.3 -66.1, 42.7 -68.5 C58.1 -70.9, 85.5 -71.4, 95.4 -71.7 C105.3 -72.1, 102.3 -71.6, 102.2 -70.5 M122.4 -67.4 C136.2 -66.1, 150.3 -63.4, 161.4 -59.2 C172.6 -54.9, 183.2 -47.5, 189.2 -41.8 C195.3 -36, 197.9 -30.8, 197.5 -24.5 C197.1 -18.2, 193.6 -9.6, 186.8 -4.1 C179.9 1.5, 168.4 4.9, 156.5 8.9 C144.6 12.9, 129.8 18, 115.5 20.1 C101.2 22.1, 85.8 22.2, 70.8 21.4 C55.8 20.6, 38.3 19, 25.3 15.4 C12.4 11.8, 1.4 4.8, -6.8 -0.3 C-15 -5.4, -21.1 -9.1, -23.8 -15.3 C-26.6 -21.4, -26.6 -30.8, -23.5 -37.2 C-20.3 -43.6, -13.8 -48.8, -4.7 -53.4 C4.3 -58.1, 17.5 -61.8, 30.9 -65 C44.3 -68.1, 60.6 -71.4, 75.8 -72.2 C91 -73, 114.5 -70.5, 122.2 -69.7 C129.8 -69, 122.4 -68.5, 121.6 -67.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M69.8 44.3 C71.7 44.5, 73.6 45.8, 74.9 47.3 C76.3 48.8, 78.1 51.5, 78 53.2 C78 55, 76.1 56.4, 74.4 57.6 C72.6 58.9, 69.8 60.4, 67.5 60.7 C65.3 61, 62.7 60.4, 61 59.3 C59.2 58.1, 57.2 55.5, 56.9 53.6 C56.7 51.7, 58.3 49.5, 59.5 47.9 C60.7 46.4, 62.3 44.6, 64.1 44.2 C66 43.9, 69.5 45.6, 70.6 45.7 C71.8 45.9, 71.1 45.2, 71 45.1 M66.6 44.1 C68.5 43.7, 73 44.5, 74.7 45.5 C76.3 46.5, 76.2 48.4, 76.5 50.2 C76.8 52, 77.3 54.7, 76.4 56.1 C75.5 57.4, 73.4 57.6, 71.1 58.4 C68.7 59.1, 64.2 61.2, 62.2 60.6 C60.3 60, 60 56.3, 59.3 54.7 C58.7 53.1, 57.8 52.6, 58.3 51.1 C58.8 49.6, 60.7 47.1, 62.3 45.9 C63.9 44.7, 66.7 44.2, 67.8 43.8 C69 43.5, 69.2 43.5, 69.1 43.8&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M63.2 44.4 C65 43.5, 68.4 43, 70.6 43.6 C72.7 44.2, 75.1 46.5, 76.1 47.9 C77.2 49.3, 77 50.2, 76.8 51.8 C76.6 53.5, 76.3 56.5, 74.8 58 C73.3 59.5, 70.1 60.7, 68 60.9 C65.8 61.1, 63.4 60.2, 61.8 59 C60.2 57.8, 58.9 55.2, 58.5 53.7 C58 52.2, 58.2 51.3, 59.4 49.8 C60.5 48.3, 64 45.5, 65.3 44.8 C66.5 44, 66.9 45.3, 67 45.3 M65.8 43.8 C67.8 43.8, 70 45.5, 71.9 46.5 C73.8 47.5, 76.6 48.2, 77.4 49.9 C78.3 51.7, 78.1 55.2, 76.9 56.9 C75.6 58.6, 71.8 59.7, 69.9 60.2 C68 60.6, 67.5 60.1, 65.5 59.6 C63.5 59.2, 59 58.6, 57.8 57.2 C56.7 55.9, 58 53.3, 58.6 51.5 C59.1 49.8, 59.5 47.7, 61.1 46.7 C62.7 45.7, 67.3 45.8, 68.1 45.5 C68.9 45.1, 66 44.5, 65.7 44.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M56.5 84.5 C57.5 84.9, 58.1 86.5, 58.7 87.4 C59.3 88.2, 60.1 88.4, 59.8 89.4 C59.6 90.3, 58.3 92.4, 57.3 93.1 C56.2 93.9, 54.8 93.7, 53.4 93.6 C52 93.6, 49.8 93.6, 48.7 92.9 C47.7 92.1, 47.2 90.5, 47.1 89.3 C47.1 88.1, 47.6 86.6, 48.6 85.7 C49.5 84.7, 51.7 83.7, 53 83.5 C54.2 83.4, 55.6 84.4, 56.3 84.8 C57 85.1, 57.1 85.6, 57.2 85.7 M53.5 85.7 C54.3 85.1, 54.7 83.2, 55.9 83.6 C57.1 83.9, 60.1 86.4, 60.7 87.7 C61.3 89, 60 90.5, 59.3 91.4 C58.7 92.3, 58 92.8, 56.7 93.1 C55.4 93.4, 52.9 93.4, 51.6 93.2 C50.2 93.1, 49.4 92.9, 48.7 92.3 C48 91.8, 47.1 91.2, 47.3 90 C47.4 88.8, 48.5 86.2, 49.5 85.1 C50.5 84, 52.4 83.4, 53.2 83.1 C53.9 82.9, 54.2 83.3, 54.2 83.5&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M57.1 84.3 C58.2 84.6, 58.6 86.4, 58.9 87.5 C59.2 88.6, 59.2 90, 58.9 91 C58.5 92, 57.9 92.6, 56.8 93.3 C55.8 93.9, 53.6 94.8, 52.3 94.7 C51 94.6, 49.6 93.7, 48.9 92.6 C48.2 91.6, 48 89.2, 48.2 88.2 C48.3 87.2, 49.2 87.1, 49.9 86.5 C50.6 86, 50.8 85.2, 52.3 85.1 C53.7 84.9, 57.6 85.3, 58.5 85.6 C59.5 86, 57.9 87.1, 57.9 87.3 M55.1 84.9 C56 85, 56.4 86.4, 57.4 87.1 C58.3 87.8, 60.6 88.3, 60.9 89.3 C61.1 90.3, 60 92.2, 59.1 93.1 C58.3 93.9, 57.1 94, 55.6 94.3 C54 94.5, 50.9 95.2, 49.9 94.5 C48.8 93.8, 49.5 91.5, 49.3 90.1 C49.1 88.6, 48.4 87, 48.8 85.9 C49.1 84.8, 50.3 83.6, 51.5 83.4 C52.6 83.2, 55 84.5, 55.6 84.8 C56.2 85, 55.3 85.1, 55 85.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;85&quot; y=&quot;-25.0&quot;&gt;what IS bad code?&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M-20.6 322.7 C163.6 320.5, 346.4 319.8, 679.3 322.3 M-20 321.9 C240.3 320, 500.4 319.7, 679.6 321.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M312.1 -91.7 C381.4 -89.3, 452.6 -92.3, 590.8 -89.1 C594.4 -91.1, 599 -84.2, 596.8 -80.2 C601.4 29.5, 599.6 138.2, 600.5 311.4 C599 321.4, 596.6 321.7, 591.4 320.5 C522.6 321.6, 455.3 318.6, 308 321.4 C305.7 322.6, 302.2 318.5, 300.6 309.3 C303.1 185.9, 301 62.3, 301.9 -78.2 C300.2 -88.1, 301.4 -90.6, 310.2 -89.2&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M309.3 -88.8 C383.7 -90.3, 456.1 -90, 589.6 -90.7 M310.6 -89.3 C376.1 -87.9, 440.4 -88.1, 590.1 -90.2 M590 -90 C598.7 -91.4, 599.8 -87.8, 601.6 -80.6 M588.4 -91.6 C594.7 -88.6, 600.6 -85.6, 599 -79.7 M598.9 -80.7 C598.5 34.1, 598.5 149.3, 600.3 311.7 M600.1 -80.1 C597.9 27.5, 598.5 134.2, 600 311.9 M600 312 C599.4 318.5, 595 323, 590.5 321.8 M600.3 312.9 C600.7 317.7, 596.9 321.4, 588 324 M589.6 323.2 C512.8 321.1, 434.5 322.3, 309 323.2 M590 322.5 C501.4 322, 413.9 321.4, 310.1 322 M310 322 C305.2 322.9, 301.8 319.6, 301.8 312.8 M310.5 323.3 C302 321.6, 301.2 318.8, 299.1 310.6 M301.1 312.5 C299.8 171.6, 300.9 33.4, 300.4 -79.2 M299.6 312 C298.3 158.6, 297.2 5.9, 299.8 -79.8 M300 -80 C299.9 -86, 301.3 -90.4, 309.5 -91.9 M301.3 -78.4 C299.3 -87.1, 301.9 -87.9, 309.8 -88.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:24.599999999999998px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;450&quot; y=&quot;110.0&quot;&gt;local.go&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;450&quot; y=&quot;160.0&quot;&gt;9,287 lines · 409 methods&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M300.8 -58.7 C294.3 -58.1, 288.3 -58.8, 275.7 -58.5 M299.5 -59.4 C295.4 -59.1, 290 -60.3, 275.1 -59.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M266.1 -65.8 C267.1 -66.8, 267.9 -66.1, 273.2 -66.4 C274.5 -68.6, 276.2 -63.5, 275.3 -62.9 C275.5 -61.3, 275.4 -61.7, 276 -57 C279.5 -56.1, 277.8 -54.7, 274.9 -51.2 C272.3 -54, 267.6 -53.1, 264.9 -55.2 C262.2 -53, 263.5 -58, 262.7 -58.5 C264.4 -58.9, 263.3 -61.9, 263.7 -65.3 C263.9 -65.4, 268 -68.6, 265.9 -62.7&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M266.6 -65.5 C268.4 -65.9, 270.8 -65.3, 274.4 -66.1 M266.2 -66.1 C268 -66.4, 270.6 -66, 274.1 -66.4 M274 -66 C273.9 -64.9, 274.9 -66.2, 277 -63.1 M273 -65.6 C273.6 -67.4, 274.4 -67.2, 275.6 -63.2 M276.3 -63.7 C275.6 -60.9, 275.8 -58.2, 276.5 -55.7 M276.1 -64.2 C275.8 -62.2, 275.7 -60.7, 276.3 -56 M276 -56 C277.6 -53.4, 275.1 -54.9, 272.6 -53.8 M277.2 -56.7 C277.3 -52.6, 276.9 -54.2, 275.8 -52.1 M274.3 -54 C271.6 -54, 267.4 -54.4, 265.3 -53.5 M274.3 -54.4 C272.4 -54.4, 271 -53.8, 265.9 -53.8 M266 -54 C263.5 -55.7, 262.7 -54.9, 264.6 -57.2 M264.9 -52.7 C266 -55.8, 265 -54.5, 265.9 -56.8 M264.2 -56.7 C264.5 -57, 263.3 -58.9, 263.7 -63.3 M263.9 -55.6 C264.2 -57.8, 264.4 -59.6, 263.8 -63.9 M264 -64 C262.7 -66, 265.8 -66.3, 267.5 -64.7 M265.7 -62.8 C265.4 -65.8, 265.7 -64.1, 266.5 -63.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M602 -41 C609.7 -44.1, 616 -40.2, 632.5 -40.2 M599.3 -41 C611.6 -42.4, 623.2 -40.9, 633.1 -42.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M636.9 -49.3 C638.9 -47, 641.2 -47.2, 643.1 -48 C648.9 -48.9, 643.6 -45.4, 643.2 -47.9 C646 -43.1, 644.8 -40, 645.4 -39.4 C648.3 -34.5, 646.5 -37.2, 640.6 -39 C643.7 -35.1, 640.4 -35.6, 634.7 -37.2 C636.5 -34.7, 636 -36.6, 634.2 -41.2 C634.8 -41.3, 633.8 -43.9, 634.3 -47.3 C634.1 -48, 631.8 -45.7, 636.3 -48.2&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M635.5 -48.6 C637.6 -48.3, 640.3 -48.8, 644.5 -47.4 M636.4 -48.2 C638.3 -47.9, 641.2 -48.3, 643.7 -47.7 M644 -48 C647.2 -49.2, 647.5 -46.7, 644.6 -45.5 M642.1 -49 C646.1 -50.1, 647.7 -45.3, 645.7 -48.2 M646.1 -46.3 C645.9 -44.2, 645.9 -41.7, 645.8 -37.4 M646.2 -45.9 C646 -44, 646.2 -42.1, 646.2 -37.8 M646 -38 C644.3 -37.2, 646.1 -37.8, 643.2 -34.8 M644.1 -37 C648.1 -34.4, 643.8 -35.2, 643.4 -37.6 M644.3 -36.8 C642.8 -36.3, 640 -36.1, 635.9 -35.6 M644 -35.8 C642 -36, 639.7 -36.3, 635.7 -36 M636 -36 C636.2 -34.4, 634.9 -37.3, 632.5 -36.5 M637.1 -37.1 C635.3 -37.6, 635.5 -35.2, 636 -37.9 M634.3 -38.7 C633.9 -41, 634.8 -43.5, 634 -46.7 M634.1 -37.6 C634.2 -40.3, 633.8 -42.5, 634.1 -46.3 M634 -46 C633.8 -47.6, 633.6 -47.6, 635.7 -49.6 M633.9 -46.6 C634.1 -46.9, 633.9 -48.5, 634.9 -48.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M299.2 -21.7 C289.7 -18.6, 282.7 -21.6, 264.7 -20.4 M299.8 -19.4 C287.8 -19.6, 275.5 -20.3, 266.3 -20.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M255 -25.3 C257.5 -25.4, 262.6 -25.9, 265.4 -25 C262.4 -27.6, 267.7 -23.7, 268 -25.3 C265 -22.7, 265.9 -19.7, 265.2 -14.8 C266.9 -18.1, 264.2 -11.8, 264 -11.3 C262.3 -15.1, 260.5 -14.3, 254.7 -14.2 C254.1 -16.1, 254.7 -16.2, 256.9 -15.5 C253 -17, 255 -19.6, 253.5 -23.7 C257.5 -28.8, 254.4 -28.2, 252.6 -24.9&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M255.9 -26.7 C257.7 -26.1, 260.8 -26.4, 264 -25.3 M256.3 -26.1 C258.2 -25.7, 259.7 -25.9, 263.7 -26.2 M264 -26 C263.4 -27.9, 267.1 -24.5, 266.3 -24.8 M262.4 -28 C263.9 -27.2, 266.6 -24.8, 263.7 -23.6 M266.6 -23.9 C265.7 -20.9, 265.8 -17.5, 266 -15.9 M266.2 -24 C266.4 -22, 265.9 -19.4, 266 -16.1 M266 -16 C265.4 -14.5, 264.8 -12.7, 262.3 -14.6 M264.5 -17.9 C263.8 -13.2, 266.7 -15.3, 263 -13.3 M264.6 -14.3 C261.9 -14.2, 259.3 -14.5, 255.8 -13.7 M263.7 -14.1 C262.6 -14.1, 260.8 -14.4, 255.7 -14.3 M256 -14 C254.7 -13.7, 253.4 -15.8, 253.9 -15.5 M254.3 -15.1 C256.6 -14, 253.1 -15.4, 252.9 -15.7 M254 -15.6 C254.3 -18.6, 253.3 -21.8, 254.5 -24.6 M254.2 -15.8 C254.1 -18.3, 254.1 -20.3, 254.1 -23.9 M254 -24 C253.2 -26.2, 255.1 -25.6, 254.7 -28 M254.1 -24.8 C255.2 -27.2, 255.1 -24.3, 257.5 -26.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M600.4 -4 C610.7 -0.7, 621.5 -3.1, 645.5 -2.1 M599.6 -3 C612.3 -1.4, 625.4 -1.4, 644.3 -2.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M645.9 -8.2 C647.4 -8.1, 650.8 -8.8, 654.8 -8.9 C653.1 -10.4, 654.7 -6, 655.6 -6.6 C657.2 -3.5, 657.2 -0.4, 655.1 2.9 C655.6 1.4, 651.9 2.4, 657.4 5.3 C651 4.1, 647.8 3.3, 644.6 4.8 C641.6 5.7, 643.3 0.3, 642.3 -1 C644.1 -1.2, 643.3 -2.5, 642.7 -6.9 C643.8 -6.5, 647 -7.6, 646 -5.6&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M646.4 -7.2 C647.8 -8.1, 649.7 -8.2, 653.6 -8.8 M646.2 -7.9 C648.9 -8.4, 651.4 -8.3, 653.7 -7.9 M654 -8 C653.7 -6.6, 656.6 -6.4, 654 -4 M652.7 -7 C656.3 -8.3, 655.5 -8.2, 656.4 -7.7 M655.6 -5.5 C655.5 -3.1, 655.7 1, 656.2 1.5 M656.2 -6 C656 -3.1, 655.7 0, 655.7 2.3 M656 2 C656.5 4.2, 653.5 4.3, 655.3 5.6 M655 1.3 C654 4.1, 655 5.2, 652.6 2.3 M653.3 4.2 C651.1 3.8, 648.5 4.7, 645.7 4.2 M654.2 3.6 C650.8 3.9, 647.8 3.7, 645.6 4.2 M646 4 C643.2 3.1, 645.9 1.6, 645.3 1.5 M645.6 2.9 C643.4 5.6, 645.4 4.9, 644.3 2.6 M643.8 1.9 C644.8 -1.8, 643.7 -4.2, 643.4 -6.5 M644.3 2 C644.1 -0.3, 643.7 -2.9, 644 -6.4 M644 -6 C642.6 -8.9, 642.7 -7.5, 647.6 -6.4 M644.3 -7 C646.3 -7, 646.3 -8.7, 645.6 -8.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M301.5 31.8 C287.4 31.2, 275.9 29.4, 256.3 30.2 M299.4 29.4 C291.3 29.1, 280.3 29.7, 256.4 30.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M246.8 22.9 C248.8 23.3, 249.3 25.1, 254.1 24.2 C253.8 20.8, 258.8 25.7, 253.3 26.1 C256.6 26.9, 255.7 29.9, 254.9 34.6 C254.2 35, 256.8 37.8, 253.5 35.8 C252.6 37, 248 34.6, 244.6 35 C246.4 34.3, 242 37.9, 245 34.7 C245.4 31.5, 244.8 28.6, 244.7 26.7 C247.3 22.6, 242.4 27, 249.5 20.4&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M245.2 24.7 C247.8 23.9, 250.3 24.1, 254.7 23.4 M246.1 24.3 C248 23.9, 250.8 24.3, 253.7 24.3 M254 24 C254 24.6, 256.1 25.7, 255.7 26.7 M253 24.1 C254.1 24.7, 254.4 26.9, 254.4 26.9 M256.1 25.2 C256.8 28.6, 255.6 30.3, 256.3 34.6 M256.2 25.9 C255.7 27.4, 256.2 29.5, 256.2 33.9 M256 34 C257.6 36.9, 256.2 35.4, 254.3 35.8 M255.4 34.5 C254.3 35.3, 253.4 35.1, 252.2 36.6 M253.5 36.7 C250.2 36.1, 247.8 36.4, 245.6 36.1 M254 36.1 C251.4 36, 248.8 35.8, 246.4 35.9 M246 36 C245.7 37.8, 244.3 37, 242.7 32.5 M246.8 34.9 C244.7 34.7, 243 34.6, 245.7 34.9 M243.5 33.4 C243.5 32.2, 243.8 30.6, 243.9 25.5 M243.6 33.7 C244.1 31.7, 244.2 28.5, 244 26 M244 26 C242 26.5, 244.2 24.5, 246.6 25.2 M244.5 24.9 C242.8 22.7, 243 25.5, 248.2 24.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M598.7 49.6 C605.7 49.9, 613.4 48.7, 623.1 48.5 M599.1 47.8 C608.1 47.8, 616.8 47.1, 624.4 47.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M624.9 42.9 C630.3 40.6, 630.8 42.1, 633.5 43.2 C634.5 45.2, 635.8 43.4, 638.1 44.8 C635.9 46.1, 637.1 46.3, 634.7 52.3 C632.8 54.6, 634.5 52, 636.9 52.4 C631.3 53.3, 628.1 55, 624.6 54 C624 56.1, 620.7 54.3, 627.6 49.2 C623.6 48.9, 623.1 46, 623.9 43.5 C623.5 44.9, 625 40.4, 625.8 39.7&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M625.7 42.6 C627.9 41.9, 630.8 42.3, 634.2 41.5 M626 41.6 C627.9 42, 629.3 41.8, 633.8 41.8 M634 42 C634.3 41.9, 635.7 43.9, 637.4 43.5 M633.2 41.1 C636.5 43.6, 637.9 43.4, 637 42.8 M636.6 43.6 C636.5 46.3, 635.3 48.8, 636.5 52.1 M636.2 43.8 C636.2 46.3, 636.1 48.9, 635.9 52.4 M636 52 C634.7 51.6, 634.9 52.4, 633.3 56 M635.8 53.7 C634.6 52.5, 636.3 55.6, 631.7 52.3 M633.8 53.6 C632.5 54.2, 630.2 54, 625.5 54.1 M633.7 53.8 C632 54, 629.9 53.8, 626.3 54.4 M626 54 C624.2 54.5, 622.8 54.5, 624.1 53.5 M624 52.8 C626 54.3, 625.2 54.9, 622.5 53.1 M623.2 52.5 C624 50.6, 624.2 48.3, 624.4 43.6 M623.7 52.3 C623.9 48.9, 623.6 46.7, 624 43.6 M624 44 C625.4 43.8, 625.8 42.6, 625.6 42.7 M624.7 42.7 C623.9 43, 624.2 41.1, 626.3 42.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M299.8 211.3 C293.1 211.9, 289 211.3, 277.9 210.9 M300.9 210.2 C293 210.5, 287.3 210.5, 276.4 209.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M265.7 203.4 C267.6 204.4, 270.9 205, 273.5 202.6 C271.8 201.8, 273.2 205.5, 276 203.7 C276.3 208.4, 276.4 212, 277 213.9 C278.8 212.9, 273.2 213.5, 272.6 215.8 C272.6 215.9, 270.9 216.2, 267.3 216 C261.1 218.4, 263.2 212.5, 261.9 210.5 C263.7 210.5, 263.4 207.9, 264.5 205.4 C263.7 206.3, 266 207.3, 266.2 205.4&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M266.2 203.5 C268.7 203.6, 270.3 204.5, 274.3 204.2 M266.2 204.3 C268.2 203.7, 269.9 204.3, 274.2 203.7 M274 204 C273.6 205.6, 274.3 203.4, 275 205.1 M272.4 205.6 C274.4 204.8, 276.6 204.7, 277.1 206.5 M276.4 206.7 C275.3 207, 275.5 209.3, 275.8 214.3 M276.3 206.1 C276.3 208.4, 275.7 210.7, 275.9 213.8 M276 214 C275.4 215.8, 275.8 217.5, 274 215 M276.8 213.4 C275.4 214.7, 273.2 214.1, 273.9 215.4 M273.8 216.4 C272.2 215.8, 269.6 216.2, 266.1 216 M274.2 215.6 C271.6 216.4, 268.6 216.2, 266.1 216.2 M266 216 C262.9 215.8, 265 216.1, 266 214.2 M266.2 216.5 C265.3 216.5, 265.7 213.7, 262.6 216 M263.3 214.5 C263.3 210.7, 263.9 207.6, 264.8 205.8 M264 214.3 C263.9 211.2, 263.8 207.8, 264.3 206 M264 206 C262.5 206.2, 263.6 205.3, 267.8 205.9 M262.9 206.8 C262.6 205.9, 266.9 205.3, 264.7 201.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M601.1 226.6 C610.7 229.3, 618.9 229.8, 632 226.6 M599.4 227.9 C609.3 227.5, 620 227.4, 633.6 227.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M636.6 223.4 C639.1 221.7, 642.3 222, 642.8 221.7 C642.5 219, 647.4 223.2, 643.6 222.4 C645.7 227.6, 644.9 228.3, 646.8 231.6 C647.5 232.5, 648.1 234.9, 646 232.3 C641.3 235.1, 638.2 233.8, 637.2 235 C635.9 233, 631.9 236.1, 634.6 232.2 C634.8 229.2, 634.6 225, 633.7 225.1 C637.1 221.4, 631.4 220.7, 632.4 224.7&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M636.7 221.4 C638.8 221.6, 640.8 221.1, 643.8 222.3 M636.1 221.6 C638.9 221.9, 641.6 221.9, 644.2 222 M644 222 C643.9 222.9, 647.9 221.5, 646.7 225.8 M642.7 222.7 C646.8 223.7, 645.5 221.2, 645.1 222.5 M645.4 223.5 C646.7 226.4, 645.4 227.8, 646 231.8 M646.3 224 C646.1 227.3, 646.4 230.2, 645.6 232.3 M646 232 C646.5 234.5, 644.5 234.6, 643 235.2 M647.2 232.6 C645.7 232, 646.1 234.6, 643.5 235.6 M644.1 233.3 C641.3 233.9, 638.9 233.8, 636 233.9 M643.9 234.1 C642.1 233.7, 639.6 234.2, 636 233.9 M636 234 C635.4 232.5, 633.5 233.5, 633.4 231.2 M637.5 234.5 C636.6 236.1, 633.3 234, 634 234.3 M634.6 232 C633.8 229.1, 634.2 225.3, 633.7 223.9 M634.1 232.1 C633.9 229.2, 634.3 226, 634.2 224.4 M634 224 C635.9 223.6, 635.1 223.3, 636.8 223.5 M633.1 224.7 C633.7 221.5, 633.6 220.9, 637.3 219.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M298.2 248.3 C292.5 251.4, 283.4 248.5, 266.8 248.9 M299.2 250.3 C293.7 250, 285.6 250.6, 265.6 250.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M254.7 244.5 C257.7 243.4, 260.8 243.3, 265.1 244.7 C263.2 247.4, 264.3 244.9, 268.4 245 C265 248, 266.3 251.6, 266.7 253.3 C266.1 256, 265.7 253.1, 262.1 252.9 C260 255.4, 258.3 255.4, 257.2 255.1 C253.4 258.8, 250.5 256.5, 257.2 250.7 C253.2 250.7, 253.2 249.3, 252.9 245.8 C253.4 247.8, 254 245.3, 255.9 240.7&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M255.5 243.3 C258.9 243.8, 259.7 243.5, 263.3 244.4 M256 243.8 C258 244, 260.2 244.3, 264.2 244.3 M264 244 C264.1 244.1, 267.4 243.7, 264.4 246.6 M263 243.7 C264.6 242.1, 264.4 246.4, 267.7 247 M265.9 245.8 C266.4 248.1, 265.2 250.4, 266.1 253.3 M266.3 246 C265.7 247.8, 266.2 249.6, 266.2 253.9 M266 254 C267.6 257.3, 267.2 255.6, 262 255.3 M267.6 255.8 C265.9 253.2, 264.5 254.5, 263.1 255.3 M264.4 255.8 C260.4 256.1, 258.1 255.5, 255.9 255.8 M263.6 255.8 C261.9 255.7, 260.7 256.3, 256 256.4 M256 256 C253.8 257.3, 255.9 254.9, 254.8 252.2 M254.7 256.5 C253.3 255.1, 255.5 253.7, 255.4 252 M254.4 253.5 C254.1 251.5, 254.4 250.1, 254.2 246 M254.2 253.9 C253.7 252, 253.7 250.6, 254.2 246 M254 246 C255.3 244.9, 256.7 245.4, 255.7 245 M253.3 246.5 C254.7 245.8, 254.8 245.1, 255.4 242.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M599.4 266.1 C613.8 269.1, 622.9 266.8, 643.6 267.3 M601 268.7 C614.8 268.7, 628.6 267.9, 643.6 269&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M645.6 261.6 C647.5 260.7, 649 263.2, 654.5 260.8 C653.9 264.6, 658.5 262.6, 656.1 263.7 C656.9 267.2, 654.5 267.9, 656.5 271 C654.7 275.6, 653.4 274.5, 655.5 276.6 C653.2 274.3, 651.7 272.7, 647.2 274.1 C648.2 273.3, 646.4 272.9, 642.7 272.4 C644.3 269.4, 644.4 266.4, 644.9 265.4 C646.8 262.9, 646.6 258.8, 649.4 260&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M646 262.8 C648.9 261.8, 650.2 261.8, 654.4 262.6 M645.9 262 C649.5 262.2, 652.7 262.1, 654.3 261.7 M654 262 C654.4 261.4, 656.9 261.8, 656.1 263.3 M653.2 260.7 C657 261, 657.9 262.9, 655.7 262.9 M656.4 264.2 C656.2 267.5, 656.7 268.9, 656.3 272.3 M656.3 263.9 C656.1 266.7, 655.9 269.1, 655.9 272.3 M656 272 C654.7 272, 655.9 272.7, 655 275.5 M654.1 271 C656.2 275, 657.4 275, 652.7 275.6 M654.6 274.3 C651.1 274.2, 650.6 274.7, 645.8 273.7 M654.2 274.3 C650.9 273.6, 647.7 274.2, 645.9 274.1 M646 274 C646.3 274, 644.4 272.4, 642.1 273.2 M645.9 274.4 C644.7 274.7, 643.2 274.1, 642.3 270.2 M644.1 272.6 C644.7 269.9, 644.7 267.7, 644.7 264.1 M644.3 271.7 C643.7 270.1, 644.2 268, 644.2 264.3 M644 264 C644.7 262.2, 644.2 263.5, 644.7 262.6 M643.5 264.4 C645.8 261.5, 646.1 260.7, 648 260.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M300.5 291.8 C286.1 291.3, 276.4 289.6, 254.4 289.6 M300.8 289.1 C288 290.8, 277.9 290.7, 255.6 289.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M246.6 282.7 C249 284.9, 250.4 284.2, 253.8 283.9 C254.6 285.9, 255.5 284.3, 253.7 286.4 C256.3 287.6, 255.9 291.2, 256.3 292.7 C253.4 292, 258.3 292.8, 251.7 297.2 C251.9 297.5, 249 297.1, 247.2 297.1 C245.7 299.1, 245 293.4, 245.3 290.9 C245.3 290.8, 242.7 290.7, 244.1 286.2 C243.1 282, 242 283.4, 245.7 283.2&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M246.4 284.7 C247.4 283.8, 250.7 284, 253.9 284.7 M245.9 284.1 C248.5 284.4, 251.2 283.7, 254.3 284 M254 284 C254.7 282.7, 256.5 283.9, 257.8 284.1 M253.5 285.7 C254.9 283.9, 256.8 283.4, 253.8 287.5 M255.4 286.6 C255.9 289.2, 256.6 293, 256.4 293.8 M256.3 285.8 C255.9 288.8, 255.8 291.7, 256.4 294 M256 294 C255.8 294.7, 254.6 297.7, 254 295.7 M254.5 294.1 C256.5 296.2, 255.7 294.9, 252.3 295.3 M253.3 296.8 C251.9 296.3, 248.2 296.3, 245.7 295.6 M253.9 296 C251.5 295.6, 248.7 296.3, 245.9 295.8 M246 296 C244.8 294.7, 242.9 293.8, 243.5 294.3 M247.2 296.4 C246 293.8, 245.4 293.8, 243.7 292.5 M243.8 294.1 C243.4 292.2, 243.3 289.4, 243.6 286.2 M244.3 294.3 C243.7 292.1, 243.8 290.2, 244.1 285.9 M244 286 C244.1 283.6, 245.8 285.5, 247.7 284.2 M243.7 286.2 C242.3 285.8, 242.7 284.9, 246.1 282.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M601.7 309.6 C604.7 309.7, 614.6 308.6, 625.2 307.9 M600.5 307.5 C609.7 307, 618.2 307.6, 623.7 308.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M627.3 302.1 C627.9 301.8, 630.9 303.1, 633.8 302.2 C631.8 298.4, 632.9 302.4, 638.8 301.3 C636.7 307.1, 635.2 306.7, 635.7 313.2 C639.3 313.5, 637 317.5, 634.6 316.6 C631.6 313.2, 628.5 314.3, 627 315.1 C622.9 317.4, 627.6 314.8, 626.8 315.5 C622.6 308.4, 623 308.6, 624.7 304.2 C623.2 299.4, 623.1 299.1, 626 305&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M625.3 301.6 C628.2 301.6, 630.2 302.2, 634 301.8 M626.1 302 C628.9 302.1, 631.8 302.1, 633.9 301.9 M634 302 C634 302.3, 635.1 303.4, 635.4 305.6 M632.7 302.3 C637.3 301.2, 635.5 300.7, 633.9 302.6 M636.8 304.1 C636.3 305.9, 636.7 309.5, 635.8 312.1 M636.4 304.1 C636 305.3, 636.2 307.1, 636.4 312.2 M636 312 C636.5 314.9, 635.6 314.8, 634.7 314.7 M635.4 313.8 C637.3 314.5, 637.2 313.9, 634.5 314.3 M633.3 314 C631.5 314, 629.2 314.5, 626.3 313.6 M633.6 313.8 C631.1 314, 627.4 313.8, 625.6 314.4 M626 314 C623.5 316, 625.1 311.4, 625.4 310.9 M625.3 312.1 C625.3 312, 625.9 313.1, 623.8 311.4 M623.9 312.1 C624.4 309.9, 624.7 309.5, 623.9 304.3 M623.8 312.3 C623.7 309.5, 624 307.3, 623.6 304.3 M624 304 C625.3 302, 623.6 300.2, 625.9 303.3 M625.9 302.3 C625.6 304.6, 625.4 300.6, 624.5 302.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;That file stuck with me because it answers a question I&#x27;d never been able to answer: what is &quot;bad code&quot;, actually? &lt;code&gt;local.go&lt;/code&gt; isn&#x27;t wrong: it works, and it ships to millions of machines. Yet everyone who touches it pays a tax.&lt;/p&gt;
&lt;p&gt;So I went looking for the answer. I read three books on software design cover to cover: John Ousterhout&#x27;s &lt;em&gt;A Philosophy of Software Design&lt;/em&gt;, Steve McConnell&#x27;s &lt;em&gt;Code Complete&lt;/em&gt;, and &lt;em&gt;The Pragmatic Programmer&lt;/em&gt;. Then I opened seven codebases that people point to as good engineering (ripgrep, axum, rust-analyzer, tailscale, redis, SQLite, excalidraw) and looked at how they do it. This post keeps what the books agree on and what the code confirmed.&lt;/p&gt;
&lt;p&gt;There is one enemy. Every good habit below is a way of fighting it.&lt;/p&gt;
&lt;h2 id=&quot;what-is-complexity-exactly&quot;&gt;What is complexity, exactly?&lt;a class=&quot;anchor&quot; href=&quot;#what-is-complexity-exactly&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Managing complexity is the most important technical topic in software development.&quot;&lt;/p&gt;
&lt;p&gt;— Steve McConnell, &lt;em&gt;Code Complete&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ousterhout defines it in one sentence: complexity is &lt;em&gt;anything about the structure of a software system that makes it hard to understand and modify&lt;/em&gt;. Read what it leaves out. It doesn&#x27;t say &quot;lots of code&quot; or &quot;clever algorithms&quot;. It says hard to understand and modify, judged by whoever has to do it next.&lt;/p&gt;
&lt;p&gt;McConnell, writing years earlier, calls managing it &lt;strong&gt;Software&#x27;s Primary Technical Imperative&lt;/strong&gt;. Two very different books land on the same word.&lt;/p&gt;
&lt;p&gt;How do you know it&#x27;s there? It shows up in three ways:&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -29 842 456&quot; width=&quot;842&quot; role=&quot;img&quot; aria-label=&quot;The three symptoms of complexity&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;125&quot; y=&quot;0.0&quot;&gt;change amplification&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;415&quot; y=&quot;0.0&quot;&gt;cognitive load&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;705&quot; y=&quot;0.0&quot;&gt;unknown unknowns&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M76.1 39.6 C105.7 41.2, 127.3 40.4, 173.7 40.3 C174.5 37.7, 177.6 41.2, 182.4 45.1 C180.4 52.7, 180.6 62.6, 179.2 79.4 C182.1 84.9, 175.1 80.4, 170.9 84.6 C138.1 80.7, 100.3 85, 78.2 83.1 C71.9 81.7, 70.9 80.7, 71.4 75.6 C67.8 68.5, 70.6 58.9, 68.8 45.5 C71.3 42.2, 73.7 38.2, 76.6 41&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M76.3 39.7 C107 37.7, 140.5 40.9, 174.4 41.9 M77.1 40.3 C106.2 39.4, 135.8 39.5, 173.1 39.2 M172.7 40 C177.3 39.4, 178.3 42.8, 180.1 45.8 M174 40.1 C178.4 40, 179.8 41.4, 181 46.6 M179.5 48.3 C180.9 57.4, 178.3 70.5, 179.1 75.3 M179.8 48.3 C180 58.2, 180.5 69.5, 179 76.4 M180 76.7 C180.8 83.3, 176.5 83.9, 173.8 84.4 M178.2 76.1 C180.6 79.8, 178.1 81.8, 174.2 82.7 M173.5 82.1 C142.7 83.8, 112.2 85.2, 78.9 85 M173 84.2 C142.5 85.2, 111.6 83.7, 77.7 83.8 M77.3 84 C70.7 83.2, 68.9 82.4, 69.7 78.2 M75.8 83.5 C72.9 82.7, 70.5 79.7, 69.7 74.8 M71.5 74.9 C71.4 67.4, 68.4 58.5, 69.8 47.2 M69.4 76.7 C69 67.3, 70.2 57.2, 69.1 46.4 M70 47.3 C70.4 44.4, 71.7 39, 78.9 40 M68.7 46.7 C69.5 41.7, 74.7 42, 75.8 41.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;125&quot; y=&quot;62.0&quot;&gt;one change&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M3.7 199 C12.4 197.7, 23.3 203.2, 29.1 202.3 C37.1 201.4, 36.2 205.5, 39.6 204.1 C34.7 214.8, 37.3 222.4, 39.1 236.1 C38.1 238.3, 35.8 242.3, 29.9 242.4 C22.9 237.7, 17.9 240, 5 238.1 C-1.3 240.1, 1.1 237.8, -1 236.8 C-1.5 222.6, 3.3 211.8, 1.6 205.1 C-3.4 200.2, 1.3 200.1, 2.5 197.6&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M7.5 200.4 C10.9 198.2, 19.9 200.9, 32 198.5 M5 199.5 C15.8 200.6, 24.9 200.6, 30.6 200.3 M30 200 C35 198.3, 34.2 202, 36.9 204.3 M28.4 201.6 C35.1 198.6, 34.2 204, 35.4 204.2 M36 207.1 C37.5 217.3, 35.4 226.2, 34.3 234.7 M35.6 206.7 C36.7 213.8, 35.3 221, 36.2 234.2 M36 234 C36.7 239.7, 35.6 239, 28.4 241.8 M37.4 234.4 C34 237.9, 35.3 238.6, 31.8 238.3 M28.2 239.5 C24.5 238.3, 21.3 240, 5.4 239.5 M29.4 240.5 C23.5 240.5, 16.5 239.6, 5.1 239.3 M6 240 C2.8 239.2, -1 237.6, -0.9 232.2 M6.7 238.4 C2.1 241.2, -1.9 236.1, -0.7 235.6 M-0.9 232.3 C1.4 221.7, 0.5 212.8, -0.4 204.9 M0.8 233.5 C-0.4 224.6, 0.2 215.2, -0.2 205.5 M0 206 C0.5 202.3, 3.3 199.4, 5.1 200.5 M-0.5 206.9 C-1.2 203.2, 2.5 201.8, 6.7 199.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M105.5 87.9 C81.9 127, 54.7 165.3, 36 196.4 M107.7 89.9 C86.3 118.3, 67.1 147.1, 35.2 195.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M46.2 187.3 C43.6 189.9, 38.8 191.7, 35.7 196 M47.7 188.7 C43 189.9, 40.3 191.3, 35.1 195.4 M35 195.6 C36.3 189, 36.3 186.6, 37.5 181.6 M34.5 194.5 C34.9 191.5, 36.3 188.5, 36.3 181.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M51.1 201.2 C59.6 201.8, 70 201, 72.5 196.9 C74 202, 75.4 202, 79.1 205.8 C79.4 212.9, 77.9 216.2, 76.5 232.4 C75.7 237.2, 74 239.8, 70.6 238.8 C68.3 241.7, 59.6 242, 44.5 237.6 C41.4 240.8, 41.7 236.6, 43.8 233.6 C44.2 222.8, 44.5 211.8, 42.5 209.5 C39.6 202.9, 42.4 200.9, 44.8 202.8&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M49.8 201.6 C56.7 201.4, 65.3 198.6, 71.2 201 M48.6 200.1 C57 200.3, 65.9 199.5, 71.1 200.3 M72 200 C77.2 201.8, 77.8 200, 79.7 204.7 M70.9 199.4 C76.2 199.2, 79.3 201.6, 76 207.7 M79.2 205.3 C76.2 215.8, 78.8 223.8, 76.1 234.7 M78 206.9 C78.7 212.3, 78.8 218.4, 77.5 233 M78 234 C77.2 239.9, 74.6 241.9, 72 239.8 M76.2 234.8 C76.9 235.9, 76.5 241.3, 72.9 239.4 M73.4 239.6 C67.6 242, 62.2 239.4, 47.6 241.4 M71.1 239.2 C66.4 240.5, 61 239.7, 48.1 240.7 M48 240 C42.9 241.2, 42 239.1, 42.5 232.2 M46.7 240.3 C44.4 240.4, 43.3 238.1, 42.2 235 M41.3 233.2 C41.4 225.6, 43 220.5, 41.7 206.7 M41.6 234.6 C43.1 228.9, 42.2 221.3, 41.1 206.2 M42 206 C40.9 201.4, 45.6 200.6, 46.8 200.7 M42.8 205.9 C40.6 203.9, 45 201.7, 48.4 200.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M113.6 88.2 C100.2 127.7, 80.8 166.3, 70.4 196.1 M114.4 88.9 C105.6 111.5, 95.8 132.6, 70.9 193.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M80.9 184.2 C78.3 188, 72.1 191.2, 70.5 195.6 M81.4 184.7 C79.1 187.4, 76.2 189.2, 70.8 193.9 M70.1 194.7 C70.9 190.2, 69.2 187.9, 69 179.6 M70.4 194.2 C70.5 190.8, 69.4 186.5, 69.9 180.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M91.2 203.4 C94.8 198.8, 107.2 198.7, 115.8 198.7 C118.1 202.5, 121.7 198.6, 118.7 207.5 C116.9 216.6, 118.4 228.4, 121.1 235.9 C120.6 236.2, 119.5 237.4, 111.2 242.4 C106.4 237.6, 101.2 243.2, 91.1 237.1 C84.1 241.6, 82.3 235.5, 81.5 237.6 C82.6 223, 85.8 211.8, 83.3 206.7 C82.5 205.6, 83.5 201.6, 87.1 200.8&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M88.1 198.7 C93.6 200.7, 101.1 200.2, 114.5 199.5 M90.2 200.7 C95.3 200, 99.3 200.4, 113.7 200.4 M114 200 C119.3 201.2, 121.3 202.1, 118.5 205.2 M113.3 201.2 C117.3 199.7, 119.8 203.8, 121.2 206.5 M118.4 207.5 C118.8 214.4, 118.2 221.4, 121.8 234.8 M120.4 205.1 C120.2 216.4, 119.8 227.1, 120.9 233.8 M120 234 C121.7 236.2, 117.5 240.8, 115.6 241.8 M119.1 235.2 C119.7 238.5, 117.7 239.3, 113.9 240.4 M114.7 239.7 C106.7 241.3, 103 238.3, 89.9 239.3 M114.7 240 C104.4 241, 96 240.2, 89.1 240 M90 240 C87 239.2, 84.9 236.7, 85.9 232.1 M90.6 238.3 C86.7 239.7, 83.8 240.1, 85.2 234.4 M83.5 234.1 C85.9 223.9, 82.2 216.9, 83.9 204.6 M84.4 233.6 C84.5 225.6, 84.1 218.3, 84.4 205 M84 206 C85.2 200.5, 87.9 201.8, 88.5 200.8 M82.1 204.9 C82.4 200, 87.5 201.6, 90.1 202.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M122 88.4 C116.5 128.1, 108.6 167.1, 104.5 192.1 M121.4 89.7 C115.7 124.8, 111.8 157.3, 106.1 194&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M114.4 181.4 C111.9 186.4, 107.4 190.8, 104.9 192.7 M114 182.3 C110.8 186.8, 109 189.6, 106 194 M104.9 194 C105.2 189, 104.4 184.3, 102.5 181.3 M106 194.1 C103.6 189.1, 102.4 185.3, 101.2 181&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M129.7 202.9 C138.8 198.1, 142.2 202.7, 154.9 197.4 C158.6 201, 165.1 200.7, 165.3 204.3 C163.3 218.2, 159.1 228.3, 163.4 232 C165.5 237, 157 242.4, 154.8 238.7 C147.6 243.4, 139.7 240, 130.4 237.3 C127.2 242.1, 126.4 235.4, 127.3 232.3 C126.4 227.9, 122.3 216.9, 124.6 206.4 C127 202.4, 129.2 200.1, 131.4 203.2&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M130.1 201.2 C138 199.6, 145.3 200.4, 155.8 200.5 M132.3 200.1 C140 200.8, 148.5 200.6, 155.4 199.1 M156 200 C159.9 200.7, 160.2 203.4, 160.8 207.7 M157.9 200.4 C161.6 199.2, 160.3 202.2, 161.2 204.6 M163.1 205.1 C162.4 213.8, 163.3 219.7, 160 234.3 M161.6 205.9 C161.4 217.9, 162.4 228.9, 161.6 234.8 M162 234 C163.4 236.7, 159.4 241, 156.2 238.1 M162.5 234.6 C160.6 237.8, 159.2 239.2, 157.4 237.9 M157.6 241.6 C147.5 240.2, 140.4 239.8, 130.1 238.1 M155.2 240.9 C147.3 240, 137.8 240.7, 132.1 240.2 M132 240 C126.7 241.1, 125.7 236.6, 124.5 232.7 M131.9 240.4 C126.1 239, 127.6 237.8, 128.1 234.7 M126.8 235.7 C126.7 224.8, 126.3 215, 126.5 207.2 M125.3 233 C126.1 225.7, 125.1 216.5, 126.8 205.5 M126 206 C125.5 202.2, 128.4 199.3, 131.5 199.6 M124.4 207.9 C124.8 201.6, 127.2 198.3, 131.7 197.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M127.3 88.7 C133.3 121.7, 136.2 157.6, 140 195.2 M129.3 89 C131.3 117.4, 134.5 144.8, 141.4 194.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M144.7 179.9 C145.1 184, 142.9 190.3, 140.3 194.8 M146.1 180.2 C144.5 184.5, 143.2 188.2, 141.2 194.1 M140.8 193.2 C139.8 190.7, 137.7 188.4, 133.4 182 M140.9 194.3 C137.8 189.8, 134.7 184.8, 133.9 182.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M177.1 197.9 C186 202.2, 189 200.4, 198.3 199.3 C202.7 201.6, 204.3 204.5, 204.9 206 C201.8 216.3, 207.8 222.1, 200.8 235.5 C203.1 236, 202.4 239.9, 195.5 242.4 C192.9 240.2, 181.3 242, 177 236.8 C169.9 242.9, 167 241.4, 164.9 236.3 C164.9 228.1, 170.7 216.9, 165.5 203.6 C170 205, 170.4 200.8, 173.7 201.2&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M172.5 198.4 C183.7 198.9, 190.7 198, 199.1 199.1 M173.8 200.6 C181.2 200.5, 189.4 199.5, 198 199.2 M198 200 C202 200.1, 203.7 201.4, 203.6 204.2 M196.4 198.2 C202.7 199.7, 205.4 199.7, 201.8 208.1 M202.4 207.3 C205.1 218, 202.7 228.5, 205.8 234.4 M204 206.1 C203.5 216.4, 203.9 226.3, 204.9 233.7 M204 234 C203.9 237, 202.4 239.9, 199.8 240.1 M205.4 235 C203.5 235.7, 200.4 241.8, 198.5 239 M198.8 241.7 C190.6 239.5, 181.3 238.7, 172.3 240.1 M198.8 239.7 C190.2 240.5, 184.4 239.3, 173.2 239.6 M174 240 C170.8 239.1, 168.6 238.2, 167.9 232.6 M175.8 238.4 C168.4 238.3, 168.2 239.8, 166.4 234.2 M169 232.7 C166.6 223.1, 168.8 211.4, 168.6 205.1 M168.1 234.1 C167.6 224.4, 167.1 213.4, 168.1 206.3 M168 206 C169.9 201.3, 170.7 200.5, 173.3 199.7 M167.7 206.9 C166.6 202.3, 169.6 198.3, 173.4 199.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M135.8 88.1 C150.2 121.8, 163.1 154.5, 178 195.9 M136.4 89.1 C149.9 130.9, 165.5 170.2, 176.6 195.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M177.3 179.4 C178.2 184, 177.9 188.1, 177.4 195.4 M177.8 180.1 C176.5 186.4, 176.1 191, 176.5 194.9 M175.6 193.3 C173.6 190.9, 169.2 189.7, 164.7 186 M176.4 195 C174.4 193, 171.6 189.7, 165.9 184.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M217.3 200.1 C221.2 199.2, 226.2 198.2, 241.7 201.1 C246.9 202.1, 243.5 201, 244.4 207.7 C246.5 214.4, 248.4 223.1, 245.4 231.7 C247.9 234.9, 240.7 237.5, 243.3 238.8 C231.1 236.1, 223 236, 216.5 243.5 C212.6 243.6, 207.7 240.3, 209.8 233 C210.5 228.3, 212 216.9, 213.5 208 C212.9 200.5, 211.5 201.6, 216 199.3&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M214.8 199.5 C220.7 198.1, 226.5 199.6, 238.3 201.6 M215.4 199.2 C224.3 200.2, 232.4 200.4, 240.5 199.2 M240 200 C244.2 199.6, 247.2 203.5, 246.4 204.7 M238.9 200 C243.8 200.3, 245.9 201.9, 246.9 207 M245.6 205.5 C247.8 216.6, 246.2 226.2, 247.6 234.4 M246.4 206.3 C245.6 214.9, 245.4 223.7, 246.2 234.5 M246 234 C244.4 237.2, 245.3 238.8, 239.5 238.2 M244.3 235.5 C246.3 238.3, 246.2 239.8, 239.6 240 M240.1 241.8 C229.8 239.2, 222.1 242.1, 214.6 242 M240.5 240.4 C235 240.5, 228.9 239.4, 216.2 239 M216 240 C210.9 241.2, 211.6 239.7, 211.4 232.6 M215.7 240.3 C210.7 242.2, 208.7 237.2, 209.3 233.6 M211.2 233.6 C211.2 227, 212 219, 210.7 206.9 M210.9 233.1 C209 226.7, 209 219.5, 209.4 205 M210 206 C210.3 200.5, 213.1 201.7, 215 199.9 M211 205.9 C208.4 203, 212.1 198.2, 215.1 200.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M143.9 87.3 C163 121.4, 186.1 155.2, 212.4 196.8 M143.2 88.9 C165.8 120.8, 185.3 155.1, 212.2 194.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M210.8 179.9 C209.2 184.7, 210.5 189.3, 212.2 196.2 M210.3 181 C211.2 184.8, 210.5 190.3, 212.1 194.5 M210.6 196.3 C207.7 191.8, 201 189.3, 200.1 187.6 M212.3 194.5 C208.4 192.8, 205.7 191.8, 199.2 187.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M410.2 251.6 C418.3 250.4, 429.3 253.3, 437.2 256.8 C445.1 260.3, 453.5 265.9, 457.7 272.7 C461.9 279.5, 462.9 289.7, 462.5 297.7 C462 305.7, 459.9 314.2, 454.9 320.8 C449.9 327.3, 440.9 333.9, 432.6 336.8 C424.3 339.8, 413.7 340.2, 405.2 338.5 C396.6 336.7, 387.3 332, 381 326.4 C374.8 320.8, 369.5 312.7, 367.5 304.9 C365.6 297.1, 366.3 287.4, 369.4 279.7 C372.5 272, 378.1 263.6, 386.2 258.9 C394.3 254.1, 411.7 252.4, 417.8 251.4 C424 250.5, 423.1 252.4, 423 253.2 M415 251.6 C423.5 250.9, 435.2 253.8, 442.6 258.1 C450.1 262.3, 456.3 269.5, 459.8 276.9 C463.3 284.4, 465.5 295.1, 463.8 302.8 C462.1 310.5, 455.8 317.5, 449.7 323.2 C443.6 328.9, 435.5 334.7, 427.3 337.1 C419.2 339.6, 409.2 340, 400.8 337.9 C392.4 335.8, 382.6 330.8, 377 324.6 C371.4 318.4, 368.1 308.7, 367.3 300.6 C366.5 292.5, 368.3 283.2, 372.2 276.2 C376 269.2, 383.2 262.8, 390.5 258.7 C397.9 254.5, 412.1 252.4, 416.2 251.4 C420.2 250.4, 415 252.1, 414.9 252.6&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M393.4 255 C400.6 251, 410.6 249.9, 419.4 250.9 C428.2 252, 439.2 256.5, 446.2 261.5 C453.3 266.4, 459.2 273.3, 461.7 280.6 C464.1 288, 463.3 297.8, 461 305.7 C458.6 313.7, 453.7 322.9, 447.3 328.3 C441 333.7, 431.4 336.9, 422.9 338.2 C414.3 339.5, 403.8 339.1, 396 336.2 C388.2 333.3, 380.8 327.4, 375.9 320.9 C371 314.4, 367 305.4, 366.7 297.2 C366.3 289.1, 368.4 279.5, 374 272 C379.6 264.5, 394.6 255.6, 400.4 252.2 C406.2 248.8, 408.6 250.7, 409 251.5 M420.7 250.9 C429.4 251.5, 439.5 256.8, 446.4 261.8 C453.4 266.8, 459.7 273.4, 462.3 280.9 C464.9 288.3, 464.2 298.8, 462 306.6 C459.8 314.4, 455.5 322.3, 449.1 327.6 C442.8 333, 432.8 337.5, 423.9 338.8 C415 340, 403.6 338.2, 395.6 335.3 C387.6 332.4, 380.3 327.9, 375.7 321.4 C371 314.9, 368.1 304.5, 367.7 296.3 C367.3 288, 368.6 278.5, 373 271.9 C377.5 265.3, 386.6 260, 394.5 256.7 C402.5 253.4, 416.7 252.9, 421 251.9 C425.3 250.9, 420.5 250.3, 420.5 250.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M362.1 53.2 C395.5 54.6, 426.8 55.8, 467.3 52.4 C466.6 52.3, 469.5 55.5, 474.2 57.4 C470.5 63.3, 474.3 70.3, 469.6 83.3 C467.8 85.9, 469.2 82.6, 467.2 87.6 C434.6 88.1, 400.6 85.7, 366.8 85 C357.5 85.9, 358.4 80.7, 362.2 84.2 C356.5 77.8, 356.5 72.3, 359.7 55.8 C357.9 54.1, 362.6 53.9, 362.5 55.3&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M362.5 53 C388.1 55.4, 413.7 52, 466.8 54.3 M364.7 54.9 C401.1 54.8, 437.1 54.5, 465.1 53.9 M465.7 54 C469.1 52.7, 469.2 55.4, 469.8 59.9 M463.9 55.5 C468.5 55.3, 473 53.7, 471.2 58.8 M471.5 58.6 C470 64.8, 470.6 67.4, 473 78.9 M471.3 58.4 C471.1 65.4, 470.5 73, 471.2 81.4 M471 80.7 C472.5 82.5, 468.9 87.4, 467.4 87.5 M470.6 80.1 C471.9 83.1, 469.1 86.7, 466.6 86.6 M466.1 88 C439.4 87.3, 416.1 87.6, 364.2 86.9 M464.7 86.2 C429.2 85, 393.7 85.8, 365 86.8 M364.3 86 C361.7 84.2, 358.5 84, 358.1 82.2 M363.1 86 C359.9 85.8, 360.6 86.3, 356.9 79 M359 78.8 C360.4 72.7, 359.6 65.2, 357.6 60.3 M359.4 80.6 C358.3 72.4, 358.9 65.4, 359.3 59.3 M359 59.3 C360.6 55.6, 359.8 55.1, 363.4 52.8 M360 59.3 C359.1 57.9, 360.5 52.8, 365 52.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;415&quot; y=&quot;70.0&quot;&gt;x&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M374.4 89.6 C407.3 89.4, 444.4 92.4, 476.6 92.7 C473.9 94.1, 481.6 93, 480.5 98 C481.8 104.3, 480.5 110.2, 482.3 119.9 C482.3 121.9, 476.2 122.5, 475.4 124.1 C448.9 121.6, 430.5 125.6, 374.9 120.6 C366.2 125, 365.1 122.9, 369.1 122 C365.2 117.1, 367.1 112.8, 369.7 96 C364.5 91.7, 371.4 90.5, 372.2 89.2&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M371.2 90.2 C396.9 93.5, 423.7 90.7, 475.4 93.7 M372.7 91.4 C401.8 92.2, 432.1 91.9, 472.8 92.1 M473.7 92 C475.9 93, 478.3 94.6, 478.5 97.5 M475.4 91.9 C476.1 93.2, 478.3 95.3, 481 98.7 M480.7 95.5 C478.8 102.4, 480.6 108.5, 479.4 120.2 M478.5 96.6 C478.6 105.6, 478.3 113, 479.1 119.5 M479 118.7 C479.4 124.1, 476.2 122.7, 472.2 124.9 M477.2 118.6 C479.4 124.3, 478.5 125.7, 472.5 124.9 M475.4 125.7 C437.7 125.6, 405 125.5, 372.8 124.3 M472.7 124.7 C448.5 122.6, 424.7 122.7, 373 123.4 M372.3 124 C366.9 122.6, 366.6 121.8, 368.5 118.4 M371.2 125.6 C368.2 125.2, 365.1 120.9, 367.3 116.8 M367.6 116.9 C365 112.9, 368.5 104.2, 367.9 96 M367.7 119 C365.9 111.4, 366.3 102.6, 367.3 96.9 M367 97.3 C367.7 91.9, 368.7 90.6, 371.1 92 M367.4 98.1 C365.4 95.6, 370.1 90.4, 371.4 91&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;423&quot; y=&quot;108.0&quot;&gt;y&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M360.9 133.2 C386.4 124.7, 404.9 125.1, 464 128.4 C470.2 127.8, 470 132.1, 473.9 138.8 C473.3 140.8, 471 150.9, 474 156 C471.6 159.3, 467.2 163, 465.1 158.6 C425.3 162.9, 390 165.1, 364.8 164.9 C358.2 163.1, 358.3 161.9, 358.6 159 C362.3 147.4, 359 146.3, 359.2 134.5 C358.6 129.1, 362.3 128.8, 366.2 129.8&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M365 129 C400.2 129.4, 438.4 131.5, 465 128.3 M364.1 130 C385.7 129, 408.4 128.5, 466 130.7 M465.7 130 C470.9 129.7, 471.5 130.3, 472.1 134.3 M466.3 131.1 C467 130.9, 470.8 130.9, 470.8 134.6 M472.1 134.8 C473 142.6, 470.4 151, 472.9 157.5 M470.5 135.5 C471.9 139, 470.4 143.5, 471.4 155.8 M471 156.7 C470.8 158.2, 471.2 161, 465.9 160 M471.4 157 C469.4 158.1, 471 161.8, 467.8 160.7 M465.3 163.2 C434.3 161, 405.4 161.8, 363.1 164 M465.8 161.3 C436.2 163.1, 407.8 163.1, 364.5 162.2 M364.3 162 C360.1 162.5, 359.6 160.5, 357.4 157.1 M366.2 163.5 C358.7 162, 360.3 160.1, 357.5 154.9 M358 154.7 C360.6 147.9, 360.6 142, 360.5 135.5 M359.1 157.1 C359.4 152.3, 358.9 147.1, 358.1 136.3 M359 135.3 C357.5 131, 361 131.9, 363.5 130.4 M360.1 136.2 C358.9 132.7, 362.2 129.3, 364.8 131.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;415&quot; y=&quot;146.0&quot;&gt;flag&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M371.3 165.6 C404 167.1, 436.6 171.5, 476.8 166.4 C478.8 169.5, 479.8 167.7, 480.5 171.6 C481.3 177.8, 476.6 184.3, 480.8 191.6 C479.9 196.3, 477.7 199.7, 476.3 198.2 C446.9 199.5, 417.9 197.3, 373.8 198.5 C369.2 201.1, 366.6 201.1, 368.2 197.5 C365.7 185.1, 367.3 180.1, 367.6 174.5 C366.9 172.2, 371.5 167.1, 369.2 169.9&quot; style=&quot;fill:var(--xd-orange)&quot;/&gt;&lt;path d=&quot;M372.3 166.7 C396.7 170, 424.6 166.5, 475.2 167.1 M372.3 168.1 C410.2 166.9, 449.2 167.3, 474 168.4 M473.7 168 C478.1 169, 478.9 167.8, 478.1 175.2 M473.5 169.9 C475.9 170.2, 480.4 168.6, 480.3 171.5 M477.1 172.1 C477.5 181.2, 479.2 185.1, 480 194.6 M478.4 172.5 C479.7 179.1, 478.2 185.4, 479 195.1 M479 194.7 C478.3 199.3, 476 201.9, 475.3 201 M478.2 193.9 C479.5 197.9, 477.8 199, 471.9 198.5 M474.8 201.8 C441.6 199.3, 408.4 199.1, 371.4 198.3 M474.6 200.7 C439.4 198.6, 404.3 199.8, 371.6 199.8 M372.3 200 C370.4 200.8, 367.5 199.8, 368 196.5 M373.3 200.6 C369.6 201, 364.7 196.8, 367.6 192.4 M368.4 196.3 C366.2 185.6, 368.7 177, 365 172.2 M366.9 195.6 C366.6 186.4, 367.5 178.3, 366.8 173.9 M367 173.3 C366.3 170.8, 367.7 169.4, 373 166 M367.9 172.7 C366.7 169.2, 369.3 167.8, 371.7 167.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;423&quot; y=&quot;184.0&quot;&gt;state&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M362.7 206 C404.5 201.3, 445.7 205.6, 463.8 205.5 C468.7 203.7, 470.1 211.3, 473.9 210.6 C471.4 213.3, 471.4 223.4, 472.8 231.4 C470.4 234.9, 471.5 239.2, 463.2 235.9 C448.4 234.4, 426.8 239.5, 362.3 235.5 C360.7 237, 357.3 235.3, 362.4 232.9 C360 225.3, 362.4 217.3, 357.8 213.2 C359.6 205.5, 361.1 206, 363.9 209.3&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M365.7 205.3 C397.8 206.9, 431.5 207.1, 465.2 205.3 M363.7 205.2 C402.4 205.2, 438.8 205.6, 464.9 206.1 M465.7 206 C467.5 204.7, 472.7 209.3, 470.7 212.5 M466.5 207.2 C467.9 206.4, 470 206.2, 472.5 212.6 M471.6 212 C469.6 220.8, 472.3 225.4, 469.1 234.3 M471.6 212.2 C470.5 216.5, 470.4 221, 471 232.3 M471 232.7 C471.1 237.1, 468.6 236.6, 465.3 238.8 M472.6 233.4 C470.1 237.7, 471.3 235.8, 466.2 236.7 M466.1 238 C435.8 235.7, 404.2 235.4, 366 239 M464.8 238.3 C444.9 239, 422.4 239.3, 363.5 238.6 M364.3 238 C359.8 236, 357.4 236.3, 357.4 233.4 M364.2 237.1 C358.5 238.9, 358.2 237.7, 358.6 233.6 M358.3 232.8 C357.2 227.8, 359.7 221.6, 360 212.9 M359.3 232.1 C359.8 227.6, 359.2 223.4, 359.6 210.4 M359 211.3 C359.9 207.8, 360.6 204.8, 363.2 206.3 M359 211.3 C361.1 208, 362.4 206.5, 362.2 207.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;415&quot; y=&quot;222.0&quot;&gt;cache&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M396.1 287.7 C396.8 287.9, 397.7 288.9, 398.4 289.5 C399.1 290, 400.3 290.6, 400.5 291.1 C400.6 291.6, 399.8 292, 399.3 292.7 C398.8 293.3, 398.1 294.6, 397.6 294.8 C397.1 295, 397.3 294.3, 396.4 294 C395.6 293.7, 393.2 293.4, 392.6 292.9 C392 292.4, 392.8 291.5, 392.8 291 C392.9 290.5, 392.3 290.4, 393.1 289.9 C393.9 289.4, 396.8 288.5, 397.4 288.1 C398.1 287.7, 397 287.5, 396.7 287.5 M396.7 287.2 C397.6 286.9, 398.1 288.5, 398.9 289 C399.6 289.5, 401.1 289.3, 401.4 290.1 C401.7 290.9, 401.2 293, 400.8 293.6 C400.4 294.2, 399.6 293.4, 398.8 293.5 C398 293.6, 396.5 294.4, 395.8 294.2 C395.2 294, 395.6 293, 395 292.4 C394.4 291.8, 392.2 291, 392.2 290.6 C392.1 290.1, 393.9 290.3, 394.6 289.8 C395.4 289.4, 396.3 287.9, 396.7 287.8 C397.1 287.6, 396.9 288.9, 396.8 289&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M396.1 288.8 C396.7 288.4, 397.4 287.1, 397.9 287.5 C398.4 287.8, 398.6 290, 399.1 290.8 C399.6 291.5, 401.1 291.2, 400.9 291.9 C400.8 292.6, 399 294.2, 398.1 294.8 C397.2 295.3, 396.3 295.1, 395.8 295.1 C395.2 295.1, 395.1 295.2, 394.7 294.8 C394.4 294.4, 394.1 293.4, 393.8 292.6 C393.5 291.9, 392.5 291, 392.9 290.2 C393.4 289.4, 395.9 288.1, 396.5 287.7 C397.1 287.3, 396.6 287.7, 396.6 287.8 M396.7 289 C397 288.9, 396.8 287.8, 397.3 287.8 C397.8 287.8, 399 288, 399.6 289.1 C400.2 290.1, 401.2 293, 401.1 293.9 C400.9 294.7, 399.8 293.9, 398.8 294.1 C397.7 294.2, 395.5 294.9, 394.6 294.7 C393.8 294.6, 393.8 293.6, 393.5 293.1 C393.2 292.6, 393 292.5, 393 291.8 C393 291.2, 393.3 289.7, 393.5 289.2 C393.8 288.6, 394.1 288.7, 394.7 288.6 C395.4 288.5, 397.1 288.4, 397.4 288.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M434.4 288 C435.2 288.1, 435.6 288.3, 436.1 288.8 C436.5 289.2, 437.1 289.8, 437 290.6 C437 291.5, 436.3 293.1, 435.9 293.6 C435.5 294.2, 435.2 293.8, 434.7 294.2 C434.1 294.5, 433.5 295.8, 432.7 295.5 C431.8 295.3, 429.9 293.6, 429.5 292.8 C429.2 291.9, 430.5 291.1, 430.7 290.6 C430.9 290, 429.9 290, 430.6 289.4 C431.3 288.9, 434.3 287.5, 435 287.3 C435.8 287.1, 435.3 288.1, 435.2 288.4 M431.9 289.1 C432.4 288.6, 432.8 288, 433.7 288.3 C434.6 288.5, 436.5 290.2, 437.2 290.7 C437.8 291.1, 437.7 290.4, 437.4 291 C437.2 291.6, 436.3 293.6, 435.8 294.4 C435.2 295.1, 434.7 295.6, 433.9 295.6 C433.2 295.6, 431.9 295, 431.4 294.4 C430.9 293.7, 431.3 292.5, 431.1 291.7 C431 290.9, 430.1 290.4, 430.4 289.7 C430.8 288.9, 432.8 287.4, 433.3 287.3 C433.7 287.2, 433.1 289, 433.2 289&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M433.3 289.1 C434 289, 434.9 288.4, 435.5 288.6 C436.1 288.9, 436.6 290, 436.7 290.6 C436.8 291.3, 436.4 292.2, 436.3 292.7 C436.3 293.1, 436.9 292.9, 436.4 293.2 C435.9 293.5, 434.1 294.6, 433.1 294.6 C432.1 294.7, 431 294.2, 430.4 293.7 C429.7 293.3, 429.1 292.7, 429.1 292.2 C429.2 291.6, 429.7 291.2, 430.5 290.4 C431.4 289.7, 433.7 288.1, 434.1 287.7 C434.5 287.3, 433.3 287.9, 433.2 287.9 M432.8 287.1 C433.3 287, 434.6 288.3, 435.4 288.9 C436.2 289.4, 437.6 289.6, 437.5 290.5 C437.4 291.4, 435.5 293.8, 434.9 294.4 C434.4 295, 434.7 293.9, 434.3 294.2 C433.8 294.4, 432.8 295.9, 432 295.9 C431.2 295.9, 429.9 295.3, 429.5 294.2 C429.1 293.1, 429.4 290.1, 429.7 289.4 C430 288.7, 430.4 290.2, 431.3 290 C432.2 289.8, 434.7 288, 435.1 287.9 C435.4 287.9, 433.6 289.6, 433.4 289.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M403 322 C412.5 312.5, 417.7 314.7, 427.4 323.2 M403.7 320.3 C409.4 315.5, 420.4 313.5, 424.7 320.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M609.1 58.6 C671.9 58.7, 731.1 58.3, 800.1 60.8 M800 60 C807 60.4, 808.3 63.9, 808.5 71.1 M809.6 69.7 C806.8 133.4, 810.1 200.2, 808.8 269.2 M810 270 C811 275.5, 805 281.8, 799.7 280.7 M800.3 278.6 C730.2 279.1, 660.6 278.5, 608.8 279.7 M610 280 C602.6 278.2, 598.5 276.2, 598.3 271.7 M598.4 269.8 C598.9 195.5, 599 118.9, 601.2 69.9 M600 70 C600.1 64.7, 602.4 58, 610.7 60.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:100px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;720&quot; y=&quot;130.0&quot;&gt;?&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M611.6 152.3 C653.6 147.7, 697.1 146.6, 722.4 148.1 C725.3 149.1, 726.4 151.4, 732.7 159 C731.6 203.6, 729.3 247, 729.9 271.9 C728.3 279.3, 726.6 282.5, 718.1 277 C688 278.1, 652.7 279.9, 607.4 279.2 C602.2 282, 600.9 274.4, 599 272.6 C602.3 233.9, 597.8 191.6, 602.5 160.6 C597.3 154.9, 600.7 152.8, 608 152.9&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M610.3 148.3 C646.4 148.2, 681 148.5, 718.9 151.1 M610 149.6 C648.1 149.7, 687.8 148.5, 719.8 150.5 M720 150 C724.8 150.5, 728.2 152.5, 729.9 161.5 M720 149.7 C727.2 148.4, 730.5 153.4, 729.2 161.2 M731.5 160.1 C730.5 198.5, 729.1 234.2, 728.7 270.4 M729.8 160.6 C729.5 195.5, 731.1 232.6, 730.5 269.3 M730 270 C728.5 277.3, 726.1 279.4, 721.6 280.7 M730.5 268.6 C729.4 278.4, 728.5 280.8, 718.5 280 M719.8 278 C679.2 280.5, 639.3 279.5, 611.1 281.8 M719.1 279.9 C694.3 279.8, 668.3 281.6, 610.9 280.4 M610 280 C605 279.8, 601.1 275.8, 599.5 269 M609.3 280.9 C603.1 278.3, 599.8 276.7, 598.7 271.2 M599.5 269.4 C601.1 247.2, 599.6 225.1, 602 159.8 M600.5 270.4 C600.5 246.6, 601.1 223.2, 600.4 160.6 M600 160 C601.2 151.7, 604.6 151.3, 610.5 150.3 M600.6 158.3 C601 153.6, 601.8 149, 610.8 147.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;705&quot; y=&quot;305.0&quot;&gt;the worst&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;415&quot; y=&quot;400.0&quot;&gt;causes: dependencies · obscurity&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;The three symptoms of complexity: change amplification, cognitive load, and unknown unknowns, which is the worst.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Change amplification.&lt;/strong&gt; A simple change needs edits in many places. You change a colour and touch twelve files.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cognitive load.&lt;/strong&gt; How much you must hold in your head to make a change safely.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Unknown unknowns.&lt;/strong&gt; You can&#x27;t even tell what you need to know. You make the change, it compiles, the tests pass, and something unrelated breaks in production. This is the worst of the three, because nothing warns you.&lt;/p&gt;
&lt;p&gt;It has two causes: &lt;strong&gt;dependencies&lt;/strong&gt; (code that can&#x27;t be understood or changed in isolation) and &lt;strong&gt;obscurity&lt;/strong&gt; (important information that isn&#x27;t obvious).&lt;/p&gt;
&lt;p&gt;Complexity is also incremental. No single shortcut creates it. It&#x27;s a thousand small decisions, each reasonable on its own: one more method on the big type, one more flag, one more special case. That is how you get a 9,287-line file that nobody chose to write.&lt;/p&gt;
&lt;h2 id=&quot;why-should-a-module-be-deep&quot;&gt;Why should a module be deep?&lt;a class=&quot;anchor&quot; href=&quot;#why-should-a-module-be-deep&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;The best modules are those whose interfaces are much simpler than their implementations.&quot;&lt;/p&gt;
&lt;p&gt;— John Ousterhout, &lt;em&gt;A Philosophy of Software Design&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If I could keep only one idea from the books, it would be this: &lt;strong&gt;modules should be deep.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A module (a function, a class, a package, a service) has an &lt;em&gt;interface&lt;/em&gt;, which is everything a caller must know to use it, and an &lt;em&gt;implementation&lt;/em&gt;, which is everything it hides. A deep module gives you a lot of function through a small interface. A shallow module makes you learn almost as much as it saves you.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -16 692 417&quot; width=&quot;692&quot; role=&quot;img&quot; aria-label=&quot;Deep module vs shallow module&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M88.2 -1 C106.4 0.7, 119.9 0.3, 167.9 2.2 C175.1 0.1, 173.4 1.2, 178.6 6.4 C173.4 11.9, 175.1 14.1, 175.2 30.2 C176 30.6, 172.1 38.7, 166.5 34 C145.4 31.6, 129.2 36.3, 90.4 34.2 C86.3 36.4, 83.2 32.3, 85.1 30 C87.4 19.9, 86.5 10.8, 87.9 7.6 C84.9 4.6, 85.9 -2.2, 93.9 1.6&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M91.4 0.8 C114.2 -0.5, 139.4 -0.4, 169.8 -0.6 M91.7 0.2 C120.1 -0.5, 151 -0.8, 168.1 0 M169 0 C171.1 1.8, 174.2 1.5, 174 5.3 M170.1 0.4 C175.1 0.9, 173 1.8, 174.2 5.5 M176.6 4.7 C174.1 14.6, 176.5 18.4, 173.6 28.6 M175.3 6.3 C174.3 11.4, 175.9 15.9, 174.8 29.9 M175 30 C173.8 32.5, 171.6 37.8, 168.2 35.8 M175.2 29.3 C176.6 33.8, 171.7 37.1, 169.2 35.6 M169.7 35.4 C149.2 35.2, 128.2 36.2, 91.3 34.2 M169.5 36.2 C144.5 35.2, 119.8 35.9, 91.2 36.1 M91 36 C88.8 34.7, 85.1 35.6, 86.6 30 M90.3 37.6 C86.3 36.9, 83.8 34.3, 83.8 28.4 M86.1 31.5 C85.9 19.7, 84.1 9.9, 85.6 6.1 M85 30.6 C85 21.3, 84.3 13.4, 85.4 6.3 M85 6 C84.9 3.2, 86.7 0.4, 91.4 -0.5 M86.6 5.1 C84.4 0.4, 86.1 1.7, 89.8 -2.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;130&quot; y=&quot;18.0&quot;&gt;interface&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M10.6 38.6 C59.9 33.8, 111.6 36, 252.8 36.4 C255.6 34.6, 260.2 37.5, 259 48.1 C259.4 103.9, 260.4 163.5, 259.4 306.6 C258.8 312.8, 255.5 314.7, 248.7 319 C163.5 313.8, 74.5 313.2, 11.2 313.3 C2.6 318.3, -0.4 313.3, -1 305.5 C1.9 228.4, 1.9 147.8, 2.8 47.6 C-2.1 36.7, 5.5 33.7, 8.8 36.2&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M8.8 35.4 C63.3 39, 118.6 38.4, 251.6 37.5 M10.5 35.8 C60.8 35.5, 113.2 34.1, 250.3 36.7 M250 36 C258.2 37.4, 258.4 39.5, 260.4 47.6 M251.6 37.4 C257.4 34.5, 259.7 38.4, 259.4 47.4 M261.1 45.7 C259.2 121.8, 259.3 194.8, 260.7 305 M260.4 46.5 C261.8 142.5, 262 239.5, 260.4 305.6 M260 306 C259.8 312.7, 258.6 317.4, 248.5 316.2 M259.9 306.7 C258.2 312.8, 256.8 314.6, 248.9 315.7 M251 317.4 C180.6 316.3, 111 317.4, 8.5 314.7 M249.6 315.7 C200.7 318.5, 149.4 318.2, 10.1 315.8 M10 316 C3.9 316.8, 0.5 312.6, 0.6 304.8 M9.5 317.3 C4.8 316.8, -0.7 311.1, 0.6 306.3 M-0.7 305.2 C-1.6 234.3, -0.1 164.4, -0.6 45.7 M-0.3 305.2 C-0.5 237.5, -0.3 169.9, -0.5 45.5 M0 46 C-0.7 39.2, 2.8 37.7, 10.4 35.6 M0.5 44.3 C-0.2 39.5, 3.7 34.1, 9 34.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;130&quot; y=&quot;176.0&quot;&gt;implementation&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;130&quot; y=&quot;350.0&quot;&gt;deep: Unix files:&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:12.299999999999999px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;130&quot; y=&quot;376.0&quot;&gt;open read write lseek close&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M367 -2.3 C466.7 0.6, 562.3 -1.4, 651.9 0.9 C656.3 0, 663.2 2.3, 657.5 9.6 C663 16, 663.7 23.5, 660.7 34.5 C657.1 40.9, 658.5 39.2, 650.9 38.9 C580.2 44.9, 510.1 44.4, 366.8 38 C365.1 40.9, 360.5 38.1, 359.2 36.5 C357.2 23.1, 359.5 12.2, 362.9 9.6 C357.5 0, 364.7 1.3, 369.6 1&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M365.8 0.5 C455.3 -0.2, 545 0.5, 652.5 -1.3 M366.7 0.3 C447.8 -1.8, 529.3 -2, 653.8 -0.6 M653.3 0 C655.9 -1.4, 660.7 0.4, 658.4 7.1 M655.1 1 C657.8 -0.6, 659.4 2.3, 658 7.4 M658.3 7.7 C657.8 13.7, 660 21, 661.7 32.2 M659.7 7.1 C660.6 15.9, 660.9 24.3, 660.1 34 M660 33.3 C659.7 39.3, 659 39.5, 653.1 39 M659.8 32.4 C660.4 39.5, 658.9 38.9, 651.8 42.1 M652.9 40.3 C539.4 39.9, 428.2 39.8, 365.4 39 M652.7 40.1 C565.5 40.9, 477 40.5, 367.2 39.6 M366.7 40 C361.2 38.6, 361 38.6, 361 32.8 M368.2 41.7 C360.9 39, 361.5 35.6, 361.4 32.4 M358.6 34.1 C360 25.2, 360.9 19.2, 361.9 7.4 M359.3 32.6 C359.3 27.3, 360.6 20, 360.3 6.1 M360 6.7 C358.8 1.8, 362.5 -0.6, 368.6 1.8 M359.1 5.3 C358.8 3, 361.4 -1.6, 367.3 1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;510&quot; y=&quot;20.0&quot;&gt;interface&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M368.8 40.3 C472.7 41.6, 569.7 40.7, 652.5 40.8 C653.6 39.3, 661.3 39.8, 662.6 52.4 C663.2 64, 659.2 78.1, 661.7 88 C658.5 90.6, 657.9 95.3, 653.6 94.7 C584.4 97.7, 512.8 94.2, 368.1 97.6 C365.7 93, 357 95.8, 360.7 84.9 C357.4 76.2, 357.8 67.9, 360.4 49.8 C362.3 40.8, 366.7 38.5, 365.9 40.9&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M369 39.3 C431.8 38.5, 494.7 38.8, 651.7 38.8 M369.6 39.6 C449.1 39.1, 528.7 38.8, 650.1 39.6 M650.7 40 C657.4 39.2, 659.8 42, 660.7 50.2 M650.3 38 C655.1 40.3, 660.3 44.7, 660.7 49.4 M660.7 47.8 C661.6 57.8, 659 68.8, 659.7 85.2 M660.3 50 C660.7 63, 660.4 77.4, 659.3 87 M660 86.7 C659.3 93.6, 658.3 95, 649.6 97.2 M659.2 85.5 C661.6 94.2, 658.3 97.8, 649.1 97.6 M650.3 95.6 C582.9 94.7, 515.8 95.6, 368.6 95.3 M650.6 96.7 C577.2 97.8, 503.9 97.4, 369.3 95.6 M369.3 96 C363 96.8, 358.7 93.3, 358 87 M369.7 94.8 C361.8 93.8, 357.9 90.7, 359.4 86.5 M359.3 86.6 C360.2 73.1, 358.1 61.6, 359.4 48.7 M360 87.5 C360.8 75.2, 361.1 66, 359.9 48.8 M360 49.3 C359.4 41.2, 361.6 40.5, 369.1 39 M362 49.2 C361.7 41.6, 364.7 39.9, 370 39.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;510&quot; y=&quot;68.0&quot;&gt;implementation&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;510&quot; y=&quot;350.0&quot;&gt;shallow: many tiny classes&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;A deep module is a narrow interface over a large implementation; a shallow module is a wide interface over a thin one.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Ousterhout&#x27;s favourite example is the Unix file API. Five calls (&lt;code&gt;open&lt;/code&gt;, &lt;code&gt;read&lt;/code&gt;, &lt;code&gt;write&lt;/code&gt;, &lt;code&gt;lseek&lt;/code&gt;, &lt;code&gt;close&lt;/code&gt;) hide disk blocks, caching, permissions, devices, and file systems you&#x27;ll never think about.&lt;/p&gt;
&lt;p&gt;ripgrep has the same shape. Its &lt;code&gt;Searcher&lt;/code&gt; has a handful of entry points: search a path, a file, a reader, a slice. Behind them it decides on its own whether to memory-map the file, read it whole, or stream it through a rolling buffer. The caller never chooses (ripgrep only logs which strategy it picked), and because the strategy is hidden, ripgrep can change it without touching a single caller.&lt;/p&gt;
&lt;p&gt;The opposite is something I used to think was &lt;em&gt;good&lt;/em&gt; style: splitting everything into tiny functions and tiny classes. Ousterhout calls it &quot;classitis&quot;. Each tiny piece has its own interface to learn, and the pieces only make sense together. You haven&#x27;t removed complexity. You&#x27;ve spread it across more doors.&lt;/p&gt;
&lt;p&gt;Is a long function always a bad one? No. &lt;strong&gt;Length is never, by itself, a reason to split.&lt;/strong&gt; Split when the result is &lt;em&gt;deeper&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id=&quot;what-should-i-hide&quot;&gt;What should I hide?&lt;a class=&quot;anchor&quot; href=&quot;#what-should-i-hide&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;We propose instead that one begins with a list of difficult design decisions or design decisions which are likely to change. Each module is then designed to hide such a decision from the others.&quot;&lt;/p&gt;
&lt;p&gt;— David Parnas, &lt;em&gt;On the Criteria To Be Used in Decomposing Systems into Modules&lt;/em&gt; (1972)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;McConnell asks the best question in either book: &lt;strong&gt;&quot;What should I hide?&quot;&lt;/strong&gt; He says asking it settles a surprising number of hard design decisions.&lt;/p&gt;
&lt;p&gt;Every module should own a few design decisions (a file format, a protocol, an ID scheme, a business rule) and keep them out of its interface. The failure is &lt;strong&gt;information leakage&lt;/strong&gt;: the same decision showing up in two places.&lt;/p&gt;
&lt;p&gt;The common version doesn&#x27;t look like a mistake. You write a &lt;code&gt;Reader&lt;/code&gt; class and a &lt;code&gt;Parser&lt;/code&gt; class, because reading and parsing feel like two steps. But both know the file format. Change the format and you edit both. Ousterhout calls this &lt;strong&gt;temporal decomposition&lt;/strong&gt;: structuring code around the &lt;em&gt;order&lt;/em&gt; things happen in, instead of around what each part knows. The fix is to put everything that knows the format in one place.&lt;/p&gt;
&lt;p&gt;The codebases go further and use the &lt;em&gt;type system&lt;/em&gt; to hide things. In tailscale, a node&#x27;s private key is its own type with a hidden field, and it&#x27;s deliberately impossible to compare with &lt;code&gt;==&lt;/code&gt;. The comment says why:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NodePrivate&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;struct&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;structs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Incomparable&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;// because == isn&#x27;t constant-time&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;byte&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can&#x27;t compare two keys with a timing leak, because the compiler won&#x27;t let you. The rule isn&#x27;t in a style guide that someone has to remember. It&#x27;s &lt;em&gt;in the type&lt;/em&gt;. Almost every codebase I read did this somewhere: the best rules turn a bug into a compile error.&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a class=&quot;footnote-ref&quot; href=&quot;#fn:1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;h2 id=&quot;who-should-pay-for-the-hard-part&quot;&gt;Who should pay for the hard part?&lt;a class=&quot;anchor&quot; href=&quot;#who-should-pay-for-the-hard-part&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;The complexity of software is an essential property, not an accidental one.&quot;&lt;/p&gt;
&lt;p&gt;— Fred Brooks, &lt;em&gt;No Silver Bullet&lt;/em&gt; (1986)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Brooks says the complexity can&#x27;t be removed. So the question is who carries it. The rule feels backwards at first: &lt;strong&gt;a simple interface matters more than a simple implementation.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Why? Because a module is written once and called from many places, so if something is hard, the module should absorb it. If it pushes the hard part onto its callers, by throwing an exception or adding a configuration option, every caller pays, forever.&lt;/p&gt;
&lt;p&gt;redis shows this well. Its hash table sometimes has to grow, which means moving every entry to a bigger table. Doing that all at once would freeze the whole server, so redis does it &lt;em&gt;incrementally&lt;/em&gt;, and each time you look something up or add something the table quietly moves a few more entries as a side effect, rather than stopping the world to do it in one go. Callers just call &lt;code&gt;dictFind&lt;/code&gt; and &lt;code&gt;dictAdd&lt;/code&gt;. They never learn that rehashing exists.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-36 -16 707 422&quot; width=&quot;707&quot; role=&quot;img&quot; aria-label=&quot;redis hides rehashing behind dictFind and dictAdd&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M6.2 -3.3 C48.9 -1.7, 82 1.1, 113.7 2.1 C117 1.2, 117 1.6, 118.6 9.9 C118.3 15.5, 123 28.7, 118.3 38.2 C123.1 39.7, 117.6 41.9, 109.4 41 C76.5 41.8, 38.5 41, 5.2 43.5 C1 43.1, 1.3 38, 3.1 36.5 C-3.4 27, 2.5 14.6, -2.4 5.9 C-2.7 4.4, 5.9 -2.4, 7 0.9&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M8.9 1.7 C48.7 -2.4, 90.4 -1.9, 114.2 0.4 M8 -0.2 C41.3 1.1, 75.6 1.4, 112.1 0.4 M112.7 0 C119.5 0, 120.9 3.5, 118.8 6.5 M112.8 0.7 C119.5 2.2, 117.7 3.6, 120.7 8.4 M120 7.7 C120.4 19, 121.4 28.2, 118.8 36.1 M120.6 7.8 C120.3 18.7, 119.5 30.1, 119.2 36.9 M120 36.7 C118.1 40.2, 115.8 43, 112.3 43.4 M118.9 35.8 C121.8 39.5, 116.1 43, 114.7 42.8 M112.6 43.3 C79.9 45.3, 42.1 42.4, 5.6 44.2 M112.6 44 C79.1 44.9, 46.1 45.2, 8.1 44.6 M7.3 44 C0.7 42.2, 1.1 40.1, -1.2 37.9 M8.7 44.5 C2.7 42.2, 1 39.9, -1.4 38 M0.9 37.9 C0.6 26.7, -1 15.4, -0.1 7.2 M0.4 36.4 C0 27.9, -0.2 19.3, 0.4 6.4 M0 7.3 C0.9 3.6, 2.4 1.1, 8.2 -1.4 M0.4 6.6 C1 2.9, 2.5 0.1, 8 0.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;60&quot; y=&quot;22.0&quot;&gt;caller&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M155.4 3.4 C192.9 3, 233.4 -0.9, 261 -1.4 C267.7 0.4, 267.9 3.8, 272.3 8.6 C271.3 17.4, 266.3 24.2, 270 34 C266.7 44, 267 42.2, 261.5 44.2 C236.9 42.3, 207.1 42.7, 154.4 40.6 C154.4 47.1, 151.3 41, 147.9 34.9 C150.1 27.9, 146.8 16.1, 151.4 4.7 C147.3 0.8, 153.8 -3.2, 154.4 0.7&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M158.5 1.7 C189.7 -0.7, 227.3 1.6, 261.4 0.9 M156.9 0.7 C182.6 1.2, 207.6 1.7, 263.5 0.3 M262.7 0 C268.8 1.5, 271.8 2.1, 269.4 7.2 M262.6 1.5 C269.7 -1.3, 268.5 2.8, 267.9 7.5 M268.8 7 C269.8 19.5, 271.5 29, 272 36.1 M269.3 7 C270.1 14.3, 270.2 21.4, 270.2 36.8 M270 36.7 C268.2 39.6, 266.1 43.4, 261.1 43.2 M271.2 37 C268.7 43.8, 268.9 43.8, 260.7 45.3 M261.5 43.8 C236.4 43.9, 210.5 46.4, 157.7 45.4 M263.2 43.4 C230.3 43.9, 199.5 42.8, 157.2 43.3 M157.3 44 C151.9 44.3, 149.5 40.1, 151 37.6 M156.1 45.6 C153.1 46, 148.4 43.1, 149.7 36.6 M148.5 34.9 C148.6 25.5, 148.9 13.5, 150.1 8.4 M150.1 37.2 C151 24.8, 149.5 14.4, 150.8 8.2 M150 7.3 C148.3 3.4, 153 -2, 156.8 -0.4 M151.2 7.8 C148.5 2.7, 154.3 -1.1, 159.4 0.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;210&quot; y=&quot;22.0&quot;&gt;caller&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M304.5 2.8 C344.2 0.5, 384.8 -3, 415.6 2.4 C418.3 -0.3, 418.7 5.9, 418.8 7.3 C417.1 17.9, 416.7 31.3, 421.7 37.1 C417.6 41.2, 416.3 42.6, 413.5 47.5 C376.1 42.8, 340.8 44.4, 310.8 44.9 C300.6 43.9, 301.4 44, 299.9 33.3 C296.5 28.8, 298.2 17.6, 297.9 10.7 C297.3 4.4, 301.6 3.1, 309 0.5&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M308.1 1.8 C334.6 0.9, 360.2 1, 412.6 1.3 M307.9 -0.4 C345 -0.9, 381.8 0, 413 0.2 M412.7 0 C418.1 -1, 418.7 0.6, 420 8 M412.5 -1.7 C415.4 -0.3, 419.3 2.1, 419.7 6.5 M421.5 6.4 C419.2 14.2, 421.6 21.9, 421.1 36.1 M419.9 8.2 C420.6 15.7, 419.5 24.4, 419.2 36.8 M420 36.7 C418.4 43, 416.4 43.9, 414 43.1 M419.6 38.3 C420.3 43.5, 417.2 44.7, 411.2 43.2 M414.4 44.2 C371.8 44.4, 332.7 44.4, 305.8 42.5 M411.7 44.8 C381.5 45, 351 44.6, 308.3 44.1 M307.3 44 C303.2 42.4, 302 40.1, 299.2 37.4 M307.6 42.6 C303.4 45.3, 300.4 41.7, 300.8 35.2 M300.2 35.9 C300.7 30.3, 298.8 23.3, 300.3 5.5 M299.8 36 C300 29.5, 301.2 21.2, 299.3 8 M300 7.3 C299.6 3.2, 303.7 -1.1, 305.5 0.5 M298 9 C300.6 2.5, 301.4 -2.2, 306.3 0&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;360&quot; y=&quot;22.0&quot;&gt;caller&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M-10.3 169.2 C92.9 170.7, 192.9 169.8, 470.3 169.4 C476.1 173.6, 482.4 175.7, 478.6 178.8 C480.4 252.4, 483.4 319.5, 480.7 380.3 C482.6 386.1, 476.2 387.7, 467.3 392.8 C371 392.5, 273.6 392.4, -10.8 390.2 C-16.6 391, -18.8 388.5, -21.2 378.9 C-26.2 322.7, -26.3 264.6, -20.4 176.9 C-22.2 172.9, -14.5 172.1, -12.1 169&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M-10.1 170.6 C129.2 171.6, 267.8 170.6, 470.3 170.8 M-9.9 170 C111.4 171.3, 233.4 171.1, 469.9 169.6 M470 170 C477.1 170.6, 481.1 174.1, 478.6 181 M470.5 168.3 C476.1 171.7, 481.5 172.5, 480.7 181.1 M480.2 178.5 C478.4 221.9, 478.5 262.2, 480.6 380 M480 180.3 C478.9 228, 479.5 277, 479.6 380.6 M480 380 C479.4 385.7, 478.6 388.7, 468.1 389.5 M480.7 378.2 C479.4 386.7, 476.7 390.3, 470.9 390.2 M469.4 390.8 C286.1 392.4, 104.5 391.8, -10 389.5 M470 389.8 C349.7 388.2, 228.6 388.4, -9.8 389.9 M-10 390 C-17.3 389.7, -18.7 384.9, -18.7 380.7 M-8.7 388.7 C-16.1 390.3, -22 388.1, -20.5 378.3 M-19.3 378.5 C-20.8 323.7, -20.9 270.5, -21.2 178.6 M-19.5 379.4 C-18.4 324.6, -19.5 269, -20.2 180.9 M-20 180 C-20.3 172.4, -17.5 169.1, -11.1 171.5 M-21.2 179 C-20.3 174.2, -18.9 170.1, -7.9 169&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;40&quot; y=&quot;192.0&quot;&gt;dict (redis)&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;226&quot; y=&quot;107.4&quot;&gt;dictFind /&lt;/tspan&gt;&lt;tspan x=&quot;226&quot; y=&quot;128.6&quot;&gt;dictAdd&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M60.6 48.3 C59.2 76.3, 60.3 105.9, 58.5 168.6 M60.1 47.5 C59.6 74.6, 60.9 102.8, 60.6 167.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M66.5 155.6 C64 157.5, 63.3 160.5, 59 168.4 M66.1 155 C64.5 157.8, 64 161.2, 60.4 167.9 M58.8 167.2 C58.7 162.2, 56.5 158.7, 54.2 154.9 M60.3 167.4 C58.4 164.1, 55.7 158.5, 54.2 154.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M211.2 48.2 C208.4 78.3, 210.1 106.3, 209.9 166.8 M211 48.7 C210.1 82.3, 210.4 118.2, 209.6 168.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M216.9 155.5 C214 158.9, 213.6 160.7, 209.9 167.2 M216.8 155.9 C214.5 158.7, 213 163.2, 209.8 168.1 M210 167.1 C209.3 163, 205.6 159.6, 205 154.2 M210.4 167.6 C208 164, 207 160.4, 203.9 154.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M361.8 48.1 C360.1 76.4, 362.2 106.7, 361.3 169 M359.9 47.9 C360.7 89.9, 360 131.6, 360.7 168.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M367.3 155.4 C364.2 157.5, 364.2 160.9, 360.9 168.7 M366 155.3 C364.6 159.6, 362 163.6, 360.5 168.4 M361.1 166.9 C359.6 163.9, 357.2 160.4, 353 156.4 M360.6 167.7 C357.5 162.6, 355.6 157.2, 353.6 154.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;80&quot; y=&quot;224.0&quot;&gt;old&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;340&quot; y=&quot;224.0&quot;&gt;new&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M25.8 242.8 C35.5 241.5, 36.6 247, 54 246.6 C55.2 247.3, 57.9 246, 57.5 250.8 C58.5 262.5, 62.2 269.2, 60.5 275.5 C59.7 283, 56.3 282.5, 56.8 285.5 C41.3 286.2, 33.1 283.3, 23.5 281.4 C21.3 284.9, 17.2 283.2, 18.6 279.2 C17.8 271.1, 18.2 265.9, 19.7 247.5 C19.4 249.5, 19.2 243, 23.7 245.5&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M25.5 245.4 C33.2 245.9, 42.4 245.3, 52 243.7 M27 243.6 C35.3 244, 46.1 243.3, 54 243.6 M53.3 244 C57 243.7, 59.1 248.1, 61.5 249 M52.3 244.3 C57.1 245.4, 59 246.4, 58.7 250.7 M60.7 249.7 C58.4 260.7, 60.9 268.3, 59.3 277.5 M59.4 250.1 C60.9 256.9, 60.1 265.8, 60.3 278.3 M60 277.3 C59.6 283.3, 59.2 283, 53.7 282.3 M58.5 277.9 C58.1 279.8, 59.3 282.1, 51.6 282.3 M54.5 285.1 C45.4 283.5, 38.4 284.1, 26.5 285 M53.6 284.4 C47.5 284.1, 40.6 284.6, 27.6 283.2 M26.7 284 C22.4 285.1, 21.2 280.5, 19.2 278.7 M28 282.9 C21 284.6, 20.1 279.9, 19 275.6 M19.2 276 C19.1 271.5, 18.8 261.5, 20.6 252.4 M19.1 277.3 C20.6 268, 20 258.6, 19.7 250.6 M20 250.7 C21 247.4, 23.5 245.8, 24.9 245.6 M19.6 250.6 C18.9 246, 20 244.4, 27.2 245.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M63.4 241.7 C70.3 240.7, 78.9 245.7, 96.8 240.7 C99.2 243.3, 99.9 249.4, 99.9 247.5 C97.7 260.3, 100.4 270.5, 96.7 275.2 C99 283.7, 98.8 280.6, 91.3 281.2 C79.6 281.1, 73 283.3, 63.5 282.7 C63.6 286.8, 60.1 282.4, 59.9 273.9 C62.2 269, 59.2 255.2, 62.3 253.2 C57.6 244.5, 60.5 240.7, 69 242.6&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M66.1 245.3 C73.3 244.2, 83 245.9, 93.4 245.9 M65.9 244.8 C72.3 244.2, 78.4 243.8, 93 243.9 M93.3 244 C97.1 245.4, 98.9 248.2, 100.3 250.4 M92.5 245.8 C96 243.6, 100.7 247.9, 97.7 251.9 M101.4 250.1 C98.2 260.5, 100.8 271.3, 101.5 276.8 M99.4 251 C100.4 256.6, 100.8 260.7, 99.9 276.9 M100 277.3 C100.2 281.7, 98.5 284.6, 93.2 283.4 M98.7 278.4 C100.6 284, 96.2 283.4, 93.7 285.7 M94.9 285.7 C88.7 283.5, 82.4 283.5, 66.4 282.9 M94.3 284 C85.8 284.4, 77.9 284, 66.5 284.9 M66.7 284 C61.6 282.5, 60.4 282.2, 61.9 276.2 M68.6 284.9 C63.9 285.4, 58.9 283.4, 62 278 M58.9 277.4 C61.3 267.9, 58.7 260.9, 59.2 250.5 M59.3 277 C60.1 268, 60 258.7, 59.7 251.1 M60 250.7 C60.7 247.1, 60.3 245.9, 66.4 243.4 M59.7 250.5 C59.4 244.8, 62.9 245.5, 68.5 245.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M108.2 240.6 C112.4 247.1, 121.1 244.5, 132.4 242 C135.9 246.5, 142 245.7, 142.3 251.4 C136.9 258.2, 138.5 271.8, 140.1 274.8 C138.4 284.5, 141.2 285.9, 133 284.1 C130.3 282.1, 123.6 282.4, 103.4 283.9 C98.8 281.5, 103.1 281.6, 101.2 275.7 C100.3 272.2, 101.1 262.3, 97.7 251.6 C102.9 246.6, 101.8 245.6, 107.2 246.8&quot; style=&quot;fill:var(--xd-orange)&quot;/&gt;&lt;path d=&quot;M106.7 245.1 C113.4 245.9, 119.6 241.9, 134.8 244.1 M106.7 244 C114.5 244.3, 121.4 244.2, 134 244.2 M133.3 244 C137.3 243, 138.6 244.2, 139.2 251.7 M132.6 243.3 C139.5 241.7, 137.9 244.9, 141.3 248.6 M138 250.6 C137.9 260.4, 140.7 270.2, 139.7 276.2 M139.4 249.9 C139.9 259.6, 139.4 268.3, 139.6 277.4 M140 277.3 C140.7 280, 137.9 282.1, 132.7 284.5 M139 279 C138.4 283.7, 137.6 284.6, 131.2 284.6 M135.2 282.3 C122.8 283.6, 115.7 283, 106.3 284.8 M133 283.7 C124 284.2, 113.2 284.8, 107.4 284.5 M106.7 284 C100.9 283.9, 99.6 280, 100.6 277.7 M105.3 282.9 C102.3 286.2, 97.7 282.3, 100.4 275.9 M98.5 278.8 C99.9 268.3, 99.1 260.2, 101.9 252.6 M99.4 276.8 C100.1 267.9, 100.6 256.8, 99.6 251.5 M100 250.7 C100.4 246.8, 101 245.9, 107.9 245.2 M99.8 250.4 C99.9 248.3, 101.2 242, 105.2 245.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M145.7 246.7 C154.5 247.2, 163.4 244.2, 175.3 243.3 C179.9 242.5, 176.9 249.1, 177.5 248.2 C182.4 256, 182.9 265.9, 183.5 274.5 C177.7 285.3, 176.5 284, 174.7 287 C168.6 283.2, 163.5 281.4, 143.4 285.2 C141.2 283.4, 138.8 280.9, 142.5 277.6 C138.5 268.2, 143.1 262.3, 140.2 250 C141 248.8, 143.1 243.3, 145.3 243.8&quot; style=&quot;fill:var(--xd-orange)&quot;/&gt;&lt;path d=&quot;M147.3 245 C153.5 244.1, 160.3 242.5, 172.2 242.2 M147.6 243.2 C156.8 244.9, 164.4 243.2, 173 244.6 M173.3 244 C177.4 244.7, 178.4 244.3, 178 249.1 M172.8 244.9 C178.5 244.5, 179.6 246.5, 180.3 249.9 M178.7 251.1 C181.7 254.9, 180.6 262.5, 181.8 275.5 M179.5 250.8 C179.9 257.2, 180.6 265.2, 179.2 278 M180 277.3 C181.3 282.4, 177.2 283.6, 172.2 285.6 M179.2 275.6 C180.8 283.3, 179.1 285.9, 173.3 283.4 M171.6 282.9 C166.2 283.7, 159.7 282.4, 146.2 282.7 M173.6 283.3 C167.6 284, 159.2 283.7, 146.4 284.1 M146.7 284 C144.1 285.2, 138.8 281.7, 139.3 279.2 M145.9 284.9 C140.7 282.4, 141.2 281.1, 138.8 278.3 M138.2 276.1 C138.6 268.7, 139.6 259.6, 140.5 250.7 M139.5 276.5 C140.2 267.9, 139.2 257, 139.6 250 M140 250.7 C140.1 246.4, 141.8 245.9, 145.4 243 M139.9 250.4 C140.5 247.1, 144.1 243.1, 146.6 245.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M233.3 245.6 C246.6 246.3, 255.6 243, 260.9 244.6 C266.6 245.7, 269 245.4, 269.9 252.1 C271.5 261, 271 267.2, 269.7 274.1 C267 278.9, 268.9 282.1, 266.4 282.6 C256.8 284.2, 253.4 280.4, 233.4 286.4 C233.6 285.3, 231.7 280.1, 226.7 279.4 C232.9 271.4, 226.8 269.4, 232.8 248.5 C229.1 243.7, 234.4 241, 233.4 240.9&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M237.8 244.9 C243.6 241.8, 250.9 242.5, 263.6 244.4 M236.5 244.4 C241.7 245.1, 248.7 243.7, 264 244.9 M263.3 244 C267.6 242.3, 268.2 244.4, 270.9 250.5 M262.9 242.4 C267.4 242.7, 271.4 248, 269.3 251.1 M269.4 251.5 C271.5 258.7, 270.5 261.4, 270 278.8 M269.5 249.7 C269.4 262.2, 269.3 272.7, 270.9 276.5 M270 277.3 C271.8 280.8, 266.6 285.1, 261.7 282.6 M269.4 276.2 C268.7 282.9, 266 282.5, 265.4 282.3 M261.9 283.5 C259.5 283.8, 253.6 281.9, 236.1 284.6 M264.3 284.9 C253.9 284.3, 246.5 285, 237.3 283.8 M236.7 284 C233.3 282.6, 228.1 283.4, 232 276.7 M236.5 282.9 C233.6 283.2, 230 280, 231.8 276.1 M231.9 277.5 C231.3 269.1, 230 258.9, 229.1 248.8 M229.6 278.2 C230.2 267.8, 229.8 257.1, 229.5 250.5 M230 250.7 C229.8 246.1, 232.6 246, 236.9 244.8 M230 250.3 C231 245.9, 232.4 244.2, 237.9 246&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M278.1 244.5 C283.3 245.5, 287.2 241.7, 303.7 245.9 C310.6 241.7, 311.1 248.8, 312.3 248.8 C310.7 258.8, 309.1 268.5, 313 273.7 C313.5 279.7, 304.2 287.4, 300.9 285.5 C295 286.3, 286.1 287.6, 273.4 280.5 C268.8 287.2, 267.4 279.3, 268 274.1 C271 269.3, 268.8 258.7, 268.2 254.1 C267.3 245.9, 275.7 245.9, 278.8 245.1&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M278.4 244.8 C283.7 244.1, 291.6 243, 305 242.5 M277.4 243.6 C284 243.2, 291.6 244.2, 303 243.3 M303.3 244 C307.7 243.9, 311.9 244.4, 309.7 251.8 M303 243.9 C306.3 245.4, 308.5 245, 308.3 252.4 M310.1 252 C311.2 258.6, 310.4 264.3, 308.2 278.2 M309.5 250.6 C310.9 259.8, 310 267.6, 310.5 277 M310 277.3 C308.4 283.1, 305.9 282.7, 305.2 283.7 M309.6 276.8 C311.1 282.5, 307.4 283.8, 302.9 285.7 M302.3 284.1 C293.6 284.4, 283 285.9, 276 282.5 M303 284.6 C292.1 284.1, 281.9 283.8, 276.2 283.4 M276.7 284 C272.6 283.9, 271.3 281.1, 270.7 278.2 M277.1 284.9 C272 284, 268.8 283.4, 270.2 278.6 M271.5 278.9 C269.4 269.5, 269.9 258.3, 271.8 250.9 M269.7 278 C270.2 265.8, 270.3 255.2, 269.5 251 M270 250.7 C269.5 245.8, 273.4 246, 278.3 242.6 M270.1 250.2 C271.6 244.8, 270.8 245.3, 274.6 246.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M315.7 243.4 C325.4 244.7, 329.5 247.7, 346.5 247.2 C347.3 244.9, 353.1 245.1, 347.6 252.8 C349.9 256.6, 347.3 262.6, 349.2 280.6 C352.8 280.4, 346.6 285.5, 342.6 281.2 C333.2 287.3, 326 286.7, 313.4 281.7 C311.1 281.9, 310.4 278.5, 309.3 275.9 C309.2 272.6, 310.7 258.7, 310.8 252.5 C312.6 248.1, 309.8 243.7, 316.9 242.1&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M315 244.7 C323.8 242.3, 332.2 243.6, 342.4 244.7 M316.3 244.8 C326.3 243.3, 334.6 244.6, 344 243.6 M343.3 244 C347.8 245.6, 351.7 244.5, 348.6 249.2 M343.2 245.4 C349.8 243.6, 350.2 246.6, 351.9 249.1 M350.7 252.5 C351 258.4, 350.3 267.3, 350.4 277.5 M349.5 251.5 C350.4 257.5, 350.6 264.5, 350.2 277.6 M350 277.3 C348.9 281.5, 349.3 284.2, 344.7 284.8 M349.8 277.4 C348.9 282.1, 348.9 285, 345 284.5 M342.6 284.7 C337 284.5, 327 285.3, 315.9 284.4 M343.6 284.2 C335.7 284.4, 329.9 283.2, 317.2 283 M316.7 284 C311.8 285.3, 310.5 282.8, 309.4 275.7 M317.7 282.8 C310.4 284.8, 312.2 282.3, 308.6 276.4 M311.2 276.3 C308.1 265.9, 310.4 257.6, 310.4 249 M309.8 277.7 C309.7 271.1, 310.4 266, 309.4 251.4 M310 250.7 C309.2 245.5, 314.1 242, 315.8 244.3 M310.2 250.1 C312.1 248.2, 313.7 241.8, 315.9 246.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M353.3 242.3 C367.5 243.8, 371.7 246.5, 382.1 241.3 C391.3 240.9, 388 248.5, 390 249.5 C389.1 254.5, 392.6 263.9, 392.6 280.2 C392.2 281.2, 389.1 283.6, 384.2 284.1 C371.5 281.2, 365.9 285.7, 353.3 283 C353.5 283.8, 353.3 284.9, 350.6 277.8 C346.4 268.6, 351.7 265.9, 353.3 251 C350.7 243, 351.1 241.4, 355 246.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M355.6 244.5 C363.9 244.1, 372.9 243.6, 383.8 242.9 M357.2 244 C366.6 243.4, 377.6 243.1, 383 243.9 M383.3 244 C388 243.2, 391.5 244.6, 391.4 250.6 M383.3 242.9 C388.7 241.8, 392 248.1, 391 250.4 M391.4 248.9 C390.7 258.2, 390.2 266.2, 388.6 276.9 M389.5 250.4 C389.9 260.5, 389.3 272.1, 389.8 278.1 M390 277.3 C389.5 279.8, 388.6 285.7, 384.2 285.9 M390 278 C391.4 281.7, 385.8 286.2, 382.5 283.4 M383 285.4 C376.3 284.6, 370.9 284.8, 355.8 282.3 M384.3 283.8 C374 284.2, 365.2 284, 356.1 284.6 M356.7 284 C351.1 282.7, 349.7 280.6, 348.1 277.2 M358.3 284.8 C353.3 285.6, 351 281.2, 351.6 278.9 M350.8 277.7 C350.7 266.3, 350.8 257, 349.1 251.1 M349.9 277.4 C349.7 271.1, 348.9 266.1, 349.4 249.9 M350 250.7 C348.9 245.1, 350.9 242, 357.3 242.1 M350.3 250 C348.1 247, 352 242.9, 357.3 246.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M238 281.2 C242.4 283, 254 285.2, 264.9 282.5 C268 284.1, 270.1 284.8, 272.4 293.5 C268.3 299.5, 270.7 305.2, 268.8 319.9 C271.5 322, 264.3 321.7, 265.9 326.9 C256.9 323.2, 245.8 325.7, 233.3 324.3 C228.7 325.6, 229 324.1, 231.9 319.6 C231.8 306.5, 226.4 295.2, 228.7 289.4 C228.9 285.2, 232.4 286.3, 233.2 283.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M236.1 284.4 C244 282.3, 253.5 284.2, 265.2 285 M236.1 283.2 C243.5 284.1, 249.9 284.1, 264 284.3 M263.3 284 C268.1 284.8, 271.2 284.6, 270.3 292 M263.5 284.4 C267.6 284.5, 269.1 285.1, 270 291.6 M268.1 289.4 C269.9 298.1, 269.5 309.1, 270.8 316.2 M269.5 291.3 C269.4 300.1, 269.9 307, 269.5 316.7 M270 317.3 C270 322.2, 268 323.2, 263.7 323 M270.3 318.6 C269.2 321.3, 267.2 322.9, 264.6 322.2 M263.3 326 C254.4 324.7, 244.3 324.3, 235.6 324.2 M263 323.4 C257.5 324.6, 251.2 323.4, 237 324.3 M236.7 324 C230.3 324, 229 322.3, 230.8 318.7 M235 322.8 C231.7 321.8, 229.9 320, 230 316.7 M230.5 319.1 C229.4 312, 231.3 307, 231.7 289.2 M230.1 317.2 C229.8 311, 229.5 304.2, 229.3 290.4 M230 290.7 C228.6 284.8, 231.7 282.1, 234.8 283.9 M230.4 290 C228.6 285.9, 230.3 284, 238.6 281.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M275.2 285.7 C285.2 280.9, 293.8 281.5, 302 282.1 C308.5 282.7, 312.6 288.6, 307.9 293.7 C310.2 298.1, 311 304.7, 311.1 319.2 C310.9 324.8, 307.7 323.1, 299.9 325.4 C295.5 323.5, 294.3 324.6, 280 323 C270.7 324.1, 268.6 321.1, 272.2 317.1 C267.7 307.6, 273.3 305.7, 267.7 290.9 C270.9 289.6, 272.1 286.3, 275.4 282.9&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M276.8 285.8 C286 283.5, 291.7 284.1, 304 284.6 M275.7 283.7 C282.2 284.9, 288.8 284.4, 304.2 283.7 M303.3 284 C307.3 284.9, 310.1 286.1, 309 290.2 M302.5 285.5 C306.6 285.6, 310.7 287.4, 311.1 292 M310.9 291.6 C311.4 298.4, 310.2 301.7, 311 317.5 M309.7 291.2 C310.6 295.7, 310.7 303.4, 309.8 316.8 M310 317.3 C310.2 322, 309.6 324.8, 304.9 322.9 M311 315.7 C312.2 322, 307.3 322.7, 304.7 324.4 M302.9 323.4 C299.3 323.7, 293.3 325.4, 277.2 322.1 M303.5 323.3 C297.8 323.3, 291.6 324.9, 277.5 324.1 M276.7 324 C273.8 326, 268 320.1, 270 315.9 M276.5 322.5 C272.6 325.8, 271.5 322.5, 271.8 315.1 M271.1 317.6 C268.8 310, 269.9 299.5, 269.9 291.6 M270.6 317.4 C269.7 311.5, 269.4 303.5, 270.2 290.9 M270 290.7 C270.1 285.6, 272.7 282.7, 275.5 283.3 M268.5 292.2 C271.4 287.9, 270.1 285.1, 275.6 283.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M320 284.6 C327.3 287.3, 336 287.4, 344.8 283.3 C345.3 285.9, 347.5 284.9, 350.3 290.4 C349.4 301.3, 349.1 309.5, 347.3 318.8 C350.3 318.4, 350.2 321.2, 341.6 321.1 C333.7 324.6, 334.2 323.7, 319.9 324.3 C313 326, 311.6 320.3, 313.5 318.9 C312.1 305.5, 307.1 295, 310.3 289.3 C309 284.6, 313.4 284, 313.5 287.1&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M317.4 285.7 C326.1 285.8, 332.3 284.7, 341.4 282.8 M316.6 284.9 C324.5 283, 331.8 284.8, 343.2 284 M343.3 284 C347.4 282.5, 349.9 286.2, 351.9 291.6 M342.6 283 C350.1 283.8, 347.9 284.4, 350.1 288.7 M351.6 292.1 C351.2 298.2, 350.1 304.6, 349.2 316.9 M349.7 290.1 C350.1 300.7, 349.3 309, 349.4 317.3 M350 317.3 C350.7 320.4, 348.9 322.3, 344.4 324 M351.2 316.3 C350 321.6, 348.7 324, 342.2 323.3 M343.3 324 C333.3 323.8, 326.6 324.8, 317.1 324 M344.2 324.9 C336.1 323.1, 329 323.7, 316.5 323.7 M316.7 324 C313 323.3, 311.2 321.9, 308.7 317.4 M317.1 324.5 C311 322, 310.3 321.4, 310.2 317.6 M310.7 318.9 C311.5 310.4, 310.4 298.8, 308.5 289.7 M310.7 317.2 C309.7 311.4, 310 303.6, 310.2 291.4 M310 290.7 C309.8 285.2, 313.5 282.7, 317 285.1 M308.6 292.1 C311.9 286.8, 313 286.2, 317 283.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M357.5 283.4 C364.1 286.5, 367.6 286.2, 380.5 284.6 C389.2 281.9, 389.6 288.3, 392.7 287.1 C388.6 299.1, 387.2 310.8, 390.7 318.5 C389.6 319.1, 385.4 326.5, 383.3 324 C379.2 325.6, 367 322.7, 359.9 325.5 C355.4 320.7, 347.3 319.5, 347.6 320.8 C350.2 308.7, 349 302.2, 352.8 287.8 C347.1 286.7, 354.7 281.7, 358.9 284.1&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M357.9 285.6 C366.1 283.5, 373 284.7, 382.8 284.9 M357.5 284.1 C366.8 283.1, 374.8 283.3, 384.2 284.4 M383.3 284 C387.5 284.2, 389.7 286.2, 390.7 288.9 M382.8 284.5 C389 281.9, 389.6 285.9, 389.1 290 M388.2 292.5 C390.9 298.1, 390 303.5, 391.4 316.2 M389.7 291 C389.6 298.3, 390 305.9, 389.1 317.8 M390 317.3 C391.3 322.7, 388.3 323.9, 383.9 325.1 M391.4 316.9 C387.9 321.2, 385.6 325.2, 384.3 322.1 M383.6 324.6 C376.7 323.9, 366.6 324.3, 357 325.9 M382.9 324.5 C374.3 323.4, 364.3 325.1, 357.4 323.3 M356.7 324 C352.3 324.7, 350.5 323.6, 351.4 318.9 M357.7 322.5 C353.9 322.8, 349.1 320.2, 348.6 315.4 M350.4 316.3 C350.2 306.8, 350.8 298.2, 351.1 291.8 M350.8 316.9 C349.7 309.4, 350.6 303.7, 350.1 289.9 M350 290.7 C349.5 284.9, 350.3 282.8, 358.5 282.9 M348.7 292 C347.8 285.6, 351.4 282.7, 358.3 283.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M140.2 256.1 C147.5 263.1, 169.4 296.2, 183.9 296.2 C198.3 296.2, 219.9 262.8, 227.1 256.1 M138.8 255.7 C146.1 262.4, 168.7 294.9, 183.4 294.7 C198 294.5, 219.5 261.2, 226.9 254.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M213.9 260.1 C217.8 259.2, 221.5 257.7, 226.6 254.4 M212.4 258.6 C215.1 257.8, 217.8 257.3, 225.9 255.5 M227.3 254.6 C224.6 258.3, 224.5 261.1, 221.3 268.1 M225.9 255.5 C225 259, 222.1 263.8, 220.7 268&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;185&quot; y=&quot;358.0&quot;&gt;moves a few buckets per call&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;540&quot; y=&quot;11.4&quot;&gt;callers never&lt;/tspan&gt;&lt;tspan x=&quot;540&quot; y=&quot;32.6&quot;&gt;see rehashing&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;redis hides incremental rehashing behind dictFind and dictAdd: each call moves a few buckets as a side effect.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Configuration knobs follow the same logic. Every option you add is a decision you push onto someone else. Before adding one, try to compute the value yourself: a timeout from measured latency, a buffer size from available memory. If you must add a knob, give it a sensible default.&lt;/p&gt;
&lt;h2 id=&quot;can-you-make-the-error-impossible&quot;&gt;Can you make the error impossible?&lt;a class=&quot;anchor&quot; href=&quot;#can-you-make-the-error-impossible&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This idea surprised me most.&lt;/p&gt;
&lt;p&gt;We&#x27;re taught to detect and report every error. Ousterhout argues that this produces a flood of exceptions that every caller must handle. Error-handling code is also the code most likely to be wrong, because it rarely runs. He quotes a study that found more than 90% of catastrophic failures in distributed data-intensive systems were caused by incorrect error handling.&lt;sup id=&quot;fnref:2&quot;&gt;&lt;a class=&quot;footnote-ref&quot; href=&quot;#fn:2&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;His fix: before you throw an error, ask whether you can &lt;strong&gt;define the operation so the error can&#x27;t happen&lt;/strong&gt;.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -41 831 397&quot; width=&quot;831&quot; role=&quot;img&quot; aria-label=&quot;Define the error away&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:24px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;350&quot; y=&quot;-10.0&quot;&gt;define the error away&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;130&quot; y=&quot;50.0&quot;&gt;delete x&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M130.6 79.3 C158.4 100.2, 190.7 119.4, 208.9 131.1 M129.9 79.9 C152.8 93.4, 173.9 106.8, 209.3 130.2 M209.8 129 C180.6 148.4, 152.1 167.1, 129.7 179.5 M209.8 130.5 C191 142.5, 171.5 154, 129.4 179 M130 181.2 C106.6 164.2, 79.2 149, 49 129.1 M130.3 180.9 C99.4 161.2, 68.7 143, 50.4 129.3 M51.1 131.3 C75.6 117, 97.5 101.2, 128.8 79.2 M50.1 130.3 C65.9 119.2, 83.1 108.5, 129.6 80.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;130&quot; y=&quot;130.0&quot;&gt;x exists?&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;235&quot; y=&quot;118.0&quot;&gt;no&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M274.3 110.3 C295.6 107.3, 313.3 108, 374.2 107.4 C380.9 105.5, 379.8 110.7, 381.9 112.3 C381 123.7, 376.6 140.1, 382.3 144.3 C377.4 150.6, 377.5 155, 373.1 149.7 C345.8 151.1, 316.3 154.8, 277 155.2 C275.2 154.5, 266.5 149, 268 145.8 C272.4 136.4, 268.2 126.2, 267.6 112.8 C270.2 108.7, 274.6 109.8, 278.2 106.4&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M279.3 108.4 C313.9 107.7, 349.6 109.7, 371.8 106.5 M278.3 107.3 C301.7 107.5, 325 107.3, 373.4 108.1 M372.7 108 C379.3 106.9, 381.6 112.3, 381.8 113.4 M371.5 106.9 C376.5 107.5, 378.6 111.1, 379.8 114.9 M381.7 113.7 C378.6 126.2, 379.6 133.8, 378.6 142.8 M379.7 115.1 C381 121.7, 380.4 130.2, 379.3 144 M380 144.7 C380.6 149, 378.1 152.3, 373.4 152.7 M379.5 143.2 C379.9 150.4, 377.2 154, 372.7 151.7 M373.8 151.6 C354.1 150.9, 332.1 153, 279.1 152.4 M372 151.4 C337.1 151.4, 300.1 152, 277.2 151.1 M277.3 152 C273.7 151.8, 270.4 150.9, 270.6 143.9 M277.4 152.3 C271.2 150, 267.8 151.5, 271.5 145.3 M271.2 145 C270.9 134.4, 269.1 126.5, 268.1 114.3 M269.9 143.8 C269.2 136.9, 271.1 127.3, 269 116.1 M270 115.3 C269.2 110.8, 272.1 108.1, 279.1 107.4 M268.3 113.7 C270.3 110.5, 273.6 107.1, 277.8 107.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;325&quot; y=&quot;130.0&quot;&gt;ERROR&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M5.5 301.8 C54.8 300.2, 101.5 297.6, 143.6 298.1 M6.1 300.4 C55.3 299.7, 106 300.2, 144.1 300.1 M143.3 300 C148.8 300.2, 150.2 300.3, 151.4 306.6 M144.5 298.3 C145.6 301.2, 150.2 303, 150.2 308.7 M150.8 305.8 C150.5 312.9, 148.9 319, 151.9 335.2 M150.1 306.5 C149.5 315.4, 150.8 321.7, 149.1 333.4 M150 333.3 C148.4 337.6, 146.2 341, 143.6 339.2 M149.5 333.3 C149.2 338.6, 150 339.3, 141.5 341.8 M142.8 340.1 C106.4 339.9, 66.3 340.3, 5.8 339.4 M144.3 340.6 C115.8 339.4, 86.7 338.6, 7.6 339.3 M6.7 340 C3.7 342, -0.3 339.1, -1.8 333.3 M8.2 339.9 C1.8 340.5, -2.2 336.4, 0.3 335.5 M1.8 332.9 C-0.6 326.4, -1 318.3, -1.9 305.9 M-0.6 334.3 C-0.4 325.2, -0.2 318.2, 0.2 306.1 M0 306.7 C1.2 304.1, 3.7 299.9, 7.1 299.6 M-0.5 306.4 C-1.8 300.1, 3 300.2, 8.1 300.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;75&quot; y=&quot;320.0&quot;&gt;caller: try/catch&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M165.1 301.9 C207.6 302, 244.3 301.1, 304.9 298.6 M167 299.3 C203.9 299.8, 242.7 300.7, 303.6 300 M303.3 300 C308.1 301.7, 311.1 302.9, 308 307.4 M304.3 299.1 C305.8 302.3, 311 302.3, 312 307.8 M309.5 305.2 C309.9 313.4, 309 319.5, 311.1 335.2 M310.7 305.7 C310 316.7, 310.1 324.4, 310.1 333.3 M310 333.3 C308.6 337, 306.5 341.4, 302.5 339.1 M311.9 334.5 C310.7 338.3, 308.2 340.2, 302.1 339.7 M301.7 340.5 C275.3 342.9, 249.5 340.7, 167.9 340.6 M302.9 340 C250.2 340.7, 196.4 340.5, 166.6 340 M166.7 340 C161 340.1, 158.2 339.1, 160.4 333 M165.7 340.9 C162.1 339.8, 159.8 339.6, 161.4 334.1 M159.5 333.9 C162 325.3, 159.4 320.4, 158.3 307.1 M159.2 333.1 C160.5 324.3, 159.4 313.7, 160.6 305.9 M160 306.7 C158.6 303.9, 160.3 300.8, 165.7 300.5 M160.4 307.6 C160.4 299.9, 160.2 299.1, 164.9 300.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;235&quot; y=&quot;320.0&quot;&gt;caller: try/catch&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M324.7 301.9 C356.5 299.9, 387 300.7, 462.1 299 M326 300.2 C379.9 300, 434.1 301.2, 463.1 299.9 M463.3 300 C467.4 299.2, 472 301.5, 468.6 308.2 M464.2 299.9 C466 298.7, 471.8 301.5, 469.2 306.9 M468.3 308.5 C469.3 313.9, 469.1 324, 470.2 335.2 M469.4 306.9 C469.9 312.6, 470.8 316.4, 469.2 333.3 M470 333.3 C468.7 336.4, 466.7 341.8, 461.4 339 M470.3 331.8 C472.2 338, 466.5 341.1, 462.6 342.2 M464.6 341 C416.9 339.2, 374 338.3, 326 341.8 M463.4 339.4 C411.9 340, 360.7 340.4, 325.7 340.8 M326.7 340 C322.3 338.2, 320.7 339.1, 318.6 332.8 M327.2 341.9 C322.5 339, 321.8 338.2, 317.9 332.8 M321.1 334.9 C320.1 324.2, 319.3 318.6, 318.5 308.2 M320.9 333.9 C319.5 326.7, 319.1 320, 319 307.6 M320 306.7 C320 303.8, 321 301.7, 328.4 301.5 M321.2 304.7 C317.9 304.3, 322 298, 326.4 300.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;395&quot; y=&quot;320.0&quot;&gt;caller: try/catch&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M215.6 128.4 C231.7 131.2, 242.7 131.6, 263.7 128.5 M215.2 129.4 C232 129.7, 248.4 129.2, 263.3 130.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M251.1 122.8 C256.1 126.7, 257.6 128.8, 263.8 128.9 M250.8 123.5 C255.3 126, 259.5 127.8, 263.5 130.1 M263.9 129 C261 132.2, 256 133.6, 252.3 136.2 M264.4 129.8 C260.3 132.3, 256.6 133, 251.1 136.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M291.5 154.2 C238.3 197.1, 181 237.8, 107 296.9 M291.3 156.2 C252.1 184, 214 213.4, 106.3 296.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M120 292.4 C116.8 294.1, 110.9 294, 106.9 296.8 M119.9 294 C116.9 294.3, 114.6 294.8, 106.3 296.7 M107.2 295.2 C108.8 293.4, 110.5 288.8, 111.3 283.4 M106.7 296.3 C108.6 291, 110.6 286.4, 111.9 284&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M311.9 158.7 C286.2 207.3, 262.7 259.3, 246.3 295.4 M312 156.4 C287.5 206.6, 263.7 255.1, 247.9 294.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M257.9 286.7 C252.7 288.3, 249.1 292.2, 246.5 295.2 M257.9 285.1 C254 289.2, 249.8 291.8, 247.6 294.6 M245.7 293.7 C248.4 290.9, 247.8 285.7, 246.8 280.8 M246.4 294.8 C246.4 289.8, 246.7 285.5, 246.9 280.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M335.6 158.7 C351.6 209.4, 371.6 259.5, 386.2 293.4 M336.1 157.8 C348.4 188.9, 358.1 218.7, 385.4 294.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M387.2 281.2 C385.2 286.4, 385.5 291, 386 293.7 M387.5 280.6 C387.3 284, 386 286.8, 385.5 294.6 M385.4 293.3 C383.9 292.9, 378.6 289.1, 376.1 284.2 M385 294.8 C382.7 292, 380.2 289.6, 375.1 284.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M500.8 40.7 C500.4 151.4, 501.7 264.5, 498.6 340.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;700&quot; y=&quot;50.0&quot;&gt;make sure x is gone&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M647.4 98.3 C689 102.8, 727.1 99.2, 752.8 99.6 M649.3 100.3 C683 99.5, 718 99.8, 750.8 99.2 M751.7 100 C755.2 99.2, 759.6 104.5, 759.8 108.5 M750.9 100.1 C755.1 101.1, 759.9 102.7, 760.5 109.8 M761.9 107.4 C760.8 119, 760.3 130.5, 758.6 142.6 M760.4 109.2 C759.3 115.5, 761.1 123.9, 760.6 141.4 M760 141.7 C758.7 148, 757.5 151.6, 751.6 149.3 M759.6 140.4 C757.9 147.7, 757.3 151.9, 753.2 151.4 M750.6 148.2 C717 148.3, 684.3 147.4, 648.6 150.6 M752.3 149.4 C731.1 151, 710.3 149.8, 649.1 149.3 M648.3 150 C644 149.1, 641.6 147, 639 142.2 M647.5 151.2 C640.6 151.4, 640.8 145.2, 638.5 140.7 M639.4 141.5 C641.8 133.5, 642.1 127.2, 638.4 109.5 M639.5 142.2 C639.4 130.5, 640 120.7, 639.1 107.7 M640 108.3 C638.5 103.7, 644.2 99.3, 648.4 100.2 M638.9 108.4 C640.7 102.3, 641.8 100.1, 647.5 98.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;700&quot; y=&quot;115.0&quot;&gt;make sure&lt;/tspan&gt;&lt;tspan x=&quot;700&quot; y=&quot;135.0&quot;&gt;x is gone&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M648.2 230.3 C678.4 230.6, 707 228.4, 749.4 229.6 C755.3 230.8, 763.5 231.8, 759.3 238.2 C760 245.3, 759.4 259.1, 761.2 268.6 C758.9 277.5, 759.5 278.8, 750.6 281.2 C718.3 278.8, 686 279.8, 650.7 282.2 C644.4 280.1, 641.7 275.2, 640.7 274.4 C643.1 266.4, 640.8 257.3, 640.1 236.9 C637.5 229.2, 642.7 228.2, 651 232.6&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M648.1 230.9 C690 229.1, 727.1 230.3, 752.9 230.3 M648.8 230 C682.8 230.3, 715.6 230.6, 751.6 229.2 M751.7 230 C756.9 230.8, 758.9 234, 758.1 238.6 M751.8 230 C759.5 229.3, 759 234.3, 759.4 237.5 M761 236.6 C758.9 245.7, 759 255.1, 759.4 272.1 M759.2 238.3 C760.3 251.1, 759.1 265.3, 759.2 271.7 M760 271.7 C760.9 275.9, 755.7 281, 751.6 278.7 M759 272.3 C760.7 275.2, 758.7 279.6, 750.9 281.6 M749.8 280.4 C725.3 280.3, 702.4 280.7, 649.2 280.9 M752.2 280 C724.9 278.8, 700.4 278.5, 649.2 279.1 M648.3 280 C641.7 279.8, 641.8 275.3, 640.9 269.7 M648.3 278.4 C642.8 278.5, 640.4 277.8, 641.2 271.8 M638.4 272 C638.7 263.1, 639.6 254, 638.3 238 M639.2 272.6 C640.7 259.9, 640.8 248.2, 639.9 237.8 M640 238.3 C638.9 232.5, 642.7 230.3, 648.9 231.3 M639.5 239.7 C639.9 234.9, 644.9 231.3, 646.8 229.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;700&quot; y=&quot;255.0&quot;&gt;done&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M699.3 156.5 C698.7 180.8, 698.6 204.9, 699.6 225.8 M699.4 156.2 C700.3 178.4, 700.1 200.1, 700.9 224&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M705.6 211.8 C702.9 215.6, 700.6 219.4, 699.7 225.3 M705.6 211.6 C704.1 215.4, 702 219.1, 700.6 224 M700 224.9 C697.6 220.3, 696.2 218.9, 692.8 210.4 M700.3 223.8 C698.7 220.8, 696.2 217.3, 693.6 211&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;figcaption&gt;Define errors out of existence: instead of &amp;quot;delete x&amp;quot; failing when x doesn&amp;#x27;t exist, define delete as &amp;quot;make sure x doesn&amp;#x27;t exist&amp;quot;.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Take &quot;delete this variable&quot;. It fails if the variable is missing. Define it instead as &quot;make sure this variable doesn&#x27;t exist&quot;, and if it&#x27;s already gone, the job is done. Ousterhout calls failing here one of his biggest mistakes in designing Tcl.&lt;/p&gt;
&lt;p&gt;Take a substring function that throws when the indexes are out of range. Return the characters that overlap the range instead. Python&#x27;s slices work this way, and nobody misses the exception.&lt;/p&gt;
&lt;p&gt;Take deleting a file that another program has open. Unix lets you: the name disappears at once, and the data stays until the last user closes it. Windows refuses, which is probably why you&#x27;ve had to hunt down &quot;the process using this file&quot;.&lt;/p&gt;
&lt;p&gt;redis does this in small ways everywhere. &lt;code&gt;sdsfree(NULL)&lt;/code&gt; simply does nothing, so no caller ever writes &lt;code&gt;if (s != NULL)&lt;/code&gt; before cleaning up.&lt;/p&gt;
&lt;p&gt;Does this mean hiding real failures? No. A dropped network connection is something the caller genuinely needs to know about. The target is error cases you &lt;em&gt;invented&lt;/em&gt; by how you happened to define the operation.&lt;/p&gt;
&lt;h2 id=&quot;have-you-sketched-it-twice&quot;&gt;Have you sketched it twice?&lt;a class=&quot;anchor&quot; href=&quot;#have-you-sketched-it-twice&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Simplicity does not precede complexity, but follows it.&quot;&lt;/p&gt;
&lt;p&gt;— Alan Perlis, &lt;em&gt;Epigrams on Programming&lt;/em&gt; (1982)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is arguably the cheapest technique in either book, and the one I skipped most often before: &lt;strong&gt;for anything non-trivial, sketch at least two radically different designs before choosing one.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Not two variations. Two different approaches, just their interfaces, compared on one question: which is simpler for the &lt;em&gt;caller&lt;/em&gt;? Ousterhout says it takes an hour or two for a class. That is nothing next to the time you&#x27;ll spend living with the result.&lt;/p&gt;
&lt;p&gt;Why do smart people skip it? Ousterhout&#x27;s answer stuck with me: they&#x27;re used to their first idea being good enough. In big systems it rarely is.&lt;/p&gt;
&lt;h2 id=&quot;can-you-write-the-comment-first&quot;&gt;Can you write the comment first?&lt;a class=&quot;anchor&quot; href=&quot;#can-you-write-the-comment-first&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Both books reach this practice from different directions.&lt;/p&gt;
&lt;p&gt;McConnell&#x27;s version: write the routine in plain-language pseudocode, check it, turn each line into a comment, and fill in the code underneath. Ousterhout&#x27;s version: write the interface comment (what the module does, what it hides, what each method promises) &lt;em&gt;before&lt;/em&gt; writing any bodies.&lt;/p&gt;
&lt;p&gt;The comment is a design test. &lt;strong&gt;If the comment is hard to write, the design is wrong.&lt;/strong&gt; If describing a function takes a long paragraph, or you can&#x27;t explain it without describing how it works inside, the interface is too complicated. You learn that in five minutes of writing instead of five days of coding.&lt;/p&gt;
&lt;p&gt;Good comments say what the code can&#x27;t: units, ranges, what &lt;code&gt;null&lt;/code&gt; means, who owns a resource, &lt;em&gt;why&lt;/em&gt; something odd is the way it is. SQLite is the best case I saw. Its pager file opens with thirteen numbered guarantees, followed by a state diagram that names which function performs each transition, so a reader can check any change against the list before touching the code. When a comment just repeats the code (&lt;code&gt;// Close closes the router&lt;/code&gt;), delete it. I found that exact comment in tailscale. Even good codebases have them.&lt;/p&gt;
&lt;h2 id=&quot;is-good-design-just-design-thats-easy-to-change&quot;&gt;Is good design just design that&#x27;s easy to change?&lt;a class=&quot;anchor&quot; href=&quot;#is-good-design-just-design-thats-easy-to-change&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.&quot;&lt;/p&gt;
&lt;p&gt;— C.A.R. Hoare, &lt;em&gt;The Emperor&#x27;s Old Clothes&lt;/em&gt; (1980 Turing Award lecture)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;The Pragmatic Programmer&lt;/em&gt; squeezes all of this into one line: &lt;strong&gt;good design is easier to change than bad design.&lt;/strong&gt; The authors call it ETC and argue that every other principle is a special case. DRY, for example, isn&#x27;t about avoiding identical &lt;em&gt;text&lt;/em&gt;. It&#x27;s about every piece of &lt;em&gt;knowledge&lt;/em&gt; having one home. Two functions with identical code that encode different business rules should stay separate.&lt;/p&gt;
&lt;p&gt;Which brings me back to &lt;code&gt;local.go&lt;/code&gt;. Tailscale&#x27;s fix isn&#x27;t a rewrite. Their docs say the preferred home for new functionality is a separate feature package. They admit the codebase is &quot;half-migrated&quot;, and tell contributors not to feel obliged to finish the migration in one change. Every new feature goes &lt;em&gt;outward&lt;/em&gt;. The hub shrinks slowly, and nobody stops shipping.&lt;/p&gt;
&lt;p&gt;I can&#x27;t tell from outside whether the hub will ever reach zero, and the docs don&#x27;t promise it. That is what managing complexity looks like in practice: a direction kept every day, not a finished design.&lt;/p&gt;
&lt;h2 id=&quot;one-floor-down&quot;&gt;One floor down&lt;a class=&quot;anchor&quot; href=&quot;#one-floor-down&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Everything here is about &lt;em&gt;writing&lt;/em&gt; code well. It says nothing about proving the code works, and I kept running into that gap in those seven codebases: even with good design, bugs still get in. When I looked at the tests meant to catch them, I found tests in respected projects that couldn&#x27;t fail at all. A test named &quot;supports 128-bit numbers&quot; only ever tests the number 123.&lt;/p&gt;
&lt;p&gt;How can a test pass while proving nothing, and how do you write ones that actually catch bugs?&lt;/p&gt;
&lt;div class=&quot;footnote&quot;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&quot;fn:1&quot;&gt;
&lt;p&gt;&quot;Almost every&quot; is my impression from seven codebases, not a count. I didn&#x27;t tally how often each one does it.&amp;#160;&lt;a class=&quot;footnote-backref&quot; href=&quot;#fnref:1&quot; title=&quot;Jump back to footnote 1 in the text&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn:2&quot;&gt;
&lt;p&gt;I&#x27;m repeating the figure as Ousterhout gives it. I haven&#x27;t checked the study myself, and it covers one class of systems (distributed data-intensive ones).&amp;#160;&lt;a class=&quot;footnote-backref&quot; href=&quot;#fnref:2&quot; title=&quot;Jump back to footnote 2 in the text&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Tests That Can Fail</title><link>https://your-moon.github.io/craft-2-tests/</link><guid>https://your-moon.github.io/craft-2-tests/</guid><pubDate>Thu, 08 Oct 2026 00:00:00 +0000</pubDate><description>&lt;h1 id=&quot;tests-that-can-fail&quot;&gt;Tests That Can Fail&lt;a class=&quot;anchor&quot; href=&quot;#tests-that-can-fail&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Craft · Part 2 of 4: Tests and debugging&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;axum, the web framework a big chunk of the Rust world runs on, has a test called &lt;code&gt;supports_128_bit_numbers&lt;/code&gt; that sends the number 123. If axum quietly broke 128-bit support tomorrow, the test would stay green.&lt;/p&gt;
&lt;p&gt;Here is the whole test. It checks that a URL like &lt;code&gt;/u/{key}&lt;/code&gt; can be read as a 128-bit integer:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/i/123&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;fm&quot;&gt;assert_eq!&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;123&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/u/123&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;fm&quot;&gt;assert_eq!&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;123&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;123&lt;/code&gt; fits in eight bits, so even if axum parsed paths as 32-bit integers this test would still pass: its name makes a promise that its input never checks.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-49 4 725 210&quot; width=&quot;725&quot; role=&quot;img&quot; aria-label=&quot;Green tests, and a bug walking by&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M528.8 117.7 C524.1 107.8, 522.9 99.1, 518.6 97.3 M530.9 117.1 C525.9 110.4, 523.9 103.3, 520.5 96.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M549.4 117.6 C552.1 109.7, 559.3 99.4, 560 95.4 M549.8 118.3 C552 113.5, 554.7 107.8, 559.5 96.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M510 163.5 C505.7 170.2, 503.2 178.6, 505.4 185.6 M510.7 163.5 C509 169.7, 507 174.3, 504.5 184.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M535.5 163.3 C531.1 172.3, 529.1 179, 527.8 183.8 M534.6 164.7 C532.3 171.2, 531 177.4, 528.5 183.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M561.1 163.2 C556 170.3, 554.6 179.4, 554.2 185.9 M560.5 163.9 C557.5 172.7, 554.9 180.4, 554.5 183.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M522.1 112.1 C530.2 110.1, 542.8 110.8, 552.1 112.4 C561.3 113.9, 571.2 117.3, 577.6 121.2 C584 125.2, 588.7 130.5, 590.5 135.9 C592.4 141.2, 591.8 148, 588.6 153.4 C585.5 158.8, 579.3 164.9, 571.5 168.4 C563.7 171.8, 551.4 174.1, 541.9 174.3 C532.5 174.4, 522.8 171.8, 514.7 169 C506.7 166.2, 497.9 162.1, 493.6 157.3 C489.3 152.4, 487.9 145.7, 488.7 140 C489.6 134.2, 492 127.6, 498.6 122.9 C505.2 118.2, 522.9 113.7, 528.4 111.8 C533.9 109.8, 531.8 110.8, 531.7 111.3 M514.4 114.3 C522.1 111.2, 536.3 110.8, 545.8 111.1 C555.3 111.3, 564.1 112.3, 571.5 115.8 C578.8 119.3, 586.6 126.5, 589.9 132.1 C593.2 137.8, 593.4 144.5, 591.2 149.8 C588.9 155.1, 583.5 160.4, 576.4 164.1 C569.4 167.7, 558.1 170.7, 549 171.7 C539.9 172.6, 530.1 171.8, 521.8 169.8 C513.5 167.8, 505.1 163.9, 499.2 159.7 C493.3 155.4, 487 149.7, 486.3 144.2 C485.7 138.7, 490.2 131.4, 495.3 126.5 C500.4 121.6, 513.3 116.6, 517 114.8 C520.6 113, 517 115.5, 517.1 115.7&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M528.3 111.5 C537.1 109.8, 549.8 110.7, 558.6 112.6 C567.3 114.4, 575.4 118.4, 581.1 122.8 C586.7 127.2, 591.6 133, 592.3 138.8 C593 144.5, 589.9 152.3, 585.3 157.2 C580.7 162.2, 572.8 166, 564.6 168.6 C556.4 171.2, 545.4 172.9, 536.1 172.8 C526.8 172.8, 516.5 171.4, 509 168.2 C501.4 165.1, 494.1 159.4, 490.7 153.9 C487.4 148.4, 486.8 140.9, 488.9 135.1 C490.9 129.4, 495.3 123.6, 502.9 119.6 C510.5 115.5, 528.1 112.4, 534.5 111 C540.9 109.6, 541.5 110.6, 541.4 111.1 M535.4 111.1 C544.5 110.2, 557.8 111.4, 566.3 114.1 C574.8 116.9, 581.9 122.6, 586.3 127.6 C590.8 132.7, 593.6 139.2, 593 144.5 C592.4 149.8, 588.7 155.1, 582.8 159.6 C576.9 164.2, 566.5 169.5, 557.6 171.8 C548.8 174.1, 538.6 174.8, 529.6 173.6 C520.6 172.4, 510.3 168.7, 503.4 164.6 C496.5 160.4, 490.1 154.3, 488.2 148.6 C486.3 142.9, 488.2 135.6, 492 130.1 C495.7 124.7, 503 119.2, 510.5 115.9 C518 112.5, 532.5 111.1, 537 110.1 C541.5 109.2, 537.7 109.9, 537.6 110.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M532.8 132.8 C533.2 133, 533.8 134.5, 534.1 135.1 C534.4 135.7, 534.3 135.9, 534.4 136.5 C534.5 137, 535.1 137.6, 534.7 138.2 C534.4 138.8, 533.2 139.8, 532.4 139.9 C531.6 140.1, 530.6 139.8, 530 139.2 C529.5 138.6, 529.3 137, 529.1 136.3 C529 135.5, 528.8 135.5, 529.1 134.9 C529.3 134.4, 529.8 133.3, 530.7 133 C531.5 132.7, 533.6 133, 534 133 C534.5 133, 533.7 132.9, 533.5 133.1 M531.4 134.3 C531.6 134.1, 531.6 134, 532.1 134 C532.6 134.1, 533.9 134.2, 534.2 134.6 C534.6 135, 534.1 136, 533.9 136.6 C533.8 137.2, 533.6 138.1, 533.4 138.4 C533.2 138.8, 533 139, 532.5 138.6 C532 138.3, 531.1 136.8, 530.5 136.6 C530 136.3, 529.6 137.2, 529.2 136.9 C528.9 136.6, 527.9 135.7, 528.4 135 C528.9 134.4, 531.8 133.3, 532.3 133.1 C532.8 132.8, 531.6 133.8, 531.6 133.6&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M531.5 133.3 C532.2 133.1, 532.3 132.2, 532.9 132.4 C533.4 132.6, 534.6 133.7, 535 134.5 C535.5 135.3, 535.8 136.5, 535.6 137.1 C535.5 137.6, 534.9 137.1, 534.1 137.6 C533.3 138.1, 531.7 139.8, 531 140 C530.2 140.2, 529.9 139.3, 529.6 138.7 C529.3 138.1, 529 137.2, 529.1 136.6 C529.1 136, 529.1 135.7, 529.7 135 C530.2 134.3, 531.9 132.8, 532.3 132.4 C532.6 132, 531.9 132.5, 531.9 132.6 M532.7 133.9 C533.4 133.7, 532.8 133.7, 533.1 134 C533.3 134.2, 533.7 135.3, 534.2 135.7 C534.7 136, 536.2 135.6, 536.1 136.1 C535.9 136.7, 534.2 138.5, 533.3 138.8 C532.4 139, 531.3 137.6, 530.8 137.6 C530.4 137.6, 530.9 139.1, 530.5 138.6 C530.1 138.2, 528.2 135.8, 528.3 134.9 C528.3 134.1, 530.2 133.9, 530.7 133.6 C531.3 133.2, 531.2 132.8, 531.4 132.9 C531.6 133, 531.8 134.1, 531.9 134.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M549.9 133.1 C550.5 133.3, 550.3 133.9, 550.6 134.4 C551 134.9, 551.9 135.1, 551.9 135.9 C551.8 136.7, 550.8 138.5, 550.3 139 C549.7 139.6, 549.3 139.2, 548.5 139.2 C547.7 139.1, 545.9 139.2, 545.3 138.7 C544.8 138.2, 545.1 136.8, 545.2 136.1 C545.3 135.5, 545.7 135.3, 546 134.7 C546.4 134.1, 546.5 132.7, 547.2 132.7 C548 132.6, 549.9 134.1, 550.5 134.3 C551.1 134.6, 550.9 134.5, 550.9 134.2 M545.7 133.2 C546.5 132.8, 547.9 133, 549 133.4 C550 133.7, 551.4 134.7, 552 135.3 C552.6 135.9, 553 136.4, 552.5 137 C552.1 137.7, 549.8 138.8, 549.3 139.3 C548.8 139.8, 550.1 140.2, 549.5 140.1 C549 139.9, 546.8 138.8, 545.9 138.4 C545 138.1, 544.2 138.6, 544.2 138 C544.3 137.4, 545.7 135.7, 546.3 134.8 C547 133.9, 547.9 132.8, 548 132.6 C548.1 132.4, 547.4 133.4, 547 133.6&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M547.8 133.6 C548.5 133.4, 548.8 133.4, 549.5 133.5 C550.1 133.7, 551.2 134, 551.6 134.4 C552 134.8, 552.4 135.2, 552 135.8 C551.7 136.4, 550.2 137.5, 549.4 138.1 C548.6 138.7, 547.8 139.6, 547.3 139.6 C546.8 139.5, 546.6 138.3, 546.2 137.7 C545.9 137.1, 545.4 136.5, 545.4 136.1 C545.4 135.7, 546 135.8, 546.3 135.2 C546.6 134.6, 546.8 132.8, 547.1 132.4 C547.3 132, 547.9 132.8, 547.9 132.8 M547.7 131.9 C548.1 132.1, 549.6 134, 550.2 134.8 C550.7 135.7, 550.9 136.7, 551.2 137 C551.5 137.3, 552.6 136.3, 552.1 136.6 C551.5 136.9, 548.8 138.5, 548 138.9 C547.2 139.3, 547.7 139.3, 547.3 138.9 C546.9 138.6, 546.1 137.4, 545.5 136.9 C544.9 136.3, 543.6 136, 543.9 135.6 C544.2 135.2, 546.7 135, 547.4 134.4 C548 133.8, 547.7 132.5, 547.7 132.1 C547.6 131.7, 546.8 131.6, 546.8 132&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M532 150 C539.3 152.7, 541.4 152.1, 549.8 151.4 M530.8 151.9 C535.7 152, 541.8 151.9, 549.4 152.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M142.4 17.6 C195.1 21.7, 252.9 20.8, 418.5 17.9 C430 17.2, 432.2 25.5, 433.3 32.2 C427.9 55, 430.2 80.2, 429.2 148.2 C426.6 153.3, 430 158.3, 422.6 161.1 C331.5 162.4, 244.7 157.9, 138 162.1 C131.6 163.2, 127.9 158.5, 128.2 151.6 C134.1 114.9, 132.4 79.6, 128.5 28.9 C127.7 23.6, 133.2 19.2, 140.8 16.6&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M140 18.9 C248.9 20.1, 358.4 20.7, 419.4 20.6 M140.7 19.9 C225.5 20.5, 309.4 20.2, 419.7 19.4 M420 20 C428.5 18.7, 428 24.2, 431.3 30.6 M419.6 18.4 C426.6 20.6, 428.3 24.7, 430.9 28.2 M429.2 28.8 C427 72.8, 428.8 113.5, 430.7 149.1 M430.9 30.3 C431.7 70.1, 431.4 110, 429.1 149.8 M430 150 C428.5 157.3, 425 160.8, 419.9 159.2 M430.1 151.1 C429 156.4, 426.9 159, 419.4 159.5 M421 160.3 C312.2 160.4, 204.4 161.5, 141.1 161.1 M420.3 160.4 C332.6 162.8, 245.7 162.2, 139.9 159.5 M140 160 C133.7 159.6, 131.4 157.6, 129.2 150.1 M139.1 161.5 C133.6 159.1, 129.3 154.7, 131.2 150.5 M129.7 151.4 C130.9 126.6, 129.2 102.3, 130.6 28.3 M129.1 150.9 C131.4 114.9, 131.4 80.5, 129.4 29 M130 30 C129 24.8, 131.9 21.1, 138.3 19.4 M130.3 31.5 C129 24, 133.4 17.7, 141.4 21&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M153.2 30.2 C239.9 26.2, 322 30.4, 410 33.2 C418 31, 418 31.8, 417.8 41.9 C416.1 72.3, 421.1 96.9, 417.3 135 C420.5 147.2, 415.4 149.4, 409.8 146.5 C308.2 147.5, 204.1 142.2, 152.8 149.1 C148 144.5, 142.8 144.7, 141 139 C142.6 112.3, 139 89.5, 144.4 39.5 C143.9 33.4, 147 34.4, 150.4 32.4&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M152.7 32 C233.6 32, 313.5 32.1, 408.9 31.6 M151.2 31.2 C214 31.1, 276.5 31.8, 407.5 31.7 M408 32 C414.6 31.1, 418.7 33.3, 417.9 43.5 M409.9 33.3 C414.9 31.3, 415.8 36.7, 418.7 43.6 M418.8 41.1 C417.6 60.8, 416.4 84.6, 416.4 139.3 M419 41.3 C418.7 74, 419.6 105.5, 418.7 138.7 M418 138 C417.4 144, 412.9 147.5, 406.9 146.8 M418.5 138.7 C416.9 146.7, 416.7 146.4, 409.7 148.7 M408.1 148.7 C316.6 149.4, 223.3 148.2, 152.9 147.1 M408.4 148.3 C340.7 148.7, 273.2 148.3, 152.1 148.3 M152 148 C143.6 149.2, 142.4 143, 143.3 138 M151.4 149.9 C146.4 146.4, 143.7 144.9, 144 136.3 M143.3 139 C142.4 110.2, 143.2 83.7, 142.3 40.2 M143 137.4 C142.2 112.2, 140.8 86.7, 141.2 42 M142 42 C142.3 35.5, 145.7 31.5, 151.8 33.2 M141.3 43.8 C141.4 34.9, 146 33.7, 151.6 33.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M106.2 163.8 C221.6 168.7, 339 170.4, 452.3 165.5 C459.7 171.4, 468.2 178, 476.1 188 C364.4 186, 255.8 184.9, 83.6 188.4 C88.4 182.1, 90.8 180.6, 108.2 164.3&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M107 165.9 C217 166, 327 165, 453 167.1 M105.9 166.1 C212.4 164.4, 318.2 165.2, 454.3 166 M454.8 166.5 C457.2 169.3, 463.3 176.3, 474.5 187.3 M453.4 166.6 C462.7 175.5, 471 182.8, 476.8 188.9 M475.6 188.4 C366.8 189.9, 260.1 188.4, 83.6 187.6 M475.5 188 C339.9 186.8, 204.2 186.6, 84.2 188.4 M85.5 187 C89.6 181.8, 96.5 175.9, 106.5 167.5 M83.8 188.5 C92.7 180, 101.8 170.8, 105.2 166.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;280&quot; y=&quot;90.0&quot;&gt;✓ all tests passed&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M42 42.4 C46.4 43.2, 50.7 45.9, 53.5 49.6 C56.3 53.3, 59.2 60, 58.9 64.7 C58.7 69.4, 55.3 74.6, 52 77.7 C48.6 80.8, 43.5 83.3, 38.7 83.4 C33.8 83.5, 26.8 81.3, 22.9 78.5 C18.9 75.7, 16.2 70.7, 15.1 66.6 C14 62.5, 14.5 58, 16.4 54 C18.2 49.9, 21.8 44.2, 26.3 42.3 C30.7 40.3, 40.3 42.2, 43.1 42.4 C45.9 42.5, 43.4 42.6, 43.2 43 M28.2 42.6 C32.4 40.8, 40.5 39.7, 45.2 41.3 C49.9 42.8, 54.2 47.8, 56.3 52.1 C58.5 56.3, 59.1 62.5, 57.8 66.7 C56.6 71, 52.2 75.1, 48.7 77.8 C45.2 80.5, 41.1 82.7, 36.8 82.9 C32.5 83, 26.5 81.4, 22.8 78.6 C19.1 75.8, 15.8 70.4, 14.6 66 C13.4 61.6, 13.3 56.5, 15.7 52.3 C18.1 48.1, 26.9 42.4, 29 40.8 C31.1 39.3, 28.2 42.3, 28.3 42.9&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M34.1 40.5 C38.7 39.8, 45.7 41.1, 49.4 43.9 C53.2 46.6, 55.8 52.7, 56.8 57.2 C57.8 61.6, 57.3 66.7, 55.5 70.6 C53.7 74.5, 50.2 78.4, 46 80.5 C41.8 82.6, 35 84.2, 30.3 83.2 C25.6 82.2, 20.4 78.2, 17.8 74.4 C15.1 70.6, 14 64.9, 14.6 60.4 C15.1 55.9, 17.6 50.5, 21.1 47.3 C24.7 44.1, 33.2 42.2, 35.8 41 C38.4 39.9, 36.4 40.5, 36.6 40.7 M39.1 42.3 C43.4 42.8, 49.9 44.2, 52.9 47.3 C55.9 50.5, 56.9 56.8, 57 61.3 C57 65.8, 56.1 70.6, 53.2 74.4 C50.4 78.1, 44.6 82.8, 39.7 83.8 C34.8 84.9, 28.1 83.1, 23.9 80.7 C19.7 78.3, 16.1 73.5, 14.6 69.4 C13 65.3, 12.8 60.3, 14.8 56.1 C16.8 51.8, 22.1 46, 26.6 43.7 C31 41.4, 39.4 42.7, 41.4 42.3 C43.4 41.8, 39.1 40.8, 38.8 41.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M30 53.9 C30.5 54.2, 30 54.6, 30.2 55 C30.4 55.5, 31.3 56, 31.3 56.5 C31.2 56.9, 30.7 57.5, 30 57.9 C29.4 58.3, 28.1 58.9, 27.3 58.9 C26.5 58.8, 25.6 57.9, 25.4 57.4 C25.1 57, 25.9 56.7, 25.8 56 C25.6 55.3, 24.5 54, 24.6 53.4 C24.8 52.7, 25.9 52.3, 26.8 52.2 C27.6 52.1, 29.2 52.2, 29.8 52.6 C30.4 53, 30.2 54.5, 30.3 54.5 M30.8 52.2 C31.1 52.8, 30.6 55.6, 30.6 56.2 C30.6 56.7, 31.2 55.2, 30.9 55.4 C30.7 55.7, 29.5 56.8, 29.1 57.5 C28.7 58.3, 28.9 59.6, 28.6 59.9 C28.3 60.3, 27.8 60.2, 27.2 59.5 C26.6 58.7, 25.5 56.1, 25.1 55.4 C24.8 54.7, 24.5 55.6, 25 55.2 C25.5 54.9, 27.5 53.4, 28.4 53.2 C29.2 53.1, 30 54.1, 30.1 54.1 C30.2 54.2, 29.3 53.5, 29 53.3&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M28 52.6 C28.4 52.3, 28.6 53, 29 53.5 C29.5 54, 30.6 54.9, 30.8 55.6 C31.1 56.3, 30.8 57.2, 30.5 57.8 C30.3 58.3, 29.7 58.6, 29.2 58.9 C28.7 59.2, 28.1 59.9, 27.6 59.6 C27.1 59.4, 26.7 58, 26.1 57.3 C25.5 56.6, 24.1 56, 24 55.5 C23.9 55, 24.5 54.6, 25.3 54.1 C26.1 53.7, 28.4 53.2, 28.8 52.8 C29.1 52.5, 27.5 52.1, 27.3 52.2 M29.5 52.2 C30 52.2, 30.7 53, 30.8 53.8 C31 54.5, 30.5 55.9, 30.4 56.5 C30.4 57, 30.9 56.5, 30.4 57.1 C29.8 57.6, 27.8 60, 27.2 60.1 C26.5 60.1, 26.8 58.2, 26.3 57.4 C25.8 56.7, 24.3 56.1, 24 55.6 C23.7 55, 23.9 54.3, 24.7 54.1 C25.5 53.9, 27.9 54.5, 28.8 54.4 C29.7 54.3, 30 53.5, 30 53.3 C30.1 53.2, 29.5 53.2, 29.2 53.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M42.3 54.2 C42.8 53.8, 43.9 52.3, 44.5 52.5 C45.2 52.6, 45.8 54.5, 46.3 55.1 C46.7 55.7, 47.1 55.9, 47.1 56.3 C47.1 56.6, 46.8 56.9, 46.2 57.2 C45.6 57.4, 44 57.7, 43.5 57.9 C43 58.1, 43.6 58.7, 43.2 58.4 C42.8 58.1, 41.4 56.4, 41 55.9 C40.7 55.5, 40.6 56.1, 41 55.7 C41.4 55.2, 43.1 53.9, 43.4 53.4 C43.7 52.9, 42.9 52.7, 42.9 52.7 M45.1 53.7 C46.1 54, 47.6 54.8, 47.7 55.2 C47.9 55.5, 46.5 55.5, 46.1 56 C45.6 56.5, 45.2 57.8, 45 58.1 C44.7 58.5, 45.2 58.1, 44.6 58.1 C43.9 58.2, 41.8 58.4, 41.1 58.2 C40.3 58.1, 39.9 58.3, 40.2 57.5 C40.4 56.7, 42.2 54.1, 42.6 53.3 C43.1 52.5, 42.6 52.8, 43.1 52.8 C43.6 52.8, 45.5 53.3, 45.7 53.3 C46 53.4, 44.6 52.7, 44.4 53&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M44.2 52.9 C44.8 52.6, 45.1 52.2, 45.6 52.7 C46.2 53.1, 47.2 54.8, 47.4 55.5 C47.6 56.1, 47.4 55.9, 46.9 56.6 C46.5 57.2, 45 58.9, 44.5 59.4 C44 59.8, 44.6 59.4, 43.9 59.2 C43.3 59.1, 41.3 59, 40.7 58.3 C40.1 57.6, 40.1 55.7, 40.3 55 C40.5 54.4, 41.4 54.7, 41.9 54.3 C42.4 54, 43.2 53.2, 43.5 52.8 C43.7 52.5, 43.1 52.3, 43.2 52.4 M44.5 53.1 C45.2 52.9, 45.3 52.4, 45.7 52.6 C46.1 52.9, 46.6 54, 47 54.9 C47.4 55.8, 48.4 57.3, 48 58 C47.6 58.8, 45.6 59, 44.7 59.3 C43.8 59.6, 43.2 59.9, 42.5 59.9 C41.8 59.9, 40.9 59.8, 40.4 59.4 C39.9 59, 39.7 58.5, 39.6 57.6 C39.6 56.7, 39.4 54.9, 40 54 C40.6 53.2, 42.6 52.4, 43.3 52.4 C44 52.4, 44 54.1, 44.2 54.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M26 68 C35.2 77.5, 42.7 78.5, 47.8 67.1 C39 70.8, 29.9 64.5, 28.5 66.7&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M26 68 C33.3 76.4, 38.6 76.6, 46.4 69.7 M27.9 69.9 C33.2 74, 40 77.2, 45.9 69.7 M47.5 68.1 C38.6 66.9, 32 68.9, 27.7 68.7 M45.3 67.2 C38.8 67.9, 31.4 68.8, 25.6 68.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M36.9 83.2 C36.8 105.1, 34.6 126.5, 34.9 148.7 M35.2 83.4 C36.2 103.3, 35.9 120.8, 36.5 150&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M37.5 149.1 C30.1 162.9, 22.1 180.2, 16.3 196.8 M36.1 150.6 C29.9 164.6, 21.9 181.8, 15.5 196.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M34.1 148.9 C43.5 164.8, 48.9 180.4, 57.7 195 M35 149.8 C39.3 158.7, 43.1 167.9, 56.5 196.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M34.7 102.3 C24.8 90.6, 18.2 77.3, 6.5 60.6 M36.6 102.3 C25.9 87.9, 14.1 72.8, 6.7 62.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M35.3 102.2 C44.6 88.6, 53.9 77.7, 67.9 62.7 M35.5 101.5 C42.2 93.5, 49 84.3, 65.7 62.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-27.1 50.9 C-23.2 51.7, -18.6 51.9, -13.5 50 M-26.7 51.3 C-22.8 51.3, -19.4 51.3, -12.5 51.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-19.7 43.8 C-20.6 48, -20.1 51.5, -19.5 58.5 M-20.5 43.7 C-19.4 48, -20.7 53.2, -20.2 57.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M85.7 45.1 C88.9 46.4, 94.3 44.2, 97.6 44.6 M85.1 44.6 C87.6 44.8, 91.4 45.3, 99.5 44.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M93.1 38 C91.3 42.5, 92.6 46.5, 91.6 53.2 M91.4 38.4 C92.1 41.7, 92.3 46.2, 91.8 52.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-33.9 112.1 C-28.6 113.6, -22.4 111.8, -18 112.1 M-32.6 112.1 C-27.4 112.2, -23.2 111.8, -18.1 112.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-26.5 105 C-26.1 109.8, -26.9 114.2, -26.8 120.6 M-25 105.9 C-26.1 110.9, -25.8 116.3, -25.8 119.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M90.1 106.3 C94.8 108, 98.9 106.7, 104.4 106.7 M90.4 106.7 C94.2 107, 97.4 107.1, 105.1 107.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M97.5 99.3 C97.3 104.3, 97.3 109.1, 98.3 112.4 M98.1 99.2 C98 104.6, 96.9 109.4, 97.4 113.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;600&quot; y=&quot;90.0&quot;&gt;shh&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M-19.5 198.2 C203.2 199.3, 424.4 199.9, 660.5 197.9 M-20.3 198.3 C214 196.9, 447.1 197, 660.4 198.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;I&#x27;m not picking on axum. It&#x27;s an excellent codebase, and that is the point. I went through the test suites of seven respected projects and found tests like this in almost all of them.&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a class=&quot;footnote-ref&quot; href=&quot;#fn:1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; So what does a green run actually tell you?&lt;/p&gt;
&lt;p&gt;Less than you hope, and probably less than you assume. &lt;strong&gt;The test was written by the same person who wrote the bug.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;how-does-a-test-pass-while-checking-nothing&quot;&gt;How does a test pass while checking nothing?&lt;a class=&quot;anchor&quot; href=&quot;#how-does-a-test-pass-while-checking-nothing&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Trying to improve software quality by increasing the amount of testing is like trying to lose weight by weighing yourself more often.&quot;&lt;/p&gt;
&lt;p&gt;— Steve McConnell, &lt;em&gt;Code Complete&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I found five ways. Every one below is real, from a project people learn from.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The table where every answer is the same.&lt;/strong&gt; tailscale has a test for a function that decides whether an error is worth retrying. Every row in its table expects &lt;code&gt;false&lt;/code&gt;. A broken function that &lt;em&gt;always&lt;/em&gt; returns &lt;code&gt;false&lt;/code&gt; passes it perfectly.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The coincidence.&lt;/strong&gt; excalidraw tests rotating a point and then rotating it back. The final check compares the result against &lt;code&gt;[x1, x2]&lt;/code&gt;. It meant &lt;code&gt;[x1, y1]&lt;/code&gt;. The test passes only because the fixture happens to set &lt;code&gt;y1 = 20&lt;/code&gt; and &lt;code&gt;x2 = 20&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The assertion that never runs.&lt;/strong&gt; Another excalidraw test expects undo to throw an error, so the &lt;code&gt;expect&lt;/code&gt; sits inside a &lt;code&gt;catch&lt;/code&gt; block. If undo ever stops throwing, the &lt;code&gt;catch&lt;/code&gt; never runs, no assertion fires, and the test passes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The one-character typo.&lt;/strong&gt; A redis test meant to send a 1 KB payload writes &lt;code&gt;puts -nonewline $s payload&lt;/code&gt;. It is missing a &lt;code&gt;$&lt;/code&gt;, so it sends the literal word &quot;payload&quot;, seven bytes. SQLite has the mirror image: a guard written &lt;code&gt;string match *journal filename&lt;/code&gt; compares against the literal word &quot;filename&quot;, so it is always false.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The test with no assertion at all.&lt;/strong&gt; A tailscale test that only logs. A ripgrep test that only prints.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -32 890 352&quot; width=&quot;890&quot; role=&quot;img&quot; aria-label=&quot;Tests that can&#x27;t fail&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:26px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;429&quot; y=&quot;0.0&quot;&gt;tests that can&#x27;t fail&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M11.8 41.6 C82.9 38.9, 161.7 36.4, 257.2 42.3 C267.2 37.6, 272.6 44.5, 269.2 47.9 C272.5 77.8, 269.6 109.3, 268 147.7 C269.5 159.7, 269.4 157.7, 259.4 158.4 C191.3 165.2, 125.7 161.3, 12.8 158.2 C0.9 162, 2.6 158.6, 2.5 148.6 C-0.9 115.9, -1 79.3, 1.3 46.4 C3.4 45.3, 5.7 43.3, 7.6 37&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M11.2 39.9 C97.2 38.6, 185.2 39.5, 261.3 38.5 M10.5 39.6 C64.6 41.3, 119.9 42.1, 260.8 39.7 M260 40 C267.3 41.1, 268.6 43, 270.2 50.7 M260.2 39 C264.8 41.1, 268.2 43.3, 268.1 50.6 M268.1 51.2 C272 72.3, 271 97.7, 270 150.6 M270.7 50.1 C268.8 81.4, 269.4 114.6, 270.3 150.1 M270 150 C270.8 156.8, 268.3 160.7, 260.2 161.1 M271.7 148.4 C269 157.7, 264.4 157.9, 259.5 161.2 M261.1 161.2 C170.2 159.5, 82.5 159, 9.7 160.4 M260.8 160.4 C201.6 161.4, 141.4 162, 10.7 160.8 M10 160 C2 158.6, -0.2 157.8, 1.6 148.7 M10.6 159.6 C2.8 158.9, 0.9 158, 1.2 150.3 M0.5 151.5 C-0.6 112, -0.5 71.2, -1.5 51.1 M0 150.4 C0 129.9, -0.2 108.7, 0.5 50.8 M0 50 C-1.1 44.6, 2.8 40.5, 9 40.3 M0.4 51.1 C-0.1 45.3, 1.7 39.8, 8.9 40.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;135&quot; y=&quot;70.0&quot;&gt;every row:&lt;/tspan&gt;&lt;tspan x=&quot;135&quot; y=&quot;90.0&quot;&gt;false&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M92.6 123.5 C122.9 121.8, 162.3 119.1, 180.9 119.7 C182.2 121.2, 183 121.7, 183.1 126.2 C187 130.1, 187.5 137.9, 182.4 143.3 C182.3 148.3, 184 146.3, 181.4 149.4 C159.4 148.4, 139.7 146.7, 87.4 146.6 C83 149.9, 87.2 148.2, 87.6 141.8 C86.8 137.6, 83.2 127.2, 82.2 126.3 C87.1 120.3, 83.7 123.6, 92.6 125.6&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M88.2 123.8 C113.6 120.6, 142.2 121.4, 182.1 123.3 M89.9 122 C111.5 123, 132.1 122.5, 181.2 122.9 M180.7 122 C182.3 123.1, 184.2 123, 184.9 125.3 M180.7 120.3 C183.9 120.5, 187 123.3, 186.7 124 M186.1 126.6 C184.1 128.9, 184.3 135.9, 185.4 143.9 M184.9 126.6 C185.4 133.7, 184.9 139.4, 185.1 143.6 M185 143.7 C184.3 146.6, 181.9 146.3, 181.8 147.6 M184.1 145.3 C185.6 146.7, 183.7 146.7, 180.9 147.9 M178.9 146.9 C160.5 147.8, 140.9 145.6, 89.7 149.5 M179.7 148.8 C155.1 149.2, 131.7 148.9, 88.4 147.1 M89.3 148 C84.8 148.9, 83.6 147.4, 84.5 142.4 M90.9 146.9 C86.9 147.7, 85.6 148.3, 83.1 143.6 M86.6 142.8 C85 137.9, 86.8 133.6, 85.7 127.7 M84.4 144.3 C84.6 136.5, 84.6 130.9, 85.1 125.5 M85 126.3 C85.1 124.8, 87 120.3, 88.8 122.3 M85.7 124.6 C85.1 121.3, 88 122.2, 87.5 120.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;135&quot; y=&quot;135.0&quot;&gt;✓ passes&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M305.7 38.9 C357.7 42.4, 412.7 44.8, 552.2 39.6 C558.6 40.1, 565.7 40.4, 563.2 52.5 C564.7 74.3, 565.9 97.8, 565 146.7 C561.5 154.9, 563.6 159.2, 551.2 159.9 C472.3 156.5, 384.4 159.3, 306.7 161.3 C294.8 160.5, 291 156.3, 293.2 147 C293.9 129.8, 290.7 109.4, 295.8 48.9 C291.8 44.6, 296.4 36.4, 303.2 42.4&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M303.3 39.7 C391.5 40.7, 481 40.7, 555.5 40.5 M303.4 39.3 C354.9 39.5, 407.6 39.5, 554 40.5 M554 40 C561.7 42, 565.9 43.2, 564.7 50.8 M554.6 39.5 C560.2 40.2, 562.8 43.4, 563.7 49.8 M564.1 48.6 C563.8 80.8, 563.2 112.5, 562.6 148.6 M564.7 50.8 C564.7 81.3, 564.7 113.3, 563.2 149.7 M564 150 C562.5 155.9, 560.3 161.2, 552.7 160.4 M562.3 150.2 C565.7 156.6, 562.8 161.6, 555.1 157.8 M552.7 159.4 C466.4 158.5, 380.7 159.8, 303.5 158.6 M554.8 159.5 C489.8 160, 427.5 159.8, 303.7 159.9 M304 160 C297.8 158.7, 295.5 154.9, 295.7 149.2 M302.5 161.6 C296.5 161.4, 296 154.6, 295 148.4 M293.5 151.6 C294.5 126.1, 295.9 103.1, 292.5 49.4 M294.3 149.6 C295 127.6, 294.5 102.7, 294.4 50.3 M294 50 C292 43.6, 299.1 40.6, 303.5 41.7 M294.7 50.9 C295.5 41.9, 295.3 38.5, 302.3 40.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;429&quot; y=&quot;70.0&quot;&gt;[x1, x2] meant [x1, y1]&lt;/tspan&gt;&lt;tspan x=&quot;429&quot; y=&quot;90.0&quot;&gt;(y1 = x2 = 20)&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M384 122.8 C414 118, 451 120.7, 471.6 125.5 C478.8 121.9, 479.1 125.9, 480.5 124.7 C480.4 131.5, 478.2 134.6, 481.8 144.2 C481.9 145.5, 477.4 151.4, 477.5 151.6 C454.9 146.4, 431.7 150.2, 381.5 146.9 C380.9 145.6, 378.4 147.4, 375.8 144.5 C376.2 137, 380.9 134, 376.1 124.3 C377.8 126.2, 377.7 120.6, 383.5 125.3&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M381.7 120.3 C413.9 123.4, 445.7 123.1, 476.6 123.1 M383.1 122.9 C411.6 121.4, 441.2 121.3, 474 122.2 M474.7 122 C476 121.6, 477.5 124.1, 477.4 127.7 M474.1 120.6 C475.9 122.7, 480.3 125.4, 480.1 127.3 M477.7 126.1 C478.6 132.8, 477.3 137.2, 478.7 142.2 M478.4 126.8 C479.3 130.7, 479 136.5, 478.5 143.3 M479 143.7 C477.9 147.7, 476.8 149.4, 476.1 148.4 M479.3 144.9 C481.1 144.3, 477.7 147.8, 473.7 149.1 M473.3 149.1 C440.3 146.8, 406.8 148.2, 382.6 146.5 M474.4 147.4 C446.5 148.1, 416.8 148.8, 383.5 147.3 M383.3 148 C380.1 148.1, 379.3 145.2, 377.9 142.8 M384.2 147 C381 149.1, 381.1 146.7, 380.9 144.8 M380.5 142.1 C379.9 139.9, 378.2 134.2, 378.4 125 M378.9 142.8 C379.5 137.7, 379.5 130.4, 378.2 126.3 M379 126.3 C377.7 123.5, 381.8 122.4, 385.2 123.4 M380.9 127.8 C376.9 124.6, 380.1 120.7, 384.6 123.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;429&quot; y=&quot;135.0&quot;&gt;✓ passes&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M599.7 42.1 C676.6 38.6, 757.8 40, 847.3 42.7 C857.2 42.5, 858.7 43.6, 857.2 49.9 C860.6 90.9, 858.6 126.3, 854.7 152.8 C860.7 157.2, 857.7 160.7, 850.3 161.3 C747.4 160.9, 649.1 158.8, 600.6 158.5 C588.8 159, 586.6 153.9, 591.2 152.5 C588.7 123.8, 589.6 99.4, 590.3 51.4 C587.4 43.9, 594.3 36.8, 598.8 40.7&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M598.7 39.4 C685.8 39.5, 773.5 38.6, 846.4 39.3 M598 40.6 C695.2 41.8, 793.7 41, 847.2 39.7 M848 40 C856.1 38.9, 859.2 43.4, 859.3 50.9 M849 40.1 C855.5 39.3, 857.4 43.5, 859.3 49 M856.1 50 C857.5 89.4, 857.3 127.3, 859.2 150.6 M858.7 49.5 C856.5 81.3, 858 112, 858.2 149.4 M858 150 C858.1 155, 856.4 161.8, 849.3 159.6 M857 148 C857.8 155.4, 856.6 160.8, 846.2 158.9 M847.5 160.9 C762.7 161.7, 679 161.4, 597.2 160 M848.7 160.2 C779.7 158.5, 712 157.7, 598.3 160.6 M598 160 C589.5 158.8, 587.2 156.1, 589.8 149.8 M598.3 159.5 C590.2 159.2, 586.5 155.8, 588.8 151.1 M586.5 151.8 C587.5 124.2, 586.3 95, 586.4 51.7 M588.7 150.8 C588 123.3, 587.1 96.7, 588.2 49.7 M588 50 C589.1 42.6, 591.4 40.7, 597.9 39.1 M589 50.7 C586.6 43, 593.5 41.8, 600.3 40.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;723&quot; y=&quot;70.0&quot;&gt;expect()&lt;/tspan&gt;&lt;tspan x=&quot;723&quot; y=&quot;90.0&quot;&gt;inside catch&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M675.4 122 C712.3 121.4, 739.6 122.4, 769.6 124.2 C768.3 122.7, 775.2 122.8, 770.8 123.2 C773.2 132.8, 774.5 137.6, 775 145.1 C774.4 149.9, 770.7 149.2, 766.5 146.6 C750.4 148.3, 723.8 150.4, 675.6 147.2 C671.5 148.5, 669.5 146.5, 671.2 147.1 C672.4 139.2, 673.1 133.9, 670 128.6 C675.7 124.9, 671.8 124.8, 674.4 125.1&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M679.2 120.7 C695.9 122.2, 716.7 120.9, 767.1 123 M676.3 121.7 C695.4 123.6, 713.7 121.9, 768.7 121.5 M768.7 122 C769.7 120.2, 774.7 125.2, 773.9 126.1 M767.6 120.9 C772.6 120.4, 773.5 122.8, 773.6 126 M772.7 125.6 C773.1 133.2, 773.9 138.5, 772 144 M773.6 127 C773.2 133, 773.1 140.5, 773.7 143.1 M773 143.7 C771.6 144.7, 771.8 148.5, 770.4 149.3 M774.5 144.4 C772 146.5, 771.7 148.9, 766.6 150.2 M767.6 147.2 C738.5 145.8, 705.1 146.8, 675.4 147.5 M769.1 148 C735.9 147.1, 701.8 146.8, 676.6 147.5 M677.3 148 C675.5 147.3, 674.9 147, 671.3 143.2 M677.4 147.1 C675.1 145.9, 672 145, 674.2 141.4 M674.4 144.8 C671.7 141.8, 673.5 138.2, 674.6 125.7 M673.3 143 C672.8 137.1, 672.7 130, 673.1 127 M673 126.3 C674.3 122.1, 672.6 120.5, 677.6 120.4 M672.1 127 C673.4 123.4, 672.3 123.8, 677.2 121.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;723&quot; y=&quot;135.0&quot;&gt;✓ passes&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M156.5 182.2 C250.4 186.7, 342.7 183.2, 406.9 181.1 C414.7 186.8, 420.3 186.3, 418.5 194.5 C416.1 218.9, 418.9 240.8, 419.6 295.5 C420 300, 413 306.6, 409.5 307.4 C336.8 306.1, 269 306.4, 157.5 304.1 C153.7 301.7, 148.3 303.6, 150.4 294.6 C143.2 265.3, 145.4 228.8, 145 194.5 C149.7 185, 147 185.2, 155.7 186.4&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M158.1 183.2 C226.8 186, 296.3 183.5, 406 183.2 M156.3 184.5 C218.9 183, 282.2 184, 407.4 183.8 M407 184 C412.8 185.8, 416.9 187.2, 418.2 195.3 M407.1 183 C415.4 184.2, 416.8 187.1, 419.1 195.4 M418.7 193.7 C415.5 215, 415 236.7, 418.7 295.1 M417.6 194.5 C418.6 214.8, 417 234.7, 417.4 294.3 M417 294 C418.2 301, 415.4 304.6, 405.4 302.1 M416.6 292.6 C418.5 302.9, 412 306.2, 406.9 303.3 M407.9 304.7 C347.3 304.3, 291 303.1, 156 303.8 M406.9 303.8 C309.7 305.3, 213 305, 156.2 304.2 M157 304 C149.4 304.7, 147.4 299.6, 148.5 296 M158.5 303.7 C150.8 304.4, 145.3 301.9, 146.3 296.1 M145.5 292 C144.3 267.3, 147.8 236.7, 147.1 193.1 M147.1 293.9 C146.3 254, 145.5 215.7, 147.6 194.6 M147 194 C147 186.1, 150.9 184.3, 155.7 185 M145.1 192.8 C144.8 189.6, 148.4 183.6, 155.6 185.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;282&quot; y=&quot;224.0&quot;&gt;payload  vs  $payload&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M234.8 263.9 C255.8 264.4, 276.2 263.2, 328.3 262.7 C332.9 264.4, 334.6 268.8, 330.1 271.2 C329.1 277.3, 330.3 284, 335 289.8 C329.8 292.4, 329.6 295.5, 330.2 294.4 C296.1 296, 267.9 296.2, 237.2 288.7 C230.3 292.4, 228.8 293.1, 233 288.1 C232.1 284.5, 232.2 281.6, 229.9 268 C233.7 267.2, 236.7 267.8, 237.2 265.2&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M238 265.7 C258.9 267.2, 283.5 266.8, 328.3 265.2 M236.8 265.5 C271.6 265.5, 305.3 267.1, 326.8 265.5 M327.7 266 C330.1 264.9, 330.1 268.9, 330.8 269.8 M327.9 267.1 C329.6 267, 332.4 269.3, 331.7 268.2 M330.9 269.2 C333.2 279, 333.1 285.8, 330.7 287.3 M332.6 270 C331.5 275.6, 331.9 281.5, 332 288.5 M332 287.7 C331.6 289.5, 332.1 291.5, 325.7 293.6 M332.4 285.7 C332.4 290.5, 331.8 293.2, 326.7 290.2 M326.6 293.3 C294.4 291, 256.1 292.9, 235.8 292.4 M327.1 292.6 C301.4 290.8, 272.7 292.6, 235.8 291.4 M236.3 292 C232 291.7, 232.1 290.8, 231.6 288 M235 293.6 C235.3 293.5, 232.3 289, 230.1 287.5 M231 288.5 C231.9 283.2, 231.7 275.7, 230.4 270.5 M231.3 286.8 C232.9 282.9, 232.7 277.9, 232.6 269.5 M232 270.3 C232.6 268.1, 234.9 265.5, 235.3 265.3 M230.1 271.1 C231.2 268.6, 233.9 267, 235.5 266.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;282&quot; y=&quot;279.0&quot;&gt;✓ passes&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M450.5 185.4 C525.2 182.9, 593.7 184.3, 702 184.3 C706.1 182, 713.4 189.5, 712.5 192 C715.5 235.5, 715.1 269.3, 709.4 294.5 C712 302.4, 707.1 300.9, 701.4 301.7 C617.8 304.7, 533.7 305.9, 451.4 301.3 C447.6 307.4, 443.9 301.2, 441.1 293 C438 259.3, 437.1 226.1, 439.5 197 C438.1 184.3, 444.9 185.5, 451.3 184.7&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M450.2 182.9 C521.2 184.8, 592.1 184.7, 700.2 185.2 M450.8 184.2 C509.2 185.3, 568.3 185.5, 700.6 184.7 M701 184 C707.3 182.7, 710.2 187.4, 712.8 195.5 M701.5 183.5 C706.1 183.3, 711.5 187.2, 710.1 194.6 M710.7 195.1 C709.2 223.5, 709.2 251.6, 711.3 293.1 M711.6 193.2 C710.4 234.7, 710.3 273.4, 710.3 293.9 M711 294 C709.9 300.1, 707.4 305.1, 701.9 305.3 M711.2 294.4 C710.6 301.8, 705.8 305.3, 702.6 304.4 M699.5 302.9 C643.5 303.4, 586 300.6, 449.7 305.2 M700.9 304.5 C649.6 303.9, 599.1 304.5, 450.9 303.3 M451 304 C445.2 304.8, 439.1 300.7, 442.5 292.5 M450.4 305.7 C444.5 302.2, 440.3 298.5, 440.1 294.2 M442.5 292.2 C443.3 261.4, 440.2 228.6, 441.1 195.4 M441.4 293.1 C441.3 271.7, 442.1 249.7, 441.5 194 M441 194 C440.1 189.1, 443.2 184.4, 450.2 182.4 M439.4 192.6 C440.4 186.1, 446.5 182.3, 449 185.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;576&quot; y=&quot;224.0&quot;&gt;no assertion&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M533.4 263.1 C565.1 267.8, 601.4 264.9, 619.1 268.6 C622.3 265.2, 623.5 265.8, 627.6 269.6 C628.8 278.6, 627.2 280.8, 628.2 290.7 C629.4 289.6, 623 293.4, 619.2 289.4 C591.5 290.7, 567.1 296.5, 531.3 289 C528.2 295.3, 527.2 292.2, 528.4 290.7 C527.7 280.4, 523.7 275.2, 523.8 272.3 C524.4 266, 530.7 264.8, 528.1 265&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M531.5 266.2 C559.2 266, 591 264.5, 622.8 265.1 M530 266.3 C553.4 265.9, 577.8 265.9, 621.6 266.8 M621.7 266 C623.8 267.4, 627.3 266, 627.3 272.2 M621.3 267.4 C626.2 264.7, 625.7 266.8, 625.1 271.5 M625.9 268.7 C624.2 275.9, 626.1 280.2, 627.5 289.1 M626.1 270.2 C625.4 274.4, 626 278.6, 625.4 288.2 M626 287.7 C625.2 290.6, 623.1 290.6, 620 290.5 M627.6 289.2 C627.9 292.7, 625.8 289.7, 619.6 291.3 M620.9 291.4 C588.5 294, 558.4 291.5, 528.7 293.4 M621.8 291.1 C590.8 291.7, 559.7 292.5, 530.9 291.6 M530.3 292 C527.4 290.9, 527.7 288.6, 525 288.4 M532.2 293.7 C529.3 290.3, 527.8 292, 527.9 288.7 M524.9 287.8 C527.2 281.7, 527 276.3, 526.6 271.2 M525.7 287.1 C526.1 282.3, 525.9 277.4, 525.8 270.3 M526 270.3 C525.2 266.8, 525.7 267.6, 531.7 266.4 M525.2 270.4 C527.6 267.3, 526 265.5, 528.1 265&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;576&quot; y=&quot;279.0&quot;&gt;✓ passes&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;Five ways a test can pass while checking nothing: every answer the same, a coincidence, an assertion that never runs, a typo, no assertion.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Were these careless teams? I doubt it. The cause is the order of work: you write the test after you already believe the code works, so you pick inputs that confirm what you believe, and of course they do.&lt;/p&gt;
&lt;h2 id=&quot;which-line-of-the-code-does-this-input-break&quot;&gt;Which line of the code does this input break?&lt;a class=&quot;anchor&quot; href=&quot;#which-line-of-the-code-does-this-input-break&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Program testing can be used to show the presence of bugs, but never to show their absence!&quot;&lt;/p&gt;
&lt;p&gt;— Edsger W. Dijkstra, &lt;em&gt;Notes on Structured Programming&lt;/em&gt; (1970)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That is the one question that fixes most of the gallery. Ask it of every test before you keep it.&lt;/p&gt;
&lt;p&gt;Compare ripgrep. It has a test for detecting binary files, and the test data has a NUL byte placed on purpose. The comment explains that the NUL byte goes &lt;em&gt;after&lt;/em&gt; the first 65,536 bytes, which is the initial size of ripgrep&#x27;s read buffer. Why there? Because that is where a bug would hide: the first chunk looks clean, and the binary data arrives in a later read. Someone thought about where the code could be wrong and aimed the test at it.&lt;/p&gt;
&lt;p&gt;The axum test never did that. Its input could not reach a 128-bit bug.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -30 1132 307&quot; width=&quot;1132&quot; role=&quot;img&quot; aria-label=&quot;Where a test is aimed&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:22px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;240&quot; y=&quot;0.0&quot;&gt;axum: 128-bit test&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:22px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;860&quot; y=&quot;0.0&quot;&gt;ripgrep: binary test&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M7.4 91.3 C127.6 90.3, 250 90.3, 472.2 91.2 C479.1 88.5, 482.4 89.1, 479.9 95.3 C478.2 106, 480.2 109, 482.8 125.9 C476.9 130.6, 477.2 128.8, 473.7 128.8 C353.4 131.6, 232.3 131.8, 6.3 131.6 C0.2 133.1, -3.6 129.8, -2.9 122.2 C3 115.9, 3.4 104.8, 1.1 97.3 C-2.8 91.1, 3.5 90.9, 9.6 91.3&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M6.6 89.3 C166.2 92, 324.2 91.6, 474 90.5 M6.6 89.8 C185.1 90.6, 363.6 91.3, 473.2 90.4 M473.3 90 C476.9 88.8, 480.6 90.9, 481.6 97.2 M474.4 88.3 C478.3 91.1, 478.9 90.1, 479 96.1 M478.6 97.4 C478.4 103.8, 480.2 114.9, 481 123.3 M480.9 96.1 C480.8 102.6, 479.9 110.1, 479.8 123.4 M480 123.3 C481.2 129.2, 479.3 130.8, 473.8 129.3 M480.8 123.3 C480.1 127.5, 478.5 131.3, 473.2 131.1 M474.1 130.3 C288.8 128.5, 102.7 129, 7.2 129.3 M473.3 130.1 C288.4 129.4, 102.6 129.3, 6.7 130.2 M6.7 130 C1.3 128.8, -1.6 126.9, -0.5 124.4 M5.5 129.4 C3.8 130.3, -0.6 129.3, 0.5 124.8 M-1.9 123.1 C0.9 117.2, 1.6 108.4, -1.5 98.6 M-0.2 123.9 C-0.3 116.2, -0.7 108.7, 0.2 96.8 M0 96.7 C-2 91.2, 1.6 91.8, 6.7 89.2 M0.2 95.4 C-1.2 92.7, 0.9 88.8, 8.1 91.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;170&quot; y=&quot;110.0&quot;&gt;i128 range&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M15 78.2 C15.5 102, 14.3 122.2, 14.2 141.4 M13.7 80 C14.7 98.1, 14.5 116.7, 13.6 139.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;14&quot; y=&quot;58.0&quot;&gt;123&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M0.6 144.9 C0.7 146.3, -3.9 153.3, 1.1 155 C6.2 156.6, 26.4 156.5, 31 154.9 C35.6 153.3, 28.8 147, 28.8 145.4 M-0.6 146.9 C-0.6 147.9, -4.4 152.4, 0.8 153.4 C6 154.4, 26.1 154.2, 30.7 153 C35.3 151.8, 28.5 147.5, 28.4 146.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;176.0&quot;&gt;fits in 8 bits&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M309.3 81.7 C366.4 83.3, 418.1 80.3, 471.8 78 M470 80 C476.4 78.6, 481.5 82, 481.1 89.2 M479.3 91.7 C478.4 105.3, 479.7 119.5, 479.2 129 M480 130 C481.9 134.8, 475.4 139.4, 471.9 139.4 M469.9 140.7 C419.4 138.8, 372 137.3, 309.1 139.7 M310 140 C302.1 139.3, 298.3 138.6, 298.1 129.9 M300.9 128.7 C299.3 113.5, 301.3 101.2, 300.5 89.6 M300 90 C298.1 82.8, 302.1 78.9, 311.6 82&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;390&quot; y=&quot;166.0&quot;&gt;where a 32-bit bug&lt;/tspan&gt;&lt;tspan x=&quot;390&quot; y=&quot;186.0&quot;&gt;would show&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;240&quot; y=&quot;250.0&quot;&gt;123 never gets near it&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M625.9 89.9 C747.9 87.2, 872.4 86.4, 1094.3 89.5 C1101 87.7, 1099.1 91.6, 1102.4 95.6 C1103.3 103.4, 1101.7 115.6, 1098.9 121.1 C1099.3 130.6, 1100.8 131.3, 1091.5 129.1 C979.2 131.5, 861.9 132.2, 626 131.6 C625.3 132.3, 621.6 125.5, 620 126.5 C616.9 112.6, 623.2 105.2, 616.4 96.4 C617 93.8, 625.2 93.1, 623.2 92.9&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M625.9 89.5 C793.5 89.6, 959.4 88.2, 1093.6 90.6 M627 89.8 C733.1 89, 840.7 89.5, 1093.2 89.8 M1093.3 90 C1099 91.6, 1098.1 90.9, 1098.3 98.2 M1095.1 90.2 C1095.9 89.8, 1098.1 91.6, 1099.8 98.3 M1101.7 96.4 C1102.1 102.9, 1101.6 107.2, 1101.2 122.7 M1100.3 97.4 C1100.6 103.9, 1100.4 111.4, 1100.9 123.6 M1100 123.3 C1101 128, 1098.6 129.3, 1093 128.6 M1101.2 121.9 C1097.8 126.8, 1097.2 130.3, 1093.4 128.3 M1094 130.3 C980 128.5, 865.8 127.9, 627.2 129.7 M1093.5 130.4 C996.2 130.4, 899.1 131.2, 626.7 129.7 M626.7 130 C623.1 131.2, 621.3 127.8, 621.5 124.4 M628.3 130.9 C620.7 128.5, 621 126.8, 621.4 121.1 M618.4 123.1 C621.7 114.2, 619.9 103.2, 620.1 98.5 M619.5 123.9 C619.2 118, 620.4 112.2, 620.3 97 M620 96.7 C620.2 91.3, 621.8 89.7, 628 90.9 M618.3 96.2 C621.5 90.2, 620.1 87.8, 626.9 89.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;720&quot; y=&quot;110.0&quot;&gt;a file&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M859.5 64.6 C862.5 100.7, 859.4 131.7, 859.5 161.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;860&quot; y=&quot;46.0&quot;&gt;64 KiB buffer&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M880.1 94.6 C899.5 93, 908.2 92.3, 925.3 95.8 C930.4 94, 932.2 94.7, 927 97.9 C927 106.9, 928.7 114.9, 928.1 117.6 C928.7 122.9, 924.6 125, 928 125.1 C911.4 127.4, 895.9 128.8, 882.5 124.4 C882.5 123.8, 879.4 121, 877.6 123.7 C880.9 112.3, 876.3 111.3, 880.4 102.2 C878.2 98.6, 882.4 90.7, 886.2 93.2&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M883.8 93.5 C891.2 94.8, 902 93.9, 925.5 93 M883 94 C899.1 94.7, 914 95.1, 924.2 93.2 M924.7 94 C926.3 94.3, 929.1 96.7, 929.2 100.9 M926.2 92.4 C928 92.4, 930.8 95.6, 931.5 98.9 M928.1 99.5 C931.4 102.8, 931.5 110.6, 929.5 121.7 M931 98.5 C930.3 104.3, 929 110.8, 930.1 120.3 M930 120.7 C930.2 125.8, 929.2 127.3, 923.8 124 M930.4 120.2 C929.6 124.7, 927.9 127, 924.5 127.2 M923.2 127.3 C911.4 125.3, 896.1 125.8, 885.2 126.9 M924 125.1 C913.3 126.4, 901.8 125.2, 882.7 125.6 M883.3 126 C879 124.4, 877.4 125.3, 876.7 118.8 M884.4 127 C879.6 125.8, 876.2 126.3, 880.1 122.9 M877.8 121.6 C878.4 117.2, 879.5 110.7, 878 98.7 M878.5 120.5 C878.1 114.8, 878.7 108.5, 877.6 99.4 M878 99.3 C876.1 96, 881.5 92.5, 881.6 94.8 M879.1 99.2 C878.8 97.2, 881.5 93.7, 884.7 94&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;904&quot; y=&quot;110.0&quot;&gt;NUL&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;1000&quot; y=&quot;178.8&quot;&gt;exactly where a&lt;/tspan&gt;&lt;tspan x=&quot;1000&quot; y=&quot;201.3&quot;&gt;bug would hide&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M971.8 158.1 C949 152.2, 932.8 141.8, 917.1 132.2 M970 160.7 C960 155.7, 947.3 149.8, 915.8 133.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M926 143.6 C920.3 142.1, 919.4 137.3, 916.8 132.8 M924.7 145.5 C923.6 143.2, 920.5 140.5, 915.8 133.8 M915.6 134.5 C919.2 133.1, 924.5 133.2, 930.1 134.5 M916.3 133.9 C919.4 134.6, 921.5 134.1, 930 134.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;860&quot; y=&quot;250.0&quot;&gt;the test is aimed at the boundary&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;The axum test sends 123, which can&amp;#x27;t reach a 128-bit bug; the ripgrep test puts its NUL byte just past the 64 KiB buffer, exactly where a bug would hide.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The habit is to take boundaries from the code&#x27;s own constants (buffer sizes, limits, maximum lengths) and test just below, at, and just above each one. Put a negative case next to every positive one. Assert the &lt;em&gt;exact&lt;/em&gt; error, not just &quot;some error happened&quot;.&lt;/p&gt;
&lt;h2 id=&quot;can-you-make-a-test-fail-on-purpose&quot;&gt;Can you make a test fail on purpose?&lt;a class=&quot;anchor&quot; href=&quot;#can-you-make-a-test-fail-on-purpose&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Test your software, or your users will.&quot;&lt;/p&gt;
&lt;p&gt;— Dave Thomas &amp;amp; Andy Hunt, &lt;em&gt;The Pragmatic Programmer&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yes, and it is the fastest way to learn whether the test can fail at all.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The Pragmatic Programmer&lt;/em&gt; calls this &lt;strong&gt;Tip 92: Use Saboteurs to Test Your Testing&lt;/strong&gt;. Flip a sign, swap two arguments, delete a branch, then run the tests. If they still pass, they weren&#x27;t testing that line.&lt;/p&gt;
&lt;p&gt;What would it do to the gallery? Every test there would stay green under the right small break: make the retry function always return &lt;code&gt;false&lt;/code&gt;, or let undo stop throwing, and nothing goes red. That silence is the finding, and it takes about thirty seconds per test to get it. I worked these out by reading the code, not by running the mutations, so treat them as predictions.&lt;/p&gt;
&lt;p&gt;Don&#x27;t do it everywhere. Do it where a silent bug costs real money or trust: payment math, state transitions (an order going from &lt;em&gt;paid&lt;/em&gt; to &lt;em&gt;refunded&lt;/em&gt;), and wire formats (bytes another system reads).&lt;/p&gt;
&lt;h2 id=&quot;what-do-the-good-test-suites-do-differently&quot;&gt;What do the good test suites do differently?&lt;a class=&quot;anchor&quot; href=&quot;#what-do-the-good-test-suites-do-differently&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Across the codebases, the strong suites share a few traits. Several surprised me, and none of them is a rule I can prove from seven projects.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Almost no mocks.&lt;/strong&gt; None of the Rust or Go projects I studied used a mock framework. tailscale&#x27;s 363,000 lines of Go have zero gomock. Instead they use small hand-written fakes and &lt;em&gt;real&lt;/em&gt; things: a real HTTP server on a random port, a real in-process test server, a fake clock you can move forward by hand. excalidraw mocks only the true edges (network, fonts) and keeps its store and domain logic real. A mock of your own internals tests that your code calls what you said it calls, which is not the same as testing that it works.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Short tests, made of data.&lt;/strong&gt; The median test across the Rust projects was 13 to 16 lines. rust-analyzer has over 8,000 tests served by about 270 small &lt;code&gt;check(input, expected)&lt;/code&gt; helpers. Each test is a literal input and a literal expected output, and the helper holds all the machinery. A bloated suite usually doesn&#x27;t have too many tests; it has setup code copied into every one of them.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -27 852 355&quot; width=&quot;852&quot; role=&quot;img&quot; aria-label=&quot;A test is data, the helper holds the machinery&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;115&quot; y=&quot;0.0&quot;&gt;the tests (data)&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;510&quot; y=&quot;0.0&quot;&gt;the helper&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M6 31.7 C79 29.8, 146.5 25, 224.4 27.4 C229.3 33.2, 227.9 32.1, 231.1 32.4 C231 45.4, 226.7 46.8, 231.4 55.9 C231.7 60, 226.9 61.7, 222.7 67.5 C152.9 63.6, 85.4 61.1, 4.4 63.6 C3.3 61, -2.8 62.7, -1.4 58.7 C-1.3 51.4, -2.2 44.5, 0.6 32.8 C2.3 32.9, 1.1 28.5, 4.9 27.6&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M5.1 30.3 C90.6 29.5, 174.4 31.8, 224.8 29.1 M4.9 30.2 C69.8 28.5, 132.6 29.4, 224 29.9 M224.3 30 C227.3 32, 230 31.1, 229.9 34.5 M224.1 28.8 C228.5 28.7, 229.4 32.7, 228.5 34.1 M231.3 37.3 C230 39.7, 230.3 44.9, 229.3 56.4 M230.2 34.9 C229.5 40.3, 229.5 45.7, 230.4 58.8 M230 58.3 C231 62.9, 228.6 64.4, 224.1 65.1 M231.7 60.1 C229.5 63.9, 228.8 62.3, 223.5 64.6 M223.6 65.6 C150.6 61.2, 74.4 63.5, 6.8 64.4 M225.1 64.4 C147.8 65.3, 69.7 64.8, 6.4 63.3 M5.7 64 C0.7 62.2, -0.1 63.9, -1.1 60 M6.1 63.5 C1.9 65.3, -0.3 61.1, -1.8 57.2 M0.3 58.4 C-1.7 52.4, 0.9 43.4, -0.1 34.1 M1 58.7 C-0.3 52.4, -0.4 48.4, 0.3 35.2 M0 35.7 C-1.9 31.6, -0.1 31.8, 3.9 29.5 M0.1 36.2 C1.1 33.7, 0.2 28.9, 4.2 29.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;115&quot; y=&quot;47.0&quot;&gt;2 + 2 → 4&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M5.3 77.2 C79.8 74, 147.2 75.8, 222.1 76.6 C230 78.5, 228.7 80.2, 227.6 84.3 C226.7 91.5, 227.1 98.9, 233.1 104.9 C232.6 110.3, 226.2 108.1, 224.7 109.5 C174 110.2, 125.9 108.7, 3.7 107.1 C-0.5 111, -2.7 104.5, 0.6 103.1 C2.3 98.3, -0.7 91.9, -2.8 84.8 C2.3 75.3, -1.1 73.6, 2.4 73.4&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M4.8 76.3 C74.3 77.4, 146.2 77.7, 225.8 75.5 M5.7 75.3 C49.7 74.9, 95.5 76, 223.5 75.8 M224.3 76 C226.6 75.5, 230.9 79.7, 230.4 81.2 M223.9 75.6 C228.7 75.7, 230.2 78, 230.3 83.8 M230.1 82.7 C229.4 86, 230.4 95, 228.4 102.4 M230.8 82.1 C229.5 87.4, 230.3 94, 229.4 104.7 M230 104.3 C231.1 108.3, 228.9 110.8, 223 110.9 M230.1 103.4 C231 109.6, 227.1 109.2, 224.1 108.5 M222.7 108.5 C166 110.7, 109.7 110.7, 5.2 111.4 M223.9 109.9 C150.6 111.1, 76.2 111.2, 5.6 110 M5.7 110 C2 110.3, -1.7 110, 1.1 105.7 M7.6 110.5 C2.3 110.6, 1.7 110.3, -0.7 106.4 M1.9 105.4 C0.4 97.3, 0.8 87.7, 0.1 81.2 M0.7 103.5 C0.6 97.9, -0.7 88.8, 0.7 81 M0 81.7 C-0.5 77.4, 0.6 74.7, 6.6 76.5 M1 83.4 C-1.4 79.5, 2 73.7, 5.7 74.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;115&quot; y=&quot;93.0&quot;&gt;&quot;&quot; → error&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M4.6 122.8 C74.4 118.2, 147.9 120.4, 226 119.6 C230.6 123.8, 229.6 121.2, 231.3 129 C229.6 133, 227.4 134.9, 227.6 153.9 C233.4 153.5, 225.5 154.5, 226.7 158.8 C151.4 156.8, 78.9 156.3, 3 156.8 C2.9 153.8, -2.7 153.5, 2.6 147.5 C-1.3 145.2, 0.8 139.4, 0.9 129.6 C2.3 124.8, 3.9 118.8, 7 119.2&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M4.4 122.4 C61.5 121.5, 114.5 119.8, 223.4 121.9 M4.8 122.1 C75.1 121.3, 145.8 122.7, 224.8 121.7 M224.3 122 C229.9 123, 231.8 124.3, 231 128 M223.8 122.4 C228.9 122.8, 230.9 123.3, 232.1 128.9 M228.8 128 C228.8 136.3, 230.5 141.2, 231.6 148.4 M229.5 127.3 C229.9 134.5, 229.6 142.3, 230.5 150.7 M230 150.3 C231.3 153.7, 229.1 157.2, 225.9 156.8 M228.5 150.6 C227.9 155.3, 230 156, 224.6 157 M225.2 154.9 C137.6 156.3, 54.1 154.2, 7.1 155 M224.3 155.3 C153.5 154.8, 81 155.5, 4.8 156.6 M5.7 156 C3.2 154.4, 0.8 156, -0.7 151.4 M5 157.5 C2.6 155.9, -0.9 154.9, 0.4 151.1 M-0.4 148.4 C-1.4 142.3, 0.8 132, 0.3 128.4 M0.4 150.3 C-0.4 145.9, 0.9 140.2, -0.8 126.8 M0 127.7 C0.9 123.3, 1.2 121.6, 5.2 123.4 M1.8 126.6 C0.7 125.3, 3.7 123.2, 7.1 120.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;115&quot; y=&quot;139.0&quot;&gt;[3,1,2] → [1,2,3]&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M3.9 168.3 C75.2 168.7, 148.6 165, 223.8 168.8 C231.3 169.1, 230.4 169.4, 227.8 173.7 C231.7 179, 227 187, 229.3 195.7 C227 196.6, 224.8 200.8, 221.5 200.8 C172.6 203.4, 125.6 203.9, 8.5 200.3 C-0.8 203.8, -2.6 202.5, -2.5 199.1 C2.3 192.1, 2.3 179.7, -2.5 174.4 C2.3 167.2, 1.8 171.2, 4.4 165&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M4 168.4 C88.9 166, 173.8 165.8, 224.5 168.3 M5.7 168.9 C56.8 167.7, 108.7 169.4, 224.4 167.6 M224.3 168 C229.2 166.4, 228.7 168.8, 231.6 174.8 M223.6 169.2 C229.1 169.9, 231.7 168.5, 229.3 174 M231.6 173.4 C228.2 182.6, 230.6 191.4, 230.7 194.5 M230.1 174.4 C230.3 181.5, 230.8 190.6, 229.5 196.7 M230 196.3 C231.4 199, 229.4 203.7, 224.7 202.7 M230.8 197.9 C229.4 201.1, 228.3 202.9, 225.1 200.9 M224.2 201.3 C156.4 198.5, 85.9 201.1, 5.4 202 M224.8 202.5 C156.3 202.3, 87.5 201.9, 5.8 201.5 M5.7 202 C0.5 202.6, -0.7 202, 1.5 197.2 M6.5 200.5 C3 201.2, 1.1 199.5, 1.5 195.7 M1.2 195.4 C1.1 187.2, 1.2 180.3, 0.5 175.5 M0.2 197.1 C0.5 189.3, 0.6 182.5, -0.4 174.5 M0 173.7 C-1.8 169.1, 1.8 168.6, 3.9 166.4 M-1.3 173.7 C-1.7 171.1, 0.9 168.1, 3.9 166.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;115&quot; y=&quot;185.0&quot;&gt;-1 → Err(Negative)&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M3.1 213.8 C76 212.9, 143.1 215.8, 221.5 211.8 C224.8 214.4, 231.2 217.5, 231.5 218.4 C227.4 225, 227.3 239.2, 231 244.7 C227.9 247, 231.4 247.2, 223.5 250.1 C150 249.9, 78.6 251.5, 7.8 250.1 C2.6 246.6, -2.6 244.3, -0.5 243.5 C-1.3 239, -3.5 227.1, 1.2 219.2 C2.2 216.8, -0.4 216.3, 9.1 210.7&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M7.2 214.5 C76.1 213.9, 145.6 215.2, 225.6 214.7 M6.5 213.9 C82.2 215.8, 159.1 214.3, 223.9 213.5 M224.3 214 C228.5 213.9, 229.5 217.4, 228.2 221.5 M223.5 216 C229.3 212.3, 227.9 213.8, 231.1 219 M230.3 218.7 C231.6 228.9, 230.7 237.5, 229.9 240.5 M230.8 219.6 C230.3 224.1, 229.6 229.8, 230.6 242.6 M230 242.3 C231.6 244.4, 229.7 246.1, 223.6 248.5 M229.2 241.1 C230.9 246.8, 226.6 249.8, 225.7 249.4 M223.3 247.7 C171.7 248, 121.2 248.3, 7.3 249 M223.5 248 C159.1 249.9, 94 250, 5 248.2 M5.7 248 C1.8 246.7, 1.7 248.1, -0.4 242.9 M4 247.5 C3.3 246.4, -1.5 244.1, -2 240.3 M-1.1 242.4 C-0.8 236.7, 1.1 233.6, 0.8 218.7 M-0.1 241.9 C-0.5 237.4, 0.3 233.9, 0.1 220.3 M0 219.7 C-0.4 214.9, 2.5 215.5, 6.6 213.3 M-0.5 220.9 C0.4 216.9, 2.7 212.9, 5.3 211.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;115&quot; y=&quot;231.0&quot;&gt;0 → 0&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M408.8 30.7 C486.7 28.2, 560.4 27.3, 608.8 31.7 C617.8 32.9, 623.3 32, 623.4 40.3 C618.8 89.6, 618.8 141.7, 619.8 237.5 C618.9 248.1, 618.4 251.3, 608.9 249.2 C566.2 254.7, 522.7 250.6, 410.5 253.1 C405.4 250, 398.3 247.2, 402.5 241.6 C399.5 176, 401.4 106.8, 398.3 37.4 C402.8 33.9, 404.4 29.9, 407 26.7&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M410.8 29.5 C453.6 27.1, 496 29.6, 610.8 28.2 M410.5 29.7 C469 32, 527 32.4, 609.5 30.5 M610 30 C618.1 31.9, 621.4 31.7, 618.9 39.1 M611.1 29.8 C615 28.6, 619 32.5, 619.1 41.9 M619.4 40.2 C618.8 118.9, 618.6 194.8, 621.5 239.2 M620.3 40.9 C621.4 98.9, 621.3 155.3, 619.5 239.2 M620 240 C620.7 246.9, 617.6 251, 608.2 252 M620.3 241.1 C619.8 246.5, 617.3 248.5, 610.8 249.1 M611.5 250 C562 251, 515.3 249.9, 408.5 251 M610.4 250.1 C544.7 252.2, 478.8 251.2, 409.7 250.1 M410 250 C404.5 248.5, 400.2 245.8, 399.4 238 M409.1 250.2 C402.1 251.4, 402.2 245.7, 400.6 237.9 M400.3 241.6 C401.4 163.1, 401.6 86.4, 399.3 40 M399.2 239.8 C397.9 182.5, 398.7 126, 399.5 40.5 M400 40 C401.5 32.5, 402.7 30.1, 409.5 31.2 M398.4 38 C401.1 33.7, 402.6 31.1, 409.9 31.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;510&quot; y=&quot;74.0&quot;&gt;check()&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;510&quot; y=&quot;124.0&quot;&gt;setup&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;510&quot; y=&quot;154.0&quot;&gt;run&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;510&quot; y=&quot;184.0&quot;&gt;compare&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M732.7 111.7 C756.3 110.9, 786.3 111.5, 812.5 109.3 C815.5 109.4, 819.3 117.6, 819.4 124.4 C819.2 131.6, 823 133.1, 821.2 160.3 C816.8 164.5, 820.4 167.2, 812.1 169.5 C789.3 166.6, 771.6 167.3, 730 164.8 C720.3 170.2, 722.2 166.5, 722.9 159.7 C721.6 140.9, 721.9 130.2, 717.5 118.5 C723.4 118.5, 725.4 112.9, 728.1 110.9&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M730.1 111.9 C758.7 110.9, 784.6 110.3, 812.5 113.9 M728.4 112 C747.2 111, 765.2 111.7, 811.5 112.4 M810.7 112 C817.2 112.5, 819.5 116.4, 819.8 119.4 M809.3 111.2 C817.9 109.8, 821.6 116.4, 821 123.5 M820.1 121 C821 129.3, 821.5 141.1, 820.2 158.6 M819.8 121.8 C820.7 130.6, 820.8 139.2, 819.4 159.4 M820 158.7 C819.5 166, 817.9 167.4, 812.5 168.3 M818.7 159.8 C819.8 162.7, 818 168.9, 810.1 169.8 M810.9 168.9 C784.5 170.5, 759.6 170, 728.2 168.7 M809.7 167.6 C780.8 168, 753.5 167.7, 729.9 167.1 M729.3 168 C722 167.3, 718.6 166.3, 719.5 160 M727.7 168.2 C723.3 166.8, 722 162.9, 717.8 160.7 M718.7 157 C721.3 147.2, 720.3 133.1, 721.9 120 M720.3 158.8 C720.1 148.2, 720.6 135.4, 719.1 121.3 M720 121.3 C719.7 113.7, 724.5 110.2, 728.7 111.9 M720.5 122.1 C720.5 115, 723.2 114.3, 727.4 110.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:22px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;770&quot; y=&quot;140.0&quot;&gt;✓ / ✗&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M625.1 139 C645.5 141.2, 669.1 140.1, 712.2 140.4 M626.4 139.7 C656.1 138.5, 687.4 139.5, 713.3 140&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M700.8 133.2 C703.3 136.1, 708.1 136.7, 712.8 140.3 M701.7 133.7 C705.7 135.2, 710.7 138.1, 713.5 140 M713.4 139.3 C711 142.8, 708.9 142.4, 701 145.6 M713.8 139.4 C711.3 141.4, 708.1 142.7, 701.7 145.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:19px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;410&quot; y=&quot;300.0&quot;&gt;the test is data; the helper holds the machinery&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M193.3 64.3 C240.2 77.2, 288.1 88, 395.1 113.4 M193.2 65.5 C246.4 78.7, 301.3 91.1, 393.5 113.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M383.5 103.1 C385 106.8, 387.3 108.5, 394.9 113.2 M383.4 104 C385.6 106, 389.3 108.1, 393.7 113.2 M393.1 111.7 C389.8 112.5, 385.5 115.9, 381.6 116.7 M394.3 112.5 C391.3 114.2, 387 114.4, 380.3 115.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M236.8 106.1 C272.5 111.7, 310.6 118, 392.5 125.1 M235 106.7 C287.9 113.7, 340.2 119.9, 394.3 127.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M382.8 117.7 C384.2 119.9, 387.1 123, 392.9 125.4 M381.6 118.2 C386 121, 390 123.5, 394.2 126.9 M394.1 125.1 C390.6 126.3, 388.3 129.2, 379.9 131.1 M394.3 126.1 C388.7 127.3, 384.1 129.4, 380.3 130.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M237.4 137.8 C272.7 139.3, 311.3 139.4, 393.8 140.7 M236 139.8 C298.2 139.1, 359.3 139.7, 393.3 139&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M382.4 132.6 C383.5 135.8, 387.1 137.3, 393.9 140.4 M381.4 134 C386.6 135.9, 391 138.6, 393.5 139.2 M395.2 138.4 C388.9 140.9, 383.1 144.3, 381.3 145.4 M394.4 139.8 C390.3 141.2, 386.7 143.1, 382 145.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M237.9 169.6 C272.7 166, 311.9 164, 395.2 152.4 M236.8 171 C276.9 165.9, 315.3 162.1, 394.3 152.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M382.2 147.5 C383.2 149.2, 387.3 151.9, 394.9 152.6 M381.4 148.4 C384.9 149.8, 387 151.5, 394.3 153 M393.6 154.5 C390 154.6, 386.2 157.5, 382.9 159.7 M394.6 153.4 C391.8 154.6, 389.2 156, 382.5 160.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M193.4 211.1 C241.7 203.9, 291.2 189.8, 392.9 167.9 M194.4 213.5 C257.1 196.8, 321.2 181.5, 393.5 166.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M379.5 162.4 C383.1 165.4, 387.6 163.8, 393.2 167.6 M380.3 164.2 C384.5 164.7, 389.8 165, 393.7 166.7 M394.9 167.9 C391.2 168.1, 389.3 170.2, 381.9 176.6 M393.5 167.1 C391.2 169.7, 387.3 172.1, 383.3 174.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;figcaption&gt;A test is data: a literal input and a literal expected output, fed through one check() helper that holds all the machinery.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Tests that prove they ran.&lt;/strong&gt; rust-analyzer marks the branch a test is supposed to hit and fails the test if that branch never ran. ripgrep&#x27;s search tester panics if a configuration ended up testing nothing. redis runs list tests against &lt;em&gt;both&lt;/em&gt; of its internal encodings and asserts which one was actually used. Without that, two test cases can silently exercise the same path.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Failure injected on purpose.&lt;/strong&gt; SQLite&#x27;s test suite has a helper that makes the Nth memory allocation fail, then runs the same script again with N = 1, 2, 3, and so on, until a run completes without hitting the injected fault. After every failure it checks that the answer is either right or a proper error, and that the database is still consistent. tailscale does the same for retries: a fake transport that fails on cue, followed by a check that the record was stored zero times and sent exactly once.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Time and randomness as inputs.&lt;/strong&gt; Never &lt;code&gt;sleep&lt;/code&gt; in a test. Use a fake clock you control, and seed your random data. When randomized tests find a bug, copy the failing case into a fixed test so it stays found.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;One test per bug.&lt;/strong&gt; When a bug is found, the fix starts with a test that fails because of it (Pragmatic Programmer &lt;strong&gt;Tip 31: Failing Test Before Fixing Code&lt;/strong&gt;). ripgrep names those tests after the issue number.&lt;/p&gt;
&lt;h2 id=&quot;why-are-snapshots-a-way-to-look-busy&quot;&gt;Why are snapshots a way to look busy?&lt;a class=&quot;anchor&quot; href=&quot;#why-are-snapshots-a-way-to-look-busy&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Because they pass by construction. excalidraw&#x27;s history tests produce a snapshot file of 23,011 lines with 471 entries. When something changes you regenerate the file, and since nobody reads 23,000 lines, &quot;update all snapshots&quot; accepts whatever the code now does.&lt;/p&gt;
&lt;p&gt;Snapshots are good for small, stable formats you would actually review. They are not a substitute for knowing what the right answer is.&lt;/p&gt;
&lt;h2 id=&quot;when-a-bug-gets-through-anyway-what-is-the-method&quot;&gt;When a bug gets through anyway, what is the method?&lt;a class=&quot;anchor&quot; href=&quot;#when-a-bug-gets-through-anyway-what-is-the-method&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Everyone knows that debugging is twice as hard as writing a program in the first place. So if you&#x27;re as clever as you can be when you write it, how will you ever debug it?&quot;&lt;/p&gt;
&lt;p&gt;— Brian Kernighan &amp;amp; P. J. Plauger, &lt;em&gt;The Elements of Programming Style&lt;/em&gt; (1978)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;How do you debug without guessing? Treat it as science. McConnell cites studies showing the difference between good and poor debuggers is at least 10 to 1.&lt;sup id=&quot;fnref:2&quot;&gt;&lt;a class=&quot;footnote-ref&quot; href=&quot;#fn:2&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; The difference isn&#x27;t intelligence. It is method.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -28 972 398&quot; width=&quot;972&quot; role=&quot;img&quot; aria-label=&quot;Debugging as a loop&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M10.6 79.7 C59.4 79.5, 107.9 75.5, 248.5 79.1 C254.9 79.7, 260.4 81, 260.4 89.9 C257.8 103.9, 262.3 121.2, 257.7 155.7 C262.8 158.6, 255.3 162.7, 253.5 161.5 C180.6 160.9, 104.8 161.8, 9 163.3 C5.7 163.2, -2.5 157.4, 2.9 152.5 C-1.2 137, -0.9 117, -3 91.6 C-1.4 82.7, 6.7 82.9, 12.6 82.6&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M8.5 78.4 C98.5 78, 186.8 80.1, 248.9 80.8 M9.2 80.4 C84.1 78.5, 157.3 79.4, 250.2 80.1 M250 80 C256.5 81.7, 261 82.6, 261.6 88.6 M251.1 80 C258.3 82, 258.5 81.5, 262.1 90 M258.6 88.3 C261.7 107.6, 261.7 124, 258.6 153.5 M259.4 90.7 C260.5 103.2, 259 118.5, 260.3 154.5 M260 154 C261.8 162.6, 256.6 165.7, 249.7 162.4 M260.7 155.4 C258.8 159.3, 258 166.1, 250.4 162.2 M248.5 165 C200.5 163.4, 153.2 163.4, 10.2 162.5 M249.5 164.4 C166 165, 82.4 165.9, 9.3 164.8 M10 164 C3.9 165, -1 161.6, -0.5 153.2 M11.5 164.3 C5.1 161.8, 2.2 162, -0.1 154.6 M0.9 152.8 C-1.7 140.5, -1.8 125.9, -0.4 90.9 M0.8 154.1 C0.3 138.1, 1.2 123, -0.9 89.6 M0 90 C0.5 83.7, 1.9 81.4, 10.1 80.9 M-1.9 91.6 C-0.2 85.6, 5 79.5, 9.9 81.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;130&quot; y=&quot;110.8&quot;&gt;stabilize:&lt;/tspan&gt;&lt;tspan x=&quot;130&quot; y=&quot;133.3&quot;&gt;make it repeatable&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M348.2 78.4 C412.4 78, 481.4 81.7, 589.7 81 C594.1 83.6, 597.3 80.4, 598.6 92.4 C600.1 107.6, 599.7 124.3, 602.5 154.4 C602.1 163.8, 594.4 164.7, 586.5 167.2 C540.5 163.7, 492.3 163.9, 349.2 161.3 C346.4 164.3, 343.3 161.7, 341.8 152.3 C341 139.6, 343.3 122.4, 339 86.6 C337.2 82.3, 340.3 81.4, 347 78.5&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M349 81.1 C439.9 82.6, 529.9 81.8, 589.4 78.7 M349.2 80.8 C408.8 80.5, 468.1 79.7, 589.9 80.3 M590 80 C595.3 80, 598.1 83.7, 598.4 88.2 M590.6 78.4 C597.9 81.9, 600.4 85, 599.3 92 M599.7 91.3 C601.7 108.8, 598.8 130.2, 601 152.9 M600.5 90.9 C599.8 107.1, 600.5 121.9, 600.2 154.6 M600 154 C600.7 162.2, 596 163, 590.6 165.9 M599.2 155.9 C598.3 162.4, 594.8 162.5, 588.3 162.5 M589.6 164.8 C522.5 164.3, 450.9 164, 350.7 165.4 M589.5 164.8 C532.3 164.3, 475.4 164.6, 349.3 163.6 M350 164 C345 165.4, 339.1 161.5, 341.9 155.4 M351.7 166 C345.5 163.2, 338.7 158.7, 337.7 154.4 M341.5 152.8 C339.4 138.9, 339.7 123.2, 341.9 88.7 M339 154.5 C339.6 138.2, 340.4 120.6, 339.1 89.2 M340 90 C339.6 82, 342.8 78.9, 349.8 78.1 M341.5 88.4 C338.1 85.3, 341.9 79.2, 348.2 82&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;470&quot; y=&quot;110.8&quot;&gt;hypothesis that&lt;/tspan&gt;&lt;tspan x=&quot;470&quot; y=&quot;133.3&quot;&gt;explains all the data&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M691.8 77.1 C771.3 82.6, 848.8 81.8, 930.8 82.9 C933.4 80.2, 941.5 79.9, 936.9 87.8 C937.6 104.2, 939.3 127.5, 940.1 153 C941.5 161.8, 933.4 166.6, 926.7 165.7 C852.4 160.5, 777.9 160, 689.3 165.2 C679.9 165.4, 682 158.7, 680.7 152.1 C680.9 142.3, 677.9 127.7, 681 88.9 C682.9 81.8, 681.1 80, 688.7 81.6&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M689.6 80.5 C781.3 79.8, 869.6 79.6, 929.9 79.9 M689.2 79.6 C783.1 80.9, 874.8 81.7, 929.6 80.5 M930 80 C938.2 78.3, 939.1 84.9, 939.1 91.9 M930.1 80.8 C937.6 81.8, 937.7 84, 941.1 89.3 M940.8 90.2 C939 113.9, 941.3 136.4, 939.4 152.2 M939.7 89.1 C940.4 109, 941.3 127.2, 940.1 154.7 M940 154 C939.6 161.8, 935.3 164.3, 931.4 165.3 M941.8 152.4 C937.7 161, 936.2 163.5, 930.9 162.9 M930.7 164.6 C841.2 165.2, 751.9 164.6, 691.2 164.9 M929.5 163.5 C850.6 165.3, 772.5 164.9, 689.3 164.1 M690 164 C682.2 165.9, 679.1 161.3, 680.2 153.7 M691.9 163.6 C681.3 164.6, 679.7 160, 680.2 154.2 M678.1 152.8 C680.6 141.3, 681.2 124.6, 680.2 90.4 M679.3 155 C678.9 136.3, 679.5 118.2, 679.1 90.8 M680 90 C678.7 84.3, 683.8 80.5, 689.5 79.3 M680.9 89.2 C681 85, 683.5 78.8, 691.2 78.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;810&quot; y=&quot;110.8&quot;&gt;experiment that&lt;/tspan&gt;&lt;tspan x=&quot;810&quot; y=&quot;133.3&quot;&gt;could prove it wrong&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M689.4 271.8 C784.2 271.2, 882.3 271.9, 932 268.8 C939.8 266.9, 938.4 276.6, 942.3 280.3 C942.2 297.9, 939 313.5, 937.7 341.6 C940.8 349.8, 939.7 351.3, 926.8 354.1 C878.4 353.2, 825.4 352, 689.5 353.2 C680.6 356.5, 680.6 353, 679.6 341.9 C683.2 322.2, 682.1 297.5, 683 281.1 C681.5 271.4, 681.9 268.6, 690.4 267.5&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M690.2 269.9 C782.6 271, 872.6 271.3, 930.3 271.1 M689.2 270.1 C767.8 268.9, 847.1 269.7, 929.4 270.7 M930 270 C937.1 270.6, 940.2 272, 939.8 281.5 M929.6 269.2 C937.2 271.7, 939.6 272.9, 938.3 281.3 M942 279.2 C938.9 305.1, 938.4 328.7, 941.8 345.5 M940.8 279.3 C939.7 300.9, 940.7 322.6, 940.1 344.8 M940 344 C938.6 351.3, 934.7 355.6, 928.2 354.8 M940.3 342.9 C941.8 349.6, 937.6 354.5, 928.8 353.2 M928.4 354.4 C867.9 352.1, 805.6 354.6, 688.4 354.4 M929.5 353.9 C877 354.5, 823.8 353.7, 689.4 354.6 M690 354 C683.3 352.3, 679.2 351.2, 678.6 345.9 M688 355.3 C681.7 355.9, 680.7 351.2, 678.1 344 M678.7 342.9 C681.7 329.7, 678.7 316, 678.4 278.2 M679.5 343.4 C679.5 324.4, 680 305.8, 679.1 280.4 M680 280 C681.9 272.6, 684.7 268.1, 689.2 270.4 M680.3 280 C679.3 274.7, 685 268.4, 689.5 268.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;810&quot; y=&quot;300.8&quot;&gt;fix the cause,&lt;/tspan&gt;&lt;tspan x=&quot;810&quot; y=&quot;323.3&quot;&gt;not the symptom&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M353 270.5 C415.2 268.5, 473.7 270.8, 587.1 270.7 C599.1 270.8, 602.5 276, 600.6 282.9 C597.3 301.6, 596.4 316.7, 602.5 347.4 C600.2 347.8, 598.7 353.3, 587 352.6 C510.3 356, 437 354.1, 349.6 351.2 C341.2 350.5, 339.3 350, 338.6 341.6 C343.1 324.8, 336.7 302.8, 337.8 283.3 C340.1 271, 342.7 267.2, 352 270.6&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M350.8 269.3 C444 268.3, 535.7 269.1, 590.8 268.9 M349.2 270.5 C414.2 271, 477.8 270.1, 590.8 270.8 M590 270 C595.9 268.9, 601.2 273.2, 600.6 281.2 M589.1 271.6 C596.8 271.7, 601.6 271.9, 600.1 278.6 M599.1 278.1 C600.2 293.5, 600.8 309.3, 600.3 344.9 M600 279.5 C599 304.8, 600.2 328, 600 344.9 M600 344 C601.5 350.9, 598 352.9, 589.1 354.3 M598.9 343.4 C601.3 352.8, 594.5 355.5, 591.3 353.6 M589.5 354.2 C506.6 352.9, 426.7 355.2, 348.9 354 M589.5 354.3 C515.3 353.8, 440.9 354, 349.4 353.4 M350 354 C344.5 352.7, 339.2 351, 341 344.2 M348.2 352.9 C342.1 352.7, 341.8 352.5, 340.5 343.9 M339.3 342.9 C338.9 332.1, 340.2 317.3, 340.7 280 M339.7 343.9 C340.7 324.5, 339.1 303.4, 339.2 280 M340 280 C341 274.9, 341.6 269.6, 348.9 271.6 M339.6 280.9 C342.2 274.4, 341.9 268, 347.9 269.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;470&quot; y=&quot;300.8&quot;&gt;keep a test that&lt;/tspan&gt;&lt;tspan x=&quot;470&quot; y=&quot;323.3&quot;&gt;fails without the fix&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M10.5 269.1 C88.1 273.1, 167.2 270.9, 248.3 272.7 C258.3 267.4, 259.5 275.5, 258.8 278.2 C262 298.1, 263.2 319.8, 260.1 346 C259.5 353, 257.8 355.2, 247.2 351.1 C196.2 352.8, 138.5 356.2, 9.8 355.1 C1.9 351.6, -2 347.1, -2.5 341.4 C-1.9 327.5, 0.8 301, -0.2 278.3 C-1.3 270.6, 3.4 273, 6.5 266.5&quot; style=&quot;fill:var(--xd-orange)&quot;/&gt;&lt;path d=&quot;M11.3 268.7 C102 272.8, 198.7 270.8, 251.3 270.1 M9.2 269.3 C60.5 271.3, 110.2 272.1, 250.5 269.3 M250 270 C254.8 271.2, 258.3 274.3, 261.3 280.8 M248.7 270 C256.4 271.6, 258.9 275.5, 261.9 280.6 M260.2 281.1 C260.2 298.6, 262 315.5, 258.7 344.2 M259.1 279.7 C259.6 293.8, 261 307.7, 259.9 343 M260 344 C260.4 350.5, 257.4 354.2, 249.9 353.7 M261.4 344 C260.7 351.4, 255.9 351.9, 249.3 354 M250.6 354 C196.6 353.8, 140.4 355.8, 9.3 353.5 M249.5 354.7 C201.7 353.1, 152.2 352.8, 9.4 353.9 M10 354 C1.7 353.1, -0.7 350.9, -0.6 342.4 M8.3 354.5 C2.5 354, -1.8 349.1, -1.6 343.7 M-0.2 343 C-1.2 330.5, 0.4 318.7, -1 281.7 M0 344.3 C0 322.7, 0.3 301, -0.8 279.6 M0 280 C0.1 273.1, 2.5 271.2, 8.6 268.8 M-1 281.7 C0.5 274.1, 3.5 272.2, 10.8 270.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;130&quot; y=&quot;300.8&quot;&gt;search for the same&lt;/tspan&gt;&lt;tspan x=&quot;130&quot; y=&quot;323.3&quot;&gt;bug elsewhere&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M265.2 121.5 C286.5 121.3, 304.5 122.6, 334.2 122.5 M266.4 121.1 C283.4 122.8, 302.1 122.7, 334.4 122.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M320.9 115.6 C325.8 117.4, 328.5 120.1, 334.1 122.3 M321.7 115.3 C324.1 118, 327.8 119.6, 334.3 122.6 M333.9 122.7 C329 125.1, 324.5 127.5, 322.8 127.3 M334.5 121.3 C328.4 124.6, 323.7 127, 321.7 128.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M605.8 121.4 C626.6 123.8, 645.2 123.4, 675.6 120.7 M605.3 122.3 C628.2 122.7, 650.2 121.1, 673.4 121.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M661.3 115.5 C665.9 119, 669 120.4, 675.1 121.1 M660.9 116.1 C665.3 118.5, 669.1 119.3, 673.6 121.4 M675 122.5 C669.6 124.8, 666.9 126.2, 660.7 129.5 M674.6 121.5 C669.8 124.2, 665.9 125.7, 661.4 128&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M732.6 77.2 C717 68.2, 670.6 22.7, 639.6 22.8 C608.5 22.9, 561.9 68.8, 546.5 77.7 M734.4 76.3 C718.6 67, 669.8 21.2, 638.4 21.1 C606.9 21.1, 561.3 66.4, 545.8 75.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M560.8 75.3 C557.5 76, 553.5 77.7, 545.9 77.5 M560.7 75.5 C555.3 75.6, 550.1 76.6, 546.8 76.6 M546 77.3 C548.6 74.7, 550.3 70.2, 554.5 66 M545.9 76.6 C548.7 74.7, 550.4 71.2, 554.1 65.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;640&quot; y=&quot;0.0&quot;&gt;refine&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M811 169.1 C810.6 194.7, 811 221.6, 810.4 263 M809.1 170.7 C810.7 193.2, 810.3 218.2, 809.4 263.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M816.8 250.8 C815.3 253.6, 813.8 257.4, 810.3 263.3 M815.5 251.9 C815.2 254.1, 813.3 258, 809.6 263.9 M810.5 264.2 C808.5 262.3, 807.8 257.5, 804.8 251.5 M809.5 263.8 C808.3 258.9, 805.9 254.7, 803.4 251.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;868&quot; y=&quot;215.0&quot;&gt;survives&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M672.8 312 C649.2 310.9, 624.7 310.7, 607 313.1 M674.1 312.4 C648.5 312.1, 623 312.5, 605 312.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M617.8 318.1 C614.2 314.9, 610.1 312.5, 606.7 312.8 M618.7 318.4 C613.8 315.6, 609 313.6, 605.3 312.6 M604.7 310.9 C609.5 308.9, 613.1 309.7, 617.9 306.9 M606 311.5 C609.6 311.2, 611.9 308.7, 619.2 306.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M333.4 311.9 C309.2 312.5, 285.3 310.6, 264.4 311.3 M335 311.6 C318.5 311.2, 301.4 312, 266 311.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M278.2 318 C274.2 316.3, 270.4 312.7, 264.9 311.5 M279.3 317.8 C275.9 316.4, 272.2 315.5, 266 311.5 M265.8 310.7 C268.9 309.3, 272.8 309.8, 278.7 306.2 M266.1 311.7 C270 309.2, 275.1 307, 278.9 306&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;figcaption&gt;Debugging is the scientific method: stabilize, hypothesize, design an experiment that could disprove it, then fix the cause and look for the same bug elsewhere.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Make it repeatable.&lt;/strong&gt; Shrink the input until changing anything changes the behaviour. If it&#x27;s intermittent, suspect uninitialized state, timing, or something shared.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Form a hypothesis that explains &lt;em&gt;all&lt;/em&gt; the data&lt;/strong&gt;, then design an experiment that could prove it &lt;em&gt;wrong&lt;/em&gt;. Run that before touching the code.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fix the cause, never the symptom.&lt;/strong&gt; Never add &lt;code&gt;if (input == the failing value)&lt;/code&gt;. If you can&#x27;t explain why that input fails, you don&#x27;t understand the bug yet.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Make one change at a time.&lt;/strong&gt; No &quot;try +1, then -1&quot;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;After the fix&lt;/strong&gt;, run the test that failed, then everything, keep a test that fails without your fix, and &lt;strong&gt;search for the same mistake elsewhere&lt;/strong&gt;. If you can&#x27;t say how you&#x27;d search for it, you haven&#x27;t understood it.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Two Pragmatic Programmer tips belong on every debugger&#x27;s wall. &lt;strong&gt;Tip 33: &quot;select&quot; Isn&#x27;t Broken&lt;/strong&gt;: assume the bug is in your code before blaming the compiler, the database, or the library. And &lt;strong&gt;Tip 34: Don&#x27;t Assume It—Prove It&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id=&quot;what-do-i-do-with-a-green-run-now&quot;&gt;What do I do with a green run now?&lt;a class=&quot;anchor&quot; href=&quot;#what-do-i-do-with-a-green-run-now&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I used to treat it as the finish line. Now I treat it as a question: &lt;em&gt;would this have gone red if the code were wrong?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Most of the time the answer is easy to find, and the check takes less time than writing the test did.&lt;/p&gt;
&lt;h2 id=&quot;one-floor-down&quot;&gt;One floor down&lt;a class=&quot;anchor&quot; href=&quot;#one-floor-down&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;All of this assumes you&#x27;re writing new code, with tests from the start. But most of the code anyone works on was written by someone else, years ago, with tests that look like the gallery above, or no tests at all.&lt;/p&gt;
&lt;p&gt;How do you even &lt;em&gt;see&lt;/em&gt; what&#x27;s wrong with a design you didn&#x27;t write, and how do you propose something better without breaking everything that depends on it?&lt;/p&gt;
&lt;div class=&quot;footnote&quot;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&quot;fn:1&quot;&gt;
&lt;p&gt;axum, tailscale, excalidraw, redis, SQLite, ripgrep and rust-analyzer. &quot;Almost all&quot; is my count from reading, not a measured rate, and I did not count how many tests per suite were affected.&amp;#160;&lt;a class=&quot;footnote-backref&quot; href=&quot;#fnref:1&quot; title=&quot;Jump back to footnote 1 in the text&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn:2&quot;&gt;
&lt;p&gt;This is McConnell&#x27;s summary of studies he cites. I haven&#x27;t read those studies myself, so treat &quot;at least 10 to 1&quot; as his number, not mine.&amp;#160;&lt;a class=&quot;footnote-backref&quot; href=&quot;#fnref:2&quot; title=&quot;Jump back to footnote 2 in the text&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Reading Code You Didn&#x27;t Write</title><link>https://your-moon.github.io/craft-3-existing-code/</link><guid>https://your-moon.github.io/craft-3-existing-code/</guid><pubDate>Thu, 08 Oct 2026 00:00:00 +0000</pubDate><description>&lt;h1 id=&quot;reading-code-you-didnt-write&quot;&gt;Reading Code You Didn&#x27;t Write&lt;a class=&quot;anchor&quot; href=&quot;#reading-code-you-didnt-write&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Craft · Part 3 of 4: Seeing bad design, and proposing a better one&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Netscape threw away its code to start over, and then went almost three years without a major release while its market share plummeted. Every engineer who opens a codebase that&#x27;s a few years old feels the same pull that led there: &lt;em&gt;this is a mess, we should rewrite it.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Joel Spolsky wrote the classic warning about that feeling in 2000. He calls rewriting from scratch &quot;the single worst strategic mistake that any software company can make&quot;, and gives a reason that stung when I read it: you think the old code is a mess because of &quot;a cardinal, fundamental law of programming: It&#x27;s harder to read code than to write it.&quot;&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-2 -46 958 406&quot; width=&quot;958&quot; role=&quot;img&quot; aria-label=&quot;The old code looks like a mess&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M26.3 53.2 C30.4 50.8, 36.5 50.2, 41.2 51.3 C45.8 52.4, 51.3 56.2, 54.2 59.7 C57.1 63.2, 59 67.8, 58.7 72.3 C58.3 76.8, 55.3 83.5, 52 86.8 C48.6 90.1, 42.9 91.6, 38.3 92.2 C33.8 92.7, 29 92.2, 24.8 89.9 C20.7 87.7, 15.1 83.1, 13.6 78.7 C12.1 74.4, 13.8 68.1, 16.1 63.8 C18.4 59.6, 25.4 55.1, 27.3 53.1 C29.1 51.2, 27.1 51.9, 27.2 52.1 M46.8 52.9 C51.1 54.8, 55.5 59.6, 57.3 63.7 C59.1 67.7, 58.8 72.8, 57.6 77.1 C56.3 81.4, 53.9 87.1, 49.8 89.5 C45.7 92, 38 92.3, 32.9 91.8 C27.7 91.2, 22.2 89.1, 19 86.2 C15.9 83.2, 14.2 78.5, 13.9 74.1 C13.5 69.8, 14.2 64, 17 60 C19.8 56, 25.7 51.5, 30.6 50.1 C35.6 48.8, 44.2 51.6, 46.6 52.1 C49 52.5, 45 52.4, 44.9 52.7&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M38.2 50.2 C42.9 50.5, 48.8 54.7, 52.1 58.1 C55.4 61.6, 57.3 66.6, 57.8 71 C58.3 75.4, 57.7 80.8, 55.1 84.4 C52.4 88, 46.8 91.3, 42.1 92.5 C37.4 93.7, 30.9 93.5, 26.6 91.6 C22.3 89.6, 18.2 85, 16.1 80.8 C14 76.5, 12.5 70.4, 13.9 66 C15.2 61.7, 19.9 57.1, 24.3 54.6 C28.6 52.1, 36.8 51.3, 39.8 50.9 C42.7 50.4, 41.5 51.3, 41.7 51.8 M28.6 51.8 C33 50.2, 39.2 51.6, 43.9 53 C48.5 54.3, 54.2 56.2, 56.7 59.7 C59.3 63.2, 60 69.2, 59.3 74 C58.5 78.7, 55.8 85, 52.2 88.2 C48.6 91.4, 42.8 93, 37.8 93.1 C32.7 93.3, 25.6 91.8, 21.8 89 C17.9 86.2, 15.4 81.2, 14.5 76.5 C13.6 71.8, 14.4 65, 16.4 60.8 C18.4 56.6, 24.5 52.3, 26.5 51.1 C28.5 50, 28 53.5, 28.2 54&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M26.5 63.1 C27.1 62.9, 29.1 63.8, 29.7 63.9 C30.4 64.1, 30.4 63.6, 30.6 64.1 C30.8 64.5, 31.1 65.9, 31 66.6 C30.9 67.3, 30.5 68, 29.8 68.3 C29.1 68.5, 27.8 68, 27 68.1 C26.2 68.2, 25.4 69, 25.1 68.8 C24.7 68.6, 24.9 67.7, 24.8 66.9 C24.7 66.1, 23.9 64.8, 24.4 64.1 C24.9 63.3, 27.3 62.4, 27.9 62.2 C28.4 62.1, 27.9 62.8, 27.6 62.9 M28.7 61.6 C29 61.9, 29.5 63.1, 29.7 64 C29.9 64.9, 29.8 65.9, 30 66.8 C30.1 67.7, 31.3 68.9, 30.7 69.3 C30.2 69.7, 27.6 69.1, 26.8 69.1 C26 69.2, 26.3 70, 25.9 69.4 C25.4 68.9, 24.2 66.6, 24.3 65.9 C24.4 65.3, 26.1 65.8, 26.4 65.5 C26.7 65.2, 25.6 64.2, 26.1 64.1 C26.7 63.9, 29.5 64.7, 29.8 64.4 C30.2 64.1, 28.4 62.2, 28.1 62.1&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M28.5 62.3 C29.3 62.4, 30.3 63.1, 30.8 63.7 C31.2 64.3, 31.2 65.3, 31.1 66.2 C30.9 67, 30.1 68.1, 29.7 68.7 C29.3 69.3, 29 69.5, 28.6 69.6 C28.2 69.7, 28.1 69.6, 27.4 69.1 C26.7 68.6, 24.8 67.3, 24.4 66.5 C24 65.7, 24.7 64.9, 24.9 64.4 C25.1 64, 25.2 64, 25.8 63.6 C26.4 63.3, 28.2 62.6, 28.6 62.4 C28.9 62.3, 28.1 62.6, 28 62.7 M26.5 63.5 C27 63.8, 30 64.6, 30.6 64.7 C31.2 64.8, 29.9 63.5, 30.1 64.2 C30.4 64.9, 32.1 67.9, 32.2 68.7 C32.2 69.5, 31.1 69.1, 30.2 68.9 C29.3 68.7, 27.8 67.9, 26.9 67.7 C26 67.4, 25.3 67.9, 25 67.4 C24.7 66.9, 24.9 65.2, 25.1 64.7 C25.2 64.2, 25.4 64.4, 25.9 64.3 C26.5 64.1, 28.1 64.3, 28.6 64 C29.1 63.6, 29.3 62.1, 28.9 62.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M43.6 63.2 C44.5 63, 46 62.7, 46.4 63.1 C46.9 63.5, 46.2 64.8, 46.3 65.6 C46.3 66.3, 46.8 67.3, 46.7 67.6 C46.7 68, 46.4 67.4, 46 67.8 C45.6 68.1, 45.1 69.6, 44.3 69.8 C43.4 69.9, 41.4 69.2, 40.9 68.7 C40.5 68.2, 41.6 67.4, 41.5 66.6 C41.5 65.7, 40.3 64.1, 40.8 63.5 C41.3 63, 43.9 63.2, 44.7 63.2 C45.5 63.2, 45.7 63.6, 45.7 63.7 M42.9 63.2 C43.4 63.3, 45.9 62.9, 46.7 63.1 C47.6 63.3, 48 63.8, 48 64.4 C47.9 65, 46.9 65.8, 46.5 66.8 C46.2 67.8, 46.4 70, 45.8 70.2 C45.1 70.4, 43.4 68.5, 42.8 68.1 C42.3 67.7, 42.8 68.3, 42.5 68 C42.2 67.8, 41.4 67.3, 41.2 66.6 C40.9 65.9, 40.1 64.2, 40.9 63.7 C41.6 63.2, 45 64, 45.5 63.7 C45.9 63.4, 43.7 62, 43.5 61.9&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M44.7 62.6 C45.3 62.7, 44.9 64.2, 45.4 64.8 C45.9 65.4, 47.5 65.6, 47.7 66 C47.8 66.4, 46.4 67.1, 46.2 67.4 C45.9 67.8, 46.3 67.9, 45.9 68.1 C45.5 68.3, 44.5 68.8, 43.7 68.7 C42.9 68.6, 41.5 68, 41 67.5 C40.6 67.1, 41 66.6, 41.2 66 C41.5 65.4, 41.7 64.4, 42.4 63.8 C43.1 63.2, 45.3 62.6, 45.6 62.4 C46 62.3, 44.6 63, 44.5 63.1 M44.5 61.7 C45.2 61.4, 47.1 62, 47.5 62.7 C48 63.3, 47.4 64.5, 47 65.6 C46.6 66.6, 45.4 68.6, 45 69.1 C44.7 69.7, 45.1 69, 44.8 68.9 C44.5 68.9, 44.2 69.4, 43.4 68.9 C42.6 68.3, 40.5 66.2, 40.1 65.6 C39.6 65, 40.4 65.9, 40.8 65.4 C41.2 64.8, 42 62.5, 42.6 62.2 C43.3 61.9, 44.6 63.2, 44.8 63.3 C45.1 63.5, 43.8 63.3, 43.9 63.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M28 83 C31.8 80.5, 34 78.1, 37 83 M26.7 84.8 C31.5 77.9, 34.7 78.9, 35.4 81.1 M36 81 C37.8 81.2, 40 83.3, 45.5 80.4 M34.3 82.1 C38.6 82.3, 38.8 80.9, 44.1 82.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M37.4 93.9 C35.4 117.7, 34.6 139.8, 37.5 158.3 M35.6 93.4 C36.7 112.2, 35.5 132.6, 36.2 160.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M37.9 159.8 C28.1 174.9, 20.9 192.4, 14.9 206.5 M36.5 160.6 C28.3 175.7, 21.2 191.6, 15.2 205.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M34.5 159.7 C42.7 176.8, 50 192.6, 56.3 204.6 M35.4 159.8 C40 169.6, 45.1 179.5, 56.2 205.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M35.1 111.6 C27.8 121.2, 21.1 133.7, 15.7 142.8 M36.3 111 C30.4 120, 24.4 128.8, 13.2 141.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M36.8 111.8 C43.3 109.6, 71.7 105.6, 75.7 97.7 C79.6 89.9, 63 70.3, 60.6 64.6 M35.7 110.6 C42 108.6, 70.5 107.2, 74.5 99.1 C78.6 91.1, 62.3 68.4, 60.1 62.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M96.5 -33 C140.6 -34, 181.9 -28, 279.6 -28.2 C286 -30.4, 292.4 -26.6, 288.5 -23.9 C291.5 -11.6, 287.2 -7.5, 290.5 14.6 C286.8 13.9, 286.2 23.5, 279.6 16.6 C228.1 22.2, 169.5 20.5, 95.9 17.1 C90.6 17, 92.8 20, 92.5 11.6 C87.5 0.5, 87.3 -9.6, 93 -24.8 C88.8 -25.7, 91.1 -33, 95.3 -31.1&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M98.6 -30.7 C161.9 -30.9, 227.8 -28.2, 282.1 -28.9 M98.4 -30.6 C170.4 -30, 242.9 -30.7, 280.9 -29.4 M281.7 -30 C288.6 -28.8, 291 -28.4, 291.2 -23.5 M282 -30.9 C289.4 -28.3, 288.2 -27.6, 291.7 -21.1 M290.1 -20.1 C289.6 -11.4, 289.1 2.1, 289.8 13.6 M290.1 -22.1 C289.1 -10.3, 290.6 0, 290.3 10.8 M290 11.7 C289 16.9, 286.2 19.2, 280.1 20.2 M291.6 9.8 C290.2 18.7, 285.3 20.4, 281.9 19.7 M282.6 21.7 C219.1 20.8, 157.1 18.1, 98.8 21.6 M281 19.6 C226.9 19.1, 171.1 19.3, 99.2 20.9 M98.3 20 C91.5 20.4, 89.9 19.1, 90.1 12.4 M98.8 21.1 C90.8 18.5, 88.9 18.6, 90 11.4 M90 9.9 C91.3 0.5, 89.9 -7.4, 88.9 -22.2 M90.9 12.2 C89.7 3.3, 89.7 -4.4, 90 -20.9 M90 -21.7 C90.2 -29.2, 91.3 -30.4, 98.4 -30.8 M90.5 -20.1 C92 -27.4, 92 -29.9, 96.7 -28.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M90.8 -15.4 C76.6 11.8, 58.1 33.1, 50.9 47.1 C64.6 38.1, 77.2 25, 91.1 5.6 C88.8 2.7, 89.9 -8.7, 87.1 -11.9&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M90.7 -12 C75.8 11.3, 62.8 34.8, 49.3 49.1 M89.3 -13.3 C77 5.1, 63.9 26, 50.1 50.8 M49.1 51.5 C64.7 32.1, 82.1 18.3, 88.8 6.6 M49.7 50.5 C62.4 36.4, 75.2 22.7, 90 7.8 M89.2 7.6 C91.6 1.5, 88.3 -9.3, 89.9 -14.7 M89 7.9 C90.9 3.4, 91.1 -0.9, 89.5 -13.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;190&quot; y=&quot;-5.0&quot;&gt;let&#x27;s rewrite it!&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M312.3 58.6 C389.1 58.7, 462.8 58.8, 592 61.4 C596.2 62.2, 602.1 60.6, 598.2 68.2 C599.6 138.6, 602.8 204.7, 602.2 289.2 C599.1 294.6, 596.9 303.3, 592.7 302.1 C526.9 304.1, 468.5 301.5, 308.2 300.3 C306 301.5, 300.8 294.4, 302.6 292.6 C299 227.3, 298.9 167.6, 302.6 72.5 C302 61.4, 302.2 62.6, 307.2 61.8&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M311.4 61.3 C413.7 59.1, 516.4 56.4, 588.6 59.5 M309.3 59.3 C378 58.6, 445 59.6, 590.1 59.6 M590 60 C596.8 58.4, 601 62.1, 599.7 68.6 M589.1 59.1 C597.5 61.5, 600.7 62.6, 600.1 71.1 M601.5 69.9 C601.5 139, 601 211.3, 599 288.7 M600.6 70.7 C598.9 141.9, 597.7 212.5, 600.7 290.5 M600 290 C598.6 297.9, 597.4 300.6, 591.1 302 M599.5 291.9 C600 296.4, 598.7 298.8, 591.4 298.2 M590.9 299.7 C531.9 296.9, 476.1 298.6, 308.6 301.1 M589.7 300.5 C511.4 301.2, 431.5 300.6, 310.8 300.7 M310 300 C304.9 301.1, 299.6 296, 298.6 289 M310.4 298.3 C304 300.4, 298.9 297.9, 298.1 289 M301.2 289.5 C303.2 222.6, 301.3 151.9, 300.8 68.6 M300.6 290.8 C300.8 215.1, 301.1 139.3, 299.4 69.6 M300 70 C301.2 65.1, 302.2 58.4, 309.5 58.3 M299 69.8 C298 63.5, 302.2 60.5, 310.2 59&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M330 100 C400.5 58.4, 441.6 160.2, 381.4 191.6 M329.6 99.7 C401.8 60, 439.4 161.9, 378.2 189.5 M380 190 C319.1 219.4, 330.6 258.6, 419.9 270.6 M378.2 189.6 C320.3 220.1, 330.9 258.7, 418.3 269.9 M420 270 C509.2 278.1, 559.7 199.7, 519.2 140.6 M418.1 270.7 C508.2 278.1, 560.4 199.4, 521 138 M520 140 C478.3 81.1, 441.8 89.1, 481.7 109 M521.8 139.3 C480 80.8, 439.8 91.8, 481.7 109.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M320 250 C379.1 129, 461.5 80.3, 561.4 120.1 M321.7 250.3 C379.7 131.5, 459.2 78.2, 558.6 121.1 M560 120 C660.3 159.8, 560 269.7, 471.6 229 M560.2 120.3 C660.5 161.9, 560.7 268.8, 471.6 231.5 M470 230 C378.3 189.2, 358.8 148.1, 409.4 108.1 M469.6 228.1 C379.4 188.9, 360.9 149, 411.5 108.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M350 150 C421.7 239.6, 501.4 280.4, 571.4 218.7 M349.8 150.9 C422.2 238.3, 499 279.1, 569 218.1 M570 220 C641.6 160.2, 499.3 90.8, 429.4 151.4 M568.2 221 C640.6 159.2, 500.4 88.9, 430.3 148.5 M430 150 C361.5 210.3, 331.8 200.5, 349.5 279.6 M431.2 149.5 C360.5 209.7, 331.4 198.7, 352 279&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M560 80 C500.2 160.2, 421.3 100.5, 391.4 151.2 M561.8 81.6 C500.1 159.7, 418.8 100, 389.4 149.7 M390 150 C358.8 200.7, 438.7 282, 541.2 269.8 M390.3 151.7 C360.8 201.1, 440.1 278.9, 539 270.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:22px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;450&quot; y=&quot;330.0&quot;&gt;the old code&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M652.2 59.1 C735.7 64.3, 818.2 62.6, 928.3 61.8 C938.3 59.8, 940.2 66.9, 938.3 70.2 C939.7 84.6, 937.1 101.4, 941.2 107 C942.3 119.3, 937.1 119.1, 928.4 117.8 C831.1 119.5, 736.3 118.5, 648.1 120.6 C645.8 118.5, 636.7 116.9, 643.3 109.3 C639.3 96.4, 640.2 83.3, 636.8 70.7 C638 60, 642.8 63.2, 650.4 58.4&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M651 60.8 C754.3 60, 856.8 58.7, 928.9 60.3 M650.3 60.2 C709.8 59, 769.1 58.5, 930.1 59.6 M930 60 C937.6 60.2, 939.6 62.5, 940.8 68.8 M929.9 60.1 C935.5 59.7, 942 62.8, 938.7 69.6 M941.7 68.6 C942 82.1, 938.3 89.5, 940 108.5 M940.8 70.3 C939.7 82.2, 939.4 94.6, 940.7 109.9 M940 110 C941.9 116, 937.4 121.8, 928.1 120.5 M940.8 111.5 C940.8 118.7, 938.3 121.7, 930.2 120.5 M929.4 119.4 C820.8 119.2, 710.3 121, 651.2 120.7 M929.7 120.3 C840.4 122.5, 750.3 122, 650.4 120.5 M650 120 C644.4 121.3, 639 118.3, 638.7 110.1 M650.1 118.3 C643.4 120.6, 641 115.7, 642.3 109.8 M639.3 109.8 C640.8 95.9, 641.4 77.5, 640.8 69 M639.3 109.3 C640.2 101.9, 639.8 93.9, 639 70.4 M640 70 C639.4 63.1, 642.8 58.6, 650.4 61.1 M639.6 69.3 C641.3 61.1, 641.3 57.8, 648.9 59.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M642.5 83.6 C621.2 111.9, 610.2 135.7, 599.3 149.8 C614.1 136.7, 634.6 116.9, 641 108 C641 103.6, 642.6 94.6, 637.5 82.8&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M641.9 86.9 C626.2 109.7, 610.1 134.1, 599.9 148.5 M639.3 85.5 C627.9 102.2, 618 121.4, 599.2 149.8 M601.9 149.4 C610.5 138, 624.2 124.1, 640.7 106 M599.8 150.5 C608.7 140.3, 616.4 133.1, 640.5 107 M638.9 106.1 C639.1 102.2, 638.6 92.4, 638.2 86.7 M640.8 108.8 C639.2 102.3, 640 94.5, 640.5 85&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;790&quot; y=&quot;90.0&quot;&gt;I hold 10 years of bug fixes&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;So how do you tell a real design problem from &quot;I didn&#x27;t write this&quot;? That is the first skill, and it comes before fixing anything. The second is proposing something better without breaking everything that depends on the old version. This post covers both. It doesn&#x27;t cover the cases where a rewrite is the right call.&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a class=&quot;footnote-ref&quot; href=&quot;#fn:1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;h2 id=&quot;step-1-where-does-it-actually-hurt&quot;&gt;Step 1: Where does it actually hurt?&lt;a class=&quot;anchor&quot; href=&quot;#step-1-where-does-it-actually-hurt&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Start with the history, not the code. Reading is slow and feels like progress; the log is quick and tells you where the pain is.&lt;/p&gt;
&lt;p&gt;Complexity shows up as &lt;strong&gt;change amplification&lt;/strong&gt;: one small change that needs edits in many places. You can count it: take the last few ordinary changes from &lt;code&gt;git log&lt;/code&gt; (a bug fix, a small feature) and count the files each one touched. Is nine files too many? That depends on the change, because a one-line behaviour change that touched nine files is a symptom, and a big feature that touched nine isn&#x27;t.&lt;/p&gt;
&lt;p&gt;Which files deserve your reading time? &lt;em&gt;Code Complete&lt;/em&gt; says to aim refactoring at two kinds of module. The first is &lt;strong&gt;error-prone modules&lt;/strong&gt;: the code your team is afraid of. The second is &lt;strong&gt;high-complexity modules&lt;/strong&gt;. McConnell cites one study, Henry and Kafura in 1984, where program quality improved when maintenance programmers focused on the most complex modules.&lt;sup id=&quot;fnref:2&quot;&gt;&lt;a class=&quot;footnote-ref&quot; href=&quot;#fn:2&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:392px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-6 -16 392 418&quot; width=&quot;392&quot; role=&quot;img&quot; aria-label=&quot;Hotspots: where three kinds of trouble overlap&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M84.2 11 C95.8 5.5, 111 4.9, 124.5 5.6 C138 6.3, 152.9 9.9, 165.2 15 C177.5 20.1, 188.7 27.5, 198.3 36.2 C207.9 44.9, 217.1 55.7, 222.8 67.1 C228.5 78.5, 231.8 91.9, 232.5 104.7 C233.2 117.5, 231.2 131.9, 227 143.8 C222.8 155.6, 216.1 166.1, 207.4 175.8 C198.6 185.4, 186.3 195.1, 174.3 201.5 C162.3 207.8, 148.6 212, 135.4 213.7 C122.1 215.4, 108.1 214.7, 94.9 211.8 C81.7 208.8, 67.3 203, 56.2 195.9 C45.1 188.8, 35.7 179.2, 28.2 169 C20.7 158.9, 14.3 147.2, 11.2 134.9 C8.1 122.6, 7.8 107.9, 9.6 95.4 C11.5 82.9, 16 71, 22.3 59.9 C28.7 48.9, 35.3 37.7, 47.8 29.1 C60.2 20.4, 86.1 11.9, 97 8.2 C107.8 4.5, 112.6 5.3, 112.9 6.9 M95.9 8.4 C107.9 4.4, 124.2 6.1, 137.3 8 C150.5 9.9, 162.9 13.5, 174.8 19.7 C186.7 25.8, 199.8 35, 208.7 44.9 C217.7 54.8, 224.3 67.2, 228.4 79 C232.5 90.8, 234.4 103.4, 233.3 115.7 C232.2 128, 227.8 141.2, 221.9 152.5 C215.9 163.8, 207.4 174.4, 197.6 183.5 C187.8 192.7, 175.1 202.3, 163 207.6 C150.9 213, 138.4 215.2, 125 215.5 C111.6 215.8, 95.6 213.7, 82.8 209.3 C69.9 205, 57.9 197.9, 47.9 189.4 C37.8 181, 29.2 169.6, 22.6 158.6 C16.1 147.5, 10.3 135.4, 8.6 123 C6.9 110.6, 9.3 96.5, 12.3 84.2 C15.3 71.8, 19 58.9, 26.8 48.8 C34.6 38.6, 47.8 29.9, 59 23.2 C70.3 16.5, 88.4 10.6, 94.4 8.3 C100.4 6.1, 94.6 8.2, 95.2 9.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M221.4 5.7 C232.9 -0.5, 248.3 -2.7, 261.9 -2.4 C275.4 -2.2, 290.3 2.2, 302.7 7.2 C315.2 12.2, 326.6 18.7, 336.3 27.8 C345.9 37, 354.6 49.7, 360.6 61.9 C366.6 74, 371.2 87.4, 372.5 100.7 C373.8 114, 372.4 128.7, 368.6 141.8 C364.8 154.8, 358.2 168.3, 349.8 179 C341.4 189.7, 329.6 199.1, 317.9 206 C306.2 212.8, 292.8 217.7, 279.5 220 C266.2 222.2, 251.5 221.8, 238.2 219.4 C224.9 216.9, 211.3 212.4, 199.7 205.1 C188.2 197.7, 176.8 186.3, 168.7 175.3 C160.6 164.2, 154.7 151.4, 151.2 138.5 C147.8 125.6, 146.3 111.1, 147.9 98 C149.5 84.9, 154.7 72, 161 60 C167.2 48, 175.3 35.3, 185.6 26.1 C195.8 16.9, 215.4 8.3, 222.4 4.9 C229.4 1.5, 226.6 4.1, 227.4 5.8 M308.2 8 C320.4 12.2, 331.9 23.7, 341.1 33.8 C350.4 43.9, 358.5 56.2, 363.8 68.8 C369.1 81.4, 372.7 96.2, 373.1 109.2 C373.6 122.3, 371.6 134.4, 366.6 146.9 C361.5 159.5, 352.3 174.4, 343.1 184.8 C333.9 195.1, 323.2 203.2, 311.3 209 C299.5 214.9, 285.3 218.3, 272.1 219.9 C258.8 221.5, 244.9 221.7, 231.9 218.6 C218.9 215.4, 205 208.8, 194.1 201.1 C183.2 193.3, 174 183.5, 166.6 172 C159.2 160.5, 152.5 145.6, 149.8 132.1 C147.1 118.5, 148 103.8, 150.4 90.8 C152.7 77.8, 156.9 65.7, 163.8 54.2 C170.8 42.7, 181.1 30.7, 191.9 22 C202.6 13.3, 215.6 5.9, 228.3 2.2 C240.9 -1.4, 254.6 -0.9, 267.8 0.1 C281 1.1, 301.1 6.5, 307.6 8.2 C314.1 10, 307.7 8.7, 307 10.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M146.6 130.8 C157.7 124.8, 173.6 122.9, 187.2 122.7 C200.8 122.5, 215.4 125.2, 228.2 129.7 C241.1 134.2, 253.8 141.2, 264.2 149.5 C274.5 157.8, 283.9 168, 290.3 179.4 C296.7 190.7, 301.1 204.3, 302.4 217.5 C303.7 230.7, 301.8 245.9, 298.1 258.5 C294.4 271.2, 287.9 283, 280.2 293.4 C272.4 303.8, 262.9 313.9, 251.5 320.9 C240.1 327.9, 225 332.8, 211.7 335.3 C198.3 337.8, 184.6 338.2, 171.5 336.1 C158.4 334, 145.1 329.5, 133.3 322.9 C121.6 316.4, 109.6 307.2, 101.3 297 C92.9 286.7, 87.2 273.9, 83.4 261.3 C79.5 248.8, 77.5 234.8, 78.3 221.8 C79 208.8, 81.8 194.9, 87.7 183.2 C93.5 171.5, 102.4 160.7, 113.4 151.5 C124.5 142.4, 146.2 132, 154 128.4 C161.7 124.7, 159.5 128, 159.9 129.6 M201.5 123.2 C214.2 122.7, 227.8 128.2, 240 133.9 C252.2 139.6, 265.4 147.6, 274.7 157.2 C283.9 166.7, 290.7 179.1, 295.4 191.3 C300.1 203.5, 303.3 217.4, 303 230.5 C302.6 243.5, 298.7 257.4, 293.4 269.8 C288.1 282.1, 280.2 295, 271.1 304.5 C262 313.9, 251 320.8, 238.8 326.2 C226.7 331.6, 211.8 335.9, 198.2 337.1 C184.5 338.3, 169.8 337.4, 156.9 333.7 C143.9 329.9, 131.1 322.7, 120.4 314.5 C109.7 306.3, 99.4 295.8, 92.7 284.8 C86 273.7, 82.2 261, 80.3 248.3 C78.3 235.6, 78 221.1, 80.7 208.5 C83.4 195.9, 89.3 183.5, 96.5 172.5 C103.7 161.5, 113.1 150.3, 123.9 142.5 C134.7 134.7, 148.3 128.8, 161.3 125.7 C174.3 122.6, 195.1 124, 201.9 123.7 C208.7 123.4, 202.3 122.2, 202 124&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M203.6 125.3 C213.2 126, 224.6 128.9, 232.1 133.6 C239.6 138.2, 246 146.4, 248.8 153.1 C251.6 159.9, 251.2 167.2, 248.9 174.1 C246.7 181, 242.1 189.5, 235.2 194.5 C228.3 199.5, 217.2 202.3, 207.5 204.2 C197.8 206.1, 186.9 207.5, 177.1 205.9 C167.3 204.3, 156.4 199.5, 148.8 194.6 C141.2 189.6, 134.5 183, 131.4 176.4 C128.3 169.9, 127.7 162, 130.2 155.3 C132.7 148.6, 139.1 141.3, 146.2 136.2 C153.3 131.2, 162.3 126.9, 172.7 125 C183.1 123, 201.6 124.2, 208.6 124.6 C215.7 125, 215 126.6, 214.9 127.4 M202.2 124.5 C212.3 125.3, 223.9 129.2, 231.7 133.5 C239.4 137.8, 246 143.7, 249 150.4 C251.9 157, 251.6 166.2, 249.4 173.4 C247.3 180.5, 242.4 188, 236 193.3 C229.6 198.7, 220.8 203.6, 211 205.5 C201.3 207.5, 187.7 206.8, 177.5 205.2 C167.3 203.6, 157.4 200.5, 150 196 C142.6 191.4, 136.6 184.3, 133.3 178 C130 171.6, 128.7 164.4, 130.4 157.7 C132 151, 136.6 143, 143.2 137.7 C149.8 132.4, 160.6 128.1, 170.2 125.9 C179.8 123.7, 195.6 124.6, 200.7 124.7 C205.8 124.8, 200.5 125.9, 200.6 126.4&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M164.5 127.6 C173 124.2, 186.1 122.2, 196.4 123 C206.7 123.7, 217.9 127.9, 226.3 132 C234.6 136.1, 242.3 141.2, 246.4 147.4 C250.5 153.5, 251.8 162.3, 250.8 169.1 C249.8 176, 246.5 182.9, 240.5 188.6 C234.5 194.2, 224.5 200.2, 214.9 203.1 C205.4 206, 193.4 206.6, 183.2 206 C172.9 205.3, 161.5 203.2, 153.2 199.2 C145 195.1, 137.8 188.1, 133.8 181.6 C129.8 175.2, 128.2 167.4, 129.3 160.6 C130.3 153.7, 133.2 146.2, 140 140.4 C146.8 134.6, 164.2 128, 170.1 125.7 C175.9 123.3, 174.6 125.5, 175.1 126.2 M170.1 126.8 C178.9 124, 191.3 123.8, 201.2 125 C211.2 126.2, 222.3 129.8, 229.9 134 C237.5 138.3, 243.3 144.4, 246.7 150.7 C250.1 157, 251.8 165.1, 250.1 171.9 C248.4 178.6, 242.9 185.8, 236.4 191.1 C229.9 196.3, 221.1 201.1, 211.3 203.5 C201.5 206, 187.7 206.9, 177.4 205.7 C167.1 204.6, 157 201.1, 149.5 196.6 C142 192.1, 135.7 185.7, 132.3 178.9 C129 172.1, 127.1 162.7, 129.3 155.7 C131.4 148.8, 138.3 142, 145.1 137 C151.9 131.9, 165.6 127.3, 169.9 125.4 C174.2 123.5, 170.3 124.7, 170.7 125.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;190&quot; y=&quot;154.4&quot;&gt;hotspot:&lt;/tspan&gt;&lt;tspan x=&quot;190&quot; y=&quot;175.6&quot;&gt;5–10 files&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;75&quot; y=&quot;57.5&quot;&gt;changes&lt;/tspan&gt;&lt;tspan x=&quot;75&quot; y=&quot;82.5&quot;&gt;often&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;305&quot; y=&quot;57.5&quot;&gt;breaks&lt;/tspan&gt;&lt;tspan x=&quot;305&quot; y=&quot;82.5&quot;&gt;often&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;190&quot; y=&quot;267.5&quot;&gt;hard to&lt;/tspan&gt;&lt;tspan x=&quot;190&quot; y=&quot;292.5&quot;&gt;follow&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;190&quot; y=&quot;375.0&quot;&gt;start here, not everywhere&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;A hotspot is where churn, bug history and complexity overlap: usually a handful of files, not the whole codebase.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The place where all three overlap (changes often, breaks often, hard to follow) is where to look.&lt;/p&gt;
&lt;p&gt;Read only those files. In my experience that is five or ten files, not the whole codebase. How about the rest? It may look ugly, but if nobody changes it and it doesn&#x27;t break, it costs you nothing.&lt;/p&gt;
&lt;h2 id=&quot;step-2-what-does-bad-design-look-like-specifically&quot;&gt;Step 2: What does bad design look like, specifically?&lt;a class=&quot;anchor&quot; href=&quot;#step-2-what-does-bad-design-look-like-specifically&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It looks like a short list of named patterns, and you read the hotspots with that list in hand instead of a vague feeling.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Any fool can write code that a computer can understand. Good programmers write code that humans can understand.&quot;&lt;/p&gt;
&lt;p&gt;— Martin Fowler, &lt;em&gt;Refactoring&lt;/em&gt; (1999)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ousterhout ends his book with fourteen &lt;strong&gt;red flags&lt;/strong&gt;. I find them easiest to use in three groups.&lt;sup id=&quot;fnref:3&quot;&gt;&lt;a class=&quot;footnote-ref&quot; href=&quot;#fn:3&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -32 992 388&quot; width=&quot;992&quot; role=&quot;img&quot; aria-label=&quot;14 red flags (Ousterhout)&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:26px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;480&quot; y=&quot;0.0&quot;&gt;14 red flags (Ousterhout)&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M11.1 41.3 C83.3 40.1, 155.2 41.5, 281.2 38.7 C285 42.8, 289.8 43.4, 291.4 49.6 C287.4 134.6, 287.7 216.1, 288 328.3 C290 334.2, 283.8 340.5, 279.6 342.4 C188.5 341.5, 92.9 340.8, 9.6 340.8 C4.8 338.8, -0.2 338.5, -1.9 326.5 C-4.5 249.9, -3 170.7, -1.1 52.7 C-0.4 45, 6.7 37.5, 7.4 37.3&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M9.3 39.9 C84.1 40.5, 159 40.5, 279.5 40.2 M10 40.3 C103.9 39.9, 197.5 40.8, 279.3 40.5 M280 40 C286.3 41.3, 288.9 42.6, 290.3 51.2 M281.4 41.1 C288 38.2, 291 41.9, 288.2 49 M289.3 50.7 C289.7 141.4, 290.5 231, 289.2 331.5 M289.4 49.3 C290.6 139.9, 290.5 230.9, 289.6 329.4 M290 330 C290.9 336.4, 288.3 340.7, 278.8 339.1 M289.3 330.9 C290.5 337.2, 288.4 341.8, 278 340 M280.6 339.6 C220.9 342.2, 159.7 343.5, 10.4 339.5 M280.1 339.4 C193 341.1, 106.4 341.8, 10.5 340.8 M10 340 C4.9 339, 0.7 336.1, 0.9 328.4 M9.5 340.2 C5.4 340.5, 1.4 336.5, -1.8 330.4 M-0.1 329.2 C-0.7 255, 1.3 177.8, -0.7 49.2 M-0.3 330.5 C-0.1 253.8, 0.3 177.5, -0.3 50.5 M0 50 C0.9 43.4, 4.2 39.8, 9.6 41.6 M-1.4 49.2 C-0.4 41.1, 3.1 40.7, 8.8 41.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:22px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;145&quot; y=&quot;75.0&quot;&gt;in interfaces&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M20.2 99.7 C88.8 100.3, 159.1 100.9, 268.5 100.5 M19.8 100.6 C87.3 98.7, 156.6 98.5, 269.3 99.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;24&quot; y=&quot;135.0&quot;&gt;shallow module&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;24&quot; y=&quot;171.0&quot;&gt;pass-through method&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;24&quot; y=&quot;207.0&quot;&gt;overexposure&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M321 41.7 C399.6 38.1, 474.5 37.6, 587.5 39.1 C597.1 40.5, 597.9 42.5, 601.5 51.6 C602.9 157, 603.8 265, 602.5 332.2 C603.1 338.9, 594.1 343.5, 592.5 338.1 C518 344.5, 441.3 340, 319.5 341.1 C314.6 343, 313 333.7, 308.8 330.3 C306.9 228.6, 309.2 120.3, 309.7 51 C312.8 43.6, 310.1 38.2, 320.6 41.1&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M318.8 39.4 C394.7 38.3, 469.3 39.7, 589.8 41 M319.5 39.7 C406 38.7, 492.1 39.7, 589.3 40.5 M590 40 C597.1 39.2, 601.5 43, 601.5 51.4 M588.2 38.1 C596 41, 602.3 42.1, 601.4 52 M599.3 49.8 C599.9 123.2, 598.3 194.3, 600.1 331.5 M599.4 50.4 C600.5 138, 601.1 225.3, 599.5 330.4 M600 330 C600.2 338.6, 598.3 341.9, 589.8 341.7 M600.6 330.5 C601.4 334.9, 598 340.1, 591.4 337.7 M589.1 339.4 C532.5 340.2, 478.7 338.6, 319.9 339.1 M590.1 340.8 C492.4 338.1, 395.9 339, 320.2 340.6 M320 340 C314.3 339.2, 310.1 338.5, 311 329.4 M319.2 340.1 C314.9 340.7, 308.9 338.9, 307.8 331.2 M311.4 329.5 C309.3 232, 307.3 131.2, 309.2 49.7 M310.3 329.3 C312.1 236.5, 312 143.9, 309.5 49.6 M310 50 C309.1 41.4, 314.8 40, 320.6 40.3 M309.2 48.7 C308.3 43.3, 312.2 38.1, 322.2 37.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:22px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;455&quot; y=&quot;75.0&quot;&gt;in knowledge&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M329.7 99.1 C399.4 97.2, 469.4 99.2, 578.9 101.3 M329.3 100 C391.6 101.6, 452.3 101.5, 579.3 99.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;334&quot; y=&quot;135.0&quot;&gt;information leakage&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;334&quot; y=&quot;171.0&quot;&gt;temporal decomposition&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;334&quot; y=&quot;207.0&quot;&gt;special-general mixture&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;334&quot; y=&quot;243.0&quot;&gt;repetition&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;334&quot; y=&quot;279.0&quot;&gt;conjoined methods&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M629.1 41.6 C729.4 39.3, 833.1 38.7, 950 39.8 C954.7 39.8, 959.3 39.9, 957.9 49.1 C959.1 154.2, 955.5 261.4, 959.5 331.7 C960.3 333.3, 958.5 341.4, 952.8 338.1 C887.2 336.3, 818 335.3, 631.2 339.8 C621.5 340.3, 621.6 336.9, 617.8 329.5 C618 270.6, 616.8 216.4, 619 52.4 C617.4 42.1, 621.9 37.4, 627.4 37.3&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M630.9 41.1 C740.3 40.1, 849 40.8, 950.4 41.2 M629.6 40.2 C733.3 41.3, 836.5 40.6, 949.7 39.9 M950 40 C958.3 38.2, 961.9 44.8, 960.8 50.3 M948.3 41.7 C954.4 39, 959.7 44.4, 959.2 50 M959.3 49.1 C960 108.9, 959.9 169.6, 960.4 328.9 M959.9 49.8 C960.5 154.2, 960.7 257.1, 959.8 330.3 M960 330 C961.5 336, 957.6 341.3, 948.5 339.4 M958.9 328.4 C960.8 334.7, 955.9 341.2, 948.3 337.8 M950.9 340.1 C881.2 337.6, 810.3 339, 629.4 338.7 M950.1 340.4 C869.5 341.4, 789.1 342.5, 630.2 339.6 M630 340 C623.1 340.1, 620.5 337.4, 618.8 328.5 M631 338.7 C623.3 340.8, 617.9 335.9, 619.1 329.8 M620.6 330.1 C620.3 242.8, 622.7 154.8, 620.7 50.2 M620.5 330.1 C619.4 222.8, 619.8 115.2, 620.3 50 M620 50 C619.6 43.1, 622.9 39.1, 631.9 40.4 M619.7 51.9 C620.7 42.4, 622 38.6, 631.2 39.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:22px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;790&quot; y=&quot;75.0&quot;&gt;in words&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M638.9 101 C743.6 98.9, 846.2 100.1, 939.5 98.6 M639.5 100.5 C713.5 98.5, 787.4 99.7, 939.7 100.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;644&quot; y=&quot;135.0&quot;&gt;vague name&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;644&quot; y=&quot;171.0&quot;&gt;hard to pick name&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;644&quot; y=&quot;207.0&quot;&gt;hard to describe&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;644&quot; y=&quot;243.0&quot;&gt;comment repeats code&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;644&quot; y=&quot;279.0&quot;&gt;implementation in interface docs&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;644&quot; y=&quot;315.0&quot;&gt;nonobvious code&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;Ousterhout&amp;#x27;s fourteen red flags, grouped by where they show up: in interfaces, in knowledge, and in words.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;In the interfaces:&lt;/strong&gt;
- &lt;strong&gt;Shallow module&lt;/strong&gt;: the interface is nearly as complicated as what it does.
- &lt;strong&gt;Pass-through method&lt;/strong&gt;: a method that just forwards to another with the same arguments.
- &lt;strong&gt;Overexposure&lt;/strong&gt;: to use the common feature you have to learn the rare ones.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In where knowledge lives:&lt;/strong&gt;
- &lt;strong&gt;Information leakage&lt;/strong&gt;: one design decision shows up in several modules.
- &lt;strong&gt;Temporal decomposition&lt;/strong&gt;: code split by the &lt;em&gt;order&lt;/em&gt; things happen in (read, then parse, then save) instead of by what each part knows.
- &lt;strong&gt;Special-general mixture&lt;/strong&gt;: one-off special cases baked into general-purpose code.
- &lt;strong&gt;Repetition&lt;/strong&gt;: the same non-trivial code in many places.
- &lt;strong&gt;Conjoined methods&lt;/strong&gt;: you can&#x27;t understand one without reading the other.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In the words:&lt;/strong&gt;
- &lt;strong&gt;Vague name&lt;/strong&gt;, or a name that&#x27;s &lt;strong&gt;hard to pick&lt;/strong&gt;, which usually means the thing does several jobs.
- &lt;strong&gt;Hard to describe&lt;/strong&gt;: the honest description is long.
- &lt;strong&gt;Comment repeats code&lt;/strong&gt;, or the &lt;strong&gt;interface comment describes the implementation&lt;/strong&gt;.
- &lt;strong&gt;Nonobvious code&lt;/strong&gt;: you can&#x27;t tell what it does by reading it.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Code Complete&lt;/em&gt; adds a list of refactoring smells that catches different things. Three I now look for every time:
- &lt;strong&gt;Parallel modifications&lt;/strong&gt;: every time you add a payment method, you edit the same three &lt;code&gt;switch&lt;/code&gt; statements.
- &lt;strong&gt;Tramp data&lt;/strong&gt;: a parameter passed through five functions that don&#x27;t use it, just to reach the sixth.
- &lt;strong&gt;Setup and teardown around a call&lt;/strong&gt;: callers always do the same thing before and after calling a function, which means the function&#x27;s interface is wrong.&lt;/p&gt;
&lt;p&gt;One more lens from McConnell: for each module, try to name &lt;strong&gt;what it hides&lt;/strong&gt;. If you can&#x27;t name a secret, the module is probably shallow. This is Parnas&#x27;s information hiding from Part 1, used as a test.&lt;/p&gt;
&lt;h2 id=&quot;step-3-how-do-you-understand-a-design-nobody-explained-to-you&quot;&gt;Step 3: How do you understand a design nobody explained to you?&lt;a class=&quot;anchor&quot; href=&quot;#step-3-how-do-you-understand-a-design-nobody-explained-to-you&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You draw it. Michael Feathers&#x27; &lt;em&gt;Working Effectively with Legacy Code&lt;/em&gt; has the best tools I&#x27;ve found for this, and they are all deliberately low-tech.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The feature sketch.&lt;/strong&gt; For a big class, draw every field and every method, and an arrow from each method to the fields it uses. Clusters appear: groups of methods that only touch their own few fields. Each cluster is a class hiding inside the big one, and the arrows that cross between clusters become its interface. Feathers also notes that a class with many private methods usually has a hidden class inside, and that wanting to test a private method is a sign it belongs somewhere else.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-41 -36 1042 395&quot; width=&quot;1042&quot; role=&quot;img&quot; aria-label=&quot;A feature sketch of one big class&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M320.9 259 C400.7 209.8, 482.7 161.8, 680.7 50.2 C676.4 44.2, 672.7 42.1, 672.7 35.4 C563.3 97, 456.6 159.4, 309.8 244.8 C312.7 250.8, 316 257.5, 321.3 258.6&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M318.3 259.7 C402.8 211.2, 486.8 161.8, 679.5 50.9 M319.1 259 C435.2 191, 550.4 125.2, 678.7 52.2 M678.8 53.2 C675.7 47.6, 673.2 41.1, 670.1 38.8 M679.1 51.2 C676.6 48.7, 674.3 44.6, 671.8 37.7 M671.7 38.2 C572.5 92.5, 475.7 148.3, 310.9 244.1 M670.9 38.2 C563.4 101.4, 455.8 162.9, 310.6 245.5 M309.6 244.9 C313.2 249.4, 316.7 253.5, 319.9 260.3 M310.9 245.7 C313.5 247.9, 314 251.5, 318.3 258.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-15.4 -19.3 C76.9 -19.3, 167.1 -19.6, 379.1 -19.8 M380 -20 C388.5 -21.8, 388.5 -17.9, 391.7 -10.6 M390.8 -8.7 C389.8 59.3, 390.2 130.2, 391 289.6 M390 290 C388 296.6, 386.6 298.3, 381 301.3 M379.2 300.3 C263.5 301, 149.5 301.6, -15.7 300.6 M-15 300 C-21.7 299.6, -24.1 295, -24.7 288.9 M-25.2 290.8 C-27.5 182.3, -27.5 77.9, -24.2 -11.1 M-25 -10 C-26.1 -18.6, -23.1 -18.8, -14.7 -19.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;path d=&quot;M599.9 -19.3 C687.4 -21, 773.2 -22.3, 974.9 -20.9 M975 -20 C980.3 -20, 985.9 -16.7, 983.9 -10.7 M984.3 -11.2 C983.3 67, 984.6 141.9, 985.8 289.6 M985 290 C986.1 297.7, 980.7 300.7, 976.1 298.8 M974.4 300.9 C836.3 301.8, 699.2 301.7, 599.2 299.3 M600 300 C591.9 299, 588.8 295, 588.5 288.3 M590.9 288.6 C587.9 215.9, 588.1 141.5, 591.2 -9.3 M590 -10 C589.1 -18, 593.7 -19.8, 599.6 -18.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;180&quot; y=&quot;330.0&quot;&gt;hidden class A&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;790&quot; y=&quot;330.0&quot;&gt;hidden class B&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M75.9 19.3 C84.2 20, 94.5 24.4, 100.3 28.4 C106.1 32.3, 110.4 37.7, 110.9 42.7 C111.4 47.8, 108 54.3, 103.3 58.9 C98.6 63.5, 90.6 68.4, 82.5 70.2 C74.4 72.1, 63.2 71.6, 54.6 70.2 C45.9 68.8, 36.5 65.7, 30.6 61.9 C24.8 58.1, 20.4 52.7, 19.6 47.5 C18.7 42.2, 21 34.9, 25.7 30.6 C30.4 26.3, 38.7 23.4, 47.8 21.6 C57 19.9, 74.6 19.7, 80.8 19.9 C87 20.2, 85.4 22.5, 85.1 23.1 M60.7 19.2 C68.9 18.5, 78.4 20.9, 85.8 23.2 C93.3 25.4, 101.3 28.4, 105.6 32.7 C109.8 37.1, 113.1 43.9, 111.5 49.1 C109.9 54.3, 103 60.5, 96.1 64.1 C89.1 67.7, 78.5 69.9, 69.8 70.7 C61.1 71.5, 51.8 71.1, 44 68.7 C36.2 66.3, 26.9 61.3, 23 56.3 C19.1 51.4, 19.1 43.8, 20.6 38.9 C22.2 34, 26 30.2, 32.3 26.8 C38.6 23.4, 54 19.7, 58.5 18.5 C63 17.3, 59.1 19.1, 59.2 19.6&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M54.1 19.4 C62.1 18, 74 18.3, 82.2 20.3 C90.4 22.3, 98.5 26.8, 103.2 31.3 C107.9 35.9, 110.8 42.6, 110.3 47.5 C109.9 52.5, 106 57.2, 100.4 61.1 C94.9 64.9, 85.7 69.1, 77 70.5 C68.4 71.8, 57.2 71, 48.6 69.1 C40.1 67.2, 30.5 63.3, 25.5 59.1 C20.5 54.8, 18.1 48.7, 18.9 43.5 C19.7 38.3, 24.6 31.9, 30.6 27.8 C36.5 23.7, 50.3 20.5, 54.7 19.1 C59.1 17.7, 56.7 19, 57 19.5 M46 20.5 C53.5 18.2, 66.1 17.7, 75.1 18.9 C84.2 20.1, 94.4 23.7, 100.4 27.9 C106.4 32.1, 110.3 39, 111.1 44 C111.9 49, 110.3 54, 105.5 58.1 C100.6 62.1, 90.6 66.1, 81.8 68.4 C73.1 70.7, 61.2 73, 52.8 71.8 C44.4 70.7, 37.2 65.9, 31.5 61.6 C25.8 57.3, 19.8 51, 18.6 46 C17.4 41, 19.3 35.7, 24.3 31.6 C29.4 27.5, 44.9 23.4, 48.9 21.5 C52.8 19.6, 47.9 20.1, 47.9 20.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;65&quot; y=&quot;45.0&quot;&gt;f1&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M178.8 21.2 C186.9 20.3, 197.3 20.4, 205 22.7 C212.7 24.9, 221.1 30.4, 225 34.7 C228.9 38.9, 229.8 43.6, 228.3 48 C226.9 52.5, 222.4 57.8, 216.3 61.4 C210.3 65, 200.6 68.7, 192 69.5 C183.5 70.3, 172.8 68.6, 165 66.2 C157.1 63.8, 149 59.4, 144.9 55.4 C140.9 51.3, 139.1 46.4, 140.6 41.7 C142.1 37, 147 30.9, 154.1 27.3 C161.2 23.6, 177.1 20.9, 183.1 19.8 C189.1 18.7, 189.9 20.2, 190.2 20.7 M195.3 20.2 C203.3 21.2, 214 26.7, 219.7 30.5 C225.4 34.4, 229.2 38.2, 229.5 43 C229.8 47.8, 226.4 55.3, 221.7 59.3 C217 63.4, 209.3 65.9, 201.4 67.2 C193.5 68.6, 182.6 68.7, 174.4 67.5 C166.2 66.2, 157.7 62.7, 152.2 59.5 C146.7 56.2, 142.6 52.5, 141.6 48 C140.5 43.5, 141.2 36.6, 145.9 32.5 C150.6 28.4, 161.1 25.2, 169.7 23.3 C178.3 21.3, 192.9 21, 197.4 21 C201.8 21, 197 22.8, 196.5 23.3&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M175.4 20.5 C183.5 19.2, 194.8 20.5, 202.8 22.3 C210.8 24.1, 219.1 27.4, 223.4 31.5 C227.7 35.5, 229.4 41.9, 228.5 46.7 C227.6 51.5, 223.2 56.7, 217.8 60.3 C212.4 64, 204 67.5, 195.8 68.6 C187.6 69.7, 176.9 68.5, 168.7 66.8 C160.4 65, 151 62.1, 146.3 58.1 C141.7 54.2, 140.1 47.8, 140.8 43 C141.6 38.1, 144.2 32.9, 150.8 29.1 C157.5 25.4, 175 21.6, 180.8 20.4 C186.7 19.2, 186 21.2, 186 21.7 M177.1 20.6 C185.1 19.9, 197.5 22.5, 205.4 24.7 C213.3 26.8, 220.6 29.1, 224.5 33.3 C228.4 37.5, 230.1 45.2, 228.7 49.9 C227.4 54.5, 222.8 57.7, 216.6 60.9 C210.3 64.1, 200.1 68, 191.4 69.1 C182.7 70.1, 172.1 69, 164.4 67.1 C156.6 65.1, 148.8 62.1, 144.9 57.6 C141 53.1, 139.5 45, 140.9 40 C142.4 35.1, 147.5 31, 153.6 27.9 C159.8 24.8, 173.9 22.8, 177.9 21.5 C181.8 20.3, 177.2 19.7, 177.3 20.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;185&quot; y=&quot;45.0&quot;&gt;f2&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M323.1 23.2 C330.5 25.1, 338.2 29.3, 342.4 33.5 C346.6 37.6, 349.6 43.2, 348.5 48.1 C347.4 52.9, 341.9 59.1, 335.9 62.6 C329.9 66.1, 320.8 68.3, 312.5 69.1 C304.2 69.8, 293.7 68.7, 286.1 66.9 C278.4 65, 270.5 62.2, 266.6 58 C262.7 53.8, 261.8 46.9, 262.8 41.8 C263.9 36.7, 267.4 30.9, 272.9 27.3 C278.4 23.8, 286.5 20.7, 296 20.4 C305.4 20, 323.3 24.1, 329.8 25.3 C336.2 26.4, 335.3 27, 334.7 27.3 M289.5 22.1 C296.6 20.3, 306.7 20.6, 315 21.9 C323.3 23.1, 333.9 25.7, 339.3 29.4 C344.7 33.1, 347.3 39.2, 347.7 43.8 C348 48.5, 346.1 53.3, 341.4 57.5 C336.7 61.7, 327.6 67.3, 319.5 69.2 C311.4 71.2, 301 70.6, 293 69.2 C284.9 67.8, 276.5 64.6, 271.2 60.7 C266 56.8, 261.7 50.5, 261.4 45.8 C261.1 41.1, 264.6 36.6, 269.4 32.6 C274.1 28.5, 286.7 23.2, 289.8 21.5 C292.9 19.7, 288 21.5, 288.1 22&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M296.7 21.2 C304.2 19.8, 313.9 20.1, 321.4 22 C328.9 23.9, 337 28, 341.6 32.3 C346.1 36.7, 349.4 43.2, 348.6 48 C347.9 52.9, 342.9 57.7, 337.2 61.2 C331.5 64.7, 322.7 67.9, 314.6 69.2 C306.6 70.5, 296.7 70.6, 288.8 68.8 C280.9 67, 271.5 62.9, 267.2 58.5 C262.9 54.1, 261.7 47.2, 262.7 42.2 C263.7 37.3, 265.9 32.6, 273.1 28.8 C280.2 25, 298.4 20.9, 305.6 19.5 C312.8 18.1, 316.2 20, 316.2 20.6 M307.9 19.7 C315.9 19.9, 327.6 23.2, 333.9 26.3 C340.3 29.3, 344.5 33, 346.2 37.9 C347.9 42.8, 347.4 50.7, 344.2 55.6 C340.9 60.5, 333.6 64.9, 326.5 67.4 C319.3 70, 309.4 71.5, 301.2 70.8 C293.1 70.2, 283.9 66.7, 277.7 63.4 C271.4 60.1, 265.7 56.1, 263.7 51.2 C261.6 46.4, 262.6 38.7, 265.5 34.1 C268.4 29.5, 274.3 25.9, 281.1 23.6 C288 21.3, 301.9 21.3, 306.6 20.5 C311.3 19.8, 309.2 18.7, 309.4 19.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;305&quot; y=&quot;45.0&quot;&gt;f3&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M675.4 18.8 C683.8 18.7, 695.7 21.5, 702.8 24.5 C710 27.5, 715.8 32.2, 718.3 37 C720.8 41.9, 720.6 48.6, 717.8 53.4 C715 58.2, 708.9 63.1, 701.6 66 C694.3 68.8, 683.1 70.6, 674.1 70.6 C665 70.5, 654.5 68.6, 647.2 65.6 C640 62.6, 633.2 57.5, 630.4 52.7 C627.7 47.8, 627.9 41.4, 630.9 36.7 C634 32, 639.9 26.9, 648.9 24.2 C658 21.5, 677.6 20.9, 685.2 20.6 C692.8 20.3, 694.6 22.2, 694.5 22.5 M676.1 18.2 C685.1 18.1, 696.1 21.9, 703.1 25.2 C710.1 28.6, 715.3 33.6, 718 38.1 C720.7 42.6, 721.9 48, 719.3 52.4 C716.7 56.8, 709.9 61.4, 702.5 64.4 C695.2 67.5, 684.4 70.4, 675.2 70.8 C665.9 71.2, 654.2 69.7, 647 66.9 C639.8 64.1, 634.6 58.8, 632 54 C629.4 49.2, 628.5 42.8, 631.2 38 C633.9 33.2, 640.7 28.4, 647.9 25.2 C655.2 22.1, 670.3 19.9, 674.7 19.2 C679.1 18.4, 674.4 20.4, 674.3 20.9&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M665.1 19.9 C673.4 18.5, 685.3 19.5, 693.8 21.7 C702.2 23.9, 711.1 28.9, 715.7 33.2 C720.2 37.5, 722.2 42.6, 721.2 47.4 C720.3 52.2, 716.1 58.4, 710 62.1 C703.8 65.9, 693.2 68.7, 684.4 69.8 C675.6 70.9, 665.4 71, 657.1 68.8 C648.7 66.7, 638.7 61.4, 634.2 56.9 C629.7 52.3, 629.2 46.2, 630.2 41.5 C631.1 36.7, 632.9 32.3, 640 28.5 C647.1 24.7, 665.8 20.1, 673 18.7 C680.1 17.3, 682.9 19.5, 682.9 20.1 M689.2 20.1 C697.6 20.9, 706 25.3, 711.1 29.1 C716.2 33, 720 37.9, 720 43.2 C720 48.6, 716.3 56.7, 711.4 61.2 C706.4 65.7, 698.6 68.8, 690.2 69.9 C681.7 71.1, 669.1 69.7, 660.6 68.3 C652.1 66.8, 644.4 65.5, 639.3 61.5 C634.3 57.5, 630.5 49.3, 630.3 44.3 C630.2 39.3, 633.2 35.4, 638.2 31.4 C643.3 27.4, 652.4 22, 660.8 20.3 C669.2 18.5, 684.1 21, 688.8 20.9 C693.5 20.7, 689.2 19, 689 19.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;675&quot; y=&quot;45.0&quot;&gt;f4&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M778.8 22.9 C786.3 20.9, 797.4 19.7, 805.7 20.9 C814.1 22.2, 823.4 26.3, 828.9 30.2 C834.4 34.2, 838.3 39.9, 839 44.5 C839.6 49.1, 837.3 53.9, 832.7 57.8 C828 61.6, 819.2 66.1, 811 67.8 C802.8 69.4, 791.7 68.9, 783.4 67.8 C775.1 66.7, 766.9 65, 761.3 61.3 C755.7 57.6, 750.3 50.9, 749.7 45.8 C749.1 40.8, 753 35, 757.9 31.2 C762.8 27.3, 775.4 24.5, 779.3 22.9 C783.2 21.3, 780.8 21.2, 781.2 21.6 M810.4 23.2 C818.3 24.8, 827.6 29.5, 832.5 33.2 C837.4 36.9, 840.2 41, 839.9 45.3 C839.6 49.6, 836.3 54.8, 830.8 58.9 C825.3 62.9, 815.4 68.1, 807 69.4 C798.5 70.7, 788.6 68.6, 780.2 66.5 C771.8 64.4, 761.8 60.9, 756.7 57 C751.6 53, 748.9 47.4, 749.6 42.8 C750.4 38.2, 755.6 32.7, 761.2 29.4 C766.8 26.1, 775.1 24, 783.2 22.9 C791.4 21.8, 805.6 22.8, 810.2 22.7 C814.8 22.7, 811.4 22.1, 811.1 22.7&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M786.3 21 C794.4 20, 806.4 21.7, 814.3 23.7 C822.2 25.7, 829.6 29.1, 833.8 33.3 C838 37.4, 840.4 43.8, 839.4 48.5 C838.3 53.2, 833.4 58.1, 827.4 61.3 C821.4 64.6, 812 67, 803.3 67.9 C794.6 68.8, 783.2 68.5, 775.2 66.5 C767.1 64.6, 759.2 59.9, 755.1 56 C750.9 52.1, 748.9 47.7, 750.1 43 C751.3 38.3, 755.1 31.7, 762.2 27.9 C769.4 24.2, 786.9 21.3, 792.7 20.4 C798.6 19.5, 797.4 21.8, 797.5 22.4 M776.1 23.3 C783.3 20.7, 794.2 18.9, 802.3 19.9 C810.5 20.9, 818.8 25.4, 825.1 29.2 C831.5 33, 838.9 38.2, 840.3 42.7 C841.8 47.1, 838 52, 833.7 55.9 C829.4 59.7, 822.1 63.7, 814.3 65.9 C806.5 68, 795.5 69.2, 786.9 68.7 C778.3 68.1, 768.5 65.8, 762.7 62.7 C756.9 59.5, 753.6 54.6, 752.2 49.8 C750.9 44.9, 751.1 37.8, 754.7 33.5 C758.2 29.2, 770.3 25.3, 773.7 24 C777.1 22.7, 774.5 25.2, 775.1 25.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;795&quot; y=&quot;45.0&quot;&gt;f5&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M9.1 230.5 C25.4 230.5, 46.1 229.5, 99.1 231.8 C109.9 230.2, 109.8 229.1, 111.7 237.5 C112.2 249.5, 111.1 253.6, 109.3 268.6 C113.5 273.9, 110.8 273.4, 101.9 271.1 C80.4 274.7, 67 271.1, 6 274.8 C3.4 276.5, 1.1 274.7, 2.8 263.5 C1.4 262.2, 0.7 252.8, -2.5 240.7 C1.4 235.9, 3.8 230.6, 5.6 227.6&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M5.4 230.7 C36.3 232.6, 62.9 231, 104 231.1 M7.7 229.5 C28.1 229.7, 47.4 230.6, 103.1 230.8 M102.7 230 C106 229.8, 108.3 231.9, 111.4 236.5 M104.5 230.3 C106.9 231, 110 231, 109.1 236.8 M108.3 238.6 C110.4 246.1, 111 257.8, 109 265.4 M110 236.9 C110.8 247.1, 110.7 255.4, 110.2 266 M110 266.7 C109.9 270.7, 108.9 272.7, 102.4 274.5 M110.8 266.3 C111.2 273, 108.3 274, 104.9 273.6 M101.1 275.8 C74.5 274.7, 45.5 273.9, 6.8 273.8 M102.8 274.4 C67.6 273.5, 33.2 274.1, 8 274.3 M7.3 274 C1.8 272.2, -0.4 272.8, -0.9 266.1 M7.5 274.2 C2.1 273.1, 1 269.8, 2.2 268.4 M0.1 265.6 C-1.1 258.9, 0.4 252.3, 0.5 236.5 M0.8 266 C0.8 259.4, 0.1 250.2, -0.7 237.7 M0 237.3 C-2 232.7, 0.7 229.3, 7.7 230 M0.1 237.1 C-2.2 231.6, 1.1 229.2, 8.4 232.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;55&quot; y=&quot;252.0&quot;&gt;m1()&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M138.3 230 C156.7 228, 177.5 227.4, 233.7 228.3 C240.6 229.5, 240.6 231.2, 238.2 236.2 C237.9 250.1, 241.5 260.8, 241 264.4 C237.1 271, 240.2 273.8, 233.9 274.4 C200.7 275.2, 175.5 272.7, 135.1 271.9 C129.6 273.3, 131.1 270.5, 127.6 269.1 C127.7 255.9, 132.1 254.4, 131.3 239.5 C131.4 232.3, 131.7 229.8, 140.2 227.4&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M139 230.7 C157.9 228.3, 181.1 228.5, 231.3 231.6 M136.7 230.4 C169.3 229.8, 199.3 231, 232.6 230.7 M232.7 230 C239.3 231.3, 239.1 234.4, 241.9 237.3 M234.3 231.1 C237.1 232, 240.7 230.3, 240.9 235.9 M241 237.9 C239.8 250.6, 241.1 258.6, 238.1 265.5 M240.6 238.1 C240.7 248.5, 239.4 260.4, 239.2 265.9 M240 266.7 C240.1 270.1, 239.1 273.1, 231.2 274.3 M239.1 267.6 C238.1 272.7, 236.6 274.9, 230.8 276.1 M234 272.2 C210.2 271.3, 192.4 271.9, 138.9 275 M233.4 273.8 C198.7 274.5, 164.4 273.7, 137.1 273.1 M137.3 274 C133 274.3, 128 272.8, 131.3 265.9 M139 275.2 C132.5 272.4, 128.4 273, 128.7 267.1 M131.8 266.6 C131 257.8, 130.3 250.4, 130.8 237.7 M130.5 266.8 C129.8 256.3, 129.8 245.2, 129.7 237.5 M130 237.3 C129.4 232.6, 131.3 230.2, 136.4 230.9 M130.9 238.3 C130 231.4, 132.9 228, 135.2 231.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;185&quot; y=&quot;252.0&quot;&gt;m2()&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M267.4 229.5 C287.9 232.7, 308.9 232.4, 361 232 C364.1 228.8, 371.4 233.4, 371.9 234.9 C369.9 244.8, 370.9 249.1, 372.7 267.4 C367.9 268.2, 369.5 274.2, 366 270.4 C340.1 275.7, 322.2 274.4, 264.3 276.2 C263 277.3, 261.2 273.5, 259.7 267.6 C261.3 256.8, 256.4 255.9, 257.8 238.3 C261.3 235.9, 259.5 229, 267.7 227.2&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M268.6 230.8 C302.5 229.9, 337.4 227.8, 362.5 228 M267.6 229.3 C289.4 229.8, 313 231.3, 362.1 230.5 M362.7 230 C368.6 228.8, 370 233, 368.5 238 M364.2 231.9 C367.3 228.5, 371.5 234.2, 368.1 239.6 M369.8 237.3 C369.2 245.3, 371.2 251.5, 371.3 265.5 M369.3 237.3 C369.2 244.1, 370.7 251.6, 370.3 265.9 M370 266.7 C370.2 273.5, 369.4 273.6, 364.1 274.2 M371.5 264.8 C369.6 272.4, 369.5 275.8, 361.3 274 M362.9 272.7 C330.9 273.8, 297.1 275.8, 267 272.2 M361.9 273.2 C329.8 273.6, 297.6 273.5, 268.2 273.8 M267.3 274 C264.3 272.4, 260.5 272.9, 259.5 265.6 M266.5 272.2 C262.8 276.3, 260.4 271.6, 259.8 265.7 M259.4 267.6 C259.7 260.6, 260.8 252.5, 261 238.8 M260.2 267.6 C260.8 259, 259.5 252, 260.2 237.3 M260 237.3 C260.8 232.4, 261.9 231.1, 269.1 231.9 M261.8 235.4 C262.1 231.2, 264.7 231.5, 266.7 231.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;315&quot; y=&quot;252.0&quot;&gt;m3()&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M616.6 228.9 C639.2 230.2, 660.3 230.3, 715.6 228.5 C714.7 228.1, 722.3 235.6, 718.4 240.8 C722.8 245.3, 721.3 256.3, 717.2 263.2 C718.8 272.5, 718.8 274.5, 710.8 273.7 C680.4 276.2, 650.8 276.1, 620.7 273.3 C609.2 274.1, 611.2 269.3, 611.7 266 C607.7 257.7, 607.9 250.2, 611.6 237.1 C611.3 232.2, 614.5 228.2, 615.1 227&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M618.2 230.8 C644.1 231.6, 671.6 231.2, 713.7 228.5 M616.6 230.2 C650.6 229.8, 684.8 231.7, 713.6 230.4 M712.7 230 C717.9 230.3, 720.9 231.6, 719.1 238.8 M714 228.8 C717.5 229.6, 722.3 233.4, 719.9 238.7 M718.5 236.6 C718.6 245.9, 721.3 252.3, 720.4 265.5 M719.9 236.5 C719.7 245.5, 720 254.6, 719.3 265.9 M720 266.7 C720.4 272.9, 715.7 274, 713 274.1 M719.9 266.1 C721.1 272.1, 717.8 272.1, 711.9 271.9 M711.8 273.1 C686.7 274.4, 659.9 273.8, 619.1 273.4 M712.5 274.6 C680.9 274.6, 650.8 273.2, 617.3 274.6 M617.3 274 C611.6 274.5, 608.9 272.9, 611.7 265.3 M618 273.2 C613.2 275.5, 607.8 270.2, 610.9 269 M611.1 268.6 C611.7 259.5, 610.7 250.6, 611.2 236 M610 266.5 C609.7 255.8, 609.2 247.1, 610.6 237.1 M610 237.3 C608.1 232.2, 612.6 228, 617.7 228.8 M608.6 236.6 C609.6 231, 611.9 230.3, 618.1 231.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;665&quot; y=&quot;252.0&quot;&gt;m4()&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M735.8 228.4 C760.4 227.6, 774.5 228.2, 833 232.2 C835.4 227.4, 843.1 230.6, 842.1 239.5 C838.6 240, 841.7 251.7, 838.9 266.2 C839.6 269.7, 838.1 274.9, 832.8 276.9 C809.8 276.7, 787.5 270.6, 739.9 270.4 C732.6 270.9, 731.3 272.3, 726.5 264.4 C731.3 258.7, 729.3 251.8, 728.1 235.9 C731.3 235.8, 732.4 227.3, 739.7 226.7&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M737.8 230.9 C759.7 229.2, 779.8 230.6, 830.9 229 M737.5 229.2 C762.7 230, 788.5 230.1, 833.1 230.3 M832.7 230 C837.2 231.8, 841.8 234.1, 839.7 235.6 M833.9 229.6 C837.7 230.6, 838.5 232.7, 841.7 237.7 M841.3 236 C838 246.5, 841.4 257, 839.6 265.5 M840.6 237.7 C839.6 246.9, 840.7 257.6, 840.4 265.8 M840 266.7 C840.6 272.3, 835.9 274.5, 831.8 273.9 M838.3 267.4 C838 271.9, 836.1 272.9, 832.4 274.4 M830.7 273.5 C793.3 272.9, 758.7 273.7, 737.3 274.6 M833 274 C804 273.7, 773.9 274.9, 738.3 273.3 M737.3 274 C732.9 272.7, 731.4 272.9, 729.9 265.1 M735.5 274.2 C733.5 274.8, 729.8 273.4, 732 267.6 M728.7 265.6 C729.8 258.3, 730.6 248.7, 731.4 237.1 M729.7 267.3 C730.7 260.5, 730.9 251.9, 729.1 236.8 M730 237.3 C729.5 232, 733.2 229, 736.4 229.8 M729.5 237.8 C731.8 230.8, 733.7 229.2, 739.5 230.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;785&quot; y=&quot;252.0&quot;&gt;m5()&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M854.9 227.9 C874.5 232.3, 895.9 233.3, 950.3 228.8 C956.1 226.6, 956.7 232.7, 958.6 238.2 C961.6 247.7, 962.2 251.7, 960.6 269.2 C960.4 274.1, 957.5 275.3, 954.8 273 C920.1 277.2, 893.3 272.3, 859.1 274.7 C856 274.9, 851.3 268.1, 848.5 270 C847.6 259.6, 850.8 253.3, 851.9 234.7 C851.3 232.2, 850.2 226.5, 857.2 226.5&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M857.4 231 C890.4 228.9, 926.2 228, 952.2 229.4 M856.5 230.1 C893.9 230, 930.4 230.5, 952.5 230.2 M952.7 230 C956.5 229.3, 958.6 232.7, 960.2 236.3 M953.7 230.4 C957.9 231.7, 959.2 232, 958.9 236.8 M960.1 239.3 C961.4 247, 961.5 257.7, 958.7 265.5 M959.2 236.9 C960 248.3, 960 260.7, 959.4 265.8 M960 266.7 C960.7 271.6, 956.2 274.9, 950.7 273.8 M960.7 268.6 C959.5 271.6, 959 273.8, 952.9 272.3 M953.7 274 C923.1 273.4, 891.5 275.7, 855.4 275.7 M953.6 273.4 C925.1 272.8, 895.1 272.7, 857.4 274.1 M857.3 274 C854.2 274.8, 849.9 273, 848 264.8 M857 275.2 C853.9 274.1, 851.8 272, 848.5 266.2 M850.4 266.6 C848.4 257.2, 851.1 246.7, 851.7 238.3 M849.4 266.1 C849.7 257.4, 850.6 247, 849.5 236.6 M850 237.3 C850.9 231.8, 853.8 229.9, 859 230.7 M850.3 239 C849.3 230.6, 850.8 228.1, 856.4 230.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;905&quot; y=&quot;252.0&quot;&gt;m6()&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M56.6 224.7 C60.6 168.5, 61.9 111.9, 61.9 75.2 M56.9 223.7 C58.2 185, 59.6 147.5, 62.5 75.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M57 88.8 C59.9 84.1, 61.5 79.2, 62.4 75.4 M57.2 88 C58.4 84.5, 59.9 81.9, 62.8 75.6 M63.2 77.2 C65.7 79.3, 65.1 80.2, 70.3 89.2 M63.6 76 C65.1 79.7, 67.4 83.7, 68.9 88.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M72.8 225.5 C107.8 165.6, 143 110, 166.8 75 M71.5 225.8 C103.1 175.6, 132.2 128.3, 167 73.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M155.7 81.5 C160.2 77.3, 164 75.9, 166.8 74.6 M154.7 81.7 C159.3 78.3, 162.1 76.7, 167 73.5 M167.8 74.8 C167.4 79.3, 166.2 84.4, 164.7 87.3 M167.3 73.9 C166.8 76.9, 166.8 81.2, 165.1 88.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M186.4 224.5 C185.9 168.5, 185.5 112.5, 186.2 75.5 M185.3 224.1 C184.5 167.1, 186.2 110, 184 76.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M179.9 88.9 C181.9 84.4, 183.9 79.8, 185.8 75.6 M179.2 88.7 C180.6 83.5, 184.1 78.3, 184.3 76.1 M184.2 76.9 C187.9 80.6, 187.1 83.8, 191.1 87.7 M185.4 76.3 C187.9 80.6, 188.9 85.8, 190.5 89.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M202.7 225.1 C236.1 167, 269.6 112.2, 286.8 75.6 M200 224.1 C222.3 188.6, 244.4 151.6, 288.2 74.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M278 82.1 C281.8 78.1, 286.3 77, 287.2 75.1 M276.1 81.3 C279.3 79.9, 282.6 77.8, 288.2 74.3 M288.5 74.8 C289.2 78.2, 287.5 80.4, 288 89.1 M288.8 74.5 C287.3 78.3, 287 82.5, 287.7 88.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M312.2 225.7 C310.9 167.3, 308.4 111.9, 307.8 77.2 M314.5 223.7 C311.6 194.3, 310.1 163.1, 306.7 75.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M300 90.1 C302.5 84.1, 304.7 80, 307.4 76.8 M301.6 88.7 C301.7 86.8, 302.8 83.6, 306.7 75.9 M306.8 76 C308.3 80.8, 311.8 85.6, 314.3 88.8 M306.4 75.7 C309 79.9, 311.3 83.7, 313.4 87.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M665.5 225.6 C667.3 165.4, 670.9 112.2, 672.2 75.4 M666.1 224.9 C668.5 183.4, 669.4 145.4, 672.7 76.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M666.2 89.4 C668.6 82.3, 671.8 80.1, 672.6 75.6 M666.6 88.9 C668.6 84.3, 669.7 82.1, 673 76.1 M672.2 75.8 C674.7 80.3, 675.6 83.9, 678 88.8 M673.6 75.9 C675.6 79.3, 676.8 81.9, 678.9 89.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M770.2 226.2 C739.2 167.2, 709.9 107.4, 690.7 75.8 M771.1 224.8 C745.1 174.6, 718.8 125, 690.8 74.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M690.9 89.3 C690.3 83.1, 691 76.3, 690.7 75.4 M691.5 88.4 C691.4 83.1, 691.3 78.5, 690.7 74.7 M690.4 73.9 C692.8 77, 695.9 78, 701.7 81.8 M690.8 74.3 C694.3 77.6, 699.6 81, 701.5 83.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M786.7 225.4 C789.7 165.5, 794.3 108.9, 795 75.7 M785.9 223.3 C788.8 165.5, 792.7 107.8, 792.8 76.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M787 89.2 C788.9 82.4, 792.8 77.9, 794.6 75.8 M786.5 87.8 C789 83, 792.4 78.4, 793 76.6 M794.5 75.5 C795.2 81.7, 798.6 85, 799.6 90.2 M793.9 76.2 C795.1 80.3, 796.1 84.1, 798.3 89.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M891.4 225.9 C858.5 167.7, 830.3 108.5, 809.5 76.2 M890.9 225.2 C870.7 185.6, 850.6 148.1, 810.8 73.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M811.7 89.1 C810.3 83.2, 811.8 76.8, 809.8 75.6 M811.4 88.6 C810.9 84.5, 810.9 81.4, 810.7 73.7 M809.9 73.6 C814 77.9, 817.2 81, 823.2 83.2 M811.1 74.6 C813.2 75.4, 814.9 78.2, 822.3 83.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M359.5 227.8 C466.1 164.4, 573 103.1, 638.8 66 M358 226.8 C447.6 177.2, 535.4 127, 638 65.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M625.6 67.7 C629.5 65.5, 634.2 65.7, 638.8 66 M624.1 66.8 C629.3 66.7, 633.2 67, 638 65.7 M639 65.1 C635.9 69.9, 634.1 72.8, 630 77.6 M639.2 66.5 C636.5 69.4, 632.9 74, 630.9 78&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M406 23.1 C441.9 20.8, 476.6 19.7, 536.5 21.4 C542.7 17.6, 548.6 19.6, 542.2 27.4 C542.9 39, 543.9 45, 547.2 62.5 C545.4 69.5, 538.7 72.9, 535.4 73.9 C498.5 78.7, 460.6 78.1, 402.8 72.4 C400.6 71.7, 396.7 68.1, 398.4 66.7 C397.4 48.3, 398.3 37.9, 392.5 30 C393 22.2, 398.5 16.6, 402.2 16.7&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M403.3 18.9 C453.3 19.1, 504.1 20.6, 537.9 19.3 M404.9 19.1 C443.1 20.4, 483.8 19.7, 536.6 19.7 M536 20 C540.2 18.1, 544.5 22, 543.1 29.5 M536.7 20.3 C541.1 19.2, 544.3 21.8, 544.3 27.8 M546.9 29 C544.2 44.6, 545.9 59.4, 543.8 65 M544.9 28.3 C544 41.2, 544.9 55.6, 545.9 65.9 M545 65 C545.4 72.5, 544 72.6, 537.4 75.1 M543.7 65.4 C543.9 71.8, 541.8 76, 537.6 75.4 M535 75.1 C502 73.3, 470.7 73.5, 402.9 74.4 M535.8 73.3 C508.7 75.2, 483 76, 404.8 74.2 M404 74 C399.8 74.5, 396 71.4, 393.9 63.8 M404.1 73.9 C398 74, 394.9 71.5, 396.3 65.8 M395.3 65.3 C396.1 56, 394.2 46.8, 396.1 27.8 M394.2 64.3 C396.2 51.9, 395.2 40.5, 394.2 29.9 M395 29 C393.7 22.6, 396.9 21.1, 403.9 18.6 M395.9 29 C395.3 24.1, 400.2 20.7, 403.8 19.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;470&quot; y=&quot;36.4&quot;&gt;becomes&lt;/tspan&gt;&lt;tspan x=&quot;470&quot; y=&quot;57.6&quot;&gt;its interface&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M477.8 80.6 C484.9 100.1, 491.1 123.4, 494.1 136.9 M478.2 79.9 C482.4 93.7, 485.5 106.9, 494.3 136.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M496.5 123.3 C496.2 127, 495.3 133.3, 494.4 136.8 M496.8 122.8 C496.6 126.3, 495.6 129.3, 494.5 136.7 M495 135.3 C491.3 133.6, 487.6 128, 486.6 124.7 M494.6 135.9 C491.5 132.7, 488.1 128.7, 485.4 126.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;figcaption&gt;A feature sketch: methods point to the fields they use; separate clusters are classes hiding inside the big one.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Tell the story of the system.&lt;/strong&gt; Explain the system in two or three sentences, as if to a new colleague. Then look at the design, or at your proposed change, and ask whether it makes that story &lt;em&gt;more true or less true&lt;/em&gt;. The design that keeps the story true is usually the better one.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scratch refactoring.&lt;/strong&gt; Make a throwaway branch and refactor freely, without tests, purely to understand the code. Learn from it, then delete the branch. Feathers is firm about this: never merge it, and don&#x27;t trust its result. Its only job was to teach you.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Mark up a listing.&lt;/strong&gt; Print the hard function, or open it in an editor you can annotate. Mark each responsibility, then mark everything a change you&#x27;re planning would affect. That set of marks is exactly the list of things your tests need to cover.&lt;/p&gt;
&lt;h2 id=&quot;step-4-what-goes-in-a-proposal-besides-this-is-bad&quot;&gt;Step 4: What goes in a proposal besides &quot;this is bad&quot;?&lt;a class=&quot;anchor&quot; href=&quot;#step-4-what-goes-in-a-proposal-besides-this-is-bad&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Two things: evidence and a path. A proposal that says &quot;this is bad, let&#x27;s redo it&quot; is the Netscape plan in smaller type.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;for each desired change, make the change easy (warning: this may be hard), then make the easy change&quot;&lt;/p&gt;
&lt;p&gt;— Kent Beck, on Twitter (2012)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here is the shape I&#x27;d use. It has five parts.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The problem, with evidence.&lt;/strong&gt; &quot;Adding the last two payment providers touched 9 and 11 files. Three of those changes were in &lt;code&gt;switch&lt;/code&gt; statements in the order, refund and report modules (parallel modifications). Each provider&#x27;s field names leak into the &lt;code&gt;Order&lt;/code&gt; type (information leakage).&quot; Numbers and red-flag names, not adjectives.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The story.&lt;/strong&gt; The two-sentence description of what this part of the system &lt;em&gt;should&lt;/em&gt; be.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Two designs, really different.&lt;/strong&gt; This is Ousterhout&#x27;s &lt;strong&gt;design it twice&lt;/strong&gt;. For a provider integration, for example:
- &lt;em&gt;Design A&lt;/em&gt;: one &lt;code&gt;PaymentProvider&lt;/code&gt; interface (authorize, capture, refund, parse webhook), one implementation per provider, and the provider&#x27;s vocabulary never leaves its own package.
- &lt;em&gt;Design B&lt;/em&gt;: a table of providers, each row holding endpoints, field mappings and a few hook functions, run by one generic engine.&lt;/p&gt;
&lt;p&gt;Which one wins? Compare them on one question first: &lt;strong&gt;which is simpler for the code that calls it?&lt;/strong&gt; Then on what each hides, and on how easy the &lt;em&gt;next&lt;/em&gt; provider will be.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The migration path.&lt;/strong&gt; How to get there without stopping work. Most proposals forget this part, and it is what the rest of this post is about.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How you&#x27;ll know it worked.&lt;/strong&gt; &quot;The next provider touches only its own package plus one registration line.&quot;&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:472px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -16 472 632&quot; width=&quot;472&quot; role=&quot;img&quot; aria-label=&quot;A design proposal has five parts&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M0.1 1.4 C85.2 0.4, 166.2 -1.3, 414.6 1.6 C424.4 8.8, 434.4 16.9, 438.1 26.3 C441 227.8, 441.4 429.9, 440.3 599.2 C297.3 597.6, 154.5 599.4, -0.9 599.4 C-0.9 369, -2 138.6, -0.3 -0.7&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M0 0.2 C142.5 -1.8, 282.7 -1.8, 414.4 0.8 M0.1 -0.4 C126.2 -1, 251.8 -0.8, 413.7 0.2 M415.5 -1.2 C421.8 4.4, 426.1 10.9, 439.2 25.8 M413.5 0.2 C421 7.8, 428.4 13.5, 440.5 25.9 M439.3 26.1 C441.7 220.7, 441.3 416, 439.9 600.4 M439.9 26.2 C439.1 226, 439 426.6, 440.2 600.1 M439.1 600.2 C306.7 600, 173.5 598.9, 0.9 599.6 M440 599.5 C332.2 599.7, 223.5 599.1, -0.3 600 M-0.1 599.4 C1 466.7, 0.7 333.1, 0.4 -0.1 M-0.1 599.7 C-0.7 384.8, -0.6 168.9, 0.4 -0.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M414.3 0.4 C414.3 5, 410 22.8, 414.2 27 C418.3 31.3, 434.9 26.2, 439.3 25.9 M413.1 -0.5 C412.8 4, 408.6 20.8, 413.3 25.5 C418.1 30.1, 437.1 27.2, 441.8 27.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:24px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;220&quot; y=&quot;48.0&quot;&gt;proposal&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;40&quot; y=&quot;117.5&quot;&gt;1  evidence: 9 and 11 files&lt;/tspan&gt;&lt;tspan x=&quot;40&quot; y=&quot;142.5&quot;&gt;    per provider&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M38.9 178 C164.6 178.3, 287.7 176.6, 398.9 176.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;40&quot; y=&quot;230.0&quot;&gt;2  the story (2 sentences)&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M39.7 277.8 C162.2 277.1, 286.2 275.8, 400.7 277&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;40&quot; y=&quot;317.5&quot;&gt;3  design A vs design B,&lt;/tspan&gt;&lt;tspan x=&quot;40&quot; y=&quot;342.5&quot;&gt;    compared on the caller&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M40.4 377.7 C162.5 380.5, 287.2 379.5, 399.9 377.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;40&quot; y=&quot;430.0&quot;&gt;4  migration path&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M39.2 477.3 C114.9 479.8, 186.6 478.7, 400.9 478.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;40&quot; y=&quot;530.0&quot;&gt;5  how we&#x27;ll know&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;A design proposal: evidence of the problem, the system&amp;#x27;s story, two genuinely different designs compared on caller simplicity, a migration path, and a way to verify.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;step-5-how-do-you-change-code-that-has-no-tests&quot;&gt;Step 5: How do you change code that has no tests?&lt;a class=&quot;anchor&quot; href=&quot;#step-5-how-do-you-change-code-that-has-no-tests&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You make it testable first, in small mechanical steps. Feathers&#x27; definition of legacy code is the one that reframed everything for me:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Code without tests is bad code. It doesn&#x27;t matter how well written it is…&quot;&lt;/p&gt;
&lt;p&gt;— Michael Feathers, &lt;em&gt;Working Effectively with Legacy Code&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;&quot;Legacy code is simply code without tests.&quot;&lt;/strong&gt; Not old code, not ugly code. Code you can&#x27;t change safely, because nothing will tell you if you broke it.&lt;/p&gt;
&lt;p&gt;That is the whole problem in one sentence, and it is why Step 5 starts with tests and not with the change.&lt;/p&gt;
&lt;p&gt;He names the two ways people change code. &lt;strong&gt;Edit and Pray&lt;/strong&gt;: plan carefully, edit, then poke around hoping nothing broke. He calls it pretty much the industry standard. And &lt;strong&gt;Cover and Modify&lt;/strong&gt;: first cover the code with tests, then change it with a safety net.&lt;/p&gt;
&lt;p&gt;The catch is obvious: to add tests you often have to change the code first, which is exactly what you were afraid to do without tests. His way out is a five-step algorithm:&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -29 1058 293&quot; width=&quot;1058&quot; role=&quot;img&quot; aria-label=&quot;The legacy code change algorithm&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;85&quot; y=&quot;0.0&quot;&gt;1&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M10.4 29.2 C53.5 31.2, 99.2 26.6, 163.6 32.1 C165.2 32.7, 167.8 31.3, 168.4 40.3 C170.1 53.8, 167.2 68.6, 170.5 99.1 C167.7 104.4, 169.1 105.2, 159.8 109.2 C112.4 108.2, 69.6 103, 8.8 105 C4.9 109.5, 0.5 104.6, 3.2 97.5 C-1.3 79.1, -3.6 62, -1.4 36.7 C-1.5 36.9, 5.6 27.5, 12.5 30.9&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M10.9 29.8 C44.1 27.4, 79.1 28.7, 158.3 28.6 M10.8 30.8 C52.8 31.3, 95.8 31.5, 159.9 29.3 M160 30 C168.5 28.4, 170.6 34.5, 171.2 39.4 M159 31.3 C168.1 31.2, 170.5 35.2, 170.8 39.6 M170.9 39.5 C170 55.2, 171.6 75.3, 171.8 95.4 M169.3 40.8 C170.4 59.8, 169.8 81.3, 169.7 95.5 M170 96 C169.5 102.1, 165.9 106.2, 158.8 105.9 M169.6 94.1 C169.6 101.2, 165.6 106.5, 160.7 107.3 M161.4 104.2 C117.3 106.3, 70.7 105.3, 11.1 107.8 M159.2 105.2 C111 105.2, 62.1 105.9, 11 105.1 M10 106 C4.8 107.8, 1.8 102.3, 0.5 94.7 M8.3 104.5 C4.2 106.3, 2.1 103.5, -0.3 93.7 M-1.7 95.9 C0.9 81.5, -1.8 66.5, 1 40.3 M0.7 95.3 C-0.3 75, 0.5 55.7, -0.7 40.3 M0 40 C-0.4 34.7, 4.9 31.9, 9.8 31.5 M1.8 40.1 C-0.2 32.2, 3 30.4, 11.5 29.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;85&quot; y=&quot;56.8&quot;&gt;change&lt;/tspan&gt;&lt;tspan x=&quot;85&quot; y=&quot;79.3&quot;&gt;points&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;299&quot; y=&quot;0.0&quot;&gt;2&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M222.6 31.4 C255.1 28.8, 282.7 32.2, 371.7 26.7 C381.3 33.2, 386.2 35.1, 387.2 42 C381.4 61.9, 381.6 82.5, 387.1 95.4 C384.5 103.3, 379.3 102.7, 372.5 105.6 C334.4 106.2, 299.7 106.2, 227.4 104.5 C219.6 103, 213.1 103.4, 212.8 94.3 C216.3 79.2, 209.7 61.8, 211.4 41.1 C213.5 32.4, 218.7 28.2, 226.8 28.9&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M225.2 30.9 C270.4 30.8, 313.6 30.4, 373.5 31.1 M224.4 29.4 C269.2 31.1, 313.2 30.5, 374.4 29.3 M374 30 C382.6 31.8, 382.1 32.5, 382 39.9 M373.5 29.1 C381.2 31.8, 383 32.8, 383.3 38.5 M382.2 41.6 C384.7 52.5, 383 70.3, 385.6 95.4 M383.7 41 C384.5 57.1, 383.4 76.1, 385 96.3 M384 96 C385.9 102.3, 380.9 105.1, 374.5 107.9 M384.4 94.5 C384.5 103.7, 378.8 104.5, 373.7 103.7 M374.6 104.3 C325.3 107.8, 277.5 106.4, 225.3 105.7 M374.9 106 C333.7 107, 294.3 105.8, 224 106.5 M224 106 C216.9 105.9, 212.7 103.9, 215.9 94.7 M224.2 106.5 C218.5 105.5, 214.6 100.9, 214.6 97.7 M212.5 96.8 C213.8 77.9, 213.7 59.2, 215.1 38.1 M213.5 96.4 C215.1 82.8, 214.5 70.8, 214.6 39.1 M214 40 C212 33.8, 219.3 29.1, 223.5 31.6 M213.1 39.1 C213.6 32.8, 217.5 30.3, 225.2 30.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;299&quot; y=&quot;56.8&quot;&gt;test&lt;/tspan&gt;&lt;tspan x=&quot;299&quot; y=&quot;79.3&quot;&gt;points&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M177.8 67.3 C186.3 67.3, 192.1 66.6, 209.7 68 M176.3 67.7 C185.1 67.3, 192.6 68.7, 208.6 67.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M196.6 61.4 C200.1 63, 201.5 64.1, 209.2 68 M195.6 61.7 C199.3 63, 202 65.5, 208.4 67.6 M208.8 66.8 C206.1 68.1, 201.3 70, 196.1 74.9 M208 67.4 C203.6 69.6, 197.9 72.2, 195.7 74.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;513&quot; y=&quot;0.0&quot;&gt;3&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M441 29.2 C465.9 33.6, 501.8 31, 591.1 26.6 C591.8 27.9, 601 33.3, 599.9 39.5 C597.1 53.2, 598.8 68.6, 597.4 99.4 C596.2 104.1, 593.7 104.6, 588.9 102.4 C542.6 103.5, 504.5 105.6, 437.1 106.4 C431.6 107.7, 431.5 105.3, 430.5 96.6 C426.8 78.3, 428.1 59.5, 426.5 36.7 C429.4 34.2, 433.1 30.6, 436.7 32.4&quot; style=&quot;fill:var(--xd-orange)&quot;/&gt;&lt;path d=&quot;M436.3 29.1 C483 27.7, 527.6 30.3, 588.8 31.7 M438.5 29.6 C468.4 30.4, 497.7 29.9, 588.1 29.5 M588 30 C593.6 29.2, 598.2 34, 597 40 M588.6 32 C593.2 31.8, 597.9 33.3, 597.3 41.7 M599.9 38.6 C596.6 56.5, 599.7 75.8, 600 95.5 M597.8 40.2 C598.2 59.8, 597.1 80.4, 598.6 96 M598 96 C596.7 103.4, 596.5 106.5, 588.9 104.1 M597.8 94.1 C598.7 104.6, 592.9 104.2, 590 107.9 M588.2 104 C551.6 104.5, 515.8 105, 437.7 104.4 M587.6 106.2 C535.3 106.4, 482.1 106.8, 439 106.5 M438 106 C429.7 107.8, 426.2 103, 426.6 94.8 M436.6 105.4 C432.8 104.8, 428.3 101.7, 429.4 98 M429.3 97.7 C429.3 83.5, 428.6 69.5, 429.1 40.6 M427.4 95.7 C429 79.6, 428.6 64, 428.7 40.8 M428 40 C429.4 32.3, 433.3 30.6, 438.3 31 M428.9 39.9 C429.6 34.4, 430.7 31.3, 437.2 29.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;513&quot; y=&quot;56.8&quot;&gt;break&lt;/tspan&gt;&lt;tspan x=&quot;513&quot; y=&quot;79.3&quot;&gt;dependencies&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M389.5 67 C396.6 69.5, 408 67.7, 423.9 66.5 M390.9 67.3 C398.6 68.2, 404.7 68.7, 421.6 68.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M409 61.2 C411.5 64.5, 416.9 64.9, 423.3 67 M410 61.4 C413 63.5, 414.9 65.2, 421.7 68.3 M420.6 69.1 C419.9 68.6, 415 71.3, 409.6 72.9 M422.5 67.9 C417.8 70.1, 413.4 71.4, 408.9 74.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;727&quot; y=&quot;0.0&quot;&gt;4&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M652.2 26.9 C683.9 31.2, 713.6 29.8, 803.3 26.5 C809.4 29.7, 808.5 31.4, 812.5 36.9 C814.9 55.7, 810.9 70, 814.9 96.1 C815 104.8, 808 106.5, 805.4 106.4 C758 106.1, 709.3 110.3, 654 108.3 C643.6 105.1, 642.7 99.9, 641 99 C644.6 77.4, 639.2 57.1, 641.6 39.5 C645.3 36, 647.4 32.9, 653.9 28.7&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M651.4 31.4 C699.6 31.7, 741.7 33.3, 800 28.3 M652.7 29.8 C697.7 29.7, 744.1 31.3, 801.7 29.7 M802 30 C808.6 30.6, 810.4 31.5, 812.1 40.2 M803.7 30.8 C809.8 31.9, 812.7 33.8, 811.3 40.4 M813.6 39.6 C812.5 60.6, 812.4 85.3, 810.4 95.6 M812 39.5 C811.8 53.4, 812.9 64.2, 812.2 95.6 M812 96 C811.6 104.5, 808.1 107.8, 803.3 104.3 M811.2 97.7 C812.9 100.8, 807 104, 801.6 107.4 M801.8 107.8 C747.8 105.2, 690.2 103.6, 650.1 107.1 M802.4 106.4 C766.8 105.7, 729.9 105.7, 652 106.5 M652 106 C646.6 105.7, 643.6 102.1, 641.2 95 M652.9 104.3 C647.1 104.1, 642 102.5, 644.1 98.2 M642.1 94.5 C642 73.9, 640.6 53.5, 643.1 39.2 M641.3 96.9 C642.9 76.3, 642.8 57.2, 642.8 40.6 M642 40 C642.7 34.7, 647.3 28, 653.1 30.4 M640.6 40.7 C641.1 31.3, 643.9 32.2, 653.7 27.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;727&quot; y=&quot;56.8&quot;&gt;characterization&lt;/tspan&gt;&lt;tspan x=&quot;727&quot; y=&quot;79.3&quot;&gt;tests&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M605.6 66.9 C613.7 66.9, 628 66.9, 634.3 69 M604.5 68.5 C617.4 68.3, 629.3 68.1, 635.7 68.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M624.5 61.1 C626.7 63.3, 633.2 65.4, 634.8 68.7 M623.7 62.3 C628.8 64.5, 633.3 66.9, 635.8 68.6 M635.9 68.6 C631.2 70.1, 628.5 71.9, 624.1 73.5 M636.4 67.6 C631.8 69.5, 627.6 72.5, 622.8 73.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;941&quot; y=&quot;0.0&quot;&gt;5&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M863.1 28.6 C923.9 32.1, 978.6 32.7, 1013.4 27.8 C1020.4 32.6, 1027.6 30.8, 1026.9 38 C1023.6 57.6, 1025.7 81.9, 1026.7 96.6 C1024.1 100.5, 1025 105.1, 1016.1 104.2 C973.3 102.2, 938.7 102.1, 866.2 102.6 C858.4 107.9, 858 106, 855.2 98.6 C859.6 80.2, 856.6 65.4, 853.6 38.7 C858.5 31.4, 859.1 30.8, 868.7 27.8&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M866.8 31.4 C911.8 29.3, 957.5 29.6, 1014.8 30.2 M865.7 30.9 C903 30.5, 940.9 31.5, 1015.1 29.4 M1016 30 C1021.2 31.1, 1027.8 33.2, 1024.9 41.2 M1014.5 31.7 C1021.3 28.8, 1024 35.6, 1025.3 37.7 M1026.5 38.5 C1026.1 59.6, 1024.6 76.1, 1024.8 95.7 M1025.8 40 C1026.9 59.8, 1026.4 81.8, 1025.2 96.9 M1026 96 C1027.2 103, 1023.4 105.5, 1017.2 104.3 M1024.6 96.9 C1025.2 104.6, 1021.9 107.1, 1017.9 106.1 M1015.7 107 C958 105.1, 897.8 107.2, 866.1 104.9 M1015.3 107 C968.7 104.1, 921.1 105.6, 866.3 106.4 M866 106 C859 106.8, 857.9 101.4, 855.4 96.7 M867.9 106.4 C861.3 105.6, 856.7 103.9, 854.7 97.1 M855.5 97.5 C855.3 76.1, 856.7 56, 854.2 40.9 M855.7 96.4 C856.3 74, 855.5 53.5, 855.1 39.1 M856 40 C856.5 32.1, 860.4 30.3, 865.1 31.8 M854.1 40.7 C857.2 33.1, 859.9 31.9, 865.2 28.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;941&quot; y=&quot;56.8&quot;&gt;change &amp;amp;&lt;/tspan&gt;&lt;tspan x=&quot;941&quot; y=&quot;79.3&quot;&gt;refactor&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M817.3 66.5 C828 69.2, 839.9 68, 848.5 67.5 M817.2 68.1 C830.8 69.3, 843.4 68.1, 850.7 67.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M836.9 60.9 C840.9 64.8, 845.7 66.2, 848.9 67.6 M836.8 62 C842.5 65, 847.6 66.6, 850.5 67.9 M850.5 68.1 C845 70.4, 842.2 73, 837.6 74.3 M849.4 68.1 C845.9 70, 843 71.7, 837.3 73.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M941.4 111.9 C934.5 122.5, 971.6 159.5, 900 175.1 C828.5 190.7, 641.5 205.5, 512.4 205.7 C383.2 205.8, 196.1 191.7, 125 175.9 C54 160.2, 92.8 122.1, 86 111.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;path d=&quot;M86.4 124.8 C84.9 120.1, 85.1 115.9, 84.9 113.1 M85.1 111.1 C86.6 112.8, 91.5 116.3, 96.4 119.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;513&quot; y=&quot;236.0&quot;&gt;next change&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;The legacy code change algorithm: find the change points, find where to test, break dependencies, write tests, then change and refactor.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Find the change points&lt;/strong&gt;, where your edit will land.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Find where you can test&lt;/strong&gt;, the places where the effects of that change can be seen.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Break dependencies&lt;/strong&gt;, just enough to get the code into a test. Do it carefully and mechanically, because there are no tests yet.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Write characterization tests.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Make the change and refactor&lt;/strong&gt;, with the tests running after every small step.&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Programming is the art of doing one thing at a time.&quot;&lt;/p&gt;
&lt;p&gt;— Michael Feathers, &lt;em&gt;Working Effectively with Legacy Code&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Characterization tests&lt;/strong&gt; are the clever part. You don&#x27;t test what the code &lt;em&gt;should&lt;/em&gt; do. You test what it &lt;em&gt;actually&lt;/em&gt; does today. Write an assertion you know is wrong, run it, read the real value from the failure message, and paste it in. Repeat for each input that matters. If the real behaviour surprises you, keep the test and flag it. Don&#x27;t silently &quot;fix&quot; it, because something might depend on it.&lt;/p&gt;
&lt;p&gt;How do you get code into a test at all? You need a &lt;strong&gt;seam&lt;/strong&gt;: in Feathers&#x27; words, &quot;a place where you can alter behavior in your program without editing in that place.&quot; A constructor parameter is a seam. An interface is a seam. A function you call directly with &lt;code&gt;new&lt;/code&gt; inside a method is &lt;em&gt;not&lt;/em&gt;. You can&#x27;t swap it without editing that line, so the first move is often to turn that hidden choice into a parameter while keeping the old call working.&lt;/p&gt;
&lt;p&gt;What if there is truly no time to get the old code under test? Feathers offers two escape hatches:
- &lt;strong&gt;Sprout&lt;/strong&gt;: write the new behaviour as a new, fully tested function or class, and add a single line to the old code that calls it.
- &lt;strong&gt;Wrap&lt;/strong&gt;: rename the old method and put a new one with the old name in front of it, which runs your new code and then the old.&lt;/p&gt;
&lt;p&gt;Both get new code in with tests. But that one line calling it isn&#x27;t tested, so review it by eye.&lt;/p&gt;
&lt;h2 id=&quot;why-not-rewrite-it-anyway&quot;&gt;Why not rewrite it anyway?&lt;a class=&quot;anchor&quot; href=&quot;#why-not-rewrite-it-anyway&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Because a rewrite stops the world, and there is a way to replace a system that doesn&#x27;t. What does a big redesign look like in practice? Martin Fowler named the pattern after a tree, the &lt;strong&gt;strangler fig&lt;/strong&gt;: a vine that grows around a host tree until it can stand on its own.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Remember, code is your house, and you have to live in it.&quot;&lt;/p&gt;
&lt;p&gt;— Michael Feathers, &lt;em&gt;Working Effectively with Legacy Code&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You build new pieces beside the old system, move behaviour across a piece at a time, and the old system shrinks. Fowler says the &quot;simple replacement&quot; plan, by contrast, goes &quot;down in flames most of the time&quot;.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -53 1022 356&quot; width=&quot;1022&quot; role=&quot;img&quot; aria-label=&quot;The strangler fig&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M13 1.4 C69.9 3, 132.5 -2, 192.4 -1.9 C199 -3.5, 199.6 1.6, 196.7 10.2 C201.4 51.5, 196.6 96.7, 202.8 162.4 C203 166.3, 197.8 167.6, 192.9 166.9 C125.2 169.6, 57.8 172.8, 9.7 171.8 C0.3 171, -2.5 165.6, -2.6 160.2 C3.9 120, 5.2 81.6, -1.6 7.6 C3 0.4, 6.5 3.1, 8.5 -1.9&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M11.6 2 C61.6 -0.8, 111.6 -2.2, 190.9 -0.6 M10.1 0.1 C45.4 -1, 83 -0.7, 191 -0.8 M190 0 C195.8 1.5, 198.6 5.2, 200.9 11.9 M189.4 -1.8 C194.7 -0.9, 197.9 4, 201.7 8.2 M200.9 12 C199.4 45.2, 196.5 83.1, 201.1 160.9 M200.9 10.8 C200.2 41.4, 199.1 72.7, 201 161 M200 160 C199.9 168.6, 197.1 169.2, 189.7 170.3 M200 161.9 C198.5 168.9, 197.2 169.8, 189 170.6 M188.3 169.7 C155.4 173.1, 118.9 170.4, 11.7 168.1 M190.7 169.5 C145.4 169.1, 99.7 170.4, 10.2 170.1 M10 170 C2.9 168.7, -1.4 165.4, -1 159.5 M10.2 171.6 C5.1 170.9, -2 166.8, 0.3 161.8 M-1.9 160.1 C0.4 125.5, 2.1 88.5, 1.1 8.5 M0.6 159.6 C0.7 120.2, 0.9 82.5, -0.2 9.5 M0 10 C-1.9 1.7, 1.4 -0.5, 9.3 0.4 M-0.7 9.2 C-0.3 2, 2.7 -1.6, 10.1 0.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;100&quot; y=&quot;85.0&quot;&gt;old system&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M216.4 86.6 C238.8 83.4, 257.7 83.1, 289.1 84.9 M214.9 84.4 C241.4 85.2, 268 83.5, 289.6 85.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M278.3 80.1 C282.4 79.8, 283.9 81.3, 289.4 85 M277.3 78.5 C281.7 81.6, 286.1 82.6, 289.7 85.6 M290.8 86.1 C285.6 87.1, 279.7 89, 277 90.9 M290.5 85.1 C286.2 87.2, 281.1 88.7, 277.1 91.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M307 1.5 C358.2 1.7, 409.4 0.5, 437.4 -2.9 C448.3 -1, 453.4 0, 447.8 12.4 C449.7 58, 450.3 108.1, 447.1 157.1 C452.9 166.9, 443.5 168.3, 437.8 168.2 C393.7 166.5, 353 170.7, 309.1 172.2 C302.8 173.1, 300.5 166.9, 301.2 159.7 C297.6 127.7, 295.4 97.3, 301 11.6 C301.2 2.3, 304.3 2.6, 310.1 2.8&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M310.1 1.5 C347.7 -0.1, 386.4 2.6, 440.8 -0.1 M309.8 0 C343.1 -0.1, 377.5 0.8, 439.9 -0.2 M440 0 C445.1 -1.5, 450.4 4.3, 448 10.2 M439.2 -0.8 C447.3 2, 448.7 5.6, 450.3 8.2 M448.9 9.3 C448.5 69.6, 447.2 124.9, 449.4 159.6 M450.3 9 C448.7 61.2, 449.8 111.6, 450.1 160.1 M450 160 C449.9 165.3, 446.2 169.7, 441.3 171.5 M451.2 160.8 C449.9 164.6, 448 168, 442.1 172 M438.3 168.4 C394.9 172.9, 350.6 170.4, 308.9 170.6 M439.3 170.5 C389 169.3, 336.7 168, 309.1 169.2 M310 170 C304.7 171.3, 298.7 166.6, 300.8 160.4 M309.4 170.9 C305.5 169.8, 299.2 164.9, 299.3 159 M300.2 159.1 C298.5 119, 299.8 79.6, 301.3 11.6 M300.4 159.9 C299.3 101.4, 298.3 44.2, 300.3 9.9 M300 10 C299.9 1.8, 302.3 2, 311.1 1 M301.7 11.5 C301 2.4, 302.7 -0.2, 308.2 -0.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;375&quot; y=&quot;72.5&quot;&gt;old&lt;/tspan&gt;&lt;tspan x=&quot;375&quot; y=&quot;97.5&quot;&gt;system&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M528.4 18 C544 22.3, 562.4 22.9, 600.1 23 C608.4 19, 610.4 25.6, 607.3 29.2 C610.8 38.9, 611.7 47.1, 609.7 63.4 C606.8 68.7, 608.7 67.8, 600.2 68.1 C574.9 73, 541.5 73.9, 529.5 68.9 C520.8 67.4, 520.7 66.7, 516.9 60.5 C522.6 48, 519.3 35.9, 518.5 27.3 C521.8 25.4, 522.4 23.3, 526.5 22.3&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M527.8 20 C556.8 19.4, 583.1 21.9, 603.2 18.3 M529.2 20.6 C557.7 21.3, 586.8 20, 601.2 19.1 M601.7 20 C606.3 21.8, 608.6 22.3, 608.7 30 M602.4 20.6 C606.3 21, 608.8 21.9, 609.6 27.3 M608.8 30.2 C610.8 40.5, 610.8 49, 610.2 60 M609.3 27.7 C609.8 40, 609.8 52.8, 610.3 61.6 M610 61.7 C610.3 65.5, 609.1 68.1, 603.6 71.2 M610.2 59.7 C610.8 68.5, 607.9 70.6, 600.1 70.5 M600.8 70.2 C574.4 68.9, 548.7 68.8, 530 69.2 M601.3 69.4 C582.2 70.4, 563.8 70.8, 528.6 70.6 M528.3 70 C524.7 69.2, 520.6 68.8, 520.2 62 M530.1 68.3 C525.1 69.8, 520 65.8, 519.2 60.5 M519.2 62.7 C519.5 51.9, 518.8 45.9, 519.5 29.1 M520 60.8 C519.6 51.4, 520.4 41.4, 520.9 27.9 M520 28.3 C521.2 23.7, 522.7 20.8, 526.8 21.2 M521.2 28.6 C521.2 21.1, 521.5 18, 527.3 18.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;565&quot; y=&quot;45.0&quot;&gt;new&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M527.6 97.4 C545.3 99.7, 563.9 100.7, 604.7 99.5 C609 98.3, 611.2 100.6, 611 107.9 C612.6 119.8, 610.9 134.9, 611.4 139.2 C607.6 145.9, 608 148.2, 602.2 151.4 C582.2 153.5, 561.2 148.3, 528.7 153.2 C524.2 151.4, 520.7 149.7, 518.9 138.9 C518.9 129, 520.7 117.4, 522.3 106.1 C521.8 101.8, 520.2 102.5, 531.2 102.1&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M527.4 100.1 C549.9 100.9, 574.2 101.2, 600.5 98.7 M528.1 99.5 C551.7 101.3, 574.2 100.3, 602.7 101 M601.7 100 C605.6 99.3, 609.5 100.9, 609.3 106.8 M602.2 101.4 C606.5 102, 609.6 101.1, 611.4 106.4 M611.5 109.5 C610.2 121.3, 610.9 134.1, 609.3 140 M609.9 108.9 C609.6 114.9, 610.4 122.9, 609.3 141.6 M610 141.7 C610.5 148.8, 605.4 148.6, 602.5 151.1 M608.6 140.9 C607.7 148.2, 606.2 151.5, 600.6 148.4 M599.7 150.7 C578.4 149.6, 558.2 151, 528.2 150.4 M601.9 150.8 C585 151.3, 566.4 150.4, 527.6 149.3 M528.3 150 C521.9 151.4, 519.1 148.9, 518.4 141.7 M527.6 149.3 C520.8 149.1, 522 149, 520.3 143.8 M520.8 143.7 C521.5 130.7, 518.7 123.8, 519.7 110.2 M519.7 141.6 C520 127.8, 519.5 115.7, 519.4 107.6 M520 108.3 C518.6 103.5, 523.4 101.7, 529.4 98.2 M518.1 109.8 C518.7 100.9, 523.3 101.5, 528.7 98&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;565&quot; y=&quot;125.0&quot;&gt;new&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M455.5 69.1 C471 63.6, 491.2 60.9, 514.8 56.3 M455.4 68.2 C467.9 65, 479.9 62.1, 513.8 55.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M500.3 53.2 C503.3 52.7, 509.4 54.3, 514.6 56.1 M500.2 52.5 C503.4 52.8, 506.3 53.3, 513.9 55.8 M514 56.1 C510.9 58.7, 507.2 61.4, 503 64.2 M513.8 55.1 C512.3 57.3, 509.6 60.1, 503.1 64.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M456.1 103.1 C471.3 106.2, 492 109, 512.2 113.1 M456.3 101.5 C472.1 104.8, 486.8 108.1, 514.8 114.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M503.2 106.5 C505.1 108.9, 510.9 110.9, 512.8 113.4 M503.3 105.4 C506.5 107.9, 508.9 110.2, 514.6 114.6 M515.1 114.5 C510.8 115.3, 505.1 115.1, 501.2 116.9 M514 113.8 C509 115.5, 505.3 117.2, 500.3 117.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;485&quot; y=&quot;-26.0&quot;&gt;behaviour moves&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M631.4 85.8 C646.1 86.5, 664.4 86.4, 690.9 84.1 M630.2 84.9 C653.4 85.7, 676.1 84.4, 690.7 84.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M678.4 79.5 C680.1 81.6, 684.3 83.3, 690.6 84.4 M677.5 78.8 C682.3 81.7, 686.7 83.1, 690.5 84.4 M690.5 84.9 C686 87.6, 678.8 90.2, 676.9 91.8 M690.2 84.8 C685.3 87.8, 679.7 89.9, 678 91.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M806 58.7 C825 57.9, 839.8 60.7, 878.7 59.1 C888.3 61.2, 888.2 59.4, 890.2 65.1 C886.6 79.7, 888 92, 892.2 103.5 C891.9 107.6, 886.2 111.8, 878.7 106.4 C851.7 108.9, 823.1 109.3, 805.4 112 C805.5 110.8, 799.7 105.3, 801.9 103.9 C803.5 88, 803.3 79.7, 801.4 69.1 C799.1 65, 800.5 59.8, 811 59.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M810.2 60.9 C825.8 60.3, 842.8 59.9, 881.1 60.7 M807.9 60 C823.9 59.9, 841 60.4, 881.7 60.5 M881.7 60 C885.5 60.2, 888.8 61.1, 891.6 67 M882.9 58.7 C885.5 61, 889.4 63.5, 889.6 67.2 M889.6 69 C891.4 76.7, 890.6 88.3, 889.5 102.8 M889.4 68.2 C889.7 78.6, 890.1 88.8, 890.5 102.3 M890 101.7 C888.5 107.8, 887.1 109.7, 881.1 111.5 M891.9 103.2 C888.8 108.5, 888.1 108.9, 883.8 112.2 M879.8 109.6 C853.3 109.8, 822.6 111.2, 806.4 111.2 M881.4 109.5 C859.6 111.1, 836.4 110.3, 809 110.9 M808.3 110 C802.1 108.2, 800.9 106.3, 798.5 103.2 M808.5 111.6 C804.7 112.3, 800.3 108.5, 800.4 102.9 M801.2 102.7 C800.9 96.1, 799.5 89.4, 798.9 67.8 M799.6 102.1 C800 94.5, 800.7 86.3, 800.6 68.6 M800 68.3 C798.2 63.2, 804.1 59.2, 807.5 61.7 M798.6 68.3 C798.1 60.7, 802.5 61.4, 810.2 58.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;845&quot; y=&quot;85.0&quot;&gt;old&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M709.8 1.5 C730.6 -0.3, 758.5 -2, 779.8 -1.2 C786.4 -0.2, 789.4 -0.8, 788.9 11.7 C792.1 21, 789.3 36.6, 791.2 43.2 C790.7 45.8, 787.4 50.5, 779.5 50 C752.8 52.8, 722.8 53.4, 707.4 48.1 C702 47.6, 702.6 47, 698.9 44.9 C700.8 33.9, 701.2 25.1, 700.6 8.6 C703.2 6.1, 700.9 -1.9, 710.4 0.2&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M708.4 -0.3 C734.6 1.4, 762.6 1.4, 782.5 0.9 M707.9 -0.9 C730.4 0.3, 751.6 0.7, 782 -0.3 M781.7 0 C788.9 0.3, 789.9 3.9, 789.8 7.6 M781.1 -0.1 C786.5 2.3, 787.7 1.4, 791.9 7.1 M791.8 7.6 C788.9 14.9, 787.9 23, 788.1 41.5 M789.9 8.8 C789.5 19.4, 789 31.4, 789.1 42.5 M790 41.7 C788.7 46.6, 785.9 50.4, 782.9 50.7 M788.1 40.9 C791.5 49.1, 787.8 51.4, 780.9 50.1 M779.7 48.8 C764.2 49.9, 750.3 52.6, 707.2 49.6 M782.6 50.5 C752.4 49.6, 723.1 49.4, 709.3 50.6 M708.3 50 C704.8 48.5, 699.6 47.1, 698.6 41.5 M708.5 50.3 C701 51, 701.7 46.4, 699.3 43.4 M699 40.1 C698.7 32.9, 699.6 28.7, 700.5 6.6 M699.4 40.7 C701.1 35.5, 701 28.4, 699.6 8.1 M700 8.3 C699.5 0.8, 702.2 -1.6, 707.2 1.9 M700.1 8.2 C697.9 2.2, 702 1.7, 706.5 1.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;745&quot; y=&quot;25.0&quot;&gt;new&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M808.1 0.3 C823.7 -1, 841.5 2.3, 881.6 -2.3 C888.8 3.2, 891.5 5.4, 893.4 10.6 C888.9 19.8, 887.5 30.9, 890.1 43.3 C888.2 50.6, 885.7 49.3, 882.7 47.2 C869 47.3, 852.1 50.6, 811 50.6 C804.5 47.2, 801.2 47.2, 803 44.3 C800.3 31.3, 796.3 16.8, 799.3 9.3 C797.4 -0.2, 804.5 -3.6, 805 -3.6&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M807.2 1.5 C833.7 0.2, 855.6 -0.6, 883.2 1 M808.6 0.5 C825.2 -1.3, 840 -1.5, 881.1 0 M881.7 0 C887 1, 889.3 3.5, 888.7 10.1 M880.3 -0.6 C889.3 0.4, 891.5 4.6, 888.8 9.4 M888.6 7 C890.6 17.5, 891.1 28.3, 891.5 42.6 M889.9 8.8 C889.5 16.9, 889 27.7, 889.6 40.9 M890 41.7 C888.8 48.9, 886.9 50.6, 880.4 49.6 M889.7 43.2 C889.6 45.6, 888.3 49.7, 881.6 50.6 M881.8 49.9 C855.9 50.8, 834.2 50.2, 809.1 48.5 M880.7 50 C860.8 50.9, 837.4 49.8, 807.8 50.2 M808.3 50 C801.4 49.1, 800.6 46.4, 799.3 39.9 M810 51.8 C804.5 50.7, 800.5 45.7, 798.5 40.1 M798.5 41.8 C798.5 32.3, 798.6 25.3, 800.8 8 M801 42 C799.9 31.7, 799.4 23.4, 799.5 8.6 M800 8.3 C798.3 3.5, 800.9 -1.2, 808.2 1.3 M798.1 8.7 C799.2 1.6, 803.5 2.2, 808 0.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;845&quot; y=&quot;25.0&quot;&gt;new&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M906.3 -0.8 C931.5 -4.4, 953.8 -3.1, 983.3 -3.5 C983.9 -0.7, 986.4 4.5, 990.7 9.5 C986.9 18.6, 986.9 32.4, 989 43.5 C993 48.2, 983.9 48.1, 978.8 51.5 C963.3 51.6, 952.2 50.6, 907.5 53.2 C899.9 46.8, 899.9 47.5, 899.9 43.7 C900.9 35.4, 899.9 21.8, 897.9 9.9 C898.8 0.7, 900.8 1.9, 906.8 -0.2&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M910 -0.8 C928.8 -1.1, 948.5 1.4, 979.9 1 M909.3 -0.1 C932.7 0.5, 957.8 -0.3, 982.3 0.3 M981.7 0 C989.1 1.6, 988.8 3.1, 991.7 8.6 M983.5 -1.1 C987.6 -1.6, 990.7 3.2, 990.3 7.2 M989.3 6.4 C988.4 20.2, 990.3 33.6, 990.9 39.7 M990 8.9 C989.6 21, 991.1 35.4, 990.1 41.3 M990 41.7 C989 47.3, 987.8 50.9, 982 48.6 M991.3 41.4 C987.8 46.7, 988.8 48.1, 982.2 51 M979.8 51 C966.2 50.2, 947.5 50.4, 907 51.4 M980.9 49.5 C952.5 50.7, 924.4 50.8, 908.3 49.7 M908.3 50 C902 49.6, 901.6 45.8, 900.1 42.2 M907.5 49.3 C903.3 50.3, 899.4 45.1, 897.8 41.5 M902 43.4 C898.3 31.7, 901.6 21.9, 901.1 9.5 M900.6 41.3 C900.8 30, 899.8 18.4, 899.4 9.1 M900 8.3 C901.1 2.2, 903.6 -0.7, 909.1 0.7 M900.2 9.2 C900.5 1, 905 -1.9, 909.5 -0.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;945&quot; y=&quot;25.0&quot;&gt;new&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M711.8 118 C724.7 122.1, 744 121.3, 785.1 122.6 C786.3 122.7, 788.5 123.5, 788.1 128.4 C792.1 137.4, 786.3 146.7, 787.9 163.6 C790.6 165.8, 789.3 166.9, 782 168.7 C764.9 168.8, 745 170.5, 711.2 168.5 C702.4 166.4, 698.5 167.7, 696.8 163.1 C700.4 152.8, 702.2 140.7, 696.6 130.6 C700.2 121.6, 704.3 120.2, 708.6 123.3&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M708.8 121 C723.9 119.1, 741.5 120.8, 780.5 121.1 M708.1 119.2 C727.5 120.4, 746.3 120.9, 781.5 120.5 M781.7 120 C787.3 118.3, 788.3 122.7, 790.6 127.1 M782.7 118.5 C785.8 121.1, 789.8 121.8, 791.8 129.6 M790.1 129.8 C789.4 136.2, 788.7 141.6, 790.3 160.8 M790 129 C788.9 138.4, 790.5 149.7, 790.7 161.8 M790 161.7 C789.2 165.6, 788.8 171.1, 783.5 171.5 M788.8 159.7 C790.5 167.8, 789.3 171, 782.9 171.4 M781.8 168.1 C757.9 171.1, 731.5 168, 708.9 170.2 M781.1 169.1 C760.9 170.5, 738.7 169.7, 708.8 169.3 M708.3 170 C702.6 170.2, 698.7 169.1, 700.9 160.5 M709 170.8 C702.2 170, 698.2 169, 701.6 162.9 M701.5 161.1 C702.1 151.2, 700.6 138.5, 701.4 126.9 M700.2 160.7 C699.7 154.9, 700.1 146.7, 699.3 127.6 M700 128.3 C699.9 120.8, 702.3 119.7, 710.1 120.1 M698.2 129.7 C701.8 125, 702 118.6, 706.4 117.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;745&quot; y=&quot;145.0&quot;&gt;new&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M810.1 116.9 C832.5 121.3, 856.3 118.5, 879.6 121.4 C888.6 118.9, 890.6 122.5, 892.6 127.3 C890.1 136.2, 893 148.2, 886.8 163.8 C888.1 170.6, 887.5 172.9, 878.1 173 C866.4 170.5, 845.1 167.7, 807.7 171.1 C805 173.2, 797.2 167.9, 800.9 162.6 C799.8 156.9, 797.3 145.7, 802.5 131.2 C801.6 122.5, 800.7 118.4, 810.4 119.5&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M807.6 118.8 C837.6 121.8, 863.8 118.8, 881.2 121.2 M808.8 120.6 C837 120.2, 864.1 120.2, 882.6 120.8 M881.7 120 C885.4 118.9, 891.8 122.3, 889.6 129.6 M882 122 C888.6 119.1, 889 125, 888.7 127.3 M890.8 129.1 C891.2 138.9, 891.9 147, 889.8 162 M890 129.1 C891 135.9, 890.5 144, 889.2 162.2 M890 161.7 C889.3 168, 885.7 171.4, 881 170.4 M890.4 161.9 C888.6 168.9, 885.2 169.4, 883.5 171.9 M879.9 169.1 C864.3 168, 844.8 169.7, 806.8 169.1 M881.3 170.6 C852.6 170.3, 823.6 168.7, 807.3 170.8 M808.3 170 C803.2 170.8, 799.7 168.5, 801.6 162.8 M806.4 168.3 C801 169.6, 801.7 168.3, 800.8 159.7 M801 162.8 C801.9 153.3, 799.7 148.5, 801.7 128.4 M799.8 162 C800.6 151.1, 800.5 141.7, 799.2 128.1 M800 128.3 C798.6 123.5, 801 120.1, 807 119.5 M800.3 130.2 C798.5 124.5, 803.5 119.1, 807.9 121.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;845&quot; y=&quot;145.0&quot;&gt;new&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M908.3 122.9 C925.7 120.6, 946.5 122.8, 981.4 120.3 C983.8 122.3, 992.7 121.5, 989.9 126.2 C988.1 135, 992.4 142.6, 992.9 163.9 C992.9 168.2, 985.8 171.7, 981.3 170.2 C960.8 167.6, 945.1 167.7, 911.3 166.4 C900.4 172.8, 903 168.2, 897.8 162 C899.2 147.1, 899.7 137.4, 901.1 131.9 C903 123.4, 904.2 116.7, 905 122.9&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M906.4 120.6 C932.7 120.6, 956.7 120.7, 981.9 121.3 M907.5 120 C929.8 120.1, 952.6 121.4, 981.8 119.1 M981.7 120 C987.6 119.6, 991.3 121.9, 988.5 128 M981.2 121.5 C986.9 121.8, 988.2 123.6, 990.1 129.7 M991.6 128.5 C988.9 137.6, 991.1 152.3, 989.2 163.1 M990 129.1 C990.4 140, 989.9 151.6, 989.7 162.6 M990 161.7 C989.5 166.3, 986.7 171.6, 982.5 169.4 M992 160.2 C991.4 165.4, 985.7 167.7, 979.5 167.7 M981.9 170.2 C956 168.9, 928.8 171.3, 908.6 172 M981.4 170.1 C961.1 169.6, 939.9 171.1, 907.9 170.4 M908.3 170 C903.8 171.3, 900.7 167.8, 898.4 161.2 M907.9 169.9 C904.5 169.3, 900.5 167.7, 900.1 161.1 M900.5 160.4 C901.8 152.7, 898.7 145.1, 902 129.8 M899.4 161.3 C900.1 149.3, 899.5 136.7, 899.1 128.6 M900 128.3 C901.4 122.2, 903.7 120.6, 908 118.9 M898.3 126.7 C899.8 123.9, 905 119.6, 909.4 119.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;945&quot; y=&quot;145.0&quot;&gt;new&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M0.7 234.7 C284.3 234.3, 567.8 233.3, 989.8 235.2 M0.2 234.7 C238.4 232.1, 476.8 232, 989.9 235&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M978.6 228.3 C982.1 230.9, 985.1 231, 989.7 235.4 M977.7 228.4 C980.2 230.9, 982.9 232.2, 989.9 234.9 M989.8 234 C985.2 237.7, 981.5 238.8, 977.5 241.5 M990.7 234.4 C986.4 236.6, 984.6 238.2, 977.4 241.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M13.8 240.5 C10 239.6, 5.9 236.3, -0.3 235.4 M13 240.6 C9.3 240.3, 6 238.7, -0.1 234.9 M-0.2 234 C3 234, 7.1 231.3, 12.7 229.3 M0.7 234.4 C2.4 233.5, 6.7 232.1, 12.6 229&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;495&quot; y=&quot;275.0&quot;&gt;keeps running the whole time&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;The strangler fig: new code grows beside the old system and takes over its behaviour piece by piece, while the system keeps running.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The codebases I studied all do some version of this:
- Tailscale&#x27;s contributor docs say new functionality belongs in a separate feature package, and admit openly that the codebase is &quot;half-migrated&quot;.
- excalidraw is gradually moving logic out of its 12,032-line &lt;code&gt;App.tsx&lt;/code&gt; into separate per-capability files.
- ripgrep labels one of its own test files as grouped &quot;in a haphazard manner. Try not to add more.&quot;&lt;/p&gt;
&lt;p&gt;Did any of them stop to rewrite? None. They put a fence around the mess and pointed all new work away from it.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Code Complete&lt;/em&gt; states the rule underneath all of it, the &lt;strong&gt;Cardinal Rule of Software Evolution&lt;/strong&gt;: every change should improve the program&#x27;s internal quality. Ousterhout puts it more bluntly: &quot;If you&#x27;re not making the design better, you are probably making it worse.&quot;&lt;/p&gt;
&lt;h2 id=&quot;one-floor-down&quot;&gt;One floor down&lt;a class=&quot;anchor&quot; href=&quot;#one-floor-down&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You can design well, test honestly, and improve old code safely, and the system can still go down at 5 a.m. Not because of a bug in the logic, but because a firewall quietly dropped an idle connection, or a marketing email sent everyone to the same page at once.&lt;/p&gt;
&lt;p&gt;That&#x27;s the last floor: code that doesn&#x27;t just work, but survives the real world.&lt;/p&gt;
&lt;div class=&quot;footnote&quot;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&quot;fn:1&quot;&gt;
&lt;p&gt;Spolsky&#x27;s essay is an argument from one famous failure, not a measurement across many rewrites. Treat &quot;never rewrite&quot; as his opinion, a well-argued one, and not a law.&amp;#160;&lt;a class=&quot;footnote-backref&quot; href=&quot;#fnref:1&quot; title=&quot;Jump back to footnote 1 in the text&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn:2&quot;&gt;
&lt;p&gt;I know Henry and Kafura&#x27;s 1984 study only through McConnell&#x27;s summary, so how strong the result is rests on his reading.&amp;#160;&lt;a class=&quot;footnote-backref&quot; href=&quot;#fnref:2&quot; title=&quot;Jump back to footnote 2 in the text&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn:3&quot;&gt;
&lt;p&gt;The fourteen flags are Ousterhout&#x27;s. The three groups are mine, and the diagram uses them.&amp;#160;&lt;a class=&quot;footnote-backref&quot; href=&quot;#fnref:3&quot; title=&quot;Jump back to footnote 3 in the text&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Surviving Production</title><link>https://your-moon.github.io/craft-4-production/</link><guid>https://your-moon.github.io/craft-4-production/</guid><pubDate>Thu, 08 Oct 2026 00:00:00 +0000</pubDate><description>&lt;h1 id=&quot;surviving-production&quot;&gt;Surviving Production&lt;a class=&quot;anchor&quot; href=&quot;#surviving-production&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Craft · Part 4 of 4: Code that survives the real world&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;An airline&#x27;s check-in kiosks and phone check-in stopped working at 11:30 p.m. They stayed down until 2:30 a.m., three hours with no way to check in.&lt;/p&gt;
&lt;p&gt;The airline wasn&#x27;t careless. The system had redundant servers and failover, everything you&#x27;re supposed to have. The cause, which Michael Nygard tells in &lt;em&gt;Release It!&lt;/em&gt;, was one ordinary line of Java. Code that returned a database connection to its pool called &lt;code&gt;close()&lt;/code&gt; on a statement, and that &lt;code&gt;close()&lt;/code&gt; threw an exception nobody expected. The exception skipped the line that would have returned the connection, so each time it happened, one more connection leaked. Eventually the pool was empty, and every request that needed the database waited for a connection that would never come.&lt;/p&gt;
&lt;p&gt;Why didn&#x27;t anyone see it? Because the monitoring said everything was fine. The status page the health check hit didn&#x27;t need the database, so it kept answering while every real request hung.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-36 -10 732 286&quot; width=&quot;732&quot; role=&quot;img&quot; aria-label=&quot;Monitoring says OK, nothing works&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M7.3 22.9 C62.9 22.7, 108.1 21.8, 153.5 16.6 C155.6 18.5, 162.6 23.8, 157.9 29.2 C163.1 72.4, 157.8 117.9, 157.4 249.8 C163 254.9, 153.4 256.7, 150.8 260 C118.4 262.1, 93.5 259.7, 7.1 263.4 C3.3 262.2, 1.5 255.6, -3 253.2 C6.4 171.6, 2.1 90.8, -2.7 26.9 C-0.3 26.6, 0 23.1, 13.3 20.1&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M10 21.7 C37.2 19.7, 68.7 22.5, 151.3 18.9 M10.6 19.9 C53.3 19.8, 97.1 19, 149.1 19.4 M150 20 C157.2 19.7, 159.9 22, 158.4 30.8 M149.8 21.9 C158.4 21.7, 159.1 23, 160 31.8 M161.4 30 C160.8 82.8, 162.3 134.5, 159.3 249.3 M160.4 30.8 C160.4 75.8, 160.3 121.7, 159.3 249.4 M160 250 C161.1 257.8, 157.6 261.2, 148.1 261.8 M160 248 C161.3 255, 158.1 260.6, 148.9 258 M151.8 260.5 C119.9 259.7, 89 260.9, 8.4 259.6 M149.7 259 C103.8 261, 56.9 262.1, 9.1 260.9 M10 260 C4 259.7, 1.2 257.4, 1.7 251.1 M10.1 261.1 C2.6 260.9, 2 257.5, -2.3 248.8 M1 251.5 C1.5 176, 1.9 105.6, -0.2 29.6 M-0.8 249.5 C-2.2 194.7, -0.7 137.7, -0.7 29.7 M0 30 C-1.4 24.7, 1.8 21.9, 10.6 20 M-1.6 30.5 C1 24.4, 3.2 19.7, 11.7 19.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M25.4 33 C56.7 41.2, 91.5 35.1, 139.4 39.3 C144.7 32.9, 149 36.4, 143.1 46.6 C147.4 61.9, 147.4 75.3, 142.7 126.1 C144.7 129.7, 143.2 138.2, 137.1 138.1 C111.6 138.5, 85.5 133.1, 23.7 133.5 C20.6 133.9, 11.6 133.8, 14 122.5 C13.5 91.7, 15.8 66.5, 16 46.6 C11.9 37.5, 15 38.2, 21.5 39.3&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M22.3 36.1 C62.6 37.6, 99.9 35.8, 135.6 36.8 M23.1 35.1 C46.9 36, 71.6 34.8, 136.9 36.3 M136 36 C144.5 37.3, 144.9 40.1, 147.9 47.2 M136.9 35.6 C143.6 34, 148.1 39.8, 145.5 45.9 M144.1 47.4 C148.4 75.6, 147 102.4, 146.7 126.1 M146 46.9 C146.6 76, 146.5 106, 145.7 125.2 M146 126 C144.4 132.1, 142.5 136.6, 135.5 137.5 M147.1 127.1 C146.5 134.9, 142.4 134.7, 137.5 134.7 M134.8 136.4 C96.3 135.5, 59 137.9, 24.7 135.8 M136.2 135 C104.7 136.3, 75.6 136.2, 23.5 136 M24 136 C17.6 134.6, 15.4 131.7, 13.9 124.3 M24.3 137.2 C18.2 135.8, 13.2 134.9, 12.3 125.9 M14.2 126.1 C13.6 97.8, 15.6 68.7, 14.3 44.4 M13.1 125.5 C14.2 108.9, 12.8 92, 14.6 45.9 M14 46 C13.7 39.2, 16.9 34.5, 24.8 34.1 M14.1 47.9 C12.7 40.8, 16.5 33.9, 23.8 35.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;80&quot; y=&quot;75.4&quot;&gt;check-in&lt;/tspan&gt;&lt;tspan x=&quot;80&quot; y=&quot;96.6&quot;&gt;unavailable&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M42 160.7 C57.7 160.3, 76.1 158.6, 119.6 159.2 C118.9 157.7, 119.6 160.9, 122.7 162.2 C120.6 166.1, 120.1 170.1, 118.4 171.2 C121.6 173, 120.8 174.1, 114.7 172.6 C101.5 173.4, 77.4 174.1, 39.4 172.7 C38.3 172.8, 40.2 170.6, 39.7 171.3 C39.7 170.9, 40.9 166.1, 40.9 162.6 C43.2 161.2, 40 158.5, 41.9 161.3&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M43.5 161.5 C56.5 159, 71.7 158.4, 117.8 159.2 M42.7 160.3 C60.9 159.7, 78.9 159.6, 116.8 160.1 M117.7 160 C120 158.9, 119.4 159.6, 120.1 161.9 M117.7 160.9 C118.8 158, 117.9 159, 118 162.1 M119.5 162.8 C119.9 164.9, 120.8 168.1, 119.8 172.5 M120.2 162.7 C119.9 165.2, 120 167.7, 120.2 171.8 M120 171.7 C118.2 175.1, 118.8 174.3, 118.8 174 M120.4 170.9 C121.6 175.4, 119 172.5, 116.1 174.3 M116.1 175.7 C95.6 173.6, 75.3 173.6, 40.5 173.4 M116.7 174.3 C95.7 173, 74.6 174.3, 43.3 174.2 M42.3 174 C39.9 172.4, 39.6 173.4, 39.1 171.8 M43.7 175.1 C41.4 171.9, 39.7 171.8, 39.1 170.8 M40.2 171.9 C39.2 168.1, 39.3 165.2, 40.5 162.2 M39.7 172.1 C40.4 169.5, 39.8 166.7, 39.6 162.6 M40 162.3 C38 161.5, 40.8 162, 41.9 159.6 M38.6 162.7 C42.1 159.5, 41.9 161.9, 42.1 159.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M43.9 189.6 C63.6 189.4, 81.7 187.2, 110.8 190.4 C114.2 190.9, 121.7 188.6, 117.9 193.3 C120.5 205, 118.5 212.3, 119.9 222 C120.9 228.4, 114.6 228.2, 112 231.5 C96.8 230, 75.7 228.7, 43.7 230 C42.2 230.7, 43.1 224.4, 41 224.8 C36.5 210.7, 42.9 204.5, 37.4 195.6 C41.3 194.8, 42.7 193.4, 44.4 188.4&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M48.4 191.3 C59.1 191.5, 73.2 189.2, 114.9 191.4 M45.9 189.5 C66 189.6, 87.1 189.8, 113.5 190.5 M113.3 190 C118.7 190.6, 119.2 191.1, 119 197.6 M113.5 188.4 C116.2 190.8, 119.7 192, 121.6 197.7 M119.6 198 C119.5 203.9, 121.8 211.6, 121.7 224.5 M120.5 196.3 C119.8 202.2, 121.1 206.7, 120.2 224.3 M120 223.3 C118.8 228, 116.7 231.8, 113.9 231.1 M120.7 223.2 C119.5 229.5, 119 229.8, 113.9 229.2 M112.2 228.3 C99.8 229.7, 85.3 229, 44.8 231.3 M113 229.9 C89.2 229.9, 66.6 230.1, 46.6 229.8 M46.7 230 C40.6 229.8, 38.8 229.7, 41.8 224.9 M48.7 229.1 C41.2 228.7, 38.5 229.8, 42.1 224.9 M40.1 225.2 C41 213.8, 38.8 204.1, 39.6 198.6 M39.4 224 C40.9 214.9, 40.3 207.3, 39 195.8 M40 196.7 C41.7 192.6, 43 192, 47.7 191.4 M38.6 196.9 C38.1 194.4, 41.6 188.4, 47.8 189.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-20.7 260.5 C124 258.3, 268.9 258.3, 679.6 259.8 M-20 260.3 C232.1 258.9, 484.3 259.1, 679.7 260.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M249.8 103.7 C254.1 103.1, 259.9 105.2, 263.5 108.1 C267.1 111, 270.3 116.5, 271.2 121.2 C272.1 126, 271 132.4, 268.9 136.6 C266.8 140.9, 263.1 144.9, 258.7 146.9 C254.4 148.9, 247.5 150.2, 243.1 148.7 C238.6 147.2, 234.3 142.1, 231.9 137.8 C229.6 133.5, 228.2 127.8, 228.8 122.9 C229.5 117.9, 232 111.4, 236 108.2 C239.9 105, 249.4 104.6, 252.3 103.7 C255.1 102.9, 253.3 102.6, 253.2 103 M242.8 105.4 C246.5 103, 251.3 101.2, 255.3 102.6 C259.3 103.9, 264 109.5, 266.7 113.5 C269.4 117.6, 271.7 122.1, 271.5 127.1 C271.4 132.1, 269.1 139.8, 265.6 143.3 C262.2 146.8, 255.8 147.7, 251 148.1 C246.3 148.5, 240.6 148.5, 237.1 145.8 C233.6 143.1, 230.8 136.9, 229.9 131.9 C229 126.9, 229.4 120.5, 231.6 115.9 C233.7 111.3, 241 106.2, 242.8 104.4 C244.6 102.6, 242.6 104.9, 242.5 105.2&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M255.8 103.7 C260.1 104.7, 265.1 109.8, 267.5 114 C269.9 118.1, 270.4 123.9, 270.1 128.4 C269.7 133, 268.5 137.9, 265.4 141.4 C262.3 144.9, 256.1 148.9, 251.5 149.5 C246.9 150, 241.3 147.5, 237.9 144.6 C234.4 141.6, 231.9 136.5, 230.7 131.8 C229.4 127.1, 228.5 120.8, 230.2 116.4 C232 112.1, 236.7 107.9, 241.2 105.8 C245.7 103.7, 254.3 103.8, 257.1 103.8 C259.9 103.9, 257.9 105.4, 257.9 105.8 M244.5 102.6 C248.6 101, 256.5 102.3, 260.4 104.9 C264.3 107.4, 266.6 113.4, 268 117.9 C269.4 122.4, 269.7 127.2, 268.7 131.9 C267.8 136.6, 266.3 143.6, 262.5 146.2 C258.7 148.7, 250.6 148.1, 246 147.3 C241.3 146.4, 237.2 144.3, 234.4 141 C231.7 137.7, 229.5 132.5, 229.5 127.5 C229.5 122.5, 231.3 115, 234.2 111.3 C237 107.5, 244.5 106.3, 246.5 105.2 C248.5 104, 246.3 104.2, 246.1 104.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M241.5 117.7 C242.3 117.8, 244.3 118.4, 244.9 118.9 C245.5 119.4, 245 120.2, 245 120.7 C244.9 121.3, 245 121.7, 244.6 122.2 C244.1 122.8, 243 123.7, 242.2 123.9 C241.4 124.1, 240.5 123.9, 240.1 123.5 C239.6 123.1, 239.4 122, 239.3 121.3 C239.2 120.6, 239.4 119.9, 239.6 119.4 C239.8 118.9, 239.8 119, 240.5 118.5 C241.1 118, 243 116.8, 243.6 116.6 C244.1 116.3, 244 117, 243.7 117 M243.3 116 C244.1 116.4, 245.1 119.1, 245.6 119.6 C246 120.2, 246.5 118.8, 246.2 119.2 C245.9 119.7, 244.5 121.8, 243.8 122.3 C243.2 122.8, 242.9 122.2, 242.3 122.3 C241.6 122.4, 240.3 123.4, 240 123 C239.7 122.7, 240.6 120.8, 240.4 120.2 C240.2 119.5, 238.6 119.8, 238.7 119.2 C238.8 118.5, 240.3 116.8, 240.8 116.2 C241.4 115.6, 241.2 115.7, 241.8 115.8 C242.3 115.8, 244.1 116.2, 244 116.6&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M243.1 117 C243.9 117.1, 244.9 117.6, 245.2 118.2 C245.4 118.7, 245 119.7, 244.7 120.3 C244.4 120.9, 243.8 121.7, 243.2 122 C242.7 122.3, 241.8 122.3, 241.4 122.3 C241 122.3, 241.2 122.5, 240.7 122.2 C240.3 121.8, 239.1 120.6, 238.8 120 C238.5 119.4, 238.4 118.9, 238.9 118.6 C239.3 118.2, 240.5 118.3, 241.3 118 C242.1 117.6, 243.4 116.4, 243.6 116.4 C243.9 116.3, 242.8 117.5, 242.6 117.6 M242.4 116.9 C243.2 116.9, 244.7 116.6, 245 117.3 C245.3 118, 244.5 120.3, 244.2 120.8 C244 121.4, 243.6 120, 243.5 120.4 C243.3 120.9, 243.9 123.2, 243.4 123.6 C243 124.1, 241.6 123.6, 240.8 123 C240.1 122.4, 239.1 120.6, 238.8 119.9 C238.5 119.1, 238.8 118.5, 239.2 118.2 C239.6 118, 240.5 118.2, 241.1 118.1 C241.7 118, 242.6 117.7, 242.6 117.7 C242.5 117.7, 241.1 118, 240.9 118&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M258.6 117.9 C258.9 118, 259.1 117.8, 259.4 118.2 C259.7 118.6, 260.4 119.7, 260.5 120.2 C260.6 120.7, 260.5 120.6, 260.1 121.1 C259.8 121.6, 259.1 122.9, 258.4 123.2 C257.6 123.5, 255.9 123.3, 255.4 123 C254.9 122.6, 255.5 121.8, 255.4 121.2 C255.2 120.5, 254.2 119.6, 254.5 119.1 C254.8 118.6, 256.1 118.4, 257 118.1 C257.9 117.9, 259.6 117.8, 259.9 117.8 C260.3 117.8, 259 118, 258.9 118 M257.6 117.6 C258.1 117.8, 259.1 118.3, 259.7 118.7 C260.3 119, 261.3 119.1, 261.3 119.8 C261.3 120.5, 260.2 122.2, 259.7 122.8 C259.2 123.5, 258.7 123.6, 258.2 123.4 C257.8 123.3, 257.3 121.9, 256.8 121.7 C256.4 121.5, 255.6 122.5, 255.5 122.3 C255.4 122, 256.4 120.8, 256.4 120.2 C256.4 119.6, 255.4 119.1, 255.6 118.8 C255.8 118.4, 256.8 118.4, 257.5 118 C258.1 117.6, 259.4 116.5, 259.5 116.3&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M259.4 117.2 C260 117.1, 259.5 116.8, 259.8 117.2 C260.2 117.7, 261.3 119.2, 261.3 120.1 C261.3 121, 260.1 122.3, 259.7 122.7 C259.2 123.2, 259.1 123, 258.7 122.8 C258.3 122.6, 257.6 122.1, 257 121.8 C256.5 121.5, 255.7 121.7, 255.4 121 C255.1 120.4, 255.1 118.6, 255.2 118.1 C255.2 117.6, 255.3 118.5, 255.9 118.2 C256.5 117.9, 258.1 116.5, 258.6 116.4 C259.1 116.4, 258.9 117.6, 259 117.9 M260.3 118.2 C261.2 118.6, 261.7 118.2, 261.9 118.3 C262 118.5, 261.4 118.8, 261 119.2 C260.6 119.6, 259.8 120, 259.3 120.7 C258.8 121.5, 258.4 123.5, 258.1 123.5 C257.8 123.6, 258.1 121.5, 257.5 121.1 C256.8 120.7, 254.5 121.4, 254.1 121 C253.7 120.7, 254.4 119.8, 255 119 C255.7 118.2, 257.2 116.5, 257.8 116.2 C258.4 115.9, 258.6 117.2, 258.7 117.1 C258.9 117.1, 258.5 116.3, 258.7 116.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M242 138 C246.5 134.6, 253.4 133.1, 256.1 139.2 M241.2 136.2 C247.5 131.9, 252.5 133.8, 258.6 138.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M251.2 148.6 C249.1 163, 248.7 176.2, 251.9 212.3 M250.6 148.7 C249.1 164.8, 250.6 182.8, 250.2 214.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M251.8 215.9 C244.2 232, 236.4 250.1, 230.9 261.6 M250.4 213.4 C246.3 224.6, 240.6 235.6, 229.4 259.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M248.4 215.8 C255.5 230.3, 263.7 250.7, 268.3 259.7 M249.3 214.6 C255.1 227.7, 260.8 239.9, 270.5 259.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M248.9 167.6 C239.8 178.1, 232.3 190.5, 227.7 197.9 M250.2 165.8 C242.3 177.3, 233.6 187.1, 227.5 196.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M249.5 167.5 C256.7 176.2, 266.8 190.9, 273.1 196.1 M249.1 165 C255.3 173.1, 259.9 179.1, 272.5 196.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M300 208.7 C299.3 204.4, 300.3 201.2, 299.2 197.1 M300 208.1 C299.7 204.9, 300.2 202.1, 299.7 198.4 M299.9 198.1 C305.1 198.1, 310.2 197.8, 321.6 198.6 M300.6 197.3 C306.7 198.6, 312.9 198.8, 320.5 198.9 M319.4 197.2 C319.5 201.5, 320.3 205.3, 319.5 207.2 M319.7 197.6 C319.5 202, 319.9 205.2, 319.7 207.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M294.8 207.9 C308.7 210.3, 323.6 206.5, 338.1 209.2 C350 207.6, 349.9 211.8, 349.2 219.6 C353.9 223.4, 348.9 237.1, 347.8 251.1 C348.3 257.2, 347.5 257.2, 341.7 258.5 C332.4 257.6, 315.1 258.5, 293.3 263 C287.9 260, 287.6 260.3, 283.6 249.6 C284.1 238.4, 284.5 221.8, 283.4 219.3 C286.7 210.8, 292.2 206, 295.1 207.3&quot; style=&quot;fill:var(--xd-orange)&quot;/&gt;&lt;path d=&quot;M295.3 209.3 C311.2 206.5, 331.9 206.3, 341.2 208.4 M295.6 207.4 C310.2 207.6, 326 208, 341.8 207.2 M341.3 208 C348.3 209.6, 349.9 210.8, 348.1 216.1 M341.7 209.2 C346.7 206.2, 348.2 209, 348.9 215.2 M348.1 214.8 C351.3 230.1, 351.6 241.7, 350.9 250.7 M350 215.9 C350.2 228.7, 350.3 241.9, 350.9 251.8 M350 251.3 C348.8 256.6, 346.5 260.7, 339.6 259.5 M349.1 251.1 C350.1 257.8, 346.6 262.1, 343 261.6 M340.1 261.5 C324 259.4, 311.4 259.5, 294.9 259.3 M342.2 260.8 C326.5 260.2, 312.5 260.4, 294.3 259.5 M294.7 260 C289.9 259.7, 284.3 257.8, 287 252.9 M296.3 258.1 C287.9 258.6, 285.3 255.7, 285.1 250.3 M284 250.3 C285.8 238.7, 286 228.5, 285.8 217.2 M286.8 250.5 C285.3 240.6, 286.4 231.2, 285.2 217.3 M286 216.7 C285.4 209.5, 287.2 209.1, 296.6 207.2 M284.2 217 C287.4 211.5, 289.6 210.1, 295.3 209&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M229.4 6.4 C234.2 5.4, 242.5 7, 247.2 9.6 C252 12.1, 256.2 16.7, 257.9 21.6 C259.6 26.5, 259.5 34.2, 257.5 39 C255.4 43.8, 250.1 47.8, 245.4 50.3 C240.8 52.8, 234.7 55.1, 229.5 54 C224.2 52.9, 217.4 47.8, 214 43.7 C210.5 39.6, 208.6 34.3, 208.9 29.4 C209.3 24.5, 211.6 17.9, 216.1 14.2 C220.7 10.5, 231.7 8.1, 236.1 7.2 C240.5 6.2, 242.7 8.1, 242.5 8.3 M238.9 6.1 C244.1 6.6, 251.2 10.2, 254.6 14.3 C257.9 18.3, 259.1 24.8, 258.8 30.1 C258.5 35.5, 256.2 42.9, 252.8 46.6 C249.4 50.2, 244.1 51.5, 238.6 52.1 C233 52.6, 223.9 52.3, 219.4 50 C214.9 47.7, 212.7 43.1, 211.5 38.2 C210.3 33.3, 210.5 25.3, 212.1 20.7 C213.6 16.1, 216.4 12.6, 221 10.6 C225.7 8.5, 237 8.6, 239.9 8.3 C242.9 8, 239.1 8.8, 239 8.7&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M242 6.8 C247.2 7.7, 252.6 12.1, 255.5 16.3 C258.5 20.6, 260.6 27.2, 259.9 32.3 C259.1 37.4, 255.1 43.2, 251.1 46.9 C247.2 50.5, 241.5 53.7, 236.1 54 C230.7 54.3, 223.1 51.8, 218.7 48.6 C214.3 45.4, 211.2 39.7, 210 35 C208.7 30.2, 208.7 24.3, 211.1 19.9 C213.5 15.6, 218.9 11, 224.5 9.1 C230 7.2, 240.5 8.2, 244.4 8.6 C248.3 9, 248.1 11, 247.8 11.2 M232.7 6.3 C237.7 5.6, 243.5 7.9, 247.7 10.9 C251.9 13.8, 256.6 18.7, 257.9 23.9 C259.2 29, 257.7 36.8, 255.3 41.6 C252.9 46.4, 248.1 51.1, 243.4 52.8 C238.7 54.5, 232.2 53.5, 226.9 51.8 C221.7 50.2, 214.8 47.1, 212 42.9 C209.2 38.6, 209.2 31.2, 210.1 26.3 C210.9 21.3, 213.3 16.2, 217 13 C220.6 9.9, 229.1 8.3, 231.9 7.2 C234.7 6.1, 233.5 6.6, 233.8 6.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M235.1 30.6 C231.9 24.7, 230.5 20.5, 230.1 18.8 M234.4 29.9 C232.7 26.9, 232.1 24.6, 231.2 18.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M232.4 30.9 C232.8 38.2, 233.1 44.4, 234.1 48.1 M233.6 29.1 C233.7 36.2, 233 41.8, 233.5 49.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;258&quot; y=&quot;72.0&quot;&gt;11:30&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M441.7 19.9 C504.1 15.4, 569.6 15.6, 668.2 18.9 C674.2 16.7, 683.6 20.2, 677.1 27.2 C679.8 83.6, 676.1 140.4, 679.2 177.7 C682.2 185.4, 675.9 188.2, 671.1 191.3 C621.5 183.8, 568.8 188.8, 438.3 189.6 C436.7 188.8, 428.5 183.7, 433.1 183.1 C429.3 142.1, 427.1 104.5, 429.5 27.9 C432.4 22, 434.4 23.3, 442.4 21.4&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M439.7 18.4 C530.5 21.1, 621.3 20.9, 670.2 20.5 M440.1 20.6 C519.3 20.3, 598.2 21.4, 670.6 19.9 M670 20 C677.6 20.2, 681.9 24.9, 680.2 29.2 M670 20.3 C675.5 21.1, 682.2 25.5, 680.7 29.4 M679.6 28.3 C680.5 86.1, 680.5 141.1, 681.9 178.1 M680.2 30.8 C680.4 59.6, 680.7 90.1, 679.8 180.8 M680 180 C681.2 187.5, 675.1 190.4, 671.4 189.8 M680.7 179.2 C679 186.4, 677.4 192.3, 670.9 189.2 M669.8 191.2 C589.5 189, 513 188.8, 441.2 190.7 M670.1 189.3 C623.1 189.8, 574.5 190.7, 439.9 189.9 M440 190 C434.8 189.1, 428.2 188, 429 180.7 M441.7 191.8 C431.3 191.2, 430.8 187.8, 429 178 M431.2 179 C430.1 134.4, 428.7 89.8, 430.5 29.3 M429.8 180.4 C429.5 126.5, 428.9 73.7, 429.9 29 M430 30 C429.7 21.3, 431.8 21.8, 440.6 21.7 M430.7 28.2 C431.7 21.4, 431.7 18.4, 438.3 18.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M549.3 67.6 C549.9 67.6, 549.8 67.4, 549.8 68 C549.7 68.6, 549.4 70.5, 549.2 71.4 C549 72.3, 549 73.3, 548.5 73.5 C548 73.7, 546.8 73.1, 546.3 72.8 C545.7 72.5, 545.5 71.9, 545.1 71.7 C544.7 71.4, 544 71.9, 543.9 71.3 C543.8 70.7, 543.8 68.9, 544.4 68 C544.9 67.2, 546.2 66.6, 547.1 66.4 C548 66.2, 549.2 66.5, 549.6 66.9 C549.9 67.3, 549.4 68.6, 549.2 68.9 M546.9 66 C547.9 66.3, 550.2 67.2, 550.9 67.8 C551.7 68.3, 551.6 68.5, 551.3 69.3 C551.1 70.2, 550 72.3, 549.5 72.8 C548.9 73.3, 548.9 72.5, 548 72.4 C547 72.3, 544.1 72.4, 543.6 72.1 C543.2 71.8, 545 71.1, 545.2 70.7 C545.4 70.3, 544.8 70.3, 544.9 69.6 C545 69, 545.2 67.3, 545.8 67.1 C546.3 66.8, 548.1 67.8, 548.3 67.9 C548.6 68, 547.2 67.9, 547.2 67.8&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M544.7 67.4 C545.3 67.1, 547.8 66.3, 548.5 66.4 C549.1 66.4, 548.3 66.9, 548.5 67.7 C548.8 68.5, 549.9 70.2, 550 71.1 C550.1 71.9, 549.7 72.6, 549.2 72.8 C548.7 73, 547.7 72.5, 546.9 72.4 C546.1 72.3, 544.8 72.7, 544.4 72.3 C543.9 72, 544.3 71, 544.3 70.5 C544.3 70, 543.9 69.8, 544.4 69.4 C544.8 68.9, 546.5 68.2, 547 67.8 C547.5 67.5, 547.5 67.1, 547.5 67 M547 66.3 C548.1 66.4, 550.1 66.6, 550.8 67.2 C551.5 67.9, 551.6 69.2, 551.2 70.1 C550.9 71.1, 549.2 72.2, 548.5 72.8 C547.8 73.5, 547.6 74.1, 547.2 74.1 C546.8 74.1, 546.6 73.2, 546.3 72.8 C546 72.4, 545.4 72.1, 545.2 71.7 C544.9 71.2, 544.8 70.9, 544.9 70.1 C545 69.3, 545.1 67.3, 545.7 66.9 C546.3 66.5, 548.1 67.9, 548.4 67.8 C548.7 67.7, 547.9 66.7, 547.6 66.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M561.4 67.8 C561.9 67.5, 563.3 67.3, 564.1 67.3 C564.9 67.4, 566 67.6, 566.2 68 C566.5 68.4, 565.8 69.4, 565.7 69.9 C565.5 70.4, 565.7 70.8, 565.3 71.2 C564.9 71.6, 563.9 72.2, 563.3 72.2 C562.6 72.3, 561.8 72, 561.4 71.7 C561 71.5, 561 71.3, 560.7 70.6 C560.3 70, 558.9 68.4, 559.2 67.9 C559.5 67.3, 561.8 67.7, 562.4 67.5 C562.9 67.3, 562.5 66.8, 562.5 66.7 M564.1 67.6 C564.9 67.7, 564.6 66.4, 565 66.8 C565.4 67.2, 566.4 68.8, 566.4 69.9 C566.5 71, 565.7 72.7, 565.3 73.3 C564.9 74, 564.8 73.5, 564 73.6 C563.2 73.7, 561.2 74.5, 560.6 73.9 C560 73.2, 560.5 70.8, 560.3 69.8 C560.1 68.8, 559.6 68.3, 559.6 67.7 C559.6 67.2, 559.7 66.7, 560.5 66.6 C561.2 66.5, 563.6 67, 564 67.1 C564.4 67.3, 562.5 67.7, 562.7 67.5&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M563.9 67.6 C564.3 67.9, 565.1 68.9, 565.4 69.3 C565.7 69.8, 565.8 69.9, 565.7 70.4 C565.6 70.9, 565.6 72.1, 565 72.4 C564.3 72.7, 562.4 72.5, 561.7 72.3 C560.9 72.1, 560.7 71.3, 560.4 71 C560 70.8, 559.3 71.2, 559.5 70.8 C559.6 70.5, 560.5 69.7, 561.1 69.1 C561.7 68.6, 562.7 67.8, 563.3 67.7 C563.9 67.6, 564.2 68.3, 564.7 68.3 C565.1 68.4, 566.2 68.4, 566.2 68.2 M565 67.7 C565.2 67.6, 564.6 67.7, 564.6 68.3 C564.6 68.9, 565 70.7, 564.9 71.5 C564.8 72.3, 564.8 72.7, 564.2 73.1 C563.7 73.5, 562.5 74.3, 561.8 73.9 C561 73.5, 560.1 71.5, 559.9 70.8 C559.7 70.1, 560.3 70.3, 560.5 69.8 C560.6 69.3, 560.5 68.2, 560.9 67.9 C561.2 67.6, 561.9 68.1, 562.5 68 C563.1 67.9, 564.1 67.4, 564.6 67.3 C565.1 67.2, 565.8 67.6, 565.5 67.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M545 82 C550.8 93, 557.7 91.1, 562.9 81.9 C560.7 82, 551.7 83, 543.2 81.3&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M545 82 C550.3 91.3, 560.1 91, 566.8 80.4 M543.3 81.6 C550.6 90.7, 557 91.5, 566.1 82.5 M564.8 83.4 C557.8 81.5, 551.9 82.8, 544.3 83.4 M565.2 82.4 C558.9 81.6, 550.9 82.3, 544.2 83&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:24px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;555&quot; y=&quot;140.0&quot;&gt;STATUS: OK&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M553.5 191.6 C556 215.8, 555.7 246.5, 554.2 259.4 M555.5 190.7 C553.7 208.1, 554.5 224.9, 554.8 259.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;I&#x27;m retelling this and the other stories below from the book. I didn&#x27;t see any of them happen.&lt;/p&gt;
&lt;p&gt;You will never remove every bug. So the question isn&#x27;t how to have no bugs. It&#x27;s &lt;strong&gt;how to stop one bug from taking everything else down with it.&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Bugs will happen. They cannot be eliminated, so they must be survived instead.&quot;&lt;/p&gt;
&lt;p&gt;— Michael Nygard, &lt;em&gt;Release It!&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;why-are-most-failures-hangs-not-crashes&quot;&gt;Why are most failures hangs, not crashes?&lt;a class=&quot;anchor&quot; href=&quot;#why-are-most-failures-hangs-not-crashes&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Integration points are the number-one killer of systems.&quot;&lt;/p&gt;
&lt;p&gt;— Michael Nygard, &lt;em&gt;Release It!&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Because a crash is loud and a hang is quiet. (By hang I mean a call that neither succeeds nor fails.) The first thing &lt;em&gt;Release It!&lt;/em&gt; changed for me was my picture of failure. I pictured a crash, a red error. In production the dangerous failure is something that gets &lt;em&gt;slow&lt;/em&gt;, or stops answering, while everything waiting on it slowly stops too.&lt;/p&gt;
&lt;p&gt;Nygard lists what an &lt;strong&gt;integration point&lt;/strong&gt; can do. An integration point is any call over a network: a payment provider, a database, a message broker. There are six ways it can fail:&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 24 752 423&quot; width=&quot;752&quot; role=&quot;img&quot; aria-label=&quot;Six ways a dependency can fail&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M7.9 39 C40.7 38.7, 69.2 38.8, 118.5 37.2 C123.9 37.4, 127.2 42.9, 127.8 52.6 C135.5 154.5, 131.6 264.1, 128.3 358.9 C129.3 370.2, 129.3 366.4, 119.6 372.9 C77.9 368.3, 41.6 374.8, 8.4 367.3 C5.8 373.3, 2.3 367, -0.3 361.7 C-2.1 265.7, 0.8 167.5, -1.4 52.1 C-3.1 42.2, 3.8 37.1, 9.9 42.2&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M9.2 39.5 C46.5 40.4, 80 39.3, 119.8 41.2 M9.1 39.9 C33.1 39.4, 58.3 38.6, 120.3 39.6 M120 40 C126.4 40.6, 131 45, 129.7 50.7 M118.1 38.2 C124.5 38.5, 128.3 42.3, 128.4 51.2 M131 50.4 C129 127.7, 127.2 205.8, 129.9 359.3 M129.5 49.7 C129.8 148.9, 129.4 248.2, 129.4 359.8 M130 360 C131.6 366.2, 127.4 368.6, 121.6 369.1 M131.2 360.6 C131.4 368.4, 127.6 371.1, 119.3 370.4 M118.5 368.7 C96.2 371.7, 69.2 370.2, 11.8 368.1 M121 370.6 C91.1 369.7, 63.2 370.5, 10 369.6 M10 370 C3.8 371.5, 0.1 366.8, 1.5 358.1 M11.1 370.7 C3 370.2, 1.9 368.6, -0.2 359.6 M0.4 360.8 C-0.6 286.2, -0.8 213, -1.2 49.8 M0.5 359.5 C0.9 247.5, 0.7 136.2, -0.4 49.5 M0 50 C1.6 44, 2.5 38.4, 9.9 39.4 M-1.2 49.1 C-2.2 45.2, 3.8 37.8, 9.8 41.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:22px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;65&quot; y=&quot;205.0&quot;&gt;client&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M582.2 37.5 C621.7 43, 663.2 37.8, 709.9 39.5 C713.1 41.3, 721.3 42.4, 723.3 47.9 C718.3 161.2, 716 274.3, 721.7 357.9 C718.7 368.2, 718.3 368.4, 709.8 371.4 C677 366.7, 644.8 365.2, 578.6 372 C576.5 367.2, 571 364, 568.6 361.5 C572.6 276.5, 571.8 189.1, 570 48.5 C572.7 41.8, 574.6 42.8, 581.6 38.1&quot; style=&quot;fill:var(--xd-orange)&quot;/&gt;&lt;path d=&quot;M579.9 38.7 C623.8 38.3, 665.1 37.8, 710.4 38.7 M579 40.5 C626.5 38.9, 672.6 40, 710 39.8 M710 40 C715.3 38.9, 718 42.1, 720.5 50.3 M711.6 40.6 C718.8 38.5, 720.2 41.2, 720.2 48.5 M719 49.7 C718.9 138.2, 720.9 229.6, 718.8 358.9 M720.3 49.9 C718.1 162.2, 717.8 273.1, 719.4 359.9 M720 360 C720.5 365.7, 716.8 369.9, 708.4 368.6 M719.7 361.1 C720.9 367, 719 372.1, 711.8 370.8 M709.8 368.5 C669.4 369.7, 626 367.8, 578.4 371.5 M711 369.1 C664.4 369.1, 620.2 369.2, 580 370.2 M580 370 C574.9 371.9, 570.2 366.6, 569.8 360.3 M581.2 368.4 C573.4 371.6, 568.3 365.2, 572.3 359.4 M570.8 360.8 C570.7 289.1, 570.8 216.2, 570.4 51.1 M570.6 359.9 C569.2 242.6, 568.9 124.3, 569.6 50.7 M570 50 C570.7 42.3, 573.5 40, 579.6 40.6 M568.2 50 C570.7 44.9, 575.3 42, 578.1 37.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:22px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;645&quot; y=&quot;205.0&quot;&gt;dependency&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M140.6 75.8 C268.7 74.2, 398 73.7, 560.4 75.6 M139.5 75.7 C258 74.2, 376.9 73.2, 559.5 75.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M548.1 69.6 C550.8 72.1, 554.9 73.3, 560.5 75.4 M546.7 69.5 C550.4 72.1, 554.6 72.5, 559.4 75.9 M560 74.8 C556.8 76.3, 554.7 78.8, 548.5 83.2 M560.2 76.4 C555 78.1, 551.8 79.9, 547.1 81.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;350&quot; y=&quot;60.0&quot;&gt;1  refuses  ✗&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M139 127.6 C268.9 129.4, 398.9 129.3, 559.8 127.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;path d=&quot;M546.1 121.4 C551 124.3, 555.8 126, 559.7 127.7 M561.1 127.8 C558.1 128.2, 554.1 130.7, 546.1 134.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;350&quot; y=&quot;112.0&quot;&gt;2  accepts… silence&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M139.6 179.5 C269.2 180.2, 397.6 180.4, 559.1 179.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;path d=&quot;M546.9 173.3 C551.1 176.3, 553.9 178.5, 558.8 179.9 M560.8 180.4 C555.5 181.7, 552.9 183.1, 546.1 185&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;350&quot; y=&quot;164.0&quot;&gt;3  answers slowly&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M140.3 231.4 C269.4 231, 398.6 231.5, 560.6 232.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;path d=&quot;M547.7 225.1 C551.2 228.4, 554.7 230.9, 560.8 232.1 M560.5 232.9 C555.4 233.7, 553.9 235.6, 546.2 237.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;350&quot; y=&quot;216.0&quot;&gt;4  dribbles bytes . . .&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M139 283.7 C274.1 282.5, 409.1 281.5, 559.8 284.3 M139.7 283.6 C240.7 283.7, 341.7 283.5, 560.2 284.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M546.1 277.5 C550.2 280.6, 554.2 281.1, 559.8 284.4 M547 277.4 C550 279.9, 553.1 281.1, 560.2 284.6 M561.4 285.3 C555.5 286.5, 549.8 289.5, 548.3 290 M559.4 283.6 C554.9 286.1, 551.1 287.8, 547.3 290.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;350&quot; y=&quot;268.0&quot;&gt;5  returns garbage #@!&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M139.6 335.6 C274.4 337.8, 410 337.1, 559.2 336.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;path d=&quot;M546.9 329.4 C550.4 332.8, 555.1 333.8, 559 336.6 M558.8 335.6 C556.3 337.1, 552 339.8, 547.8 341.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;350&quot; y=&quot;320.0&quot;&gt;6  drops mid-call&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;360&quot; y=&quot;420.0&quot;&gt;only #1 is fast and obvious&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;Six ways a dependency can fail: refuse the connection, accept but never answer, answer slowly, dribble bytes, return garbage, drop mid-call.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;ol&gt;
&lt;li&gt;Refuse the connection outright.&lt;/li&gt;
&lt;li&gt;Accept the connection, then never answer.&lt;/li&gt;
&lt;li&gt;Answer, but slowly.&lt;/li&gt;
&lt;li&gt;Dribble the response out a few bytes at a time.&lt;/li&gt;
&lt;li&gt;Answer with garbage, or something that breaks the protocol.&lt;/li&gt;
&lt;li&gt;Drop the connection halfway through.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Only the first is fast and obvious. A slow response is &lt;em&gt;worse&lt;/em&gt; than a refusal, Nygard points out, because a refusal frees you at once while a slow response holds your resources the whole time.&lt;/p&gt;
&lt;p&gt;His best story here is a system that hung every morning at 5 a.m. A firewall sat between the application and its database, and it quietly forgot any connection that had been idle for an hour without telling either side. After a quiet night, the application tried to use pooled connections the firewall had already forgotten, and every request hung. Nothing in the code was &quot;wrong&quot;. The fix was periodic traffic on each connection, so none sat idle long enough to be dropped.&lt;/p&gt;
&lt;h2 id=&quot;does-every-wait-need-a-limit&quot;&gt;Does every wait need a limit?&lt;a class=&quot;anchor&quot; href=&quot;#does-every-wait-need-a-limit&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Hope is not a design method.&quot;&lt;/p&gt;
&lt;p&gt;— Michael Nygard, &lt;em&gt;Release It!&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yes. If one thing in this post sticks, let it be this: &lt;strong&gt;every call that waits must have a timeout.&lt;/strong&gt; That means every HTTP call, database query, message publish and lock, and every time you take a connection from a pool. Nygard puts the pool version plainly: &quot;Safe resource pools always limit the time a thread can wait to check out a resource.&quot;&lt;/p&gt;
&lt;p&gt;Won&#x27;t the language do it for you? Mostly not. In Go, the default &lt;code&gt;http.Client&lt;/code&gt; has &lt;em&gt;no&lt;/em&gt; timeout, so a request to a provider that never answers waits forever. A plain &lt;code&gt;fetch&lt;/code&gt; in TypeScript waits forever too. You have to ask for a limit every time.&lt;/p&gt;
&lt;p&gt;What happens without one? His Black Friday story answers: a retailer ran a promotion, and the extra traffic flowed through the website into the order system, and from there into a small scheduling system that could handle about twenty-five requests at once. Far more than twenty-five arrived. The website&#x27;s connection pool to that system had no timeout, so its 3,000 threads waited, one by one, until none were left. The whole store went down because of the smallest system in the chain.&lt;/p&gt;
&lt;h2 id=&quot;what-should-happen-once-a-dependency-keeps-failing&quot;&gt;What should happen once a dependency keeps failing?&lt;a class=&quot;anchor&quot; href=&quot;#what-should-happen-once-a-dependency-keeps-failing&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Stop calling it. Even with bounded calls, a dependency that keeps failing still costs you: every request tries it, waits for the whole timeout, and fails, so you&#x27;ve made every request slow. Why keep paying for an answer you already know?&lt;/p&gt;
&lt;p&gt;The fix is the &lt;strong&gt;circuit breaker&lt;/strong&gt;, named after the electrical one.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -16 714 402&quot; width=&quot;714&quot; role=&quot;img&quot; aria-label=&quot;A circuit breaker has three states&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M8.5 2.5 C70.3 4, 133 3.5, 222.6 0.5 C227.6 0, 233.1 5, 230.8 9.5 C232.1 32.2, 227.5 53.2, 232 87.4 C229.5 96.5, 223.5 98.7, 219.6 98.3 C160.7 99.7, 98.9 102.8, 8.1 100.7 C0.1 101, 0.8 98.7, -1 91 C2.6 65.8, 0.4 39.4, 0.6 12.8 C0.8 4.2, 0.3 2.2, 10.1 2.8&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M11.7 1.3 C80.9 -2.7, 151.7 -2.1, 219.9 -0.5 M10.6 0.7 C63.2 0.1, 116.4 1.3, 220.1 -0.6 M220 0 C226.9 -0.2, 228.1 4.7, 230.4 10.5 M220 1.9 C225 -0.2, 230.5 3.7, 227.8 10.6 M229 11.3 C230.7 31.1, 230.8 53.2, 229.9 90.8 M229.6 9.3 C230.7 33.2, 229.6 57.3, 229.4 89.5 M230 90 C231.9 97.7, 226.1 100.6, 218.5 98.7 M230.7 91.9 C231.6 94.9, 226.1 100.8, 221 98.6 M219.4 98.7 C144.7 99.2, 66.9 101.3, 8.5 101.1 M220.4 100.7 C161.5 100.6, 100.9 101.4, 9.9 100 M10 100 C3.6 100.7, 0 96.7, -1.3 91.6 M10.4 99.2 C3.4 100.5, 2.2 95.4, 1.5 91.2 M-0.3 90.3 C-1.7 66.1, -1.8 42, 1 8.3 M-0.8 89.7 C-1.4 67.5, -0.1 42.6, -0.7 9.4 M0 10 C1.8 1.6, 4.9 -1.2, 8.9 -1.1 M-1.1 11.7 C1.7 3.3, 3 -1.3, 9.2 2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;115&quot; y=&quot;37.5&quot;&gt;closed&lt;/tspan&gt;&lt;tspan x=&quot;115&quot; y=&quot;62.5&quot;&gt;calls go through&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M438.3 -0.1 C510 -3.9, 574.3 -0.3, 650.1 -1.7 C655.7 0.8, 663.1 0.2, 660.4 8.5 C661.8 27.9, 659.5 48.9, 662 89.2 C661.6 98, 656 99.5, 649.3 101.4 C574.3 97.6, 492.3 99.8, 437.9 100.5 C430.6 96.7, 426.6 95.1, 430.3 88.5 C429.1 69.2, 426.2 52, 427.9 12.2 C428.9 5.9, 430.9 -1.4, 437.9 0.7&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M440.2 0.1 C517.4 -0.4, 593.4 1.3, 650.5 0.4 M440 -0.3 C486.1 -1.6, 531.5 -1.8, 649.7 0.1 M650 0 C657.5 1, 658.8 3.1, 659.2 9.9 M648.2 -1.6 C654.4 2.3, 659.7 2.5, 660.1 8.3 M660.4 11.3 C657.9 35.3, 659.6 58.4, 658.1 92 M660.7 10.3 C659.1 32.9, 660.2 54.9, 659.8 89.9 M660 90 C658.9 97.3, 657.9 100, 650.2 100.6 M659.2 91 C659.8 97.5, 655.6 98.1, 651.1 101 M649.1 98.7 C572.1 99.7, 492.9 97, 440.8 101.6 M650.4 99.4 C569 99.5, 487.6 99, 440.4 99.6 M440 100 C434.6 101.8, 429.5 97.2, 432 90 M440.2 101.7 C435.4 100.9, 429.6 95.5, 429.1 92.1 M428.5 91.6 C429.7 67.9, 429.4 42.2, 431.5 11.2 M430.9 89.7 C430.7 62, 429.7 31.4, 430.4 10 M430 10 C431.5 4.8, 431.9 -1.8, 439.7 1.7 M428.6 10.5 C431.7 4.4, 431.4 0, 441.9 -0.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;545&quot; y=&quot;37.5&quot;&gt;open&lt;/tspan&gt;&lt;tspan x=&quot;545&quot; y=&quot;62.5&quot;&gt;fail fast&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M225.1 272.4 C275.9 271.3, 324.6 271.1, 435.5 267.3 C443.2 266.9, 443.5 272, 444.9 283.4 C442.5 309.4, 440.5 339, 443.4 360.5 C447.5 363.7, 441.3 368.4, 432.8 372.1 C357.2 369.7, 277.2 372.8, 223.1 369.3 C219.1 366.7, 216.2 367.9, 212.1 361.7 C216.6 337.8, 216.8 312.4, 218.5 279.5 C215.3 276.3, 217.8 271.9, 226.4 267.6&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M224.5 269.4 C280.8 268.4, 336.3 268.7, 434.1 268.9 M224.4 269.7 C303.1 269.1, 379.8 268.3, 435.8 270.9 M435 270 C442.2 270.7, 444 273.2, 445.2 281.5 M435.8 271.1 C440.6 270.3, 444 274.1, 446.3 281.6 M445.1 281.2 C445.9 308.5, 447.2 335.2, 445.8 361.6 M445.1 279.9 C443.6 303, 444.9 325.7, 445.2 360.6 M445 360 C445.4 366.6, 441.8 369.5, 435.3 370.4 M445.8 359.7 C445.5 364.5, 443.7 371.1, 433.8 367.9 M435.7 370.1 C376.4 371.4, 316.7 371.4, 223.9 368.9 M435.8 370.7 C363 368, 289.5 368.5, 225.4 370.5 M225 370 C217.4 368.8, 214.7 368, 213.4 360.2 M225.3 369.9 C216.5 368.1, 217.1 366.5, 216.8 358.6 M214.5 358.4 C213.5 335.9, 214.8 310.8, 213.1 280.5 M215.7 360.4 C214.7 329.2, 213.6 300.6, 215.2 279.5 M215 280 C214 273.4, 216.9 269, 224.9 269.7 M214.8 281.8 C214 271.4, 218.2 272, 226.9 270.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;330&quot; y=&quot;307.5&quot;&gt;half-open&lt;/tspan&gt;&lt;tspan x=&quot;330&quot; y=&quot;332.5&quot;&gt;one trial call&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M234.9 49.2 C275.1 49.4, 318.4 48.1, 425.2 49.7 M236 50.1 C283.5 48.6, 330.8 48.6, 423.9 50.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M410.6 43.4 C412.9 45.8, 417.4 46.2, 424.9 49.8 M411.4 44 C414.9 44.8, 418.1 46.3, 423.9 50.4 M422.7 48.8 C420.7 51.1, 414.1 53, 410.5 56 M423.5 50.1 C420.4 52.6, 415.8 53.5, 410.8 55.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;330&quot; y=&quot;36.0&quot;&gt;too many failures&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M609.5 109.3 C573 148.4, 538.7 188.3, 438.9 291.6 M610.7 109.4 C556.8 166.6, 504.6 223.2, 440.7 290.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M452.7 284.4 C449.2 285.4, 448.5 287.2, 439 291.3 M453.7 284.5 C448.3 286.2, 445.1 288, 440.6 290.7 M439.8 288.6 C442.3 285.4, 442.2 283.6, 444.1 275.9 M439.7 290.2 C441.8 286.4, 442 283.3, 444.8 276.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;560&quot; y=&quot;205.0&quot;&gt;after a pause&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M225.5 289 C195.4 250.9, 166.3 213.2, 91.2 108.5 M225.5 289.7 C192.8 246.5, 160.3 204.9, 90.8 109.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M93.1 122.9 C91.2 120.1, 90.8 118.3, 91 108.8 M93.1 123.5 C92.2 120.3, 91.1 117.8, 90.6 109.7 M89.3 111.1 C95.7 111.8, 98.2 114.7, 103.8 117.1 M90 110.5 C93.4 111.7, 97 112.8, 102.4 116&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;end&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;128&quot; y=&quot;205.0&quot;&gt;trial works&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M411.8 268.6 C428.5 235.1, 449.4 202.6, 500.2 108.5 M410.4 270.1 C441.6 212.4, 475.5 154.5, 500.9 110.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M489.7 117 C490.2 115.8, 493.6 115.7, 500.1 109 M488.8 118.1 C492.3 115.2, 497.4 112.2, 500.6 110.2 M498.8 110.8 C501.2 113.1, 500.9 115.8, 499.3 123.3 M500.3 109.4 C500.4 114.9, 500 119.3, 498.6 123.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;end&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;425&quot; y=&quot;205.0&quot;&gt;trial fails&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;A circuit breaker: closed lets calls through; too many failures open it so calls fail fast; after a pause it goes half-open and lets one trial call through.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Closed&lt;/strong&gt;: calls go through normally, and failures are counted.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open&lt;/strong&gt;: after too many failures, calls fail &lt;em&gt;immediately&lt;/em&gt;, without even trying. The broken dependency gets room to recover, and your callers get a fast answer instead of a slow one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Half-open&lt;/strong&gt;: after a pause, one trial call is let through. If it works, the breaker closes again. If not, it opens again.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Two details from the book are easy to miss. First, decide &lt;em&gt;with the business&lt;/em&gt; what happens when the breaker is open. Do you refuse the payment, or accept the order and process it later? That&#x27;s a business decision, not a coding one. Second, give operators a way to trip and reset the breaker by hand.&lt;/p&gt;
&lt;p&gt;And &lt;strong&gt;don&#x27;t retry immediately&lt;/strong&gt; inside the request. Nygard calls hammering a struggling service with retries &quot;Hammer Time&quot;, because it turns a short hiccup into a full outage. Return an answer (failed, or &quot;accepted, we&#x27;ll process it&quot;) and retry later from a queue, with growing delays. For payments, every retry must be &lt;strong&gt;idempotent&lt;/strong&gt;: sending the same request twice must never charge twice.&lt;/p&gt;
&lt;h2 id=&quot;how-do-you-keep-one-failure-in-its-compartment&quot;&gt;How do you keep one failure in its compartment?&lt;a class=&quot;anchor&quot; href=&quot;#how-do-you-keep-one-failure-in-its-compartment&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;A distributed system is one in which the failure of a computer you didn&#x27;t even know existed can render your own computer unusable.&quot;&lt;/p&gt;
&lt;p&gt;— Leslie Lamport, in an email (1987)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ships have watertight compartments called &lt;strong&gt;bulkheads&lt;/strong&gt;, so one hole doesn&#x27;t sink the whole ship. Nygard applies the same idea: give each dependency its own separate pool of connections or workers. If the slow scheduling system uses up its own pool, the rest of the store keeps working. In the Black Friday story, a separate pool would have meant &quot;scheduling is unavailable&quot; instead of &quot;the store is down&quot;.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-106 24 905 289&quot; width=&quot;905&quot; role=&quot;img&quot; aria-label=&quot;Bulkheads: one pool per dependency&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M-1.4 38.6 C7.4 101, 11.6 159.9, 17.2 210.7 C205.7 227.5, 391.4 232.6, 580.6 206.5 C589.3 156.9, 592 108.3, 601.7 41.4 C363.4 39.5, 124.6 40.1, -1.2 41.3&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M-1.3 39.8 C5.4 78.3, 9.6 114.6, 20.6 211.1 M0.4 39.9 C3.1 80.5, 9.7 122.3, 20.9 209.4 M20 210 C207.2 230, 391.7 228.4, 581 211.4 M20.7 210.2 C205.3 231.6, 392.2 231.8, 580.1 211.9 M580.4 210.5 C582.9 176.9, 586.7 138.9, 601.6 40.2 M581 210.3 C586.3 164.3, 592.1 117.5, 599 39.1 M600.6 40.1 C477.6 39.2, 355 40.4, -0.4 39.8 M600.1 39.7 C435.3 38.5, 270.9 38.3, 0 40.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M156.7 112.3 C156.7 112.3, 156.7 112.3, 156.7 112.3 M156.7 112.3 C156.7 112.3, 156.7 112.3, 156.7 112.3 M156.4 124.5 C160.6 122.7, 161.8 119.2, 168.2 111.2 M156.7 123.9 C161 119.5, 163.9 117, 167.4 112.1 M158 133.8 C163.5 130, 170.9 122.6, 177.8 112.1 M158.3 135.9 C163.1 128.1, 170 121, 177.2 113.1 M158.8 149.6 C164.5 138.9, 172.1 131, 187.4 114.6 M157.5 147.2 C169.7 133.4, 181.4 120.8, 188.5 114 M157.8 157.9 C174.4 142.7, 189.1 124.1, 196.9 112.6 M157.2 160 C171.9 143.7, 184.8 128.7, 197.8 112.1 M156.1 173.2 C170.6 158.5, 184.4 141.9, 210 112.7 M158.5 172.2 C175.3 152.6, 194.3 132.1, 209.3 113.2 M157.4 183.8 C180.5 159.7, 200.9 134.1, 220.1 112.1 M157.1 185.2 C176.4 163.1, 195.1 141, 219.4 112.2 M157.1 198.9 C172.1 178.2, 189.9 160, 231.7 111.3 M156.2 197.9 C187 164.8, 215.2 129.1, 230.8 112.1 M159.9 207.4 C191.1 171.7, 222.6 136.8, 239.7 110.9 M159.9 206.9 C191.8 172.2, 222.3 137.3, 240.2 112.5 M169.7 211 C190.4 179.8, 217.5 152.6, 251.1 111.7 M167.9 209.4 C194.3 178.9, 219.3 149.7, 251 112.2 M177.5 208.3 C199.9 184.5, 221 161.9, 260.4 111.6 M178.3 208.9 C201.8 182.1, 225.9 155.6, 263 112.5 M187.2 210.1 C207.1 189.5, 224.1 171.5, 271.4 113.3 M188.1 209.5 C222.1 171.1, 254.5 134, 273.2 112.7 M199.6 207.7 C224.4 180.4, 250.4 147.7, 284.5 113.6 M199.2 210.2 C230 172.2, 262.4 134.7, 283.5 113.2 M209.9 208.9 C229.7 185.9, 253.7 160.1, 294.5 111 M209.7 208.7 C232.4 185.4, 252.9 159.8, 293.3 113 M221.2 209.8 C246.2 176, 275.6 143.9, 298.8 119.3 M220.7 209.2 C246.9 178.4, 274.9 147.3, 298.2 120.9 M231.8 207.8 C254.9 181.4, 279.6 153.9, 296.6 134.8 M231.5 208.8 C250.4 186.9, 270.3 166.1, 296.1 132.9 M240.9 209.6 C255.6 195.1, 270.5 178.7, 295.7 144.2 M243 208.4 C257.9 190.4, 275.9 171.6, 296.3 145.6 M252.3 208 C262.4 197.1, 272.5 183.1, 298.7 159.5 M253.1 209.7 C268.1 190.6, 285.7 171.5, 297.1 157.3 M263.7 210 C274.2 198.7, 283.2 188.2, 297.5 168.8 M263.1 208.8 C273.6 197.6, 283.5 185.5, 297.6 170.6 M274.6 209.6 C280.6 204.3, 282.6 199.6, 297.3 180.4 M274 209.7 C282.3 199.2, 290.9 190, 297.9 181.8 M285.6 205.6 C290.5 200.6, 294.3 197.3, 296.2 193.6 M286.8 206.7 C288.2 203.3, 290.6 201.4, 296.3 194&quot; style=&quot;fill:none;stroke:var(--xd-blue-ink);stroke-width:1&quot;/&gt;&lt;path d=&quot;M163.3 109.7 C190.6 107.7, 218.1 108.4, 288 109.2 M163.3 109.1 C201 109.6, 238.9 110.5, 285.9 109.8 M286 110 C293.3 111.6, 294.2 111.8, 295.9 118.8 M286.8 111.7 C294.8 109.8, 296.6 112.1, 295.1 118.5 M297 121 C295.9 138.1, 295.7 154.8, 295.8 195.5 M297 119.2 C295.1 135, 294.7 150.6, 296.7 195.7 M296 196 C296.3 202.5, 292.4 207.3, 287.6 207.3 M295 195.7 C297.8 201.7, 293.1 205.9, 285.6 208.3 M286 206.4 C254.1 205.5, 223.7 205.9, 162.8 206 M286.8 205.4 C245.4 204.8, 204.3 204.8, 164 205.3 M164 206 C158 207.5, 155.2 204.3, 155.3 196.4 M163.5 207.8 C158.2 203.8, 153.9 202.5, 152.5 197.8 M152.5 196.6 C153.3 181.8, 153.5 165.9, 154.9 119.9 M154.2 195.6 C153.6 168, 153.7 141.1, 154.8 119.2 M154 120 C153 112.1, 158.9 109.2, 164 109.2 M154.2 121.8 C154.3 115.5, 157.1 112, 162.7 109.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M149.9 39.6 C148.6 80.1, 149.5 118.9, 149.4 219.4 M150.2 40.3 C149.2 104.8, 149 171.2, 150.9 218.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M300.5 39.4 C301 78.2, 302.4 119.3, 300.8 217.6 M299 39.5 C297.7 80.4, 298.5 120.6, 299.9 218.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M451 39.3 C449.7 80.3, 451.7 119.7, 448.2 219.7 M449.9 40.7 C448.2 91.7, 448.1 143.2, 450.9 218.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;75&quot; y=&quot;62.8&quot;&gt;payments&lt;/tspan&gt;&lt;tspan x=&quot;75&quot; y=&quot;85.3&quot;&gt;pool&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;225&quot; y=&quot;62.8&quot;&gt;scheduling&lt;/tspan&gt;&lt;tspan x=&quot;225&quot; y=&quot;85.3&quot;&gt;pool&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;375&quot; y=&quot;62.8&quot;&gt;search&lt;/tspan&gt;&lt;tspan x=&quot;375&quot; y=&quot;85.3&quot;&gt;pool&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;525&quot; y=&quot;62.8&quot;&gt;orders&lt;/tspan&gt;&lt;tspan x=&quot;525&quot; y=&quot;85.3&quot;&gt;pool&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M-90 150 C-72 143.2, -58.6 143.5, -42.5 150.8 M-91.2 150.8 C-73 145.6, -55.5 145.2, -43.2 151.3 M-41 150 C-23.1 154.9, -8.4 158, 8.8 151.5 M-41.1 150.9 C-22.6 155.2, -8 155.6, 6.5 152&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M592 150 C610.1 141.9, 623.6 142.2, 641.1 149.6 M592.1 150.7 C610.5 142.5, 626.2 145.3, 643.1 151.4 M641 150 C659.1 155.8, 675.3 158.4, 691.4 149.6 M642.4 148.3 C659.6 156.2, 673.4 157.9, 690.3 148.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;700&quot; y=&quot;150.0&quot;&gt;water line&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;225&quot; y=&quot;286.0&quot;&gt;slow dependency: only its own pool fills&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M225.3 268.6 C224.5 241, 223.9 214.3, 226.4 180.4 M224.4 269.4 C225.4 247.7, 224.4 225.5, 224.7 180.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M219.1 191.6 C220.2 187.5, 221.7 184.2, 226 180.2 M218.5 192.2 C220.9 189.6, 221.8 186.7, 224.8 180.1 M225.4 179.4 C227.9 183.9, 230.2 187.7, 232.2 193.2 M224.5 180.1 C226.8 183.7, 229.3 188.5, 230.4 193.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;figcaption&gt;Bulkheads: each dependency gets its own pool, so one slow dependency can only use up its own compartment.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Three habits go with it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Fail fast.&lt;/strong&gt; Check that you &lt;em&gt;can&lt;/em&gt; do the work before you start the expensive part: the pool has a connection, the breaker is closed, the input is valid.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Separate your errors.&lt;/strong&gt; Report &quot;our system is overloaded&quot; differently from &quot;your request was invalid&quot;, so a user&#x27;s bad input never trips someone else&#x27;s breaker.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Say when you&#x27;re busy.&lt;/strong&gt; An overloaded service should say &quot;busy, try later&quot; rather than queueing work forever.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;what-fails-slowly-over-weeks&quot;&gt;What fails slowly, over weeks?&lt;a class=&quot;anchor&quot; href=&quot;#what-fails-slowly-over-weeks&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Anything that grows, and probably something in your system already does: a log file that slowly fills the disk, a table of events that grows until its queries time out, a cache that keeps every item it ever saw.&lt;/p&gt;
&lt;p&gt;Nygard calls the fix &lt;strong&gt;steady state&lt;/strong&gt;: every mechanism that accumulates something must ship, in the &lt;em&gt;same&lt;/em&gt; release, with the mechanism that removes it. Logs rotate. The application itself purges old rows. Every cache has a size limit and an expiry. Every query has a &lt;code&gt;LIMIT&lt;/code&gt;, even the ones that &quot;only ever return one row&quot;, because one day the data won&#x27;t match your assumption.&lt;/p&gt;
&lt;h2 id=&quot;why-did-a-three-month-load-test-miss-the-crash&quot;&gt;Why did a three-month load test miss the crash?&lt;a class=&quot;anchor&quot; href=&quot;#why-did-a-three-month-load-test-miss-the-crash&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It tested the wrong users. A retailer replaced its whole online store in a project that ended up more than a year late, then spent three months load testing it. The new site went live at 9 a.m. By 9:30 it held 250,000 sessions, and then it crashed.&lt;/p&gt;
&lt;p&gt;The load tests had simulated polite shoppers who log in, browse and buy. Real traffic included search engine crawlers, scrapers and bots that don&#x27;t keep cookies. So &lt;em&gt;every single request&lt;/em&gt; created a brand-new session, each one using memory. No test had ever done that.&lt;/p&gt;
&lt;p&gt;Test with &lt;strong&gt;hostile&lt;/strong&gt; traffic, then, not just the happy path: requests without cookies, the same URL hammered over and over, every device reconnecting at once after a network blip. And build the safety controls before launch: a way to limit new sessions, a way to block an abusive address, a polite &quot;come back later&quot; page.&lt;/p&gt;
&lt;h2 id=&quot;how-do-you-see-a-hang&quot;&gt;How do you see a hang?&lt;a class=&quot;anchor&quot; href=&quot;#how-do-you-see-a-hang&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You export the numbers that reveal it. You can only fix what you can see, and Nygard&#x27;s advice on &lt;strong&gt;transparency&lt;/strong&gt; comes down to three habits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Count what is in flight.&lt;/strong&gt; Export how many requests are running right now, how many timed out, and how many callers are waiting on each pool. An average response time hides a hang, because the requests that never finish are never counted.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Make health checks do real work.&lt;/strong&gt; The airline&#x27;s status page said &quot;fine&quot; while every real request hung. A check should go through the same path as a real request, and an external probe should run a real transaction from outside.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Treat logs as a user interface.&lt;/strong&gt; One line per event, the same format every time, an ID that ties a request&#x27;s lines together. ERROR means &quot;a human must act now&quot;, and nothing else. Write each message so a stranger at 3 a.m. knows what failed and what to do.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;The Pragmatic Programmer&lt;/em&gt; adds two tips that fit here. &lt;strong&gt;Tip 38: Crash Early.&lt;/strong&gt; When the program is in a state that should be impossible, stopping cleanly does less damage than limping on. And &lt;strong&gt;Tip 95: Don&#x27;t Use Manual Procedures.&lt;/strong&gt; If fixing an outage means someone remembering twelve steps, script them now. In the Black Friday story, the store recovered in under five minutes &lt;em&gt;only&lt;/em&gt; because Nygard had already written scripts to switch off the scheduling connection without restarting everything.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;A dead program normally does a lot less damage than a crippled one.&quot;&lt;/p&gt;
&lt;p&gt;— Dave Thomas &amp;amp; Andy Hunt, &lt;em&gt;The Pragmatic Programmer&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;what-keeps-software-healthy-after-launch-day&quot;&gt;What keeps software healthy after launch day?&lt;a class=&quot;anchor&quot; href=&quot;#what-keeps-software-healthy-after-launch-day&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Production isn&#x27;t one launch day. It&#x27;s every day after. In the codebases I studied, three habits kept them healthy over years:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Release in small, safe steps.&lt;/strong&gt; Nygard&#x27;s pattern for database changes is to &lt;strong&gt;expand, then roll out, then clean up&lt;/strong&gt;. Add the new column first, release code that uses it, and remove the old one only once nothing uses it any more. Every release keeps working with the previous one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Let tools hold the rules, not people.&lt;/strong&gt; tailscale has small repository tests that fail if a package has no documentation. rust-analyzer&#x27;s build fails if anyone adds a kind of test its style guide bans. Rules that live only in people&#x27;s heads get forgotten. Rules a computer checks don&#x27;t.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Improve what you touch, and put a fence around what you don&#x27;t.&lt;/strong&gt; That&#x27;s the strangler fig from the last post, every single day.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Is that everything the book says? No. This post stays on one narrow slice of the book: what happens to a service when something it calls goes wrong. Deployment pipelines and capacity planning get no more than a mention here.&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a class=&quot;footnote-ref&quot; href=&quot;#fn:1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; Since the evidence here is one book&#x27;s stories, plus what I saw in a few codebases, read the rules as strong advice rather than measured fact.&lt;/p&gt;
&lt;h2 id=&quot;floor-zero&quot;&gt;Floor zero&lt;a class=&quot;anchor&quot; href=&quot;#floor-zero&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Across these four posts, the books and the codebases kept saying the same thing in different words. Here are the floors, from the top down:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;The enemy is complexity&lt;/strong&gt; (&lt;a href=&quot;/craft-1-complexity/&quot;&gt;Part 1&lt;/a&gt;). Fight it with deep modules, hidden decisions, errors defined away, and designs considered twice before they&#x27;re built.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A test is only worth something if it can fail&lt;/strong&gt; (&lt;a href=&quot;/craft-2-tests/&quot;&gt;Part 2&lt;/a&gt;). Aim its inputs at the bug, and break the code on purpose to prove it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Respect old code&lt;/strong&gt; (&lt;a href=&quot;/craft-3-existing-code/&quot;&gt;Part 3&lt;/a&gt;). Measure where it hurts, name the problem precisely, propose a better design with evidence, and change it under tests, piece by piece.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Assume the world will break you&lt;/strong&gt; (this post). Bound every wait, fail fast, keep failures in their compartment, and make the system tell you the truth about itself.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-56 -45 512 425&quot; width=&quot;512&quot; role=&quot;img&quot; aria-label=&quot;Four floors&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M9.3 140 C150.8 136.1, 292 136.3, 392.4 140.9 C396.5 136.7, 400.4 144.8, 398.3 148.8 C400.6 156.7, 397.3 170.1, 399.3 185.8 C399.1 192, 394.3 192.5, 391.5 194 C251.5 199.1, 114 200, 9.7 194.9 C4.1 196.3, -2.3 193.7, -1 187.3 C3.8 175.5, -0.2 162.6, -1.8 147.6 C-0.8 144.4, 5.8 140.2, 12.3 140.2&quot; style=&quot;fill:var(--xd-orange)&quot;/&gt;&lt;path d=&quot;M9.5 140.1 C138.7 141.4, 267.4 141.4, 391.7 139.3 M8.8 140.3 C108 140.8, 206.9 140.5, 391.3 139.7 M390.7 140 C396.7 141.1, 398.3 142.6, 398.2 151.2 M390.1 139.9 C398.2 140.9, 397.9 141.3, 401.9 150.7 M401.1 151.1 C398.1 155.7, 400.1 165, 399.1 187.7 M400.4 149.1 C400.4 163.2, 399.4 177, 399.5 187.1 M400 186.7 C400.7 191.5, 398.1 194.3, 389.8 196.2 M399 187.7 C400.3 191.1, 398.1 198.3, 390.2 196 M391.8 195.8 C251.8 193.3, 113.4 193.7, 8.9 196.9 M390.4 196.3 C301.6 197.3, 213 196.9, 9.7 196.2 M9.3 196 C4.2 197.3, 1.4 191, -0.7 187 M10.9 196.4 C3.9 194.4, -0.5 194.7, 1 187.9 M-1.1 188 C-1.1 174.6, 1.3 157.1, -1 148.8 M-0.2 187 C-0.2 176.8, -0.9 168, -0.9 148.8 M0 149.3 C0.6 141.4, 2.7 139.6, 7.6 138.1 M-1.2 150.4 C1 143.7, 2.5 137.9, 11.4 140.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;200&quot; y=&quot;168.0&quot;&gt;4  assume the world breaks&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M7.9 197 C128.1 195.6, 242.5 194.4, 391.8 198 C399.3 197.9, 398.4 199.8, 399.3 207 C397 222.9, 396.9 231.1, 401.1 241.6 C398.9 250.2, 394.7 248.6, 389.7 255.2 C296.7 255.6, 198.7 255.2, 11.4 253.3 C2.1 249.6, -2.2 252.3, 2.7 243.9 C-0.3 230.3, 2.5 210.9, 2.4 202.2 C-1.1 201.6, 4.6 195.9, 6.1 194.3&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M8.6 195.6 C134.6 193.8, 261.7 195.4, 391.4 195.9 M9.2 195.8 C110.9 196.8, 214 196.8, 390.4 196.1 M390.7 196 C396.6 196.2, 398.7 199.7, 401.7 205.4 M390.9 194.2 C397.7 195.2, 400.3 198.2, 398.2 206.1 M400.9 205.1 C399.4 217.7, 399.4 231.4, 401 243.2 M400.7 205.7 C399.4 219.2, 398.9 235.6, 400.6 242.9 M400 242.7 C398.1 250.5, 396 250.8, 391.1 251.5 M399.4 243.6 C397.9 250.5, 395.2 253.9, 389.4 253.4 M390.9 251.6 C290.2 249.4, 187.2 248.9, 9 250.8 M390.4 252.3 C268 250.5, 145.1 251.3, 9.3 251.7 M9.3 252 C2.3 252.2, 0 247, -1.3 240.9 M7.4 252.3 C1.5 252, 1.5 248.5, 1.8 241.6 M0.2 243.5 C0.8 231.5, 2.2 225.7, -0.5 204.3 M0.8 243.4 C0.3 231.8, 0.2 221.6, -0.6 204.6 M0 205.3 C-1.2 197.2, 3.9 194.6, 11.1 195.6 M0.2 206.6 C-2.1 197.4, 3.5 194.8, 9.3 194.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;200&quot; y=&quot;224.0&quot;&gt;3  respect old code&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M10.7 253.9 C125.5 248.2, 247.1 250.7, 390.5 250.2 C397.8 249.6, 402 254.7, 398.6 257.9 C399.6 266.7, 402.2 278.8, 399.2 296.7 C396.9 302.3, 400.3 305.1, 387.3 308.2 C256.2 307.5, 121.1 306.4, 11 308.2 C4.4 305.4, -1.2 306.3, -0.7 298.7 C3 288.3, -2.2 275.1, 0.3 257.9 C3 256.1, 6 249, 12.8 253.1&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M9.8 252.5 C107.3 250.1, 204.7 250.1, 389.8 252.8 M9.2 251.9 C88.3 252.5, 167.1 251.8, 390.8 251.7 M390.7 252 C398.5 253.6, 398.1 254.5, 398.7 260.6 M389.9 253.9 C398.2 251.9, 400.4 254.6, 398.8 259.9 M401.3 260.5 C398.9 273.1, 401.9 286, 400.3 297.7 M400.8 261.4 C400.7 274.1, 400.8 286.9, 399.9 299.3 M400 298.7 C400.5 303, 398.7 307.4, 390.7 306.9 M399.5 300.2 C398.1 304.4, 397.1 309.6, 388.8 310 M390.3 307.4 C283.3 309.7, 177.2 309.7, 8.4 308.5 M390.2 308.5 C249.4 308.4, 109.4 307.9, 9.3 308.1 M9.3 308 C4.8 306.2, -1.3 305, -1 299.6 M11.3 307.1 C2.8 306, 0.3 303.8, -1.8 299.3 M-1.7 299.8 C0.1 287.4, -0.9 280.3, 0.6 263.1 M-0.7 298.8 C0.2 289, -0.9 278.4, -0.3 260.5 M0 261.3 C-1 254.3, 1.5 251.3, 10.2 250.9 M-1 259.4 C0.2 257.2, 2.3 251.2, 10.8 253.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;200&quot; y=&quot;280.0&quot;&gt;2  tests that can fail&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M11.1 307.2 C125.8 308.6, 241.7 307.3, 390.8 309.2 C398.8 305.3, 398.3 310.7, 401.7 320.2 C399 330.3, 398.3 340.5, 401.6 356.3 C399.5 362.6, 399.2 365, 388.7 365.9 C288.3 366.6, 183.4 368.5, 10.4 362.3 C6.2 365.2, 0.7 362.9, 0.6 351.5 C2.9 345.7, -0.6 338.9, -3.3 314.3 C-3.4 312, 3.5 309.3, 11.2 307.6&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M9.8 307.8 C155.3 307.9, 302.4 309.1, 390.3 306.9 M9.2 307.6 C114.4 310.2, 218.6 310.6, 390.4 307.7 M390.7 308 C395.1 309.2, 400.8 312.6, 398.1 318.7 M391.4 306 C398.7 306.6, 399.6 313.3, 401.1 316.1 M399.4 316 C399.6 330.1, 400 346.4, 398.5 354.5 M399.3 318.1 C400.7 329.2, 399.2 341.7, 399.6 354.5 M400 354.7 C401.3 359.9, 396.1 365.5, 390.6 363 M401.8 354.2 C401.3 360.4, 395.7 364.2, 391.7 365.5 M390.2 365 C274.6 361.1, 160.2 363.3, 9.8 363.9 M390.5 363.9 C251.1 363.3, 110.6 363.8, 9.3 364.5 M9.3 364 C2.2 364.5, 0.6 359.1, -0.3 354.8 M8 362.9 C1.6 366.3, -1.1 362.2, -1.3 356.9 M-1.4 356.5 C0.2 340.8, 0.5 327.8, 1.3 318.1 M-0.3 354.4 C0.3 341.9, -0.5 327, -0.9 317.7 M0 317.3 C-0.8 309.2, 3.1 307.9, 8.7 308 M-0.7 316.2 C0.3 312.2, 2.3 309.9, 10.4 308.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;200&quot; y=&quot;336.0&quot;&gt;1  the enemy is complexity&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M-40.3 363.7 C108.8 362.7, 256.3 361.6, 439.6 364.1 M-39.9 364.3 C151.3 361.6, 342.6 362.2, 440.3 363.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M189.8 -12.7 C193.9 -15, 200.2 -17.2, 204.9 -16.3 C209.6 -15.4, 215.3 -11.2, 218 -7.2 C220.7 -3.3, 221.5 2.6, 221.2 7.3 C220.9 12, 219.1 17.7, 216.2 21 C213.2 24.3, 208.2 26.6, 203.4 27.3 C198.7 28, 191.4 27.3, 187.4 25 C183.5 22.7, 181.2 17.8, 179.8 13.4 C178.3 9, 176.8 3.2, 178.7 -1.5 C180.5 -6.3, 188.2 -12.8, 190.7 -15.2 C193.1 -17.5, 193.1 -16, 193.4 -15.5 M194.4 -13.8 C198.5 -15, 204.9 -14.6, 209.1 -13.2 C213.3 -11.8, 217.1 -9.3, 219.3 -5.2 C221.5 -1.1, 223.5 6.4, 222.3 11.5 C221.2 16.5, 216.5 22.3, 212.5 25.2 C208.4 28.1, 202.9 29.6, 198.1 29.1 C193.3 28.7, 187.2 25.9, 183.7 22.4 C180.3 18.8, 177.8 12.4, 177.3 7.8 C176.7 3.2, 177.5 -1.2, 180.2 -5.1 C182.8 -9, 190.6 -13.9, 193.1 -15.6 C195.6 -17.4, 195 -15.8, 195.1 -15.6&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M195.1 -16.4 C199.5 -17.6, 206.8 -16.6, 211 -14.1 C215.2 -11.6, 218.7 -5.9, 220.2 -1.5 C221.8 2.9, 221.8 7.8, 220.3 12.2 C218.8 16.7, 215.3 22.9, 211.2 25.4 C207.2 27.9, 200.7 28, 195.9 27.1 C191.1 26.3, 185.6 23.8, 182.6 20.3 C179.5 16.9, 177.4 11.1, 177.5 6.2 C177.5 1.4, 179.4 -4.9, 182.9 -8.7 C186.5 -12.5, 195.5 -15.5, 198.8 -16.6 C202.1 -17.6, 202.6 -15.5, 202.6 -14.9 M208 -15.9 C212.1 -14.8, 215.8 -10.3, 217.9 -6.2 C220.1 -2.1, 221.3 3.7, 220.9 8.6 C220.6 13.6, 219 20.5, 215.8 23.6 C212.6 26.6, 206.6 27.4, 201.7 27.1 C196.7 26.8, 189.9 24.9, 186 21.8 C182.2 18.7, 179.6 13.2, 178.6 8.6 C177.5 4.1, 177.2 -1.4, 179.7 -5.2 C182.1 -9.1, 188.7 -12.6, 193.5 -14.2 C198.2 -15.7, 205.9 -14.4, 208.2 -14.4 C210.6 -14.4, 207.8 -14.3, 207.6 -14.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M191.9 -3.7 C192.5 -3.8, 193.1 -2.7, 193.6 -2.4 C194.1 -2.2, 194.3 -2.4, 194.7 -2 C195 -1.7, 195.9 -1, 195.9 -0.4 C195.8 0.2, 194.9 1.3, 194.3 1.7 C193.7 2.1, 192.9 1.9, 192.1 2.1 C191.3 2.3, 190 2.9, 189.4 2.8 C188.9 2.6, 188.7 1.8, 188.6 1.2 C188.5 0.6, 188.3 -0.3, 188.7 -0.9 C189 -1.5, 189.9 -2.3, 190.6 -2.6 C191.2 -3, 192.6 -3.2, 192.6 -3.1 M190.2 -2.6 C190.3 -2.6, 191 -2.4, 191.4 -2.2 C191.9 -2.1, 192.4 -2.5, 193 -1.9 C193.7 -1.3, 195.3 1, 195.2 1.6 C195.2 2.2, 193.4 1.6, 192.9 1.7 C192.4 1.9, 192.4 2.5, 192.2 2.4 C191.9 2.3, 191.5 1.6, 191.2 1.3 C190.9 1, 190.4 1, 190.3 0.6 C190.1 0.2, 190.1 -0.2, 190.1 -0.9 C190.1 -1.6, 190 -3.2, 190.3 -3.7 C190.6 -4.2, 191.9 -4, 192 -3.6&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M191 -3.3 C191.7 -3.5, 193.7 -2.7, 194.3 -2.3 C195 -1.8, 195 -1.2, 195 -0.7 C195.1 -0.2, 195 0.4, 194.6 0.8 C194.2 1.2, 193.2 1, 192.7 1.5 C192.1 2, 191.7 3.6, 191.2 3.8 C190.7 4, 190 3.5, 189.6 2.8 C189.2 2, 188.8 0.3, 188.9 -0.6 C189 -1.5, 189.8 -2, 190.4 -2.4 C191 -2.9, 192.1 -3.5, 192.5 -3.5 C192.9 -3.4, 192.9 -2.2, 192.9 -2.1 M189.7 -2.7 C190.2 -2.8, 191.4 -3.5, 192.1 -3.4 C192.9 -3.2, 194.1 -2.8, 194.4 -2.1 C194.7 -1.3, 193.7 0.4, 193.8 0.9 C193.9 1.4, 194.9 0.6, 194.9 1 C194.8 1.4, 194.3 3, 193.5 3.3 C192.6 3.6, 190.4 3.1, 189.9 2.9 C189.4 2.6, 190.4 2.6, 190.5 1.7 C190.6 0.8, 190.5 -1.7, 190.6 -2.4 C190.7 -3.2, 190.8 -3.2, 191.1 -3 C191.4 -2.9, 192.5 -1.7, 192.4 -1.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M207.1 -3.9 C207.9 -4.3, 209.7 -4.1, 210.3 -3.5 C210.8 -3, 210.1 -1.4, 210.3 -0.7 C210.6 0, 211.6 0, 211.6 0.7 C211.6 1.4, 211.2 2.8, 210.5 3.4 C209.8 3.9, 208.3 4.1, 207.4 4 C206.5 3.9, 205.7 3.5, 205.3 2.9 C205 2.4, 205.4 1.6, 205.3 0.9 C205.3 0.1, 204.8 -0.8, 205.1 -1.6 C205.4 -2.4, 206.6 -3.8, 207.1 -3.9 C207.6 -4.1, 207.8 -2.7, 208 -2.6 M210.4 -4.4 C211.3 -4, 210.6 -2.5, 210.8 -1.5 C211 -0.6, 211.8 0.9, 211.6 1.5 C211.4 2.1, 210 1.4, 209.6 1.8 C209.2 2.2, 209.7 3.9, 209.1 4.1 C208.6 4.4, 207 3.9, 206.3 3.4 C205.6 2.9, 205 1.8, 204.8 1 C204.7 0.2, 205.1 -0.5, 205.4 -1.3 C205.8 -2, 206.5 -3.3, 207.1 -3.4 C207.6 -3.5, 208.4 -1.6, 208.9 -1.8 C209.5 -1.9, 210.6 -4, 210.3 -4.2&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M207.2 -3.3 C207.7 -3.5, 208.2 -3.8, 209 -3.4 C209.7 -3, 211.2 -1.8, 211.6 -1 C211.9 -0.1, 211.3 1.1, 211 1.7 C210.8 2.2, 210.5 1.9, 210 2.2 C209.4 2.6, 208.1 3.7, 207.5 3.7 C206.9 3.6, 206.6 2.4, 206.2 2 C205.8 1.5, 205.5 1.7, 205.3 0.9 C205.1 0.2, 204.6 -1.6, 205 -2.4 C205.4 -3.2, 206.9 -3.8, 207.6 -3.8 C208.4 -3.7, 209.5 -2.2, 209.5 -2.1 M207.6 -2 C208.3 -2.3, 208.6 -3, 209.2 -2.8 C209.9 -2.6, 211.4 -1.6, 211.5 -0.9 C211.6 -0.1, 210.2 1.1, 209.9 1.5 C209.6 1.9, 210.1 1.4, 209.6 1.5 C209.1 1.6, 207.7 2, 206.9 2 C206.1 2, 205 1.8, 204.8 1.4 C204.7 0.9, 205.6 -0.1, 206 -0.7 C206.4 -1.2, 206.9 -1.3, 207.1 -1.9 C207.3 -2.5, 207.3 -3.8, 207.3 -4.2 C207.3 -4.6, 207.4 -4.5, 207.3 -4.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M190 12 C199.9 21.2, 202.1 20.1, 209.8 12.2 C200.9 13.5, 201.2 15.3, 186.7 9.6&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M190 12 C196.5 21.6, 202.2 20.8, 210.2 11.9 M191.2 12.6 C197.8 18.8, 203.9 21.2, 209.7 12.8 M210.1 12.6 C206.4 13.7, 200.3 12.3, 190.3 10.9 M210.9 12.4 C202.5 12.5, 197.1 11.8, 190.7 11.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M198.2 26.8 C200.3 47.7, 200.7 69.1, 198.1 93.2 M200.6 28.6 C201.1 48.6, 200.1 68.2, 199.8 94.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M201.7 94 C193.7 111.8, 186.5 130.9, 179.2 138.7 M199.6 93.2 C195.4 103.6, 191.8 113.6, 180.7 139.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M198.3 93.9 C209.7 109.8, 214.3 131.2, 220.6 140.9 M200.5 94.4 C206.1 106.4, 211.6 119.7, 219.7 140.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M198.8 45.8 C190.2 30.6, 176.3 13.5, 172 5.1 M199.4 45.6 C188.7 31.7, 179.3 18.4, 170.7 6.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M199.4 45.7 C213.6 28.9, 223.1 14, 229.4 7.2 M200.3 46.8 C206 37.8, 212.2 30.4, 229.7 6.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M123 -15.3 C129.7 -14.7, 134.1 -15.6, 137.5 -15.4 M122.4 -15 C127 -14.8, 130.1 -15.4, 137.5 -15.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M130.4 -22.4 C131.4 -17.8, 130.8 -11.7, 128.7 -6.9 M130 -22.5 C130.6 -17.1, 129.3 -12.7, 129.8 -8.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M263.8 -22.5 C267 -21.7, 275 -22.2, 276.7 -22.2 M263.7 -21.7 C268.2 -21.6, 274.5 -21.7, 277.5 -22.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M271.2 -29.6 C268.8 -24.7, 269 -18.2, 270.7 -13.7 M269.9 -29.2 C270.1 -24.8, 270.2 -22.5, 269.8 -14.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M114.8 61.3 C120.1 62.3, 126.1 62.3, 128.8 62 M116.5 62.6 C121 61.5, 124.9 61.9, 130.5 62.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M122.2 54.3 C122 59.4, 122.9 66.4, 122.8 67.7 M122.7 55 C122.5 59.8, 122.7 65.8, 122.8 69.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M269.7 55.2 C275.6 54.9, 282 55.6, 283 56.2 M269.5 55.4 C274.2 55.2, 280 55.4, 283.9 55.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M277.1 48.1 C277.3 54.8, 275.9 59.7, 276.9 62 M277.1 47.8 C276.8 51.2, 277.2 53.1, 277.6 62.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;None of these is clever, and that&#x27;s the point. What separates good software from bad isn&#x27;t cleverness. It&#x27;s the habit of asking, on every change: &lt;em&gt;does this make the system easier to understand and change, and does it fail safely?&lt;/em&gt; The good codebases are made of years of small changes where someone said yes.&lt;/p&gt;
&lt;p&gt;So what&#x27;s the next change you&#x27;ll make, and what would your answer be?&lt;/p&gt;
&lt;div class=&quot;footnote&quot;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&quot;fn:1&quot;&gt;
&lt;p&gt;Both are in &lt;em&gt;Release It!&lt;/em&gt; and worth reading in full. I left them out because this post is about the calls a service makes, not about how it ships or how big it needs to be.&amp;#160;&lt;a class=&quot;footnote-backref&quot; href=&quot;#fnref:1&quot; title=&quot;Jump back to footnote 1 in the text&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>I Tried Building My Own Programming Language</title><link>https://your-moon.github.io/s1-1-interpreter/</link><guid>https://your-moon.github.io/s1-1-interpreter/</guid><pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate><description>&lt;h1 id=&quot;i-tried-building-my-own-programming-language&quot;&gt;I Tried Building My Own Programming Language&lt;a class=&quot;anchor&quot; href=&quot;#i-tried-building-my-own-programming-language&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;When I first learned to program, there was one thing I never noticed. I only figured it out much later.&lt;/p&gt;
&lt;p&gt;Everyone&#x27;s first program is a single line that puts &quot;Hello World&quot; on the screen. You see it work, you feel good, you move on. Nobody asks where those two words came from, or how they got there. And the teachers don&#x27;t explain what actually makes it run, either.&lt;/p&gt;
&lt;p&gt;Some university courses do teach this well, of course. But I never connected the pieces, and I didn&#x27;t really understand the point of what I was doing. That was something else I only realized later.&lt;/p&gt;
&lt;p&gt;I never asked, either. Understanding how two little words — &quot;Hello World&quot; — end up on a screen took me three years.&lt;/p&gt;
&lt;p&gt;What I ended up with is a language whose keywords are in Mongolian, and which runs directly on the CPU:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;extern функц мөр_хэвлэх(м мөр) -&amp;gt; хоосон {}

функц үндсэн() -&amp;gt; тоо {
    мөр_хэвлэх(&quot;Өдрийн мэнд&quot;);
    буц 0;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Өдрийн мэнд
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;(&lt;code&gt;функц&lt;/code&gt; is &lt;em&gt;function&lt;/em&gt;, &lt;code&gt;мөр_хэвлэх&lt;/code&gt; is &lt;em&gt;print a line&lt;/em&gt;, &lt;code&gt;буц&lt;/code&gt; is &lt;em&gt;return&lt;/em&gt;. The output means &quot;Good day.&quot;)&lt;/p&gt;
&lt;p&gt;Something like that.
The first feedback anyone gives on seeing it is, of course:&lt;/p&gt;
&lt;p&gt;Isn&#x27;t this just C with the keywords translated?&lt;/p&gt;
&lt;p&gt;Why would you even build this?&lt;/p&gt;
&lt;p&gt;Why Mongolian?&lt;/p&gt;
&lt;p&gt;None of these can be answered in a single sentence, so this is going to be a long piece.&lt;/p&gt;
&lt;p&gt;One long piece is tiring to read, so I decided to write it in parts.&lt;/p&gt;
&lt;p&gt;Part one: the why, and the work.&lt;/p&gt;
&lt;p&gt;Every programmer has probably written a hello world. I&#x27;d written plenty. But I couldn&#x27;t tell you what actually happens between typing these six lines and seeing «Өдрийн мэнд» on the screen — not the hand-wavy &quot;the computer runs it&quot;, but every step, all the way down to the CPU. That&#x27;s what I set out to learn.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-2 4 644 198&quot; width=&quot;644&quot; role=&quot;img&quot; aria-label=&quot;Six lines of Mon handed to the CPU — but how does it run them?&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M45.1 31.5 C49.5 33.1, 55 37.5, 57.2 41.9 C59.3 46.3, 59.3 53.2, 58 58.1 C56.7 62.9, 53.3 68.1, 49.3 70.9 C45.4 73.7, 39.3 75.4, 34.4 74.9 C29.4 74.4, 23.2 71.4, 19.7 67.8 C16.1 64.3, 13.3 58.7, 13 53.7 C12.7 48.7, 15 41.7, 17.8 37.9 C20.5 34, 24 31, 29.4 30.6 C34.9 30.1, 46.4 33.7, 50.4 35.2 C54.4 36.7, 54 39.4, 53.7 39.5 M44.8 32.2 C49.1 33.7, 52.4 37.6, 54.8 41.8 C57.2 46, 59.7 52.8, 59.1 57.4 C58.5 62, 55.4 66.5, 51.3 69.4 C47.2 72.3, 39.7 74.6, 34.5 74.6 C29.2 74.7, 23.5 73.1, 19.9 69.9 C16.3 66.7, 13.5 60.1, 12.8 55.3 C12 50.4, 12.6 44.9, 15.4 40.9 C18.2 37, 25.1 33.3, 29.7 31.8 C34.4 30.3, 40.8 31.9, 43.4 32 C46 32.1, 45.1 32.3, 45.4 32.5&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M42.4 29.5 C46.9 30.2, 51.6 34.4, 54.4 38.6 C57.1 42.7, 59.3 49.6, 58.9 54.4 C58.6 59.1, 55.7 63.8, 52.2 67.1 C48.7 70.3, 43 73.3, 38 73.7 C33 74.2, 26.4 72.6, 22.2 69.8 C18 67.1, 14.2 61.9, 12.9 57.3 C11.6 52.6, 12.5 46.3, 14.6 42 C16.8 37.7, 21 33.3, 26 31.5 C31 29.8, 41 31.5, 44.7 31.7 C48.3 31.9, 48.1 32.5, 47.9 32.7 M26.8 31.9 C31.1 30, 37.4 29.8, 42.3 30.9 C47.1 32, 53.1 34.2, 55.8 38.3 C58.4 42.5, 58.8 50.5, 58.2 55.8 C57.6 61.1, 55.4 67.2, 52 70.2 C48.5 73.2, 42.6 73.8, 37.6 73.8 C32.6 73.8, 26.1 73.1, 21.9 70.1 C17.8 67.1, 13.7 60.7, 12.6 55.8 C11.6 50.9, 13.1 44.7, 15.7 40.5 C18.3 36.3, 26.3 32.4, 28.2 30.7 C30.2 28.9, 27.7 29.6, 27.5 30&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M26.6 45.4 C27.1 45.1, 28.8 44.9, 29.4 45.2 C30 45.5, 29.7 46.6, 30.1 47.2 C30.4 47.9, 31.5 48.6, 31.4 49 C31.3 49.4, 30 49.5, 29.4 49.8 C28.9 50.1, 28.6 50.6, 28 50.8 C27.5 51, 26.8 51.2, 26.2 50.8 C25.5 50.3, 24.4 48.6, 24.1 48 C23.8 47.4, 24 47.6, 24.4 47.1 C24.8 46.5, 25.9 44.8, 26.4 44.6 C26.8 44.5, 27 45.9, 27.1 46.1 M27.9 45.1 C28.6 45.2, 30.1 46, 30.6 46.3 C31 46.7, 30.7 46.5, 30.7 47.2 C30.7 47.9, 30.8 49.8, 30.7 50.7 C30.5 51.5, 30.6 52.3, 29.8 52.1 C29 52, 26.4 50.1, 25.9 49.8 C25.3 49.5, 26.4 50.6, 26.4 50.3 C26.5 50, 26 48.9, 26.1 48.2 C26.1 47.4, 26.6 46.4, 26.9 46 C27.2 45.5, 27.4 45.5, 27.9 45.6 C28.4 45.6, 29.8 46.4, 29.8 46.1&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M29.6 44.8 C30.3 45.1, 30.5 46.4, 30.8 47 C31.2 47.7, 31.9 48.1, 31.8 48.6 C31.7 49.1, 31.2 49.6, 30.5 50 C29.8 50.3, 28.2 50.4, 27.4 50.6 C26.7 50.8, 26.3 51.5, 25.8 51.3 C25.3 51, 24.7 49.7, 24.6 49.1 C24.5 48.5, 24.5 48.3, 24.9 47.7 C25.4 47.1, 26.3 45.9, 27 45.5 C27.8 45.2, 29 45.7, 29.4 45.6 C29.8 45.5, 29.3 44.8, 29.2 44.9 M28.4 44 C28.7 44.3, 28.8 46.1, 29.4 46.4 C30 46.8, 32 45.6, 32.2 46.2 C32.4 46.7, 31.2 48.8, 30.7 49.8 C30.2 50.7, 30.1 51.6, 29.3 51.9 C28.6 52.2, 26.9 52.2, 26.2 51.6 C25.5 51.1, 25.4 49.4, 24.9 48.8 C24.5 48.2, 23.3 48.6, 23.5 48.2 C23.6 47.8, 25 47, 25.7 46.3 C26.5 45.6, 27.5 44.2, 28 44 C28.5 43.7, 28.7 44.2, 28.8 44.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M43.7 45.5 C44.5 45.2, 45.4 44.2, 46.1 44.4 C46.8 44.6, 47.6 46.1, 47.8 46.7 C48 47.3, 47.5 47.3, 47.2 48 C46.8 48.8, 46.3 50.8, 45.7 51.2 C45 51.6, 43.9 50.5, 43.3 50.5 C42.7 50.4, 42.4 51.2, 42 50.7 C41.6 50.3, 41 48.3, 40.8 47.6 C40.6 47, 40.4 46.9, 40.8 46.6 C41.1 46.2, 42.3 45.9, 42.9 45.6 C43.5 45.3, 44.6 44.6, 44.6 44.7 M45.2 43.8 C45.5 43.7, 44.5 44.8, 44.5 45.5 C44.6 46.1, 45.4 47.4, 45.7 47.8 C46 48.3, 46.4 47.8, 46.4 48.2 C46.5 48.6, 46.4 49.6, 45.8 50.2 C45.2 50.7, 43.5 51.6, 42.8 51.4 C42.2 51.3, 42 50.2, 41.6 49.3 C41.3 48.5, 40.9 46.9, 40.9 46.3 C40.8 45.6, 41.2 45.8, 41.6 45.6 C42.1 45.4, 43 44.9, 43.6 44.9 C44.2 45, 45 45.8, 45.2 45.9&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M43.9 45 C44.3 45, 45.1 45.5, 45.5 46.1 C45.9 46.7, 46.2 47.7, 46.4 48.4 C46.7 49.2, 47.2 50.3, 47 50.7 C46.7 51.2, 45.6 51.1, 44.7 51.1 C43.9 51.2, 42.7 51.4, 42.1 50.9 C41.5 50.4, 41.3 48.8, 41.2 48.2 C41.1 47.6, 41.2 47.7, 41.2 47.3 C41.3 46.9, 41.2 46, 41.6 45.7 C42.1 45.5, 43.5 45.7, 44.1 45.6 C44.6 45.4, 44.8 44.9, 45.1 45 M43.4 45.1 C43.9 45.3, 45.9 47, 46.4 47.4 C46.8 47.8, 46 47, 46.1 47.5 C46.1 48, 46.9 49.4, 46.6 50.2 C46.2 50.9, 44.6 52, 43.9 52 C43.3 51.9, 43.3 50.2, 42.7 49.9 C42 49.6, 40.1 50.7, 40 50 C39.9 49.4, 41.8 46.8, 42.2 45.9 C42.6 44.9, 42.1 44.2, 42.4 44.2 C42.8 44.3, 44 46.1, 44.2 46.3 C44.5 46.5, 43.6 45.3, 43.8 45.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M28 62 C34.8 66.1, 39.3 65.5, 45.7 63 M27 61.2 C35.6 64.5, 39.3 67, 44.1 61.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M38 74.5 C36.8 100.5, 35.7 125.5, 36.9 140.2 M36.6 74.7 C35.7 97.5, 35.9 119.9, 35.3 140.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M34.6 140.4 C28.9 156.7, 20.5 176.3, 14.3 184.3 M35.5 139.9 C31.9 150.2, 26.9 159.6, 16.3 185.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M35.1 140.3 C45 158.8, 52.7 176.7, 55.7 186.5 M36.4 139.1 C42.3 153.3, 46.3 165.9, 55.3 185.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M35.7 92.2 C28.6 102.8, 20.6 116.7, 15.1 120.6 M35.3 92.3 C27.9 103.1, 21.9 113.4, 14.3 121.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M36.3 92.1 C58.9 90.6, 77.6 88.2, 90.5 84.8 M36.2 91.5 C47.3 88.9, 59 87.8, 91.3 84.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M90.1 20.3 C188.1 24.8, 281 20.7, 350.9 20.6 C362.9 31.2, 375.9 45.1, 384.2 51.7 C380.6 86.6, 384.9 126.6, 382.6 150.9 C299.1 148.7, 221.6 149.8, 93.8 151.8 C92.9 113.5, 93.5 78.1, 88.6 20.2&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M92.7 20 C193.8 18.6, 292.6 17.8, 351.9 19.2 M91.3 20.5 C160.8 20.9, 228.8 21.5, 352.3 20.4 M353.5 19 C361.7 29.7, 371.5 38.5, 382.4 48.4 M351.6 20.4 C364 30.9, 374 41.1, 382.8 50.2 M381.8 51.2 C381.3 81.7, 380.2 114.9, 380 151.5 M382.2 49.6 C381.5 79.1, 381.4 107.7, 383 150.9 M383.4 149.6 C312.4 148.7, 242.9 148.8, 91.1 151.2 M382.4 150.7 C315.2 150.7, 249.9 151.5, 91.6 149.5 M93.2 149.1 C89.8 116.6, 90.5 79.6, 91.8 19.6 M91.4 149.3 C92.9 115.1, 92 81.4, 92.7 20.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M351.3 19.9 C351.3 24.6, 347.7 43.9, 352.7 48.9 C357.7 53.9, 376.4 49.4, 381.3 49.8 M353.2 18.8 C353 23.6, 347 44.5, 352.1 49.9 C357.2 55.2, 378.8 51.1, 383.8 51&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;108&quot; y=&quot;61.0&quot;&gt;функц үндсэн() -&amp;gt; тоо {&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;108&quot; y=&quot;85.0&quot;&gt;    мөр_хэвлэх(&quot;Өдрийн мэнд&quot;);&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;108&quot; y=&quot;109.0&quot;&gt;}&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M394.1 85.7 C430.5 83.5, 466.2 85.9, 491.2 86.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;path d=&quot;M478.1 79.4 C483.1 80.4, 487.5 84.4, 491.5 86.2 M490.7 83.9 C487.5 86.4, 486.6 88.4, 480 91.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:44px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;444&quot; y=&quot;51.0&quot;&gt;?&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M523 42.3 C549.8 37, 573.8 38.7, 605.6 41.6 C609.9 38.7, 611.8 39.9, 613.7 50.7 C613.3 76.4, 616.8 94.1, 613.8 121.8 C613.5 129.5, 610.8 130.2, 604.2 131.4 C571.9 126.6, 545.2 130.4, 523.9 128.4 C517.1 131.2, 515.2 124.5, 517 121.9 C511.2 104, 511 88.8, 517.4 52.3 C511 42.4, 516.9 42.1, 525.4 39.5&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M523.3 40.5 C552.7 39.8, 583.5 38.9, 602 42 M524.9 39.6 C555.1 39.8, 585.7 38.7, 604.4 40.9 M604 40 C609.2 39.2, 615 44.1, 614.7 51.9 M604.6 38.1 C612.8 39.9, 614.2 41.5, 614.1 47.8 M615.6 51.1 C615 66.3, 615.5 84.4, 613.1 118.2 M614.7 49.3 C613.6 63.6, 613.4 79, 614.2 119.9 M614 120 C614.8 126.2, 612.1 131.4, 602.2 129.2 M613.9 119.1 C612.7 124.6, 609.6 130.8, 603.1 129.2 M602.7 128.7 C583.4 129, 568 131.5, 525.1 131.4 M604.7 130.1 C577.1 130.6, 552.2 129.4, 524.5 129.4 M524 130 C516.9 128.1, 513.3 125, 515.2 121.8 M523.7 129.7 C515.9 129.3, 513.9 124.7, 513.2 121 M513 119.5 C513.3 98.5, 514.9 74.3, 513.5 48.7 M513.2 119.2 C514 95.5, 513.1 70.8, 514.2 50.6 M514 50 C515.1 44.6, 518.1 38.5, 524.1 39.8 M515 49.8 C513.4 42.1, 515.3 41.6, 524.2 40.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M529.9 40.2 C529.3 36.2, 530.1 30.1, 529.7 28.1 M529.9 40.5 C530.5 37.4, 529.8 34, 529.7 27.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M530.3 130.1 C529.4 134.1, 530.5 138.4, 530.5 141 M530.4 130 C529.8 134.2, 529.8 137.7, 530.3 141.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M514.6 55.1 C508.9 55.9, 505.8 54.7, 500.9 55.3 M513.7 54.5 C509.7 54.4, 504.6 55.6, 501.7 54.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M615 55.9 C619.1 54.3, 622.7 54.7, 626.6 55 M613.5 54.8 C617.9 54.9, 622.1 54.6, 625.8 54.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M551.9 40.8 C553.7 35.9, 553.1 30.7, 552 26.9 M553 40.5 C553.2 35.4, 552.8 30.5, 553.4 27.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M552.3 130.7 C553.7 133.8, 553.4 139.1, 552.9 142.2 M553.6 130 C552.6 133.3, 552.8 136.5, 552.8 142&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M513.6 75.7 C510.1 75.4, 505.6 75.1, 502.7 74.1 M513.9 74.6 C510.1 75.3, 505.8 74.4, 502.4 75.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M614 75.6 C619.3 74.3, 624.2 75.4, 625.1 75.4 M614.4 75.3 C618.8 75.5, 623.6 74.8, 625.8 75.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M576.3 40.5 C576.8 36, 575.1 31.6, 576 27.3 M575.8 39.8 C575.4 36.5, 576.3 34.3, 576.4 28.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M576.7 130.4 C576.8 133.9, 575.4 140, 576.8 142.6 M576.3 130.5 C575.8 133.2, 576.1 137.8, 575.8 141.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M515 95.4 C510.3 95.6, 504.8 96.1, 501.3 94.5 M513.6 95.1 C509.8 94.6, 505.1 94.5, 502.4 94.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M613 95.3 C619.5 94.5, 623.4 94, 626.1 95.8 M614.2 94.6 C617.3 94.9, 619.2 95, 625.8 95&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M598.3 40.2 C600.1 36.1, 599.7 30, 599.9 27.7 M598.5 40.3 C598.7 36.5, 598.5 33.3, 599.4 28.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M598.7 131.1 C598.7 133.6, 598.4 138.4, 599.2 141.4 M599.5 130.6 C598.6 133.6, 599.1 136.6, 599.5 141.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M514 116 C509.2 115.3, 504.6 114.4, 503 115.7 M513.8 115.1 C510.2 114.6, 506.4 114.8, 501.9 115.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M614.4 115.9 C618.5 114.2, 623.4 114.7, 625.5 114.6 M614.3 114.6 C618.8 114.5, 622.7 114.9, 626.5 115.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M548.8 73.6 C549.3 73.7, 549.4 73.4, 549.8 73.9 C550.2 74.4, 551.2 75.8, 551.1 76.4 C551 77, 549.6 76.8, 549.2 77.3 C548.7 77.9, 548.8 79.5, 548.3 79.5 C547.9 79.6, 546.9 78.1, 546.2 77.5 C545.6 76.9, 544.6 76.4, 544.5 75.9 C544.4 75.4, 545.3 74.8, 545.7 74.4 C546.1 74.1, 546.4 73.9, 546.9 73.9 C547.4 73.8, 548.4 74.2, 548.7 74.3 C549.1 74.3, 549 74.2, 549 74.1 M548 71.7 C548.3 71.8, 548.9 72.6, 549.5 73.1 C550 73.6, 551.1 74.2, 551.1 74.8 C551.2 75.3, 550.1 75.8, 549.9 76.5 C549.7 77.1, 550.7 78.2, 550.1 78.7 C549.6 79.2, 547.3 79.3, 546.7 79.3 C546.1 79.3, 546.7 79.2, 546.3 78.7 C545.9 78.1, 544.4 76.8, 544.2 75.9 C544.1 75, 544.9 74, 545.7 73.5 C546.5 73, 548.6 73, 548.8 72.8 C549.1 72.7, 547 72.2, 547.1 72.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M549.6 73.2 C550.2 73.4, 550.8 74.8, 551 75.3 C551.1 75.9, 550.7 76.3, 550.5 76.7 C550.2 77.1, 549.7 77.4, 549.4 77.7 C549 77.9, 549.2 78, 548.6 78 C547.9 77.9, 546.1 77.6, 545.6 77.4 C545.1 77.1, 545.5 76.8, 545.5 76.4 C545.6 76, 545.9 75.6, 546.1 75 C546.2 74.4, 545.8 73.1, 546.4 72.8 C547 72.5, 549 73, 549.7 73.3 C550.4 73.6, 550.8 74.4, 550.7 74.6 M548.8 72.3 C549.4 71.8, 550.8 72.1, 551.1 72.7 C551.4 73.3, 550.6 75.5, 550.7 76 C550.7 76.6, 551.4 75.6, 551.3 76 C551.3 76.4, 550.8 77.8, 550.2 78.3 C549.6 78.8, 548.5 78.9, 547.6 79 C546.7 79.2, 545.3 79.4, 544.7 79.1 C544.2 78.8, 544.2 77.9, 544.2 77.2 C544.1 76.6, 544 75.8, 544.3 75.1 C544.7 74.3, 545.9 73.1, 546.3 72.7 C546.8 72.3, 546.8 72.6, 546.9 72.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M581.9 73.7 C582.3 74.1, 582.2 74.4, 582.3 75.1 C582.4 75.8, 582.4 77.4, 582.5 77.9 C582.6 78.4, 583 78.2, 582.6 78.4 C582.3 78.6, 581.3 79.2, 580.5 79 C579.6 78.8, 578.2 77.7, 577.6 77.1 C577 76.6, 576.7 76.3, 576.6 75.8 C576.5 75.3, 576.3 74.5, 576.7 74.1 C577.2 73.7, 578.7 73.4, 579.5 73.3 C580.2 73.2, 580.7 73.4, 581.2 73.4 C581.7 73.3, 582.1 72.9, 582.3 73.1 M578.3 73.1 C579.2 73, 581.8 71.7, 582.4 72 C583 72.4, 582.2 74.5, 582.1 75.3 C581.9 76.2, 581.6 76.3, 581.6 77.1 C581.6 77.9, 582.4 79.8, 582.1 80 C581.8 80.1, 580.5 78.5, 579.7 78.1 C579 77.8, 577.9 78, 577.6 77.8 C577.3 77.6, 578.3 77.8, 578.1 77 C577.9 76.1, 576.1 73.8, 576.5 72.9 C576.9 72.1, 580.1 72.1, 580.5 71.9 C580.8 71.8, 578.8 71.8, 578.5 72&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M581.8 73.1 C582.6 73.4, 583.4 73.7, 583.6 74.3 C583.8 74.8, 583.4 75.8, 583.1 76.5 C582.8 77.3, 582.3 78.3, 581.8 78.6 C581.3 79, 580.5 78.7, 579.9 78.8 C579.2 78.9, 578.5 79.5, 577.9 79.3 C577.3 79, 576.4 78.3, 576.1 77.5 C575.9 76.7, 575.9 75.3, 576.4 74.5 C576.8 73.6, 578 73, 579 72.7 C580 72.4, 581.8 72.6, 582.4 72.9 C583 73.2, 582.7 74.2, 582.6 74.4 M579.8 73.1 C580.1 73, 580.5 72.7, 581.1 73.4 C581.7 74.1, 583.2 76.8, 583.6 77.3 C584 77.8, 583.7 76.4, 583.3 76.6 C582.8 76.8, 581.3 78.5, 580.8 78.7 C580.3 78.8, 580.9 77.8, 580.1 77.6 C579.2 77.4, 576.5 77.9, 575.8 77.4 C575.1 77, 575.6 75.6, 575.8 74.8 C576.1 74.1, 576.1 73.3, 577 72.8 C578 72.2, 580.9 71.6, 581.6 71.7 C582.2 71.8, 581.3 72.9, 580.9 73.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M552 100 C558.8 103.7, 569.2 105.4, 577.7 99.5 M552.7 98.2 C562.2 106.7, 568 105.6, 576.5 99.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;564&quot; y=&quot;164.0&quot;&gt;CPU&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;Mon is where that question ended up. It started much smaller. In my first year I built a little interpreted language called &lt;strong&gt;Cecile&lt;/strong&gt;, and in doing so I discovered that the most boring program you know — &quot;hello world&quot; — is quietly hiding almost everything interesting about computers. This series follows the whole road: Cecile first, then Mon, then all the way down to the CPU.&lt;/p&gt;
&lt;h2 id=&quot;so-why-do-this-at-all&quot;&gt;So — why do this at all?&lt;a class=&quot;anchor&quot; href=&quot;#so-why-do-this-at-all&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I was a second-year student.&lt;/p&gt;
&lt;p&gt;I kept coming back to the same question: &lt;em&gt;how am I going to get a job, and what do I actually have that sets me apart from the next student?&lt;/em&gt; I had zero work experience. Sitting there empty-handed, I figured I had to make something, and I realized I needed one real thing I could point at and say: &lt;strong&gt;I built that.&lt;/strong&gt;&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-27 -16 597 314&quot; width=&quot;597&quot; role=&quot;img&quot; aria-label=&quot;The 1am thought&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M26 6 C4.4 23.9, 1.2 36.4, 27 51.2 C16.4 36.9, 16.1 19.3, 24.9 4.6 C26 6, 26 6, 26 6&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M26 6 C-0.5 22.1, 0 36.5, 26.2 51.6 M27.8 5.9 C2.3 20.2, -1.2 35.5, 25.9 48 M26 50 C14 36.5, 14 21.7, 25.4 4.4 M25.5 48.6 C13.7 36.6, 16.4 22, 27.1 5.6 M26 6 C26 6, 26 6, 26 6 M26 6 C26 6, 26 6, 26 6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M71.4 127.8 C75.5 129, 80.7 132.8, 83.6 136.6 C86.4 140.4, 89 146, 88.7 150.6 C88.4 155.1, 85.2 160.4, 81.7 163.8 C78.2 167.2, 72.5 170.5, 67.7 171 C62.8 171.5, 56.4 169.8, 52.6 166.7 C48.9 163.7, 46 157.3, 45.1 152.6 C44.1 148, 45 143.2, 46.8 138.9 C48.7 134.6, 51.1 128.6, 56.2 127.1 C61.3 125.6, 73.3 128.7, 77.4 129.8 C81.6 130.9, 81.3 133.4, 81 133.7 M69 127.5 C73.8 127.9, 81.3 129.5, 84.5 133.1 C87.7 136.6, 88.1 143.8, 88 148.9 C87.9 154, 87 160, 83.7 163.7 C80.4 167.5, 72.8 170.7, 68 171.3 C63.2 171.9, 58.9 169.9, 54.9 167.2 C50.8 164.4, 45.3 159, 43.7 154.6 C42.2 150.3, 43.7 145.6, 45.6 141 C47.5 136.5, 51 129.9, 55.1 127.5 C59.3 125, 68.2 126.6, 70.6 126.4 C72.9 126.2, 69.5 126, 69.2 126.3&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M59.9 127 C64 125.4, 70.1 125.3, 74.5 127.3 C78.9 129.3, 83.9 134.6, 86.2 139 C88.4 143.4, 89.1 149.1, 88 153.6 C86.9 158.1, 83.4 163.2, 79.7 165.8 C75.9 168.4, 70.5 169.4, 65.6 169.2 C60.6 169.1, 53.6 168, 50 164.9 C46.3 161.7, 44 155.5, 43.7 150.5 C43.4 145.6, 45.3 139.3, 48 135.4 C50.7 131.5, 57.5 128.6, 59.8 127.1 C62.1 125.7, 61.6 126.3, 61.9 126.7 M71.5 125.5 C75.8 126.1, 82.1 131, 84.8 134.8 C87.4 138.6, 87.7 143.3, 87.3 148.2 C87 153.2, 85.7 160.8, 82.5 164.5 C79.2 168.2, 72.5 169.8, 67.8 170.3 C63.1 170.7, 58.5 170, 54.4 167.3 C50.4 164.5, 45.4 158.5, 43.7 153.8 C42 149.1, 42.2 143.6, 44.3 139.2 C46.5 134.7, 52.1 129, 56.7 127 C61.4 125, 69.5 126.9, 72.1 127.1 C74.7 127.3, 72.8 127.9, 72.4 128.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M53.5 141.5 C56.6 142.7, 58.8 142.2, 61.4 142.5 M53.8 141.9 C55.7 141.6, 57.2 141.8, 60.9 142&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M70.7 141.5 C73.7 142.1, 76 142.4, 77.5 141.8 M71.1 142.3 C72.7 141.8, 74.9 142.1, 78.3 142.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M58.8 155.9 C64.4 155.6, 66.6 157.9, 72.9 158.2 M58.5 157 C63.6 156.7, 68.4 157.6, 72.8 157.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M66.3 168.3 C67 190.6, 64.5 212.8, 67.2 235.8 M66.1 169.2 C67.1 195.5, 66.3 221, 66.8 237&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M66.9 234.2 C61.6 248.7, 53.5 262.9, 44.6 280 M65 236.4 C60.4 247.6, 55.7 259.3, 45.8 281.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M67.5 234.1 C73.8 250.5, 78.7 263.1, 86 282.2 M65.9 235.6 C72.4 250.5, 78.1 265.3, 86.8 281.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M64.1 190 C61.3 195.5, 53.6 205.4, 45.4 216.3 M66.8 188.8 C58.3 199.5, 50.5 209.5, 43.8 218&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M66.9 187.2 C73.8 185, 103.2 182.9, 107.1 175.2 C111 167.5, 93.1 146.9, 90.2 141 M65.9 189.4 C72.7 186.9, 102.8 182, 106.8 173.6 C110.7 165.3, 92.4 144.7, 89.6 139.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M351.2 5.5 C366.8 6.8, 381.9 10, 394.2 13.9 C406.5 17.8, 417 23.2, 424.9 28.9 C432.9 34.6, 439.2 41.5, 441.8 48 C444.5 54.4, 443.7 61.2, 440.9 67.8 C438.1 74.4, 433.2 81.7, 424.9 87.4 C416.7 93.1, 404.4 98, 391.5 102 C378.7 106, 363.1 109.4, 347.8 111.5 C332.5 113.6, 316.2 114.6, 299.7 114.6 C283.3 114.5, 264.3 113.2, 248.9 111 C233.4 108.9, 219.4 105.8, 207.2 101.7 C194.9 97.7, 183.5 92.6, 175.4 86.8 C167.4 81, 161.5 73.5, 158.7 67.1 C155.9 60.7, 155.8 54.8, 158.6 48.5 C161.3 42.2, 167 35, 175.2 29.3 C183.4 23.6, 195.2 18.5, 208 14.3 C220.8 10.1, 236.4 6.2, 252 4 C267.5 1.8, 284.4 1.1, 301.3 1.2 C318.2 1.3, 344.1 3.7, 353.5 4.7 C362.8 5.7, 358.1 6.3, 357.4 7.2 M367.2 7 C382.4 9.3, 396.9 15.7, 407.8 20.5 C418.6 25.3, 426.1 29.9, 432.2 35.7 C438.4 41.5, 443.9 48.9, 444.5 55.5 C445.2 62, 441.3 68.6, 436.4 75.1 C431.5 81.6, 425.2 89, 415.3 94.3 C405.3 99.7, 390.5 103.9, 376.4 107.2 C362.3 110.5, 346.4 112.9, 330.6 114.2 C314.8 115.4, 298 115.8, 281.7 114.8 C265.3 113.7, 247.3 111, 232.6 107.9 C217.9 104.7, 204.6 100.7, 193.5 95.8 C182.3 90.8, 172.4 84.3, 165.9 78.4 C159.4 72.5, 154.9 66.4, 154.5 60.3 C154.1 54.3, 158.6 48.1, 163.7 41.9 C168.8 35.6, 175.4 27.9, 185.2 22.7 C195.1 17.6, 209 14.3, 222.9 11.1 C236.7 7.9, 252 5.4, 268.1 3.6 C284.2 1.8, 302.9 -0.5, 319.5 0.3 C336.2 1.1, 360.2 7.2, 367.8 8.6 C375.3 10, 366.3 7.9, 365 8.7&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M324.9 2.6 C341 2.8, 357.8 5.7, 371.9 8.6 C386 11.5, 399.1 15.3, 409.5 20.1 C420 24.9, 429 31.3, 434.7 37.5 C440.5 43.6, 444 50.3, 444.1 57.1 C444.2 63.8, 440.8 71.9, 435.4 77.9 C430 84, 422.2 88.7, 411.7 93.5 C401.1 98.3, 386.5 103, 372.1 106.6 C357.8 110.1, 341.8 113.7, 325.6 115 C309.4 116.3, 291.2 115.5, 275.1 114.3 C258.9 113.1, 242.9 111.1, 228.9 107.8 C214.9 104.4, 201.8 99.2, 191.1 94.2 C180.5 89.3, 170.6 84.3, 164.8 78.2 C159 72.1, 156.2 64.5, 156.2 57.8 C156.2 51.1, 159.1 44.2, 164.6 38.2 C170 32.2, 178.7 26.6, 189 21.8 C199.2 17, 212 13, 226.3 9.6 C240.5 6.2, 256.8 2.7, 274.6 1.4 C292.4 0.1, 321.8 1.2, 332.9 1.8 C344 2.4, 341.7 4, 341.1 5.2 M255.5 3.9 C269.7 1, 286.9 1.5, 303 1.8 C319 2, 336.4 3.2, 351.9 5.6 C367.5 7.9, 383.9 11.5, 396.4 15.8 C408.9 20.2, 419 25.8, 426.9 31.4 C434.7 37.1, 441.2 43.6, 443.6 49.9 C446 56.2, 444.9 62.8, 441.5 69 C438 75.2, 431.8 81.6, 423 87 C414.3 92.4, 401.5 97.3, 388.7 101.5 C376 105.7, 362 110.1, 346.5 112.2 C330.9 114.4, 311.9 114.8, 295.3 114.4 C278.7 114.1, 261.7 112.4, 246.7 110.3 C231.8 108.3, 217.4 106.2, 205.4 101.9 C193.3 97.7, 182.9 90.6, 174.7 84.8 C166.4 79.1, 158.8 73.7, 156 67.4 C153.2 61.1, 154.3 53.5, 157.7 46.9 C161.1 40.4, 167.7 33.6, 176.4 28.2 C185 22.8, 196.3 18.8, 209.4 14.7 C222.6 10.6, 247.4 5.3, 255 3.5 C262.7 1.7, 254.8 3.1, 255.3 3.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M212.5 113.6 C214.5 113.6, 216 113.8, 217.3 115.2 C218.7 116.6, 220.7 120.2, 220.6 122 C220.4 123.8, 217.8 124.7, 216.5 126.1 C215.1 127.6, 214.4 130.2, 212.4 130.6 C210.5 131, 206.6 129.4, 204.6 128.5 C202.7 127.7, 201.4 127.3, 200.8 125.5 C200.1 123.8, 199.9 119.6, 200.6 117.9 C201.3 116.2, 202.7 115.8, 205 115.2 C207.4 114.6, 212.6 114.2, 214.6 114.2 C216.5 114.2, 217.1 115.2, 216.8 115.3 M211.2 114 C213 114.2, 216.5 114.1, 218 115.6 C219.5 117, 220.4 120.5, 220.3 122.5 C220.1 124.6, 218.7 126.7, 217.3 127.9 C215.9 129, 214.2 129.4, 211.8 129.4 C209.5 129.4, 205 128.7, 203.2 127.9 C201.5 127.1, 201.8 126.3, 201.5 124.6 C201.3 123, 200.8 119.7, 201.8 118.1 C202.7 116.5, 205.6 115.7, 207.3 115 C209 114.2, 210.9 114.1, 211.9 113.8 C212.8 113.4, 213 112.7, 213.2 113&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M210.5 114.2 C212.5 114.1, 214.9 113.9, 216.5 115.2 C218.1 116.5, 219.8 120.3, 220 122.2 C220.1 124.2, 219 125.7, 217.5 126.9 C216.1 128.2, 213.2 129.4, 211.1 129.9 C209.1 130.3, 207.1 130.3, 205.3 129.5 C203.5 128.7, 201.1 126.5, 200.3 124.9 C199.4 123.3, 199.6 121.4, 200.4 119.9 C201.2 118.3, 203.1 116.5, 205.2 115.5 C207.2 114.5, 211.1 113.8, 212.5 113.6 C214 113.4, 214 114.1, 213.9 114.4 M212.7 112.1 C214.5 112.6, 215.8 115.6, 217.1 117.1 C218.4 118.7, 220.3 119.8, 220.5 121.6 C220.7 123.4, 220.2 126.9, 218.3 128.2 C216.5 129.5, 211.8 129.1, 209.5 129.4 C207.2 129.7, 206.1 131, 204.7 129.9 C203.3 128.7, 201.5 124.4, 201.1 122.5 C200.7 120.6, 201.6 120.1, 202.2 118.6 C202.7 117.1, 202.6 114.5, 204.4 113.5 C206.2 112.6, 211.5 112.9, 212.9 112.6 C214.2 112.4, 212.4 111.7, 212.5 112.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M141.4 123.5 C142.5 123.8, 144.4 124.4, 145.2 125.2 C146 126, 146.2 127.1, 146.2 128.2 C146.1 129.2, 145.9 130.7, 144.8 131.6 C143.7 132.4, 141 133.2, 139.5 133.1 C137.9 133.1, 136.4 132.2, 135.5 131.4 C134.7 130.6, 134.3 129.5, 134.3 128.4 C134.3 127.3, 134.7 125.5, 135.3 124.8 C135.9 124.1, 136.6 124.3, 137.9 123.9 C139.1 123.5, 142 122.5, 142.7 122.5 C143.5 122.6, 142.3 124, 142.2 124.3 M141 122.1 C141.7 122.4, 141.8 124.5, 142.5 125.6 C143.3 126.7, 145.1 127.7, 145.4 128.8 C145.8 129.9, 145.3 131.4, 144.7 132.2 C144.1 133, 143.3 133.4, 142 133.6 C140.6 133.8, 138.1 134.2, 136.8 133.5 C135.6 132.9, 135.1 130.7, 134.6 129.6 C134.1 128.6, 133.4 128.2, 133.8 127.3 C134.3 126.4, 136.2 124.9, 137.2 124.1 C138.3 123.3, 139.4 122.8, 140 122.5 C140.7 122.2, 141.3 121.9, 141.2 122.1&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M140.1 122.1 C141.4 122.2, 143.1 123.7, 144.2 124.8 C145.3 125.9, 146.6 127.6, 146.7 128.5 C146.9 129.4, 145.8 129.2, 145 130.1 C144.2 130.9, 142.9 133.2, 141.7 133.6 C140.4 134, 138.7 133.4, 137.5 132.7 C136.3 132, 135 130.2, 134.5 129.2 C133.9 128.3, 133.8 127.9, 134.3 126.9 C134.9 125.8, 136.5 123.5, 137.8 122.9 C139 122.2, 141.3 122.9, 142 123 C142.8 123.2, 142.2 123.5, 142.1 123.7 M138.8 123.1 C139.9 122.5, 140.2 123.5, 140.9 123.8 C141.7 124.1, 142.7 124, 143.3 124.8 C143.9 125.6, 144.3 127.7, 144.6 128.7 C144.9 129.7, 145.6 130.1, 145.2 130.8 C144.8 131.5, 143.5 132.7, 142.1 133 C140.7 133.4, 137.9 133.7, 136.7 132.9 C135.5 132.1, 135.5 129.4, 134.9 128.4 C134.3 127.4, 132.8 127.5, 133.2 126.9 C133.6 126.3, 136.3 125.5, 137.2 124.8 C138.1 124.2, 138.5 123.2, 138.7 122.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;300&quot; y=&quot;46.8&quot;&gt;how do I get a job?&lt;/tspan&gt;&lt;tspan x=&quot;300&quot; y=&quot;69.3&quot;&gt;what sets me apart?&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M528.7 59.8 C534.6 61.1, 542.4 65.9, 546.4 71.6 C550.5 77.2, 552.8 86.5, 553 93.7 C553.1 100.9, 551 109.3, 547.4 114.9 C543.8 120.4, 537.4 125.1, 531.3 127.1 C525.2 129.1, 516.9 129, 510.8 127.1 C504.6 125.2, 498.3 121.1, 494.5 115.6 C490.7 110.1, 488.2 101, 487.8 94.1 C487.4 87.2, 488.6 79.7, 492.2 74.1 C495.7 68.6, 503.1 63.2, 509.4 60.8 C515.7 58.4, 526.3 59.5, 530 59.8 C533.7 60.1, 531.7 61.8, 531.6 62.7 M519.9 59.2 C525.8 58.9, 534.1 62.2, 539.3 66.5 C544.6 70.9, 549.5 78.6, 551.5 85.1 C553.6 91.7, 553.6 99.5, 551.4 105.6 C549.3 111.8, 544.2 118.1, 538.6 121.8 C533 125.5, 524.4 127.8, 517.9 127.9 C511.5 128.1, 504.7 127.2, 499.9 122.9 C495.1 118.6, 490.9 109, 489.3 102.3 C487.7 95.6, 488.6 89.2, 490.6 82.9 C492.5 76.5, 495.7 67.9, 500.7 64.1 C505.8 60.2, 517.4 60.6, 520.8 59.6 C524.2 58.6, 520.7 57.6, 520.9 58.1&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M521.7 58.3 C527.8 58.2, 534.9 62.4, 539.9 67 C544.9 71.5, 550.1 78.7, 551.7 85.4 C553.4 92.2, 551.9 101, 549.7 107.4 C547.5 113.7, 543.8 119.9, 538.6 123.4 C533.5 127, 525.2 129.2, 518.9 128.7 C512.5 128.3, 505.4 125.1, 500.4 120.7 C495.4 116.3, 490.8 109, 489 102.4 C487.2 95.7, 487.5 87.1, 489.8 80.7 C492 74.4, 496.1 67.6, 502.5 64.2 C508.8 60.8, 522.8 60.6, 527.9 60.2 C533 59.9, 533.3 61.6, 533.2 62.1 M507.4 63 C512.7 60.3, 521.3 59.2, 527.4 60.4 C533.5 61.7, 539.9 65.8, 544.1 70.8 C548.3 75.7, 551.6 83, 552.4 89.9 C553.2 96.8, 552.5 106.5, 549.1 112.3 C545.7 118.2, 537.9 122.5, 531.8 125 C525.7 127.5, 518.6 128.4, 512.3 127.2 C506 126.1, 498.4 122.9, 494 117.8 C489.6 112.8, 486.3 103.8, 486 97 C485.7 90.2, 488.9 82.6, 492.4 76.9 C495.9 71.2, 504.5 64.8, 506.9 62.5 C509.3 60.2, 506.6 62.8, 506.6 63&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M518.5 94.1 C520.9 92.2, 524.6 86.9, 528.8 78.5 M519.8 93.9 C523.6 89, 525.7 82.3, 528.7 80&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M518.8 94 C519.1 87.7, 521.8 81.5, 521.7 68 M520.7 93.1 C519.1 88.3, 520.7 80.7, 519.2 66&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;520&quot; y=&quot;152.0&quot;&gt;01:00&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;So I went looking for a project.&lt;/p&gt;
&lt;p&gt;The first goal was honestly that shallow — find something impressive enough to help me get hired. I was scrolling through the &lt;a href=&quot;https://github.com/codecrafters-io/build-your-own-x&quot;&gt;build-your-own-x&lt;/a&gt; repo (a big list of &quot;build your own git / database / regex engine / …&quot; guides) when one line stopped me cold: &lt;strong&gt;build your own compiler / interpreter.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I didn&#x27;t fully know what those words meant. That was the point. It just looked interesting.&lt;/p&gt;
&lt;h3 id=&quot;just-because-it-looked-interesting&quot;&gt;&quot;Just because it looked interesting?&quot;&lt;a class=&quot;anchor&quot; href=&quot;#just-because-it-looked-interesting&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Yes. And because it smelled like the kind of project where you accidentally learn ten other things on the way to the one thing.&lt;/p&gt;
&lt;p&gt;Here&#x27;s the belief that pulled me in, and I still hold it: &lt;strong&gt;the way code runs is the most mysterious, most fundamental piece of software there is.&lt;/strong&gt; It grew up right alongside the computer itself. Strip it away and the word &quot;software&quot; stops meaning anything — there&#x27;s nothing left to &lt;em&gt;write&lt;/em&gt; software in. Every app, every website, every game you&#x27;ve ever touched sits on top of some program whose only job is to take human-ish text and turn it into something a chip will do. I had used that machinery every day for years and had no idea how it worked.&lt;/p&gt;
&lt;p&gt;At some point, I figured, you have to look inside.&lt;/p&gt;
&lt;p&gt;I also knew, without being able to explain why yet, that this was going to hurt. Compilers sit on top of half of computer science at once — grammars, parsing, data structures, memory, a little of how the CPU itself thinks. Which was exactly the appeal. Hard thing, huge surface area, lots to learn.&lt;/p&gt;
&lt;p&gt;For something that hard, I didn&#x27;t want to flail — I wanted structure. So I did the un-glamorous thing and bought a book.&lt;/p&gt;
&lt;h2 id=&quot;the-book-crafting-interpreters&quot;&gt;The book: &lt;em&gt;Crafting Interpreters&lt;/em&gt;&lt;a class=&quot;anchor&quot; href=&quot;#the-book-crafting-interpreters&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://craftinginterpreters.com&quot;&gt;&lt;em&gt;Crafting Interpreters&lt;/em&gt;&lt;/a&gt; by Robert Nystrom (finished in 2020) deserves every bit of praise it gets. It&#x27;s easy for readers to follow, it&#x27;s full of hand-drawn diagrams, and — rare for a technical book — it&#x27;s genuinely &lt;em&gt;fun&lt;/em&gt; to read. If you want to learn this topic, start here. I mean it.&lt;/p&gt;
&lt;p&gt;The format is simple: you don&#x27;t read &lt;em&gt;about&lt;/em&gt; interpreters, you build one, chapter by chapter. Each chapter hands you code, an explanation, and pictures, and by the end you have a real, working language. The book comes in two halves, and the jump between them is the whole education.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Part 1 — A Tree-Walk Interpreter (10 chapters).&lt;/strong&gt; You build a small language called Lox in Java. It&#x27;s called a &lt;em&gt;tree-walk&lt;/em&gt; interpreter because it literally builds a tree out of your program and then walks that tree, node by node, doing what each node says. It&#x27;s the most direct way to make a language work. &lt;em&gt;Most beginners end up here&lt;/em&gt; — and that&#x27;s completely fine. I did.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Part 2 — A Bytecode Virtual Machine (17 chapters).&lt;/strong&gt; This is the heart of the book. You throw away the Java version and rebuild the language from scratch in C, this time compiling it to &lt;strong&gt;bytecode&lt;/strong&gt; and running that on a little virtual machine you write yourself. It&#x27;s a huge step up, and it&#x27;s where Cecile really took shape — enough that it gets its own post next. For now, just know that this is the model real languages actually use: JavaScript&#x27;s V8, Python, and Java all run on some version of this bytecode-VM idea.&lt;/p&gt;
&lt;p&gt;By the end of the book, I didn&#x27;t just have a working tutorial language. I had opinions.&lt;/p&gt;
&lt;h2 id=&quot;designing-a-language-of-my-own-cecile&quot;&gt;Designing a language of my own: Cecile&lt;a class=&quot;anchor&quot; href=&quot;#designing-a-language-of-my-own-cecile&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;So I decided I didn&#x27;t want to build &lt;em&gt;Lox&lt;/em&gt;. I wanted mine. I called it &lt;strong&gt;Cecile&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;At the time I was learning Rust, and I&#x27;d fallen for it hard — a genuinely wonderful language (the borrow checker and I have our differences, but that&#x27;s a story for another day). So I asked myself one deceptively small question:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What if it &lt;em&gt;read&lt;/em&gt; like Rust, &lt;em&gt;behaved&lt;/em&gt; like JavaScript, and &lt;em&gt;had types&lt;/em&gt; like TypeScript?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That became Cecile&#x27;s whole personality. Rust&#x27;s clean, explicit syntax — &lt;code&gt;fn&lt;/code&gt;, &lt;code&gt;let&lt;/code&gt;, arrows for return types. JavaScript&#x27;s easygoing runtime feel. TypeScript&#x27;s &quot;types are there when you want them.&quot; I wrote it in &lt;strong&gt;Rust&lt;/strong&gt;, taking early inspiration from &lt;a href=&quot;https://github.com/ajeetdsouza/loxcraft&quot;&gt;loxcraft&lt;/a&gt;, a Rust implementation of Lox. A program in Cecile looks like this:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;fn add(a: int, b: int) -&amp;gt; int {
    return a + b;
}

let total: int = add(2, 3);
println total;        // 5
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;But taste doesn&#x27;t run on a computer. To actually &lt;em&gt;build&lt;/em&gt; a language, you start by writing down its &lt;strong&gt;grammar&lt;/strong&gt; — the exact rules for what counts as a valid program. Grammar is the contract. Once you have it, everything downstream is a series of translations, each one turning your program into a form that&#x27;s a little closer to something a machine can execute. Let me show you those stages by pushing one line of Cecile through all of them.&lt;/p&gt;
&lt;h2 id=&quot;watch-one-line-become-something-a-machine-can-run&quot;&gt;Watch one line become something a machine can run&lt;a class=&quot;anchor&quot; href=&quot;#watch-one-line-become-something-a-machine-can-run&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Say a Cecile program contains this:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;let x: int = 2 + 3 * 4;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Watch where it goes.&lt;/p&gt;
&lt;h3 id=&quot;stage-1-the-lexer-text-tokens&quot;&gt;Stage 1 — the Lexer: text → tokens&lt;a class=&quot;anchor&quot; href=&quot;#stage-1-the-lexer-text-tokens&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A computer doesn&#x27;t see words. It sees a river of characters: &lt;code&gt;l&lt;/code&gt;, &lt;code&gt;e&lt;/code&gt;, &lt;code&gt;t&lt;/code&gt;, space, &lt;code&gt;x&lt;/code&gt;, &lt;code&gt;:&lt;/code&gt;, and so on. The &lt;strong&gt;lexer&lt;/strong&gt; (or &lt;em&gt;scanner&lt;/em&gt;) is the first translator. Its only job is to chop that river into meaningful chunks called &lt;strong&gt;tokens&lt;/strong&gt;, and label each one.&lt;/p&gt;
&lt;p&gt;So &lt;code&gt;let x: int = 2 + 3 * 4;&lt;/code&gt; comes out the other side as:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;[let → keyword]  [x → identifier]  [: → colon]  [int → type]  [= → equals]
[2 → number]  [+ → plus]  [3 → number]  [* → star]  [4 → number]  [; → semicolon]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;That&#x27;s it. Text in, labeled tokens out. The lexer doesn&#x27;t understand &lt;em&gt;math&lt;/em&gt; or &lt;em&gt;meaning&lt;/em&gt; yet — it doesn&#x27;t know that &lt;code&gt;*&lt;/code&gt; binds tighter than &lt;code&gt;+&lt;/code&gt;. It just knows &quot;this blob is a number, that blob is a keyword, this symbol is a star.&quot; Dumb, fast, and absolutely necessary.&lt;/p&gt;
&lt;h3 id=&quot;stage-2-the-parser-tokens-tree&quot;&gt;Stage 2 — the Parser: tokens → tree&lt;a class=&quot;anchor&quot; href=&quot;#stage-2-the-parser-tokens-tree&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This is the hard part. Honestly, one of the hardest steps in the whole project.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;parser&lt;/strong&gt; takes that flat line of tokens and discovers the &lt;em&gt;structure&lt;/em&gt; hiding in it — the shape my grammar says it must have. There&#x27;s a whole zoo of parsing algorithms, and I went with &lt;strong&gt;Pratt parsing&lt;/strong&gt; on top of &lt;strong&gt;recursive descent&lt;/strong&gt;. The reason I reached for Pratt is exactly the thing the lexer couldn&#x27;t handle: &lt;strong&gt;precedence.&lt;/strong&gt; &lt;code&gt;2 + 3 * 4&lt;/code&gt; is not &lt;code&gt;(2 + 3) * 4 = 20&lt;/code&gt;. It&#x27;s &lt;code&gt;2 + (3 * 4) = 14&lt;/code&gt;, because multiplication binds tighter than addition — and the parser is where that rule finally gets enforced.&lt;/p&gt;
&lt;p&gt;The output isn&#x27;t a line anymore. It&#x27;s a tree:&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;74 -16 603 384&quot; width=&quot;603&quot; role=&quot;img&quot; aria-label=&quot;Syntax tree for x = 2 + 3 * 4&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M241.4 1.3 C247.3 2.4, 253.4 6.3, 256.9 10.9 C260.4 15.6, 263 23.8, 262.4 29.4 C261.9 34.9, 258.3 40.3, 253.6 44 C248.8 47.7, 240.7 51.3, 233.9 51.7 C227.1 52.1, 218.1 49.8, 212.8 46.5 C207.6 43.2, 203.8 36.9, 202.6 31.8 C201.4 26.7, 202.8 20.6, 205.5 15.7 C208.2 10.8, 212.7 4.8, 218.8 2.3 C224.9 -0.1, 238.2 0.9, 242.3 1 C246.4 1.1, 243.5 2.5, 243.5 3.1 M229.1 1.8 C235.4 1.4, 245.1 3.6, 250.3 6.6 C255.5 9.6, 258.8 14.7, 260.5 19.7 C262.1 24.6, 263.1 31.6, 260.2 36.4 C257.3 41.2, 249.3 46.3, 243.4 48.7 C237.4 51.2, 230.7 52.7, 224.5 51.2 C218.3 49.7, 209.9 44.4, 206.1 39.7 C202.3 35, 201.3 28.3, 201.9 22.9 C202.4 17.6, 205.1 11.5, 209.6 7.5 C214.2 3.6, 225.8 0.5, 229.2 -0.6 C232.7 -1.7, 229.8 0.5, 230.2 1.1&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M227.4 -0.1 C233.6 -0.8, 242.8 2.4, 248.4 5.5 C254 8.7, 258.7 13.5, 260.7 18.7 C262.8 24, 263 31.9, 260.7 36.8 C258.4 41.7, 252.9 45.9, 246.9 48.2 C240.9 50.5, 231.3 51.9, 224.7 50.7 C218.1 49.5, 211.4 45.2, 207.4 40.9 C203.4 36.6, 200.1 30.2, 200.6 24.9 C201 19.6, 204.7 13.2, 210.1 9.1 C215.5 5, 228.3 1.7, 232.7 0.5 C237.2 -0.8, 236.9 1, 236.9 1.5 M222.9 0.9 C228.7 -1.3, 237.2 -0.5, 243.5 1.5 C249.8 3.6, 257.6 7.9, 260.6 13.2 C263.7 18.5, 263.3 27.9, 261.8 33.3 C260.2 38.7, 256.4 42.8, 251.1 45.7 C245.9 48.6, 237 50.5, 230.2 50.5 C223.5 50.5, 215.5 49.1, 210.8 45.6 C206.2 42.2, 203.2 35.4, 202.3 30 C201.4 24.6, 202 18.3, 205.5 13.4 C208.9 8.4, 220.1 2, 222.9 0.2 C225.7 -1.7, 222 1.6, 222.1 2.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:19.68px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;232&quot; y=&quot;26.0&quot;&gt;=&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M125.3 100.9 C132.4 101.2, 142.2 104.3, 147.3 108.2 C152.4 112.2, 155.9 119.1, 155.9 124.6 C156 130, 152.1 136.7, 147.7 141.1 C143.3 145.5, 136 149.7, 129.4 151 C122.7 152.2, 113.9 151.2, 107.6 148.8 C101.2 146.3, 94.2 141.1, 91.3 136.2 C88.3 131.3, 87.6 124.5, 89.7 119.3 C91.8 114.2, 97 108.4, 103.7 105.3 C110.4 102.2, 125.2 101.3, 129.9 100.7 C134.6 100.1, 132.1 101.1, 131.8 101.6 M122.1 99.7 C129.4 99.7, 140 104.3, 145.5 108.1 C150.9 111.9, 153.7 117.1, 154.7 122.3 C155.6 127.5, 155 134.7, 151.3 139.2 C147.6 143.8, 139.5 147.8, 132.5 149.7 C125.6 151.6, 116.3 152.4, 109.6 150.6 C102.8 148.7, 95.7 143.4, 92.2 138.5 C88.6 133.5, 86.9 126.5, 88.4 120.8 C89.9 115.2, 95.3 107.9, 101 104.6 C106.7 101.3, 118.9 101.5, 122.6 100.9 C126.2 100.3, 122.7 100.7, 122.8 101&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M119.2 100.2 C125.9 99.2, 135.4 100.8, 141.2 104 C147.1 107.3, 152.3 114.1, 154.2 119.7 C156.2 125.2, 155.9 132.4, 152.9 137.3 C149.9 142.3, 142.6 147.2, 136.2 149.4 C129.7 151.5, 121 151.8, 114.2 150.4 C107.3 149, 99.6 145.3, 95.2 141 C90.8 136.7, 87.4 130.1, 87.8 124.6 C88.2 119.2, 92.2 112.2, 97.4 108.2 C102.7 104.2, 115.5 101.8, 119.5 100.6 C123.5 99.5, 121.1 100.9, 121.4 101.2 M138 104.4 C144.3 106.7, 150 111.1, 152.4 116 C154.9 120.9, 154.8 128.8, 152.9 134 C151 139.3, 146.6 144.6, 141.1 147.5 C135.5 150.5, 126.5 152.3, 119.5 151.7 C112.5 151.1, 104.3 147.8, 99.2 143.8 C94.1 139.8, 89.5 133.2, 88.8 127.8 C88.2 122.5, 91.4 116.1, 95.4 111.7 C99.5 107.3, 106.4 102.9, 113.1 101.3 C119.8 99.6, 131.9 101.3, 135.5 101.7 C139.2 102.1, 135.3 103.4, 135.1 103.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:19.68px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;122&quot; y=&quot;126.0&quot;&gt;x&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M356.8 104.4 C362.9 106.6, 369.4 111.9, 372.2 116.7 C375 121.5, 375.5 128.1, 373.4 133.1 C371.3 138.1, 365.5 143.6, 359.6 146.7 C353.6 149.7, 344.3 152.3, 337.5 151.5 C330.6 150.7, 323.1 146, 318.5 142 C314 137.9, 310.6 132.3, 310.2 127.2 C309.8 122, 312.2 115.4, 316.2 111.1 C320.2 106.8, 326.7 101.9, 334.3 101.3 C341.9 100.7, 356.4 106.1, 362 107.6 C367.5 109.2, 367.5 110.3, 367.3 110.6 M340 100.8 C346.6 99.8, 354.9 101.8, 360.6 104.8 C366.3 107.8, 372.1 113.4, 374 118.7 C375.9 123.9, 374.9 131.4, 371.9 136.4 C368.9 141.3, 362.3 146.3, 355.9 148.3 C349.6 150.4, 340.4 149.9, 333.7 148.5 C326.9 147.1, 319.1 144.1, 315.4 139.9 C311.8 135.7, 310.8 128.8, 311.8 123.3 C312.7 117.8, 316.4 110.8, 320.9 107 C325.5 103.2, 336.2 101.5, 339.2 100.7 C342.2 99.8, 339.1 101, 338.9 101.7&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M334.6 102.1 C341.1 100.5, 351 101.1, 357.2 103.4 C363.5 105.7, 369.7 110.6, 372.3 115.6 C374.8 120.7, 374.8 128.4, 372.5 133.6 C370.2 138.8, 364.2 144.2, 358.6 147 C353 149.7, 345.8 150.8, 339.1 150.1 C332.3 149.4, 322.9 146.7, 318.1 142.8 C313.3 138.9, 310.9 132.3, 310.5 127 C310.1 121.6, 311.1 115.2, 315.8 110.9 C320.6 106.5, 334.4 102.7, 339 101.1 C343.5 99.5, 342.9 100.9, 343 101.2 M345.3 100 C351.8 100.1, 360.9 103.3, 365.4 107.4 C369.9 111.4, 372 118.9, 372.3 124.3 C372.5 129.7, 370.5 135.6, 366.8 139.9 C363.2 144.2, 356.7 149, 350.2 150.2 C343.8 151.4, 334.4 149.6, 328.3 147.3 C322.2 145, 316.5 140.8, 313.7 136.3 C311 131.9, 310.3 125.8, 311.8 120.7 C313.4 115.5, 317.5 108.3, 323.2 105.3 C328.9 102.2, 342.6 103.1, 346 102.3 C349.5 101.5, 344.2 100.1, 343.7 100.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:19.68px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;342&quot; y=&quot;126.0&quot;&gt;+&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M218 203.8 C223.5 200.9, 232.8 198.9, 239.5 200.1 C246.3 201.2, 254.6 206.2, 258.5 210.8 C262.4 215.4, 263.7 222.2, 263.1 227.7 C262.5 233.2, 259.6 239.5, 254.9 243.5 C250.2 247.5, 241.5 250.8, 234.9 251.5 C228.3 252.2, 220.8 250.9, 215.1 247.9 C209.5 244.8, 203.2 238.8, 201.1 233.2 C199 227.7, 199.1 220, 202.7 214.6 C206.3 209.2, 218.4 202.8, 222.4 200.6 C226.5 198.5, 227.2 201.2, 227.2 201.8 M218.2 202.5 C223.9 199.8, 231.9 200.4, 238.6 201.6 C245.4 202.8, 254.3 205.1, 258.5 209.7 C262.7 214.2, 264.2 223.3, 263.6 229 C263.1 234.7, 259.6 240, 255.1 243.6 C250.6 247.2, 243.2 249.8, 236.5 250.6 C229.8 251.4, 220.9 251.3, 215 248.4 C209.1 245.6, 203.5 238.8, 201.2 233.4 C198.9 228.1, 198.5 221.6, 201.4 216.5 C204.3 211.4, 216.1 204.7, 218.7 202.8 C221.4 200.8, 217.2 204.4, 217.2 204.8&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M223.2 200.6 C229.4 198.8, 238.1 199.1, 244.6 201.6 C251 204.1, 258.8 210.4, 261.7 215.6 C264.6 220.9, 263.8 227.5, 261.9 232.9 C260.1 238.3, 255.9 244.9, 250.4 247.9 C245 250.9, 235.9 251.6, 229 251 C222.2 250.5, 214.1 248.5, 209.4 244.7 C204.6 240.9, 201.4 233.9, 200.7 228.2 C200.1 222.6, 201.4 215.5, 205.7 210.8 C210 206.1, 222.7 201.6, 226.3 199.9 C230 198.1, 227.8 199.9, 227.7 200.4 M234.3 199.4 C240.8 199.3, 248.6 201.9, 253.3 205.9 C258 209.8, 261.8 217.4, 262.7 223 C263.7 228.7, 262.7 235.3, 259 239.7 C255.3 244.1, 247.1 247.8, 240.5 249.3 C234 250.7, 225.8 250.1, 219.7 248.4 C213.7 246.6, 207.6 243.1, 204.3 238.7 C200.9 234.4, 198.5 227.6, 199.6 222.2 C200.8 216.8, 205.6 210.2, 211 206.3 C216.5 202.4, 228.5 199.8, 232.2 198.9 C236 198, 233.5 200.3, 233.4 200.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:19.68px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;232&quot; y=&quot;226.0&quot;&gt;2&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M452.2 201.3 C458.6 201, 467.6 202.7, 472.6 206.2 C477.5 209.6, 480.8 216.8, 481.9 222.2 C483.1 227.6, 482.7 234.2, 479.4 238.6 C476.1 243, 468.4 246.7, 462 248.7 C455.5 250.6, 446.7 251.8, 440.7 250.2 C434.6 248.6, 428.6 244.1, 425.6 239.3 C422.5 234.6, 421.4 227, 422.5 221.5 C423.5 216, 426.3 209.7, 431.9 206.2 C437.4 202.8, 451 201.4, 455.6 200.8 C460.1 200.1, 459.3 201.7, 459.2 202.3 M451.9 202.3 C458 201.7, 466.1 201.7, 471.1 204.7 C476 207.8, 480.1 215, 481.4 220.7 C482.7 226.3, 482.1 234.1, 478.9 238.6 C475.7 243.2, 468.3 246.1, 462.4 248.1 C456.4 250, 449.3 252, 443.3 250.5 C437.4 249.1, 430.1 244.1, 426.6 239.5 C423.1 234.8, 421.4 228.2, 422.1 222.7 C422.9 217.2, 426.5 209.8, 431.1 206.3 C435.8 202.8, 446.7 202.7, 449.9 201.7 C453.1 200.7, 450.6 199.8, 450.5 200.3&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M437.3 204.2 C442.7 201.5, 452.4 201.2, 458.8 202.2 C465.2 203.2, 471.8 206, 475.8 210.3 C479.9 214.5, 483.2 222.1, 483 227.6 C482.9 233.1, 479.4 239.4, 475.1 243.4 C470.7 247.4, 463.6 250.9, 457 251.4 C450.3 252, 440.9 249.6, 435.2 246.7 C429.5 243.9, 424.7 239.5, 422.6 234.4 C420.5 229.3, 419.8 221.2, 422.7 216 C425.7 210.8, 436.9 205.4, 440.1 203.1 C443.3 200.7, 442.1 201.5, 442.1 202 M464.5 203.3 C470.7 204.9, 477.4 210.6, 480.4 215.5 C483.4 220.4, 484.2 227.7, 482.5 232.6 C480.9 237.5, 475.9 241.8, 470.5 244.9 C465.1 248, 456.9 251.6, 450.4 251.3 C443.8 251, 435.9 246.7, 431 243 C426.2 239.4, 421.9 234.8, 421.3 229.6 C420.7 224.5, 423.7 216.7, 427.5 212.1 C431.3 207.6, 437.7 203.4, 443.9 202 C450.1 200.6, 461.3 203.7, 464.7 203.8 C468.1 204, 464.6 202.6, 464.2 203&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:19.68px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;452&quot; y=&quot;226.0&quot;&gt;*&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M344.7 301.5 C351.4 301.7, 361 303.8, 366 307.6 C371 311.5, 374.4 318.9, 374.6 324.6 C374.8 330.2, 371.3 336.9, 367.1 341.4 C362.9 345.9, 356.1 350.3, 349.5 351.5 C342.9 352.7, 333.8 351.2, 327.6 348.8 C321.3 346.3, 314.7 342.1, 312.1 337 C309.5 331.9, 310.1 323.4, 312.1 318 C314.2 312.6, 318.7 307.5, 324.6 304.6 C330.5 301.7, 343.8 301.4, 347.7 300.8 C351.7 300.1, 348.7 300.3, 348.4 300.9 M345.7 300.1 C352 300.5, 360.7 305.5, 365.5 309.4 C370.2 313.4, 374.1 318.7, 374.3 323.8 C374.5 329, 371.1 335.6, 366.9 340.4 C362.7 345.2, 355.3 350.8, 349 352.4 C342.7 354, 335.2 352.8, 329.2 350.1 C323.1 347.5, 315.7 341.3, 312.7 336.3 C309.6 331.3, 309 325, 310.7 320 C312.5 314.9, 317.2 309.2, 323.1 306 C328.9 302.8, 341.9 301.3, 345.7 300.7 C349.6 300, 346.2 301.7, 346.1 302.3&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M332.9 300.5 C338.8 298.8, 348.6 301.2, 354.9 303.6 C361.1 306, 367.5 310.1, 370.6 314.8 C373.6 319.6, 375 326.8, 373.2 332.2 C371.3 337.5, 365.3 343.7, 359.6 346.9 C353.9 350.2, 345.8 352, 339 351.7 C332.2 351.3, 323.6 348.7, 318.9 345 C314.2 341.2, 311.2 334.6, 310.8 328.9 C310.4 323.3, 311.6 315.8, 316.7 311.1 C321.7 306.3, 335.8 301.7, 341.4 300.2 C346.9 298.7, 350.1 301.5, 350.1 301.9 M348.2 299.6 C354.7 300.3, 363 305.6, 367.1 309.8 C371.1 314, 372.6 319.2, 372.6 324.8 C372.6 330.5, 371.3 339.2, 367 343.7 C362.7 348.2, 353.9 351.1, 346.8 351.9 C339.8 352.7, 330.7 351.3, 324.7 348.5 C318.6 345.7, 312.5 340.3, 310.4 335.3 C308.3 330.3, 309.2 323.6, 312 318.5 C314.7 313.4, 320.9 307.8, 326.8 304.7 C332.7 301.7, 343.6 300.8, 347.2 300.1 C350.7 299.4, 348 299.9, 348 300.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:19.68px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;342&quot; y=&quot;326.0&quot;&gt;3&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M569.6 299.9 C576.2 300.4, 582.8 304.7, 587.2 309.1 C591.6 313.4, 596.2 320.5, 596 326.1 C595.9 331.7, 591.1 338.2, 586.3 342.5 C581.4 346.8, 573.7 350.9, 566.9 351.9 C560.1 352.8, 551.7 351.3, 545.5 348.2 C539.3 345.1, 532.3 338.5, 529.8 333.2 C527.4 327.9, 527.9 321.3, 530.7 316.3 C533.5 311.4, 540.1 305.8, 546.8 303.3 C553.6 300.8, 566.9 301.6, 571.3 301.3 C575.8 301.1, 573.9 301.7, 573.7 302 M568 299.6 C574.7 300.3, 584.3 305.7, 588.7 310.3 C593.1 315, 594.6 322.4, 594.6 327.6 C594.5 332.8, 592.8 337.7, 588.3 341.6 C583.9 345.6, 575 350.1, 567.7 351.4 C560.5 352.7, 551.2 352, 545 349.4 C538.9 346.8, 533.4 341.1, 530.8 335.8 C528.2 330.5, 527.1 322.6, 529.4 317.4 C531.6 312.2, 538.1 307.2, 544.5 304.4 C550.9 301.5, 563.9 300.6, 568 300.3 C572.2 300, 569.3 302.2, 569.4 302.6&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M570 300.4 C576.7 301.4, 585.9 306, 590.1 310.7 C594.4 315.5, 596.3 323.3, 595.5 328.8 C594.8 334.3, 590.9 339.9, 585.6 343.7 C580.4 347.5, 571.2 351.3, 563.9 351.7 C556.6 352.1, 547.4 349.3, 541.7 346.1 C535.9 342.9, 531.1 337.8, 529.4 332.6 C527.7 327.3, 528.5 319.7, 531.7 314.7 C534.9 309.7, 541.6 304.7, 548.4 302.6 C555.3 300.4, 568.5 301.9, 572.9 301.8 C577.4 301.7, 575.4 301.5, 575 301.8 M565.7 300.7 C572.6 300.5, 580 302.5, 585.1 306.3 C590.2 310.1, 595.6 317.5, 596.3 323.4 C597.1 329.3, 593.7 337.5, 589.5 341.9 C585.4 346.3, 578.7 348.6, 571.6 349.6 C564.6 350.6, 553.7 350.2, 547.2 348 C540.8 345.7, 536.1 340.9, 533 336.1 C529.9 331.3, 526.8 324.3, 528.5 319.2 C530.2 314.2, 536.9 309, 543.1 305.9 C549.2 302.8, 562 301.6, 565.5 300.7 C569 299.8, 564.2 300.1, 564.1 300.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:19.68px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;562&quot; y=&quot;326.0&quot;&gt;4&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M206.4 47.5 C187.9 68.1, 171.2 84.7, 148 102.4 M206.6 49.9 C193.6 61, 182 71.4, 147.4 102.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M258.5 51.4 C275.4 65.5, 295.5 80.4, 317.9 104.5 M257.1 49.1 C274.4 64.3, 290.7 78.4, 316.9 103.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M317.6 151.3 C297.3 167.3, 277.7 180.6, 256.8 202.7 M316.4 150.3 C297.5 168.4, 276.8 186.1, 257.4 203.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M367.1 150.5 C390 168.6, 414.4 189.1, 426.4 202.9 M367.9 148.6 C390 168.8, 410.2 188.3, 426.2 201.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M426.2 250.3 C403.2 270.2, 379.3 288.9, 369.3 301.1 M425.3 249.8 C411.9 261.8, 398 274.2, 368.7 302&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M478.3 250.2 C500.4 268.4, 522 289.5, 535.2 303.2 M477.7 249 C494.8 264.8, 512.6 280.8, 536.2 302.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;520&quot; y=&quot;189.4&quot;&gt;evaluated first:&lt;/tspan&gt;&lt;tspan x=&quot;520&quot; y=&quot;210.6&quot;&gt;3 * 4 = 12&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;400&quot; y=&quot;100.0&quot;&gt;then 2 + 12 = 14&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;The syntax tree for x = 2 + 3 * 4&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Read it and the shape carries the meaning: to compute &lt;code&gt;+&lt;/code&gt;, you first have to compute &lt;code&gt;*&lt;/code&gt;, because &lt;code&gt;*&lt;/code&gt; lives &lt;em&gt;below&lt;/em&gt; it in the tree. The tree&#x27;s shape solves the ordering problem. This tree has a proper name — an &lt;strong&gt;Abstract Syntax Tree&lt;/strong&gt;, or AST — and it&#x27;s the most satisfying artifact in the whole pipeline, because it&#x27;s the moment raw text turns into something that actually &lt;em&gt;knows what it means&lt;/em&gt;. (If the tokens &lt;em&gt;don&#x27;t&lt;/em&gt; fit the grammar — say you wrote &lt;code&gt;let x = = 2&lt;/code&gt; — this is exactly where the parser stops and hands you a syntax error.)&lt;/p&gt;
&lt;h3 id=&quot;stage-3-bytecode-generation-tree-instructions&quot;&gt;Stage 3 — Bytecode generation: tree → instructions&lt;a class=&quot;anchor&quot; href=&quot;#stage-3-bytecode-generation-tree-instructions&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A tree is lovely to reason about but awkward to execute fast. So the last translator walks the AST and flattens it into &lt;strong&gt;bytecode&lt;/strong&gt;: a straight, ordered list of tiny instructions the machine can run one after another.&lt;/p&gt;
&lt;p&gt;Conceptually, our little tree compiles down to something like:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;PUSH 3
PUSH 4
MUL          ; 3 * 4  -&amp;gt; 12
PUSH 2
ADD          ; 2 + 12 -&amp;gt; 14
STORE x      ; x = 14
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Notice how the tree&#x27;s nesting became a &lt;em&gt;sequence&lt;/em&gt;: multiply first, then add, then store. That&#x27;s the tree&#x27;s meaning, unrolled into steps a machine can follow one at a time without ever chasing a pointer through a tree again.&lt;/p&gt;
&lt;p&gt;Text → tokens → tree → instructions. Four translations, and Cecile has a runnable program. (&lt;em&gt;What actually runs that bytecode is a little machine of its own — that&#x27;s the next post.&lt;/em&gt;)&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -12 631 514&quot; width=&quot;631&quot; role=&quot;img&quot; aria-label=&quot;From text to result: the four translations&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;119&quot; y=&quot;20.0&quot;&gt;source text&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;250&quot; y=&quot;20.0&quot;&gt;let x: int = 2 + 3 * 4;&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M104.6 5.7 C104.6 21.4, 105.7 38.8, 106.1 62.2 M104.2 3.9 C104.9 24.8, 106 46.2, 105.8 63.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M110.8 52.6 C109.4 55.3, 108.4 59.2, 105.8 62.7 M110.5 51.3 C108.8 55.6, 107.5 60.3, 105.5 63.4 M103.8 63.2 C102.5 60, 100.5 55.6, 98.2 50.3 M105.1 63.4 C104 61.3, 102.2 59, 98.9 51.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M5.6 68.6 C74.7 68.6, 142.9 69.8, 198 66.8 C205.4 68.7, 209 71.7, 213.6 81.2 C207.7 87.6, 212 97.8, 208.8 115.8 C209 120.9, 204 122.9, 202.5 127.6 C142.2 122.6, 91.5 125.3, 8.4 122.4 C6.3 127, -0.7 119, -0.9 112.2 C1.6 107.9, 1.3 92.8, 2.2 82.5 C0.7 74.9, 4.4 72.2, 6.4 67.1&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M7.1 70.3 C56.1 73.4, 102.9 72, 202 70.1 M9.2 70.4 C50.9 70.1, 91.7 70.1, 201.1 69.8 M201 70 C205.7 69.1, 209 74.3, 210.9 79.1 M202.1 71.5 C206.1 68.8, 208 75.1, 208.4 77.4 M210.7 80.5 C208.4 93, 209.3 107.2, 211.3 114.8 M210.6 78.9 C209.7 87.3, 210 94.1, 210.1 114.8 M210 115 C208.8 122.6, 205.1 125.2, 203 124.2 M210.5 116 C210.9 120, 207 123.7, 202.2 125.3 M199.8 124.1 C162.6 122.1, 123.6 120.4, 9.4 122.1 M200.8 124.3 C133.9 124, 69.2 123.5, 9.4 124.2 M9 124 C3.4 123.1, 0.4 119.4, -1.1 116.4 M7.5 122.5 C2.6 122.6, -2.2 119.4, 1 113.7 M1.2 113.9 C1.4 108, 1 101.4, 0.1 77 M0.9 114.2 C0.2 104.7, -1 95, 0.4 78.7 M0 79 C0.8 72.3, 4.2 70.5, 10.9 69.7 M0.1 81 C-1.1 73.7, 2.7 68.8, 9.5 71.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;105&quot; y=&quot;97.0&quot;&gt;Lexer&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;119&quot; y=&quot;147.0&quot;&gt;tokens&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;250&quot; y=&quot;147.0&quot;&gt;[let] [x] [:] [int] [=] [2] [+] …&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M11.3 171.4 C81 178.3, 155.1 175.3, 199.2 172.9 C208.8 176.5, 207.5 179.8, 212.9 183.2 C209.5 188.6, 212 194.8, 210.2 219.4 C206.4 224, 204.3 228.4, 202.7 227 C160.4 225.1, 113 226.2, 10.9 229.1 C3.7 226.1, -0.8 222.5, -3.1 220 C-0.9 206.7, -1.2 190.8, 2.8 185 C2.1 176.8, 4.2 176.9, 7.9 175.9&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M7.4 175.6 C70.3 174.5, 130.3 177, 200.6 175.4 M8.2 173.2 C62.9 174.6, 114.9 174.9, 201 174.5 M201 174 C206.4 174.4, 210.1 178.4, 211.9 184.9 M201 175.7 C209.1 172.1, 208.2 178, 210.7 184.5 M208 183.3 C208.3 195, 211.1 206.9, 209.3 218.4 M210.2 182.7 C209.2 192.2, 210.1 203.1, 209.2 219.1 M210 219 C208.5 225.3, 208.1 229.1, 199.7 229.4 M209.7 217.6 C208.7 227, 207 230.2, 199.8 229.2 M199.9 228 C141.5 227.4, 82.7 229.2, 9.9 228.4 M200.2 228.5 C130.9 228.4, 60.8 228.5, 8 227.5 M9 228 C4 226.7, -1 224.8, -1.3 219 M7.6 229 C3.3 225.8, -0.8 223.6, 2.1 219.1 M0.6 218.8 C-0.3 211.1, 0.2 199, 0 183.4 M-0.3 219.3 C0.9 209.4, 0.3 200.3, 0.3 182.8 M0 183 C-0.9 177.8, 3.6 175.4, 10.7 172.2 M-0.5 184.6 C-0.2 176.3, 3.4 172, 7.4 175.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;105&quot; y=&quot;201.0&quot;&gt;Parser&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;119&quot; y=&quot;251.0&quot;&gt;tree (AST)&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;250&quot; y=&quot;251.0&quot;&gt;x = 2 + (3 * 4)&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M8.8 279.6 C77.3 273, 151.8 274.2, 198.8 278.8 C205.7 280.4, 207.3 280.8, 207.4 284.1 C207.2 292.9, 213.5 308.2, 210.3 326.1 C210.8 326.1, 207.7 334.1, 201.4 333.2 C152.2 329.8, 111.7 331.8, 10.5 334 C2.1 333.9, -2.4 328.8, 1.5 324.8 C-2.6 310.3, -2.9 300.6, -1.6 288.4 C-0.6 282.3, 2.9 274.6, 7.1 279.6&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M10.1 278 C74.6 281.2, 136.2 278.6, 201.1 279.4 M9.9 277.5 C71.7 278.9, 135.2 278.1, 201.5 277.6 M201 278 C207.9 279.7, 211.5 282.6, 211.2 286.4 M199.8 277.6 C209.3 276.1, 210.6 279.8, 211 288.7 M208.2 287.5 C209 298.2, 209.4 312.8, 211.2 325 M210.4 287.6 C210.5 301.3, 209.1 313.1, 209.8 323.1 M210 323 C210 330.1, 208.1 330.3, 199.2 332 M211.8 324.6 C210 329.7, 206.9 330.3, 201.8 332.7 M200.5 331.9 C140.1 328.8, 77.4 329.4, 9.8 331.9 M200.7 331.1 C143.1 331.9, 84.9 331.7, 8.7 332 M9 332 C2.8 333.1, -1.6 327.6, 0.9 321.4 M10.3 331.1 C1 329.9, -0.2 327.2, 0.7 323.4 M-0.1 322.3 C-0.5 312.2, -0.7 300.5, 0.7 286.6 M0.1 323 C0.3 312.6, 0 300.9, -0.4 287.8 M0 287 C0.1 282.4, 3.2 278, 10.2 279.5 M1.6 287.1 C2 280.5, 2.7 279, 11 278.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;105&quot; y=&quot;305.0&quot;&gt;Bytecode generator&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;119&quot; y=&quot;355.0&quot;&gt;bytecode&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;250&quot; y=&quot;355.0&quot;&gt;PUSH 3  PUSH 4  MUL  PUSH 2  ADD  STORE x&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M11.4 381.4 C72.7 381.7, 146.2 379.3, 204.5 384.7 C208.1 382.4, 212.4 383.7, 208.5 390.4 C210.7 399.3, 210.9 409.5, 209.9 423.4 C212.8 429.7, 205.9 439.5, 203.1 435.8 C138.2 430.5, 82 433.1, 7 435.4 C1.9 438.3, 1.9 430.8, 0.9 429.3 C-3.7 414.9, -1.5 400.8, 2.1 390.8 C1.7 383.4, 6 384.2, 6 384.9&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M10.5 380.7 C58.5 382.3, 109.3 381.4, 199.2 380.1 M201 382 C206.2 381.1, 211.9 385.9, 209.6 391.5 M211.4 390.6 C208 398.8, 208.1 406.1, 210.6 426 M210 427 C209.7 434.8, 208.9 435.4, 199.6 435.5 M201.7 437.7 C138.7 435.7, 74.5 435.2, 8.4 437.7 M9 436 C4.6 436, -0.1 433.7, 0.4 425.4 M0.7 428.8 C0 416.9, -1.5 410.5, 1.7 392.4 M0 391 C1.3 386.1, 1.3 382.5, 9 381.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;105&quot; y=&quot;409.0&quot;&gt;Virtual machine&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;230&quot; y=&quot;409.0&quot;&gt;(next post)&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M104.7 131.6 C104.8 144.4, 104.6 158.9, 104.6 166.8 M104.7 129.1 C105.6 145.3, 105.5 159.1, 105.8 168.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M110.9 156.5 C108.9 160.4, 106.6 165.6, 104.7 167.2 M110.9 154.8 C109.2 160.7, 106.8 165, 105.6 168.4 M106 168.1 C103.7 163.4, 100.9 162.3, 98.1 154.3 M104.9 168.3 C102.6 163.7, 100.6 157.7, 98.8 155.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M105.3 235.5 C105.4 246.4, 105.7 259.2, 106 273 M105.6 234.3 C104.1 244.3, 105.2 253.2, 104.8 272.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M111.3 260.4 C109.2 263.1, 107.2 267.1, 105.7 272.7 M111.5 259.6 C109.1 263.2, 108.3 265.9, 104.9 272.6 M104.4 271.9 C104.3 268.2, 102.8 267.1, 98.8 260.4 M105 272.4 C103.4 267.5, 101.6 263.6, 98.5 259.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M105.9 339.4 C105.2 352.5, 106 363.6, 103.4 375.1 M104.5 337.5 C104.7 348.9, 104.8 362.5, 105.8 375.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M111.7 364.4 C109.1 368.5, 107.5 371.3, 103.9 375.4 M110.7 363 C109.1 366.7, 107.3 371.9, 105.6 375.5 M105.5 375.7 C103.4 370.5, 99.3 366.9, 99.6 363.7 M105.2 376.6 C104.1 372.8, 102.7 371, 98.3 363.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M106.5 443.3 C105.8 456.7, 107.2 472.3, 104.8 487.3 M105.4 442.7 C105.3 457.7, 104.4 474.2, 104.8 485.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M112.1 474.3 C109.4 477.1, 108.1 481.5, 104.9 486.9 M111.3 473.9 C109.1 477.6, 106.3 482.4, 104.9 485.7 M103.9 485.6 C103.7 481.3, 100.9 477.8, 97.6 473.1 M105.4 485.3 C102.5 481.5, 101.5 477.8, 99.4 473.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;119&quot; y=&quot;470.0&quot;&gt;result&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;250&quot; y=&quot;470.0&quot;&gt;x = 14&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;The pipeline: lexer, parser, bytecode generator, then the VM (next post)&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;wait-interpreter-or-compiler-whats-the-difference&quot;&gt;Wait — interpreter or compiler? What&#x27;s the difference?&lt;a class=&quot;anchor&quot; href=&quot;#wait-interpreter-or-compiler-whats-the-difference&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Good moment to stop, because you might be quietly wondering what I was wondering the whole first month: &lt;em&gt;what even is an interpreter, and how is it different from a compiler?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Here&#x27;s the analogy that finally made it click for me, and I&#x27;ve never found a better one:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;An &lt;strong&gt;interpreter&lt;/strong&gt; is a live translator. A &lt;strong&gt;compiler&lt;/strong&gt; is a document translator.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -31 842 347&quot; width=&quot;842&quot; role=&quot;img&quot; aria-label=&quot;Interpreter vs compiler&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:24px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;0.0&quot;&gt;Interpreter&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;30.0&quot;&gt;a live translator&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:24px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;480&quot; y=&quot;0.0&quot;&gt;Compiler&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;480&quot; y=&quot;30.0&quot;&gt;a document translator&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M440.7 -8.7 C439.3 67.9, 441.1 145.2, 439.4 290.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;path d=&quot;M7.4 68.9 C37.8 70.5, 74.8 68.4, 100.8 70.5 C108.9 66.8, 112.1 69.2, 107.9 79.6 C112.6 85.8, 110.4 88.9, 111.2 106.3 C110.1 116.4, 110.7 118.7, 100.1 117.4 C72.8 116.7, 43.8 118.5, 4.4 118.4 C5.4 113.1, 1.9 115.7, 2.2 111.4 C0.2 97.2, -3.3 87.2, -1.6 75.3 C-2.9 74.8, 1.4 69.3, 6.8 69.1&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M6.9 69.5 C39.3 72, 72.3 69.2, 101.3 69.5 M6.8 70.1 C35.2 71, 61.5 71.7, 102 69.5 M102.3 70 C106.2 71.7, 108.2 74, 111.1 78.4 M103.2 69.2 C105.2 70, 110.9 74.1, 107.8 79 M110 76.5 C109.2 89.4, 109.3 98.5, 109.5 110 M109.2 77.9 C109.6 85.4, 109.5 91.8, 110.6 108.4 M110 108.3 C109.8 113.2, 108.9 114.7, 103 116.2 M109.3 109.2 C108.6 111.4, 107.9 113.8, 103.5 117.8 M100.6 115.7 C73.9 118.6, 44.6 117.2, 7 116.9 M103.1 115 C76.5 115.8, 52.2 116.9, 8.6 115.3 M7.7 116 C2.6 114.5, -1.5 113.7, -0.4 106.5 M8.3 116.3 C4.7 116.5, -0.4 114.4, 2.1 107.5 M-1.4 108.7 C-0.7 96.5, -0.8 87.2, -1 79.6 M-0.9 107.5 C-1 98.5, -0.2 88.6, -0.1 78.4 M0 77.7 C1.9 70.7, 0.9 70.1, 8.3 72 M-0.6 76.1 C2 73.4, 2.2 71.7, 7.2 69.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;55&quot; y=&quot;93.0&quot;&gt;line 1&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M216.3 72.3 C252.3 71.2, 292.3 67.1, 350.1 69.2 C355.3 72.9, 356.5 69.9, 359.1 77.4 C357.5 89.1, 361.8 99.3, 360.8 111.8 C358.1 115.7, 357.9 118.9, 349.7 113.4 C314.8 111.7, 272 112.5, 219.8 113.9 C212.6 114, 206.4 114, 206.5 106.5 C211.6 103.8, 207 97.2, 211.7 78.7 C211.3 72.5, 213.2 71.5, 215.7 71.2&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M217.1 69.8 C254.8 70.7, 291 70.4, 351.7 68.5 M216.8 71 C264 69.9, 312.8 69.6, 353.1 69.6 M352.3 70 C357.9 71.5, 361.4 73.9, 358.5 78.3 M350.7 71.2 C356.7 72.3, 359.9 72.7, 357.8 77.2 M358.5 78.1 C359 90.8, 360.1 101.8, 361.2 110 M359 78.3 C360.7 86.9, 360.2 96.8, 360.8 108.5 M360 108.3 C361.5 112.2, 355.6 114.3, 352.8 116.9 M359.1 108 C358.8 111.9, 358.4 113.8, 350.8 114 M353 115.1 C300.4 116.3, 246.3 117.3, 218.5 117 M352.1 116.2 C318.2 114.8, 284.5 115.5, 218.1 115.7 M217.7 116 C212.9 114.6, 210.3 113.5, 209 107.8 M218.4 117.2 C214 116.8, 208.3 115.5, 211.6 109.1 M209.1 108.9 C208.1 99.9, 211.4 93, 208.7 77 M210.9 108.2 C209.1 97.8, 209 86.5, 210.4 78.2 M210 77.7 C211.1 72.1, 211.3 70.6, 216.3 69.9 M210.4 77.4 C208.4 71.9, 214.6 70.2, 218.9 71.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;285&quot; y=&quot;93.0&quot;&gt;run&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M114.7 94.4 C137.3 91.3, 160.4 93.3, 203.3 92 M116.6 93.9 C146.2 92.7, 176.3 92.4, 203.6 92.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M190.5 87.9 C193.6 87.2, 197 90.2, 203.5 92.3 M191.8 87.5 C195.8 88.6, 200 90.5, 203.7 92.4 M203.4 93.4 C199.5 94.4, 193.5 97.1, 192 98.8 M204.3 92.6 C198.9 95.7, 193.5 97.7, 191.4 99.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M4.6 132.7 C41.8 137.5, 72.8 136.6, 99 136.5 C105.3 134.6, 112.8 140.5, 106.6 143.1 C108.8 153.2, 108.1 161.4, 107.5 176.3 C107.8 175.9, 103.9 179.5, 102.6 180.2 C75.4 181, 44.2 177.6, 7.4 179.1 C3.4 183.8, -0.9 176.4, -1.4 172.5 C-3.4 162.7, 1.1 151.6, -0.5 144.1 C-0.9 135.4, 1.8 137.6, 10 138.6&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M8 137.7 C41.8 135.1, 72.2 135.3, 102.6 136.1 M7 136.4 C44.7 136.5, 82.4 137.2, 101.6 135.6 M102.3 136 C107.2 135.1, 110.3 137.5, 108.2 144.5 M104.3 138 C107.8 136, 111.7 140.6, 107.8 143.6 M109.7 143.5 C111.2 151.7, 108.1 158.5, 109.9 176 M109.3 143.1 C111.2 152.8, 111.2 161.3, 110.2 174.1 M110 174.3 C110.6 180.3, 106.5 182.1, 103.4 182.4 M108.7 174.8 C108.8 178.2, 108 184.1, 101.1 183.3 M104.2 181.5 C82 181.6, 56.6 182, 9.4 181.5 M101.8 181.2 C69 181.4, 35.8 182, 7.6 181.3 M7.7 182 C1.5 182.4, 1.9 178.8, 0.2 172.7 M6.6 181.2 C0.3 181.8, -0.7 181.2, -1.7 173.7 M1.4 175.5 C1.2 166.1, 0.4 159.6, -1 144.2 M-1 174.8 C-1.1 162.7, 0 150.8, 0 144.1 M0 143.7 C1.2 139.2, 0.9 137.6, 9.1 137.3 M1.2 142.9 C-0.5 136.4, 1.4 134.1, 9.8 134&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;55&quot; y=&quot;159.0&quot;&gt;line 2&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M220.7 136 C256.3 134.7, 290.2 138.9, 355.5 135.1 C358.9 133.5, 357.2 141.2, 357.7 140.9 C360.9 150.4, 359.5 159.5, 357.1 174.6 C362.9 182.4, 358.3 179.6, 352.2 183.4 C309.3 180.1, 270.6 183, 215.5 181.8 C210.6 184.7, 210.8 181.9, 210.2 174.8 C208.1 169.3, 211.3 161.6, 212.8 140.3 C213.2 140.3, 213.6 132.6, 218.8 133.4&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M218.2 134.1 C253.4 137.7, 291 136.4, 353 135.1 M217 135.2 C252.7 135.3, 286.1 137, 352.8 135.8 M352.3 136 C358.9 134.9, 359.6 137.4, 359.5 144.4 M351.8 136 C359.3 133.7, 360.7 139.2, 357.8 141.9 M358.2 145.1 C361 153, 358.9 157.7, 361.6 176.1 M359.1 143.6 C360.4 154.3, 360 166.2, 360.3 174.2 M360 174.3 C358.3 179.3, 357.3 181.7, 353.2 183.1 M358.5 173.5 C359 178.8, 358.5 184.1, 353 184.1 M352.6 180.8 C311.5 179.1, 268.3 182, 216.8 181.7 M352.9 182.4 C307.2 180.2, 261 180.5, 217.1 181.7 M217.7 182 C211.8 182.5, 209.8 178.6, 209.6 173.9 M216.8 182.1 C214.3 182, 208 177.7, 207.7 175.3 M211.9 175.8 C210.6 163.4, 209.3 149, 208.7 145.5 M210.8 173.5 C209.1 168.1, 209.2 161, 210.6 144 M210 143.7 C210.4 140.5, 211.3 134, 217.1 135.3 M208.2 144.2 C210.4 139.5, 213.8 137.2, 216.8 136.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;285&quot; y=&quot;159.0&quot;&gt;run&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M116.1 160.9 C136 156.4, 158.4 156.7, 203 158.2 M116.7 158.9 C145.9 159.1, 174.6 158.9, 203 158.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M191.5 154.3 C193.4 153, 197.2 154.6, 203.3 158.4 M191.9 152.8 C195.9 155.2, 199.5 157.1, 203.3 158.4 M202.7 158.5 C200.1 160.3, 196.2 162.7, 191.1 164.2 M203.7 159 C199.5 160.3, 195.8 162.1, 191.8 165.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M9.6 199.7 C41.8 201.3, 75.8 202.6, 103.5 201.9 C107.9 201.4, 111.3 207.6, 109.3 208.9 C110.9 217.7, 112 219.5, 108.6 237.5 C108.8 246.9, 108.2 248.2, 100.8 244.4 C75.5 246.9, 49.5 250.6, 5.8 251.5 C4.3 247.1, 0.7 249, 1.9 243.1 C-1.3 232.1, 0.9 217.8, -0.4 207.7 C1.6 202.2, 2.4 205.3, 6 205.5&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M8.4 202.8 C33.6 202.2, 62.7 200.4, 104.3 201.4 M7.4 202.7 C39.9 203.8, 73.4 203, 102.4 202.3 M102.3 202 C106.4 203.9, 109.8 204.4, 108.7 207.7 M103.3 201.6 C109.4 200.6, 108.1 206.1, 108.4 211.9 M108 208.3 C108.4 222, 110.4 233.3, 109.1 241.1 M109.1 208.9 C109.8 219.4, 109.5 230.7, 110 240.1 M110 240.3 C108.1 244.1, 106.1 246.2, 100.6 249.8 M108.9 240.9 C109.8 244.6, 107 249.5, 102.8 246.3 M100.5 247.2 C69.1 248.2, 35.5 248.9, 8.5 247.6 M102.4 249 C74.2 248.9, 46.3 248.5, 7.9 248.2 M7.7 248 C0.7 249.6, -1.4 246.8, 0.9 240.9 M6.9 249.6 C3.8 249, 1.1 244.1, 1.9 240.4 M-1.3 241.9 C-1.8 229.1, 1.4 215.3, -0.9 210.4 M0.8 240.6 C-0.6 231.5, 0.2 220, -0.9 209.2 M0 209.7 C-1.8 203.6, 0.9 201.5, 7.4 201.3 M1.6 210.7 C-0.7 202.3, 4.4 202.1, 8.1 201.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;55&quot; y=&quot;225.0&quot;&gt;line 3&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M218.5 203 C257.6 201.5, 302.9 200.7, 352.8 200.6 C354.3 200.3, 362.9 201.1, 360.4 206.7 C363 221, 356.1 229.9, 358.2 243 C356.8 246.1, 355.4 248.4, 350.4 247.7 C317.8 249.2, 278.4 244.8, 221.1 247 C211.5 248, 212.4 247.3, 213.4 238.2 C209.1 231.5, 210.1 227.8, 212.9 211.1 C208.5 207.1, 214.2 200.3, 214.9 200.4&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M218.6 203.2 C247 200.2, 277.1 200.9, 350.7 200.4 M217.3 201.6 C246 202.6, 273.3 202.8, 351.6 202.4 M352.3 202 C358.1 203.7, 359 204.2, 360 211.6 M350.8 203.6 C356.3 202.9, 361.7 204.7, 358.5 210.1 M360.5 209.9 C358.2 217.2, 361.2 224.2, 360.9 241.1 M360.9 209.4 C359 216.8, 360.2 223.4, 360.2 240.2 M360 240.3 C359.7 247.1, 356.8 249.8, 350.5 246.5 M358.7 239.7 C359.9 245.1, 357.5 249.5, 350.1 247.1 M352.9 246.5 C320.9 247.9, 287.6 247.1, 216 247.7 M351.5 248.1 C314.7 247.7, 276.2 247, 217.4 248.6 M217.7 248 C211 249.7, 210.5 246.7, 210.3 242.2 M217 246.5 C213.1 249.2, 209.7 245.2, 211.3 242 M209.2 242.2 C211.6 232.5, 210.2 221.1, 208.9 207.7 M210.6 241.2 C209.5 228.8, 209.4 217.9, 209.6 209.1 M210 209.7 C211.4 205, 211.3 201.9, 219.4 203.3 M208.6 208 C210.2 205.4, 212.2 200.6, 219.7 204.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;285&quot; y=&quot;225.0&quot;&gt;run&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M117.9 226.6 C136.3 224.7, 160.4 223.9, 203.2 226.6 M115.4 224.5 C144.5 224.5, 173.1 225.3, 204.1 225.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M192.7 220 C193.6 220.5, 198.5 221.4, 203.4 226.2 M191 218.5 C195.6 220.2, 199.9 222.8, 204 225.1 M203.3 224 C199.9 226.8, 195.9 227.3, 190.7 231 M204.2 225.5 C201.1 226.7, 197.3 228.7, 191 231&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;290.0&quot;&gt;starts now, one line at a time&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M491.5 70.2 C508.1 68.8, 531.4 72.2, 586.8 69 C593.9 67.2, 602.9 72.9, 599.1 79.7 C602 124.3, 600.2 164.4, 597.9 239 C600.4 244.7, 593.6 244.7, 587.1 247.8 C563.4 252.4, 539.1 251.4, 492.5 247.8 C485.8 246, 477.9 248.3, 476.8 241.6 C479.9 183.2, 484.9 126.9, 479.4 83.2 C477.8 72.4, 484.1 69, 489.9 71.5&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M488.4 71.1 C515.3 67.4, 537.5 70, 591.3 70.7 M490.2 70.1 C512.7 69, 535.8 70.1, 590.9 70.2 M590 70 C594.9 68.5, 599.6 72.2, 599.8 81.9 M591.1 68.3 C595.4 70.5, 598.8 72.6, 600.5 80.4 M599.3 81.1 C597.9 127.3, 598.6 170.9, 598.5 236.4 M599.2 80.1 C600 142.2, 601.7 202.7, 599.3 238.2 M600 238 C599.2 246.1, 595.3 247.9, 591.1 249.7 M599.2 236.3 C601.2 243.2, 595.3 247.2, 591.7 248.1 M588.7 247.4 C558.8 249.3, 531 247.2, 488.7 246.2 M590.6 248.2 C556.7 248.8, 525.2 248.3, 489.6 248.2 M490 248 C485 247.2, 478.8 243.4, 478.5 237.1 M488.5 247 C482.8 248.3, 477.7 242.9, 481.6 239.8 M478.8 238.2 C477.3 208, 479.3 174.6, 481.9 79.6 M480.6 237.9 C479.4 177.8, 480.9 116.6, 480 80.7 M480 80 C478 75.1, 483.2 70.3, 490.9 71.6 M481.3 80.6 C481.2 75.3, 483.8 68.6, 491.1 71.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;540&quot; y=&quot;137.8&quot;&gt;line 1&lt;/tspan&gt;&lt;tspan x=&quot;540&quot; y=&quot;159.0&quot;&gt;line 2&lt;/tspan&gt;&lt;tspan x=&quot;540&quot; y=&quot;180.3&quot;&gt;line 3&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M670 67.7 C718.1 72.2, 760.3 71.1, 796.5 73.3 C805.5 73.4, 807 70.3, 807.1 77.9 C810.5 92.6, 807.7 109.5, 809.1 126.8 C812.7 140.1, 803.5 137, 797.1 139 C761.2 143.6, 726.8 141.9, 670.9 140.1 C664.6 141.5, 659.7 138.3, 660 133.5 C661.7 120.3, 661.5 100.6, 660.1 79.7 C657 71.1, 663.4 72.1, 672.5 69&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M671.5 68.8 C699.5 69.7, 728.9 67.8, 801.4 71.9 M670.1 70.9 C712.1 69.2, 752.2 69.6, 799.1 70.6 M800 70 C804.8 70, 811.2 72, 809 78.9 M801.7 70.3 C808.6 72.3, 810.6 72.5, 809 81.8 M811.5 79.2 C808.9 94.6, 810.4 108.8, 808.2 129.1 M810.9 80.6 C809.9 97.9, 810.5 115.1, 810.7 129.9 M810 130 C810.4 134.8, 805 141.5, 799.2 141.5 M811 130.2 C809.4 136.4, 808.2 137.9, 801.5 139.2 M799.6 139 C754.4 138.1, 710.7 139.6, 668.3 141.4 M800.8 141 C770.7 140.7, 739.2 139.6, 669.3 139.4 M670 140 C665.3 138.2, 660.3 136.6, 659.6 129.2 M668.7 138.8 C663.7 140, 659.5 138.4, 660.9 128.2 M658.3 130.9 C658.3 116.7, 659.8 102.4, 659.6 80.8 M659 129.4 C660.6 114.6, 659.9 98.7, 660.9 79.2 M660 80 C659.1 74.2, 663.4 70.7, 668.9 69.8 M659.2 81.4 C661.5 74.3, 664.3 71.2, 670.9 70.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;735&quot; y=&quot;94.4&quot;&gt;read the&lt;/tspan&gt;&lt;tspan x=&quot;735&quot; y=&quot;115.6&quot;&gt;whole text&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M672.9 175.5 C709.7 177.9, 748.9 180.7, 799.8 176.7 C804.8 181.4, 808.3 182.8, 807.6 189.8 C812.8 198.6, 811.9 208.1, 811.5 237.1 C808.8 245.2, 804.3 249.8, 797.7 245.5 C767.7 253.7, 734.6 248.3, 672.8 245.1 C664.6 247.6, 659.6 247.4, 660.9 235 C662.8 223.3, 660.4 204.1, 660 188.4 C656.5 181.4, 666.9 180.2, 669.7 175.8&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M670.1 179.6 C722.5 179.4, 772.8 179.7, 800.4 177.9 M670.9 177.7 C710.7 176.2, 751 176.4, 800.2 177.6 M800 178 C808.4 178.3, 808.2 183, 811.1 189.7 M798.3 177.5 C808.2 176.9, 810.8 181.4, 811.3 186 M809 186.3 C808.1 202.8, 809.2 220.1, 810.2 239.2 M809.4 188.7 C811.1 206.4, 810.9 224.9, 810.1 238.2 M810 238 C808.1 243.6, 805.7 247.6, 799.1 246.4 M808.9 238.5 C810.7 245.7, 805.7 247.9, 800.3 246.8 M798.9 247.3 C749 247.5, 699 246.6, 670.2 247.9 M799.5 248.3 C752.3 246.3, 703.6 247.8, 669.3 248.2 M670 248 C661.4 246.6, 660.7 245.8, 660 236.8 M671.3 248.4 C662 249.3, 660.2 242.9, 657.7 237.6 M660.8 236.8 C661.7 224.5, 659.1 206.8, 661.4 189.3 M661 237.3 C660.2 224.9, 660.2 211.3, 659.4 188.9 M660 188 C658.4 182.7, 665 176.3, 671.9 176.7 M661.4 186.4 C661.5 179.1, 664.5 176.1, 669.2 176.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;735&quot; y=&quot;202.4&quot;&gt;finished&lt;/tspan&gt;&lt;tspan x=&quot;735&quot; y=&quot;223.6&quot;&gt;translation&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M606.5 141.8 C616.9 135.6, 630.1 135, 652.4 127.8 M605.7 140.3 C616.2 138.1, 629 135.6, 653.3 127.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M641 125.5 C643.3 124.3, 647.6 126.8, 653 127.7 M640.4 124.5 C643.2 125.6, 647.5 126.6, 653.6 127.3 M653.7 128.4 C651.9 129.8, 648.8 132.6, 644 136 M653.8 127.2 C650.8 129.7, 648 132.2, 643.4 136.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M736.3 146.9 C734.1 153, 736 160.3, 734.6 170.6 M735.8 146.7 C735.2 154, 735.8 160.4, 735.1 172.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M742 160 C739 162.9, 738.9 166.7, 734.7 171 M741.6 159.9 C739.4 163.3, 738.1 166.2, 735.1 172.1 M735.6 172.9 C732.9 168, 730.9 163.6, 730 158.1 M734.8 172 C732.4 167.2, 729.9 162.1, 728.3 159&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;480&quot; y=&quot;290.0&quot;&gt;waits, sees everything, optimizes&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;Interpreter vs compiler&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;A live translator works line by line, sentence by sentence, translating on the spot as you speak. Immediate, flexible, no waiting — but they only ever see one sentence at a time. A document translator does the opposite: they take the &lt;em&gt;whole&lt;/em&gt; text first, read all of it, analyze it, understand how the end connects to the beginning, and &lt;em&gt;only then&lt;/em&gt; produce the translation.&lt;/p&gt;
&lt;p&gt;Put that way, the difference is huge — and so is the trade-off. The document translator (the &lt;strong&gt;compiler&lt;/strong&gt;) can produce faster, more optimized output, precisely because it sees everything before committing. The live translator (the &lt;strong&gt;interpreter&lt;/strong&gt;) gives that up in exchange for starting &lt;em&gt;right now&lt;/em&gt;, with no wait and more flexibility. Neither is &quot;correct&quot;; they&#x27;re different deals. Cecile is an interpreter — it compiles your code to bytecode and then immediately runs it, no separate build step.&lt;/p&gt;
&lt;p&gt;That&#x27;s the key point for today: &lt;strong&gt;even a plain interpreter gives us exactly the result we want, and it&#x27;s more than enough to finally see how running code works.&lt;/strong&gt; Which is why Cecile&#x27;s whole first year lived here, in software, one comfortable step above the metal.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;If you find that you&#x27;re spending almost all your time on theory, start turning some attention to practical things; it will improve your theories. If you find that you&#x27;re spending almost all your time on practice, start turning some attention to theoretical things; it will improve your practice.&lt;/em&gt;
— Donald Knuth&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;does-it-actually-run-heres-cecile-working&quot;&gt;Does it actually run? Here&#x27;s Cecile, working&lt;a class=&quot;anchor&quot; href=&quot;#does-it-actually-run-heres-cecile-working&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Enough theory. After all of it — grammar, lexer, parser, bytecode — here&#x27;s a real, complete Cecile program. A number-guessing game:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;fn guessGame() {
    println &quot;Enter your guess:&quot;;

    let target: int = randomInt(100);
    let tries: int = 0;
    let maxTries: int = 10;

    while tries &amp;lt; maxTries {
        let guess: int = readInt();
        tries = tries + 1;

        if guess == target {
            println &quot;congrats, you got it 🎉&quot;;
            println &quot;Your tries:&quot;;
            println tries;
            return;
        }

        if guess &amp;lt; target { println &quot;too low&quot;; }
        if guess &amp;gt; target { println &quot;too high&quot;; }
    }

    println &quot;Out of tries! It was:&quot;;
    println target;
}

// Cecile picks a random number; the player tries to guess it.
guessGame();
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Look at everything in there: typed variables, a &lt;code&gt;while&lt;/code&gt; loop, &lt;code&gt;if&lt;/code&gt; conditions, function calls, a random-number call, reading input from the keyboard, an emoji in a string. Every one of those features had to be lexed into tokens, parsed into a tree, lowered to bytecode, and executed — by an interpreter I wrote. The first time this ran and printed &lt;code&gt;too low&lt;/code&gt; at me, I just sat there grinning. It still feels a little unreal to paste it out.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-44 -6 546 238&quot; width=&quot;546&quot; role=&quot;img&quot; aria-label=&quot;The first time it ran&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M157.3 7.4 C247.1 5.5, 332.8 9.4, 431.7 7.9 C438.7 7.7, 442.1 15.1, 438.2 17.7 C436.6 50.8, 437.5 86.5, 439.5 148.9 C438.7 157.8, 435 161.6, 428.1 159.7 C374.1 153.9, 313.4 154.3, 160.1 162.5 C154.1 158.4, 152.6 159.3, 153.5 149.9 C145.5 115.3, 152.2 76.8, 152.8 19.3 C152.6 11.3, 153.8 7.3, 156.5 12.9&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M161 9.8 C257.2 10, 358.5 7.5, 429.8 9.8 M160.3 9.4 C253.5 8.3, 348.9 8.7, 430.2 10.2 M430 10 C437 10.9, 441 11.5, 438.1 21.1 M431.2 11.4 C438.2 9.8, 440.6 15, 440 20.6 M441.8 19.4 C437 59.2, 438.8 95.7, 439.7 148.6 M440.4 20.2 C439.2 65.7, 438.9 111.6, 440 150.5 M440 150 C440.9 157.4, 434.7 161.1, 429.3 161 M438.4 150.4 C440.5 158.4, 436.1 158, 432.2 161.7 M430.6 160.1 C372.5 159, 315.5 160.3, 161.3 159.6 M429.7 160.1 C352 159.2, 274.9 158, 159.8 159.7 M160 160 C153.2 161.3, 150.7 154.9, 151 150.3 M160.9 160 C151.5 158.5, 151.8 157.2, 150.6 149.3 M151.5 148.3 C150.4 102.5, 149.4 54.7, 151.2 20.4 M149.4 149.3 C149.6 105.5, 149.5 58.6, 150.5 19.6 M150 20 C150.3 12, 153.8 8, 160 10.3 M148.9 18.6 C148.5 15.5, 154.2 11, 159.2 9.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M173.1 24.2 C261.5 22.1, 348.1 19.9, 416.2 20.8 C423.5 22.9, 425 23.3, 428.6 33.6 C424.2 60.3, 424 84.7, 430.9 136.5 C426 146.6, 425.4 147.7, 417.8 150.5 C361 148.3, 301.9 147, 172.1 145.7 C168.5 148.3, 160.3 146.5, 159.6 139.7 C164.1 110.3, 160.1 86.6, 160.2 29.8 C162.8 25.4, 167.1 24.2, 173.9 21.9&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M173.5 21.7 C260.4 22, 350.3 21.3, 418.9 23.6 M171.4 22.3 C223.6 23.9, 276 22.9, 417.4 22.5 M418 22 C425.2 20.6, 428.8 23.6, 428.9 30.5 M419.4 20.9 C425.1 19.9, 425.7 24, 427 33.8 M426.5 31.9 C429.1 65.8, 427.1 100.2, 429.9 139.9 M428.4 31.1 C428.8 61.5, 429.6 92.8, 427.6 137.1 M428 138 C429.5 143.8, 426 146.6, 416.9 146.1 M426.6 139 C426.4 146, 425.6 147.2, 417.7 148.6 M418.9 148.6 C331.4 146.7, 246.4 147.6, 173.3 149.1 M418.3 147.8 C329.2 149.5, 240.3 149.1, 172.6 147.4 M172 148 C164.5 146.6, 161.9 144.6, 161.7 139.8 M173.5 150 C166.4 147.3, 162.7 144.1, 161 139.7 M163.2 137.7 C161.6 98.7, 162.3 53.8, 161.9 30.5 M161.5 137 C162.1 99.1, 162.5 61.9, 162.4 32.1 M162 32 C162 23.6, 166.6 20.1, 173.5 20.1 M161 30.5 C161 26.3, 164.6 24.1, 172.6 21.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M124.2 165.1 C225.6 161.9, 320 161.9, 464 165 C471.2 174.6, 479.7 180.1, 482.5 186.4 C386.4 188.2, 283.7 190.8, 105.5 187.1 C114.3 183.4, 118.8 176.5, 124.2 165.8&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M124.9 165.7 C248.5 169, 372.4 167.4, 463 166 M126.1 165.7 C218.4 167.3, 310.3 166.7, 464.2 166.6 M464.2 166.5 C468.7 173.8, 477.1 176.9, 484.7 187.4 M464.4 165.7 C471.4 172.8, 478.7 181.2, 485.8 187.7 M485 188.8 C393 189.9, 301.2 188.7, 105.2 187.2 M485.5 187.7 C397.1 187.5, 309.6 187.2, 103.7 188.5 M104.8 186.1 C112.8 179.1, 119.6 169.6, 127.4 167.4 M104.2 188.8 C109.8 181.3, 116.9 175.3, 125 165.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;176&quot; y=&quot;44.0&quot;&gt;Enter your guess:&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;176&quot; y=&quot;69.0&quot;&gt;50&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;176&quot; y=&quot;94.0&quot;&gt;too low&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M36.4 60.9 C41.1 61.1, 47.8 63.9, 51.5 67.1 C55.1 70.3, 57.8 75.8, 58.3 80.1 C58.9 84.4, 57.3 89.5, 54.8 93 C52.2 96.5, 47.6 99.6, 43 101 C38.4 102.5, 31.9 103.2, 27.3 101.6 C22.6 100, 17.2 95.4, 15.1 91.4 C13 87.4, 13.6 82, 14.7 77.5 C15.9 73, 17.9 67.3, 22.2 64.5 C26.5 61.7, 37.1 61.3, 40.5 60.8 C43.9 60.3, 42.9 61.1, 42.7 61.4 M33.5 60.4 C37.8 59.5, 44.2 61.3, 48.5 64.2 C52.7 67.2, 57.7 73.3, 58.9 78 C60.2 82.7, 58.2 88.4, 55.9 92.3 C53.6 96.2, 49.5 100, 45.2 101.6 C40.9 103.2, 34.7 103.3, 30.1 102 C25.4 100.7, 19.8 97.6, 17.3 93.7 C14.7 89.9, 14.4 83.6, 14.8 78.9 C15.2 74.3, 16.7 68.8, 19.8 65.8 C23 62.7, 31.5 61.4, 33.9 60.6 C36.2 59.8, 33.9 60.7, 33.8 61.1&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M31.4 61.9 C36 60.6, 42 61.8, 46.3 63.7 C50.6 65.6, 55.3 69.3, 57.1 73.3 C58.9 77.3, 58.3 83.3, 56.9 87.8 C55.5 92.3, 52.9 97.8, 48.8 100.5 C44.8 103.1, 37.7 104.4, 32.8 103.8 C27.9 103.1, 22.7 100.1, 19.5 96.6 C16.3 93.1, 13.7 87.2, 13.5 82.7 C13.4 78.3, 15 73.7, 18.5 70 C22 66.4, 31.2 62.4, 34.6 60.9 C38 59.3, 38.9 60.5, 38.9 60.8 M32.3 62.8 C36.7 61.9, 41.3 62.1, 45.5 64.2 C49.6 66.4, 55.5 71.4, 57.3 75.4 C59.1 79.4, 57.8 84.5, 56.3 88.4 C54.9 92.4, 52.2 96.3, 48.5 98.8 C44.8 101.3, 39.3 103.7, 34.3 103.4 C29.2 103.1, 21.8 100.3, 18.2 96.8 C14.5 93.2, 12.3 86.6, 12.4 81.9 C12.5 77.3, 15.6 71.9, 18.6 68.7 C21.7 65.5, 28.5 64, 30.7 62.8 C32.8 61.5, 31.5 61, 31.7 61.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M28.5 73 C29.1 72.8, 30.4 73, 30.7 73.4 C31 73.9, 30.5 74.9, 30.3 75.7 C30.2 76.5, 30.1 77.6, 29.9 78.2 C29.7 78.8, 30 79.2, 29.4 79.3 C28.8 79.4, 27.1 79.1, 26.3 78.8 C25.5 78.4, 24.9 77.8, 24.6 77.2 C24.4 76.6, 24.5 75.7, 24.8 75.2 C25.1 74.8, 25.7 74.6, 26.5 74.3 C27.3 74, 28.9 73.7, 29.6 73.5 C30.2 73.3, 30.4 73.1, 30.5 73.1 M28 73.9 C28.5 73.3, 29.3 71.8, 29.8 71.8 C30.2 71.8, 30.7 73.2, 30.7 73.8 C30.7 74.5, 30.2 75.3, 29.9 75.9 C29.7 76.5, 29.5 76.5, 29.2 77.2 C29 78, 29.3 80.5, 28.6 80.4 C27.9 80.4, 25.4 77.6, 24.9 76.8 C24.3 76.1, 25.3 76.2, 25.2 75.9 C25.1 75.7, 24 76.1, 24.3 75.4 C24.5 74.7, 26.4 72.3, 26.8 71.8 C27.2 71.4, 26.5 72.4, 26.5 72.5&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M28.1 73.6 C29 73.3, 29.5 72.6, 30.1 72.7 C30.7 72.8, 31.6 73.4, 31.6 74.2 C31.7 75, 30.9 76.8, 30.5 77.4 C30.2 78.1, 29.9 77.7, 29.4 78 C28.9 78.4, 28 79.8, 27.5 79.7 C27 79.6, 26.8 78.2, 26.5 77.4 C26.1 76.7, 25.8 75.7, 25.5 75.3 C25.2 74.9, 24.4 75.4, 24.8 74.9 C25.2 74.5, 27.5 73.1, 27.9 72.6 C28.4 72.2, 27.6 71.9, 27.6 72.1 M27.5 72.2 C28.2 72.3, 28.7 74.5, 29.4 74.9 C30.2 75.3, 32.1 74.1, 32.1 74.5 C32.1 75, 30.2 77, 29.6 77.6 C29 78.1, 29.2 77.9, 28.6 77.9 C28.1 78, 26.7 78.2, 26.3 78.1 C26 77.9, 27.1 77.4, 26.7 77 C26.2 76.6, 23.6 76.2, 23.6 75.8 C23.6 75.4, 26.2 74.8, 26.8 74.4 C27.4 74, 27.1 73.6, 27.1 73.4 C27.1 73.2, 26.7 72.9, 26.8 73&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M45.7 73.3 C46.4 73.4, 46.9 74.1, 47.2 74.7 C47.6 75.4, 48.1 76.4, 47.8 77.2 C47.5 77.9, 46.1 78.8, 45.4 79.1 C44.7 79.3, 44.2 78.7, 43.5 78.6 C42.9 78.4, 42.1 78.5, 41.6 78.2 C41.1 78, 40.7 77.6, 40.7 77.1 C40.7 76.5, 41.3 75.5, 41.7 75 C42.1 74.5, 42.3 74.4, 43 74 C43.7 73.6, 45.5 72.8, 46 72.8 C46.4 72.8, 45.8 73.9, 45.7 74.2 M42.3 72.8 C42.9 72.5, 43.1 73.9, 43.6 74.2 C44.2 74.5, 44.6 74.2, 45.4 74.5 C46.2 74.9, 48.5 75.8, 48.5 76.4 C48.4 76.9, 45.6 77.7, 45.1 78.1 C44.6 78.5, 45.9 78.7, 45.6 78.8 C45.3 78.9, 44.2 79, 43.3 78.7 C42.4 78.4, 40.5 77.6, 40.3 77 C40.1 76.4, 41.9 75.6, 42.2 75.2 C42.6 74.7, 42.5 74.9, 42.5 74.4 C42.4 74, 41.8 72.5, 42 72.5&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M42.3 73.9 C43 73.9, 44 73.8, 44.7 73.8 C45.3 73.9, 45.8 73.7, 46.2 74.1 C46.6 74.5, 46.9 75.5, 46.9 76.2 C47 76.9, 47.2 78, 46.7 78.5 C46.1 79, 44.7 79.3, 43.8 79.3 C42.9 79.2, 41.4 78.8, 41.1 78.4 C40.8 78, 41.8 77.3, 41.8 76.8 C41.9 76.2, 41.3 75.8, 41.5 75.1 C41.7 74.4, 42.6 73.1, 43.1 72.6 C43.6 72.2, 44.1 72.3, 44.4 72.5 M45.5 73.5 C45.9 74, 46.3 75.6, 46.3 76 C46.4 76.4, 46 75.6, 45.8 75.9 C45.7 76.2, 45.8 77.6, 45.4 77.9 C44.9 78.2, 43.6 77.6, 43.2 77.8 C42.8 78.1, 43.1 79.7, 42.9 79.2 C42.7 78.8, 42 76.1, 41.9 75.1 C41.8 74.2, 42.2 74, 42.5 73.5 C42.8 73.1, 42.9 72.6, 43.6 72.4 C44.2 72.3, 46.1 72.6, 46.3 72.9 C46.5 73.1, 45.1 73.7, 44.7 74&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M26 88 C31.5 95.8, 38.6 94.7, 46 85.2 C43.3 89.5, 38.8 89.4, 27.3 89.6&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M26 88 C32.9 94.4, 38.1 94.8, 47.3 89.7 M26.1 87.1 C31.8 96.1, 37.8 96.7, 48 88.3 M46.5 88 C38.8 86.8, 30.9 87.9, 27.5 89.7 M45.2 87.5 C40.4 87.1, 35 88.6, 25.1 88.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M36.4 103.2 C34.6 125.7, 35.5 147.6, 34.3 170.3 M36.9 103.8 C34.7 127, 35.5 149.4, 36.8 169.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M37 169.1 C27.5 187.1, 22.2 200.5, 15.7 214.4 M35.8 169 C31.3 180.1, 27 189.5, 15.8 215.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M37.6 169 C41.7 185.2, 50.5 200.9, 57.1 216.6 M36.7 170.2 C41.4 182.9, 45.7 195.5, 56.8 216.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M34.2 120.9 C24.4 110.3, 16.9 95.3, 4.5 80.8 M35.6 121.4 C25.5 109.4, 15.6 94.7, 5.8 82.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M34.7 120.7 C45.1 108.1, 58.4 95.4, 65.9 82.9 M36.5 122.6 C47.1 105.6, 59.9 90.8, 66.9 82.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-23.5 42.6 C-19.1 44.9, -14.6 44.3, -8.1 43 M-23.4 43.5 C-19.2 43.2, -15.6 44.1, -9.1 43.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-16.1 35.6 C-16.8 41.2, -16.6 46.9, -16.9 51.5 M-15.8 35.9 C-15.2 40.8, -15.8 44.9, -15.4 50.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M81.3 37.3 C85 39.7, 90.3 39.5, 95.1 38 M80.4 38.6 C86 38.2, 91.4 38.1, 94.9 38.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M88.7 30.2 C87.4 36.1, 88.3 42.2, 89 46.5 M88.1 31 C88.2 34.8, 87.7 38.4, 88.6 45.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-27.1 99.5 C-24 102.1, -18 99.5, -15 100.6 M-27.5 101.2 C-23.4 101.1, -20.3 101.5, -14.3 101.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-22.4 93.5 C-20.5 98, -21.9 102.2, -20.1 107.3 M-20.8 93.2 C-20.7 97, -21 100.7, -21.1 107.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M85.4 95.2 C91.8 96.5, 95.5 94.7, 99.5 96.6 M85.8 95.8 C90.2 95.2, 95.1 95.5, 99.6 95.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M92.8 88.1 C94.1 92.9, 93.5 97.5, 93.5 102.3 M93.4 88.2 C93.2 93.8, 92.9 99.8, 93.3 103.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;h2 id=&quot;but-something-was-still-missing&quot;&gt;But something was still missing&lt;a class=&quot;anchor&quot; href=&quot;#but-something-was-still-missing&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;And yet.&lt;/p&gt;
&lt;p&gt;The moment Cecile worked, I realized I &lt;em&gt;still&lt;/em&gt; couldn&#x27;t answer the question I started with. Yes — a handful of letters go in, and my machine produces exactly the output I asked for. But my interpreter is itself a program written in another language, running on top of &lt;em&gt;another&lt;/em&gt; system, and somewhere underneath all of that a physical CPU is flipping actual electrical signals. &lt;em&gt;How do a few letters become that?&lt;/em&gt; That floor was still a black box, and I&#x27;d only built one floor above it.&lt;/p&gt;
&lt;p&gt;Cecile runs — but it never once touches the metal. And I couldn&#x27;t stop thinking about the metal.&lt;/p&gt;
&lt;h2 id=&quot;one-floor-down&quot;&gt;One floor down&lt;a class=&quot;anchor&quot; href=&quot;#one-floor-down&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Before we go down, we go &lt;em&gt;in&lt;/em&gt;. Cecile turns your code into bytecode — a list of instructions that, on its own, does nothing at all.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So what actually runs the bytecode?&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>The Machine Inside Your Machine</title><link>https://your-moon.github.io/s1-2-virtual-machine/</link><guid>https://your-moon.github.io/s1-2-virtual-machine/</guid><pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate><description>&lt;h1 id=&quot;the-machine-inside-your-machine&quot;&gt;The Machine Inside Your Machine&lt;a class=&quot;anchor&quot; href=&quot;#the-machine-inside-your-machine&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Building my own programming language — Season 1: Cecile · Part 2: The Bytecode VM&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;These six instructions compute &lt;code&gt;2 + 3 * 4&lt;/code&gt;. On their own, they do absolutely nothing.&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;PUSH 3
PUSH 4
MUL          ; 3 * 4  -&amp;gt; 12
PUSH 2
ADD          ; 2 + 12 -&amp;gt; 14
STORE x      ; x = 14
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;They&#x27;re the bytecode Cecile produced last post — a handful of bytes sitting in memory. Something has to pick them up, one at a time, and &lt;em&gt;act&lt;/em&gt;. And I&#x27;d quietly skipped the most important question in the whole project: &lt;strong&gt;who runs this?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That something is a &lt;strong&gt;virtual machine&lt;/strong&gt;, and it turns out to be shockingly small: a loop, a stack, and a pointer. Let me build one with you, and by the end you&#x27;ll see exactly how &lt;code&gt;2 + 3 * 4&lt;/code&gt; becomes &lt;code&gt;14&lt;/code&gt; inside a machine that is itself just a program.&lt;/p&gt;
&lt;h2 id=&quot;why-not-just-walk-the-tree&quot;&gt;Why not just walk the tree?&lt;a class=&quot;anchor&quot; href=&quot;#why-not-just-walk-the-tree&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Quick honesty, because I glossed over this last time.&lt;/p&gt;
&lt;p&gt;My first version of Cecile didn&#x27;t have a VM at all. It had an AST — that lovely tree — and it just &lt;em&gt;walked&lt;/em&gt; it: to run &lt;code&gt;+&lt;/code&gt;, visit the left child, visit the right child, add them. Simple. It worked. So why did I throw it away and build a whole bytecode machine instead?&lt;/p&gt;
&lt;p&gt;Speed, and it&#x27;s worth seeing &lt;em&gt;why&lt;/em&gt;, concretely. Walking a tree means that for every single operation, the program chases pointers all over memory — down to a child node, back up, down to another, back up. Memory is scattered; the CPU spends its life waiting for the next node to arrive. A flat list of bytecode is the opposite: the instructions sit &lt;strong&gt;next to each other&lt;/strong&gt; in memory, and the machine reads them in a tight, predictable line. Same result, but one design fights the hardware and the other flows with it.&lt;/p&gt;
&lt;p&gt;That&#x27;s the whole reason real languages — V8, Python, the JVM — compile to bytecode instead of walking trees. So I did too.&lt;/p&gt;
&lt;h2 id=&quot;the-smallest-possible-machine-a-loop-and-a-stack&quot;&gt;The smallest possible machine: a loop and a stack&lt;a class=&quot;anchor&quot; href=&quot;#the-smallest-possible-machine-a-loop-and-a-stack&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The entire idea is this small.&lt;/p&gt;
&lt;p&gt;A bytecode VM has two pieces:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;An instruction pointer&lt;/strong&gt; — a finger pointing at the current instruction. It starts at the top and marches down.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A stack&lt;/strong&gt; — a pile of values you can only touch from the top. &lt;code&gt;PUSH&lt;/code&gt; puts a value on top; &lt;code&gt;MUL&lt;/code&gt; takes the top two off, multiplies them, and puts the result back.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That&#x27;s it. The VM is a loop: &lt;em&gt;read the instruction my finger points at, do it, move the finger down, repeat.&lt;/em&gt; People call this the &lt;strong&gt;fetch–decode–execute&lt;/strong&gt; loop, and if that phrase sounds familiar, it should — it&#x27;s exactly what a real CPU does. A bytecode VM is a tiny software CPU.&lt;/p&gt;
&lt;h2 id=&quot;a-program-pretending-to-be-a-cpu&quot;&gt;A program pretending to be a CPU&lt;a class=&quot;anchor&quot; href=&quot;#a-program-pretending-to-be-a-cpu&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Let me slow down on that last sentence, because it&#x27;s the whole trick.&lt;/p&gt;
&lt;p&gt;A real CPU is a chip. Inside it, a register points at the next instruction. The chip fetches that instruction, works out what it means, does it, and moves the pointer on — billions of times a second. And it only understands its own instructions: machine code, built into the silicon.&lt;/p&gt;
&lt;p&gt;My VM does exactly the same dance — but it isn&#x27;t a chip. It&#x27;s a Rust program. Its instruction pointer is just a variable. Its instructions are bytecode — &lt;code&gt;PUSH&lt;/code&gt;, &lt;code&gt;MUL&lt;/code&gt;, &lt;code&gt;ADD&lt;/code&gt; — a tiny instruction set I made up myself. No chip in the world understands &lt;code&gt;PUSH 3&lt;/code&gt;. My VM does, because I wrote the loop that pretends to.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -16 546 342&quot; width=&quot;546&quot; role=&quot;img&quot; aria-label=&quot;The real CPU and my VM, side by side&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M122.3 0.2 C187.2 -1.2, 245.7 -2.3, 297.1 0.5 C309 2.5, 306.3 -0.7, 309.6 7.8 C309.1 14.6, 306.5 24.8, 307.3 37 C306.4 38.7, 307.9 44.9, 301.3 43.8 C235.8 40.9, 168 43, 116.8 40.8 C114.8 45.3, 112.6 39.2, 115 38.3 C113.2 25.3, 113.8 20, 112.7 8.6 C110.4 3.9, 117 1.9, 121.8 3.6&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M120 0.6 C188.2 1.8, 255.5 -1.3, 298.8 0.9 M118.7 0.6 C167.5 1.1, 214.1 0.5, 300.3 -1 M300.7 0 C304.6 0, 307.3 0.5, 309.7 6.5 M301.3 -1.3 C307.2 0.8, 306.9 4.5, 307.8 9.3 M308.5 7.7 C308.6 16.8, 306.4 25.1, 308.3 35.3 M308.9 7.4 C308.4 15.4, 308.8 23.4, 308.4 35.7 M308 36.7 C309.8 43.3, 307.1 43.2, 300.3 42.2 M309.1 35.2 C309.7 42.8, 304.2 43.8, 300 44.4 M299 43.5 C255.5 41.7, 208.6 40.7, 119 42.2 M300.4 44.4 C247.9 45.2, 193.6 45.7, 119.4 45 M119.3 44 C114.9 42.9, 112.8 41.9, 113.7 37.2 M120.5 43.5 C112.6 43, 110 39.9, 110.5 34.4 M113 35.4 C114 26.7, 111.1 15.1, 112.5 6 M112.1 37.4 C111.7 26.1, 112.1 17, 111.7 6.4 M112 7.3 C111.1 0.5, 112.5 -0.8, 118.5 1.7 M110.5 6.1 C111.4 0.4, 115.9 0.8, 119.3 -1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:19px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;210&quot; y=&quot;22.0&quot;&gt;the real CPU&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M322.7 -0.9 C385.6 -0.5, 449.1 4.1, 505.4 -0.4 C514.2 -0.1, 512.1 1.1, 512 10.8 C513.2 18.5, 513.5 28.6, 516.4 38.1 C511.3 40, 514.2 44, 504.3 43.2 C468.5 48.2, 424.5 48.9, 328.2 40.4 C317.7 45.7, 316.2 38.6, 321 34.9 C318.5 26.4, 315 19.9, 316.9 8.6 C316.3 5.2, 318.8 -0.7, 325.3 -1.9&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M323.9 -1.7 C391.8 1.1, 458.7 -1.5, 507.9 -0.3 M324.5 -0.4 C370.6 2.7, 415.1 2.3, 507.6 -1 M506.7 0 C510.9 -0.7, 515.6 3.6, 513.1 9.1 M506.9 -0.1 C512 2.1, 512.5 2.2, 515.5 6.8 M515.5 8.7 C512.7 20.2, 512.5 28.9, 515 36.2 M513.4 6.7 C514.3 17.6, 513.6 28.7, 513.2 35.8 M514 36.7 C515.4 39.9, 511 42.3, 507.6 42.9 M515 38.4 C512.6 41.9, 510.2 45.3, 505.5 46.1 M505.2 45 C450.5 42.9, 393.5 43.6, 325.2 43.7 M506.2 44.5 C443.3 42.9, 380.4 44.5, 326.3 44.8 M325.3 44 C320 44.5, 319.6 41.9, 316.4 35.3 M323.9 43 C320.7 44.3, 318.2 40.6, 315.9 34.8 M319.8 37 C316.7 29.4, 317.5 19, 316.7 6.2 M317.9 36.7 C318.8 30.1, 317 22.4, 318.1 8.2 M318 7.3 C318.9 2.6, 320.2 0.8, 324.2 -0.9 M319.3 7.2 C318.2 0.6, 321.3 0, 326.2 0&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:19px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;416&quot; y=&quot;22.0&quot;&gt;my VM&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;85.0&quot;&gt;instructions&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M123.2 56.2 C188.8 55.7, 254.4 56.3, 300 57.6 M122 56.4 C181.7 54.7, 241.8 55.3, 299.4 56.9 M298.7 56 C303.4 55.1, 308.9 59.7, 307.9 64.2 M297.8 56.5 C305.9 57.5, 307.7 60.6, 307.5 64.7 M307.4 63.8 C306.6 79, 307.1 91.6, 307.7 101.8 M308.2 64.5 C307.7 73.6, 308.7 82.4, 308.7 103.6 M308 102.7 C306.1 108.6, 304.9 113.1, 296.8 112.4 M308.3 102.1 C309.4 110.8, 303.8 111.1, 298.5 110.9 M297.2 112.1 C235.1 110.1, 166.4 111.8, 119.4 110 M299.3 112.2 C259.7 111.3, 219.9 111.2, 121.7 111.3 M121.3 112 C114.4 112.4, 111 108.5, 113.5 103.1 M122.6 110.9 C114.7 111.9, 114 107.3, 112.9 101.3 M111.5 103.1 C111.7 93, 113.7 86.2, 111.8 66.7 M112.8 102 C111 90, 111.5 74.6, 112.7 65.7 M112 65.3 C112.3 57.5, 114.1 54.9, 122 55.5 M112.9 65.7 C111.5 56.8, 113.1 55.4, 119.1 56.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;210&quot; y=&quot;84.0&quot;&gt;machine code&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M329 55.3 C379.7 53.8, 432.8 55.3, 503.3 56.3 M327 56.6 C368.5 56.4, 409.1 56.6, 505.5 56.6 M504.7 56 C510.1 55.7, 515.9 59.9, 515.8 66.9 M505.1 56.3 C511.8 55.7, 515.4 56.8, 514.6 64.2 M515.1 65.1 C512.5 77.3, 513 92, 512.5 104.5 M513.6 66.2 C514.8 78, 513.5 90.4, 513 102.8 M514 102.7 C513.4 109.3, 509.9 112, 503 113.4 M513.5 100.9 C513.1 108.5, 509.6 113.5, 503.8 110.4 M504.3 112.7 C463.1 112.1, 418.8 111.6, 328.9 110.9 M505.4 112.9 C448.1 111.7, 394.1 112.9, 328 111.4 M327.3 112 C322.2 113, 317.6 107.6, 317.3 102.3 M328.6 112.4 C323.1 110.3, 318.4 108.4, 315.7 102.6 M317.7 104.5 C319 90.4, 319.6 78.4, 317.6 65.2 M318.7 103.2 C317.4 88.4, 318.7 75.6, 317 65 M318 65.3 C318.4 59.7, 319.9 56.2, 326.3 57.6 M319.4 66.2 C320 57.9, 321.3 58, 325.6 58.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;416&quot; y=&quot;74.0&quot;&gt;bytecode:&lt;/tspan&gt;&lt;tspan x=&quot;416&quot; y=&quot;94.0&quot;&gt;PUSH, MUL, ADD&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;151.0&quot;&gt;the finger&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M122.6 123.9 C158.4 123.7, 195.7 124.6, 297 120.4 M121.7 121.5 C190.7 123.5, 260.8 122.9, 299.3 122.1 M298.7 122 C303 120, 307.5 124.8, 307.4 130.5 M298.2 122.7 C306.8 120.6, 305.8 125.9, 306.7 131.9 M306.8 133.1 C307.5 139.8, 308.4 152.1, 308.7 170.6 M308.5 131.7 C307.5 141.8, 308.6 153.1, 307.5 167.9 M308 168.7 C306.1 176, 306.1 177.8, 297.8 177.6 M309.2 169.2 C308.3 176.7, 303.1 178.2, 299.8 175.8 M297.7 176.1 C232.4 178.5, 163.8 179.9, 122.5 179.4 M298.1 177.6 C253.3 178.6, 208.4 179.2, 121.5 178.8 M121.3 178 C115 179.1, 113.7 173.5, 114 168.1 M121.1 176.4 C114.2 179, 110.7 176.6, 109.8 167.8 M112.5 168.6 C111.2 157.9, 111.2 145.5, 114 130.6 M111.4 169.6 C112.5 159, 111.9 150.2, 112.4 132 M112 131.3 C112.8 126.8, 117.1 123.1, 120.6 121.1 M113.9 129.7 C110.9 126.5, 114.4 120, 122.3 123.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;210&quot; y=&quot;140.0&quot;&gt;a register&lt;/tspan&gt;&lt;tspan x=&quot;210&quot; y=&quot;160.0&quot;&gt;inside the chip&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M325.9 122.4 C384.6 125.1, 442.1 122.9, 504.6 122.5 M326.4 121.1 C365.7 120.2, 405.7 121, 504.9 122 M504.7 122 C509.9 120.6, 512 126.8, 513.2 129.8 M504.6 121.1 C510.7 124.3, 515.8 124.1, 512.5 130.3 M513 132.9 C512.6 142.6, 514.3 148.8, 513.6 169.9 M514.1 131.4 C514.6 144.1, 514.3 158.2, 513.7 168.4 M514 168.7 C514.1 173.7, 509.4 177.8, 504.3 179.6 M513.8 170.2 C512.8 175.2, 512.3 176, 506.6 177.6 M505.9 180 C440.4 177.3, 374.2 178.3, 328.9 176.3 M505.3 178 C440.6 178.4, 377.4 176.9, 327.5 177.7 M327.3 178 C321.5 179.3, 316.7 175.1, 316.7 169.8 M327.3 178.3 C319.6 180.1, 319.6 176.2, 319.3 169.9 M316.7 166.9 C318.1 157.1, 318.3 147, 316 132.7 M317.2 168.9 C318.5 155.9, 317.8 142, 318.8 132 M318 131.3 C316 125.2, 319.5 121.3, 327.9 122.8 M319.6 129.6 C317.8 127.1, 322.1 123.4, 327.5 122.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;416&quot; y=&quot;140.0&quot;&gt;a variable&lt;/tspan&gt;&lt;tspan x=&quot;416&quot; y=&quot;160.0&quot;&gt;in my program&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;217.0&quot;&gt;the loop&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M122.7 186.8 C173.2 187.2, 219.8 186.4, 299.7 186.7 M121.7 188.5 C170.7 188, 220 187.8, 299.5 188.8 M298.7 188 C303.6 186.8, 307.9 191.6, 308.9 196.9 M297.1 189.2 C303.6 187.9, 310.1 192, 308.4 198.7 M308.9 197.4 C307.2 203.2, 308.3 213.3, 307 236.2 M307.3 196.4 C309.2 206.5, 307.5 213.7, 307.8 233.8 M308 234.7 C307.9 241.6, 305.5 245.3, 298.8 243.9 M308 234.6 C310.1 239.5, 305.7 244.3, 297.9 241.8 M296.9 245.5 C236.7 242.6, 173.6 244.9, 119.4 242.5 M299.1 243.1 C259.7 244.9, 221.4 246.1, 120.8 243.6 M121.3 244 C114.5 242.9, 110.5 242, 111.1 232.8 M119.7 244.9 C114.4 246.2, 113.2 238.8, 111.3 234.9 M112.3 234.3 C111.8 225.2, 112.6 221.2, 111.2 198.1 M111.4 234.5 C112.2 226.7, 112.1 217.9, 112.6 197.7 M112 197.3 C111.7 190.8, 116.7 188.7, 121 189.7 M111.2 195.9 C110.4 193.2, 116.5 187.8, 122.2 187.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;210&quot; y=&quot;206.0&quot;&gt;fetch → decode&lt;/tspan&gt;&lt;tspan x=&quot;210&quot; y=&quot;226.0&quot;&gt;→ execute&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M328.8 186.9 C378.3 187.6, 431.9 187.4, 505.9 186 M328.2 188 C387.6 189.1, 449.5 190.5, 503.9 188.2 M504.7 188 C510.3 187.5, 515.6 191.7, 512.8 196.1 M503.3 190 C513.1 186.7, 514.9 189, 511.7 195.7 M515.5 198 C514.1 203.4, 515.6 210.7, 514 234.8 M514.6 196.8 C513.7 207.3, 513.9 217.2, 514.1 234.9 M514 234.7 C513.3 241.3, 509.5 244.9, 506.1 244.2 M515.8 235 C513.5 240.3, 510.6 243.5, 503.3 245.1 M506.6 243.4 C437.2 243.3, 370.3 245.1, 329.3 242.4 M504.3 244.3 C438.1 246, 371.2 245.2, 327.3 243.8 M327.3 244 C321.4 245.5, 318.5 242.2, 317.2 233.4 M327.6 242.8 C321.2 245.6, 318.4 242.9, 318.7 233.4 M318.7 235.1 C319.1 227.3, 319.6 216.4, 317 195.8 M318.7 235.5 C318.6 220.4, 318.2 206.9, 317 198.2 M318 197.3 C318.8 189.2, 320.5 186.9, 325.9 186.3 M319.2 196 C319.6 192.8, 321.2 189.7, 326.5 188.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;416&quot; y=&quot;206.0&quot;&gt;the same loop,&lt;/tspan&gt;&lt;tspan x=&quot;416&quot; y=&quot;226.0&quot;&gt;written in Rust&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;283.0&quot;&gt;made of&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M119.8 252 C187.8 255, 254 254.2, 297 253.4 M122.3 255 C181.7 252.8, 240.3 252.7, 297.8 254.5 M298.7 254 C303.9 252.3, 308.5 255.8, 307.2 263.3 M298.6 255.6 C303.7 254.3, 308.1 256, 309.5 264.1 M308 262.5 C307.2 271, 309.1 281.8, 307.3 301.6 M307.5 262.4 C308.8 277, 308.3 289.7, 307.7 301 M308 300.7 C309.9 305.8, 304.8 309.8, 299.4 308.4 M308.7 302.6 C308.6 308.2, 305 311.4, 296.8 307.7 M299.3 308.8 C245.3 309.9, 189.1 310.2, 122 309.3 M299.2 309.5 C236.2 307.8, 172.7 307.9, 120.7 310.6 M121.3 310 C115.6 311, 111.1 308.6, 112.7 300.9 M123.2 308.3 C114.9 310.4, 109.8 308.4, 110.2 301.1 M110.7 301.9 C110.5 288.9, 110.3 279.5, 113.5 262.7 M111.5 300.8 C112.2 285.3, 112.9 271.3, 112.1 263.1 M112 263.3 C112.3 258.4, 114.3 253.8, 121.4 254.3 M111.7 264.3 C109.9 256.5, 116.7 255.7, 122.1 255.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;210&quot; y=&quot;282.0&quot;&gt;silicon&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M328.9 255.8 C369.6 252.3, 414.2 250.5, 504 252.6 M326.5 253.4 C368.7 253.1, 410.1 253.2, 503.8 253.4 M504.7 254 C509.5 252.7, 515.6 255.2, 512.8 262.1 M503.8 253 C512.7 252.2, 512.6 258, 515.1 264.8 M515.4 262.3 C512.1 276.9, 514.2 288.5, 514.2 299.9 M514.4 263.2 C513.2 273.3, 514.6 283.2, 514.8 301.3 M514 300.7 C512.3 305.6, 512.3 311.6, 503.4 308.4 M514.2 302.5 C513.3 304.8, 512.8 309, 505.1 310.9 M505.2 311 C447.6 311.2, 389 310.4, 326.1 311.7 M504.8 309.8 C448.1 309.1, 392.4 309.5, 327.2 309.1 M327.3 310 C322.5 311.6, 319.2 306, 316.7 302.3 M328.6 309.1 C322.6 309, 320 307.3, 319.8 302.9 M318.7 298.9 C318.8 287.7, 319.7 275.6, 317.2 265.2 M317.7 300.3 C318.9 291, 317.7 281.6, 317.8 263 M318 263.3 C318.4 255.8, 322.6 253.3, 327.1 255.3 M317.7 263.2 C320.1 257.5, 323.1 254.6, 327.4 255.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;416&quot; y=&quot;272.0&quot;&gt;a Rust program,&lt;/tspan&gt;&lt;tspan x=&quot;416&quot; y=&quot;292.0&quot;&gt;on the real CPU&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;The same job, two very different machines.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;That&#x27;s what &lt;em&gt;virtual&lt;/em&gt; means here. The VM is a machine that doesn&#x27;t physically exist: a program playing the role of a CPU. And underneath it, the real CPU is running that program, one real instruction at a time.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;31 -10 535 327&quot; width=&quot;535&quot; role=&quot;img&quot; aria-label=&quot;My VM pretending to be a CPU&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M211.9 17.4 C237.4 24, 271.8 22.3, 340.4 18.6 C344.5 21.7, 353.6 25.7, 347.4 27.9 C350.9 52, 350.1 76.9, 347.8 128.8 C348.7 135.6, 346.9 138.9, 338 139 C296.9 143.4, 259.6 143.9, 211.2 137.6 C205.1 136.8, 200 137.2, 200.9 130 C204.2 100.6, 200.4 67, 198.6 31 C197.3 25.1, 200.3 18.6, 212.1 20.5&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M210.2 20.4 C236.9 18.8, 264.2 18.2, 339.2 20 M210.5 20.3 C256.4 20.4, 302.3 20.4, 339.8 20.5 M340 20 C348 18.9, 351.4 23.3, 349.2 30 M341.2 21.1 C345.7 21.3, 349.5 24.2, 352.2 31.4 M349.2 31.9 C348.1 60.4, 349.4 92.2, 351.4 129.6 M349.4 29.3 C349.3 61.1, 350 93.2, 349.8 129 M350 130 C349 134.7, 346.7 139.4, 338.6 139.4 M348.1 129.7 C348.3 136.1, 345.5 139.7, 340.3 139.3 M339.1 140.9 C294.5 140, 246.5 138.8, 210.9 140.2 M340.8 140 C309.7 141.2, 278.4 140.1, 210.4 140.9 M210 140 C202.3 138.7, 198.5 137, 200.7 129.5 M208.4 139.1 C203.6 140.3, 200 136.8, 198.6 131.3 M199.5 128.6 C202.5 101.8, 200.5 76.6, 198.7 30.6 M200.9 130.2 C199.2 97.9, 200.1 65.9, 200.7 29.1 M200 30 C199.8 22.2, 204.3 19.7, 208.1 19.9 M198.8 29.6 C201.8 23.4, 202.3 19.1, 208.7 18.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M267.2 52.1 C267.8 51.9, 268.5 51.9, 268.8 52.5 C269.1 53, 268.9 54.6, 268.9 55.5 C269 56.3, 269.2 56.9, 269.2 57.4 C269.1 57.9, 269 58.3, 268.7 58.7 C268.3 59.1, 268 60, 267.3 60 C266.6 60, 265 59.2, 264.4 58.6 C263.8 58, 263.4 57.2, 263.6 56.4 C263.7 55.5, 264.4 54.3, 265.1 53.5 C265.7 52.8, 267 52.1, 267.4 52 C267.8 51.8, 267.5 52.4, 267.4 52.5 M266.5 53.2 C267.1 53.1, 266.9 53.7, 267.4 54.1 C267.9 54.5, 269.1 55.2, 269.2 55.7 C269.4 56.2, 268.3 56.8, 268.4 57.1 C268.5 57.3, 270.2 56.8, 269.7 57.2 C269.3 57.7, 266.4 59.8, 265.7 59.9 C265.1 59.9, 266.3 57.9, 265.9 57.4 C265.5 56.9, 263.5 57.4, 263.2 56.7 C262.9 56, 263.5 53.8, 264 53.3 C264.6 52.8, 265.8 54, 266.3 53.8 C266.9 53.6, 267.2 52.5, 267.2 52.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M267.2 52.5 C267.9 52.2, 269 52.4, 269.3 52.9 C269.6 53.3, 269.1 54.6, 269 55.3 C269 56, 269.2 56.4, 268.9 57.1 C268.6 57.8, 267.8 59.4, 267.2 59.5 C266.7 59.7, 265.9 58.2, 265.4 58 C264.9 57.7, 264.3 58.8, 264.2 58.2 C264.2 57.6, 264.7 54.9, 265 54.3 C265.3 53.6, 265.5 54.3, 266 54.2 C266.5 54.1, 267.6 53.6, 267.9 53.6 C268.2 53.5, 268.2 53.8, 268.1 53.9 M266.7 51.7 C267.6 51.5, 268.2 52.7, 268.5 53.1 C268.8 53.6, 268.4 53.5, 268.5 54.2 C268.5 55, 268.4 57.3, 268.7 57.8 C268.9 58.4, 270.4 57.6, 270.1 57.8 C269.8 57.9, 268 58.8, 267 58.8 C266.1 58.8, 265.2 58, 264.5 57.8 C263.8 57.5, 263.1 57.6, 262.9 57.2 C262.7 56.7, 263.1 55.4, 263.5 54.9 C263.8 54.4, 264.8 54.4, 265 54.1 C265.2 53.8, 264.8 53.2, 264.8 53&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M282.3 52.3 C283.1 52.4, 284.7 53.3, 285.4 53.7 C286.1 54.2, 286.6 54.2, 286.5 54.9 C286.4 55.7, 285.1 57.8, 284.8 58.4 C284.5 58.9, 285.2 57.9, 284.8 58.1 C284.5 58.2, 283.3 59.8, 282.6 59.5 C281.8 59.3, 280.7 57.1, 280.4 56.5 C280 55.9, 280.2 56.6, 280.4 56 C280.6 55.5, 280.9 53.6, 281.5 53.1 C282.2 52.6, 283.6 53.1, 284.3 53.2 C284.9 53.3, 285.4 53.7, 285.5 53.8 M280.8 52 C281.5 51.8, 283.8 53.2, 284.3 53.4 C284.9 53.6, 283.6 52.7, 284 53.4 C284.5 54, 286.7 56.7, 287 57.5 C287.2 58.3, 286.3 58, 285.6 58.1 C284.9 58.2, 283.5 58.1, 282.7 58.3 C282 58.5, 281.5 59.4, 281.2 59.3 C281 59.2, 281.1 58.8, 281.2 57.8 C281.4 56.7, 281.8 53.8, 282 53.1 C282.1 52.4, 281.9 53.5, 282 53.3 C282.1 53.2, 282.5 52.5, 282.7 52.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M283.5 52.8 C284.2 52.8, 285.6 53.6, 285.9 54 C286.3 54.3, 285.8 54.5, 285.7 55.1 C285.6 55.8, 285.5 57.4, 285.3 57.9 C285.1 58.3, 285.1 57.7, 284.5 58 C283.9 58.3, 282.3 59.7, 281.7 59.6 C281.1 59.4, 281.2 57.8, 280.8 57.2 C280.4 56.6, 279.4 56.3, 279.3 55.8 C279.3 55.3, 280 54.8, 280.6 54.4 C281.2 54.1, 282.3 53.7, 283 53.7 C283.7 53.6, 284.6 54.4, 284.7 54.4 M281.6 52.7 C282.2 52.4, 284.9 53.4, 285.5 53.9 C286.2 54.4, 285.7 54.8, 285.6 55.5 C285.4 56.3, 284.9 58, 284.8 58.4 C284.7 58.8, 285.1 57.7, 284.9 58.1 C284.7 58.4, 284.5 60.1, 283.5 60.3 C282.6 60.5, 279.8 60, 279.5 59.1 C279.1 58.1, 281.3 55.9, 281.4 54.8 C281.5 53.7, 280 52.9, 280 52.6 C279.9 52.3, 280.7 53, 281.2 53.2 C281.6 53.4, 282.6 53.6, 282.7 53.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M265 68 C273.1 78.3, 277.1 78.5, 288.2 69.9 C279.6 69.7, 273.9 65.7, 264.9 70.2&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M265 68 C272.1 78, 278.4 75.8, 283.2 66.3 M266.5 69.3 C269.9 77, 277 76.7, 284.8 67.3 M285 69 C282.6 69.7, 275.4 67.7, 265.1 69.7 M285.8 68.8 C278.9 68.3, 273.6 68.2, 265.1 68.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M246 91.7 C265.5 96.5, 293.5 95.9, 305.8 94.3 C306.8 95.9, 307.9 95.6, 310.7 101.9 C309 101.8, 310.4 108.1, 307.4 118.9 C310 125.2, 307.8 127.1, 305.7 121.3 C283.8 123.2, 268.1 126, 246.6 123.4 C245.6 121.9, 243.6 124.5, 244.8 120.4 C242.4 114, 243.1 99.6, 243.2 98.2 C242.9 97, 241 96.6, 245.9 96.9&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M248.8 95.4 C262.8 92.5, 277.7 92.2, 301.2 93.2 M246.9 94.4 C268.4 94, 288.7 94.5, 303.1 93.2 M303 94 C304.8 94.2, 308.7 96.3, 307.7 99.5 M301.3 95.2 C305.6 95.6, 308.2 93.9, 309 99.6 M306.3 100.8 C308.8 104.6, 307.3 110.3, 308.2 117.9 M307.5 98.4 C307.6 103.1, 307.9 106.8, 307.5 119.2 M308 119 C308.9 121.5, 307.6 125.1, 302.5 122.7 M309.2 118.4 C307.3 120.7, 308 125, 304.8 123.4 M302.8 123.2 C286.1 123.2, 268.8 125.3, 247.2 125.6 M302.8 123.9 C282.5 124.5, 262.5 124.3, 247.7 124.9 M247 124 C244 125.2, 242.3 123.9, 242.6 117.7 M248 123 C244.5 124.7, 242.5 121.9, 244 117.4 M241.6 119.5 C240.1 112.2, 243.1 105.8, 242.8 98.1 M242 119.2 C241.6 113.6, 241 105.2, 242.1 98.8 M242 99 C242.6 96.8, 242.7 94.3, 246.7 95.5 M240.7 98.2 C241.6 96.6, 245 95.3, 247.8 93.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;275&quot; y=&quot;109.0&quot;&gt;CPU&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;end&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;180&quot; y=&quot;70.0&quot;&gt;my VM&lt;/tspan&gt;&lt;tspan x=&quot;180&quot; y=&quot;90.0&quot;&gt;(a Rust program)&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M410.1 4 C446.4 2.9, 480 6, 544.5 5.1 C547.2 5.4, 551.6 10.2, 547.4 14.2 C546.9 28.4, 547 36.2, 546.5 44.3 C551.8 49.6, 547.7 57.9, 542.6 57.9 C507.1 56.9, 477.4 52.5, 409.4 53.9 C404.4 56.9, 403.2 56.2, 401.6 44.4 C397.5 31.9, 402 23.2, 399.6 13.1 C400.5 9.1, 400.3 5.3, 406.4 3.1&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M408 5.7 C436.6 5.6, 463.9 6.8, 541.2 7 M408.2 5.5 C451.8 7.4, 495.5 7.4, 541.5 6.5 M541.7 6 C545.4 6.7, 550 9.1, 550.3 14.6 M539.7 4.1 C548.9 5.5, 550.8 9.8, 550.9 14.2 M549.3 15.1 C550.2 24.6, 548.3 31.9, 548.6 47.3 M549.4 15 C549.2 24.7, 550.9 35.6, 549.7 48 M550 47.7 C548.3 53.4, 547.3 56.6, 541.3 57.9 M549.4 47 C549.1 54.9, 545.7 54, 540.7 57.5 M542.8 56.6 C494.1 57.8, 451.3 56.8, 408.6 55.6 M542.5 55.8 C504.8 55.5, 467.9 54.5, 408.3 56.7 M408.3 56 C401.3 54.8, 401.9 51.9, 400.9 48.2 M406.4 55 C402.5 56.5, 402.1 51.1, 398.3 49.8 M401.5 46.5 C400.7 35.5, 401.4 21.8, 398.6 15.6 M399.6 48.3 C400.8 34.5, 400.9 22.7, 400.4 14.3 M400 14.3 C398 9.7, 404.4 5.8, 407.4 4.7 M399.4 13.4 C400.4 11, 400.9 7.1, 410.4 5.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M402 21.9 C377.8 33.1, 354.8 44.2, 342.7 56.2 C361.1 53.8, 374 50.3, 398 42 C400.9 36.1, 396.2 32.9, 400.3 24&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M400.3 21.6 C387.5 30.1, 374.5 36.4, 341 53.1 M400.7 22.7 C376.6 35.3, 352.1 46.1, 340.9 54.8 M338.3 53.8 C355.7 50.1, 370.3 49.3, 401 44.5 M339.8 53.4 C364.4 50.5, 388.5 46.6, 400.4 43.2 M398.8 42.6 C400.2 38.3, 399.1 36.8, 398.9 21.5 M399.6 43.5 C399.6 38.7, 399.9 34, 399.8 21.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;475&quot; y=&quot;31.0&quot;&gt;I&#x27;m a CPU!&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M231.7 171.9 C262.9 167.6, 300 169.5, 316.9 173 C324 171.8, 330.7 170.7, 327.5 177.3 C332.3 195.1, 329.2 213.7, 329.4 246.8 C329.7 249.4, 327.3 257.4, 318.8 257.3 C294.1 252.9, 262 249.6, 231 255.7 C224.9 253.4, 217.6 251.3, 218.4 246.2 C218.8 231.9, 220.1 214.8, 220.1 181.2 C222.1 173, 224.8 169.6, 229.7 172.6&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M231.4 169.3 C249.4 171.9, 269.3 168.1, 319.8 169.4 M230.5 169.1 C257.8 168.8, 287.2 169.8, 320.9 169.5 M320 170 C325.3 171.6, 329.3 173.9, 330.8 180.4 M318.4 168.6 C325 168.6, 331.4 174.5, 327.9 179.1 M331.3 178.1 C329.4 200.2, 328 223.3, 331.2 245.6 M329.4 179.4 C330.5 200, 329.7 219.3, 330.6 243.9 M330 244 C330 249.9, 324.8 255.2, 318.2 255.2 M330.1 245.1 C331.8 251.2, 324.9 255.7, 320.8 252.1 M318.2 252.4 C288.6 251.7, 257.7 252.8, 229.9 255.3 M320.8 254.7 C294.1 255, 266.5 255.2, 230.8 253.6 M230 254 C223.6 252.9, 219.6 250.5, 220.9 245 M229.9 255 C222.7 252.4, 218.6 249.7, 218.1 244.2 M220.4 243 C219.9 216.5, 218 191.1, 218.5 179.6 M219.9 243.9 C220.3 230.7, 220 217.2, 220.3 179.4 M220 180 C221.2 173.3, 223.2 169.9, 229.5 170 M219.7 178.9 C222.1 172.1, 225.6 169.8, 231.5 169.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M236.6 168.9 C236.9 166.7, 237.1 162, 237.1 157.7 M236 170.4 C236.4 168, 235.8 165.3, 235.9 157.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M236.9 252.8 C237 257.6, 235.1 262.2, 235.6 267 M236.5 253.9 C235.8 256.8, 235.8 260.1, 236.5 265.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M218.9 186.1 C217 185.7, 211.4 185.3, 208.4 184.9 M219.8 184.4 C216.1 184.5, 211.5 184.8, 207.9 185&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M329.2 186.1 C335 184.6, 337.8 185.6, 340.8 183.8 M330.4 185.2 C335.2 184.8, 340.1 185.2, 342.5 185.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M261.5 171 C263 166.9, 262.1 162.8, 261.7 158.1 M261.7 169.7 C261.6 166.8, 262.3 164.3, 262 158.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M261.9 254.9 C263.1 257.7, 262.6 263.1, 262.5 265 M262.2 254.4 C262 257.9, 262.2 261.4, 262.6 266.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M220.2 203.9 C217.2 204, 212.9 201.9, 207 203.3 M219.6 202.9 C215.8 203.3, 210.8 203.1, 208 202.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M330.6 203.8 C332.8 202.8, 337 202.2, 341.8 202.2 M330.1 202.5 C332.5 203.4, 335.6 203.4, 342.6 202.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M288.9 170.7 C286.9 167, 287.3 161.3, 288.6 158.5 M287.4 170.2 C287.9 166.7, 287.5 162.1, 288 158&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M286.9 254.6 C286.8 257.9, 287.6 261.6, 287.1 265.4 M288 253.7 C288.3 259, 288.6 262.7, 288.6 266.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M219.3 220.1 C216 221.7, 212.8 220.6, 208.7 220.1 M219.7 221 C216.2 221, 212 221.1, 207.5 220.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M329.6 220 C334.2 220.5, 337 220.8, 341.2 221.4 M330.3 220.5 C335.2 220.9, 339.1 221.3, 342.1 221.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M314 168.9 C314.3 166.6, 313.3 161.9, 314 157.3 M313.6 170.2 C313.6 167.1, 313.5 163.4, 313.5 158.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M314.3 252.8 C314.3 257.6, 313.7 262.4, 314.9 266.6 M314.1 253.7 C314.1 258.1, 314.6 261.5, 314.1 266.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M220.6 240.2 C216.2 239.7, 211.9 239.4, 207.3 238.5 M219.5 239.5 C215.9 239.5, 211.3 239.2, 207.5 238.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M331 240.1 C334.4 238.5, 338.5 239.6, 342.1 239.8 M330 239 C332.5 239.5, 335.9 239.5, 342.1 238.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M266.2 200.8 C266.6 200.7, 267.8 200.5, 268.3 201 C268.8 201.4, 269.1 203, 269.2 203.7 C269.3 204.4, 269 204.4, 268.8 205 C268.6 205.6, 268.5 206.7, 268.1 207 C267.7 207.3, 266.9 207.3, 266.2 206.9 C265.4 206.5, 264.1 205.2, 263.7 204.6 C263.2 204.1, 263.4 204.1, 263.5 203.6 C263.6 203.2, 263.6 202.5, 264.3 202 C265 201.5, 267.2 200.6, 267.7 200.5 C268.2 200.3, 267.4 201.1, 267.4 201.1 M267.6 201.1 C268.5 200.9, 270.8 200.6, 271.1 201.1 C271.5 201.6, 270.5 203.6, 269.9 204.4 C269.3 205.1, 268 205.1, 267.5 205.6 C267 206.1, 267.7 207.1, 267.1 207.2 C266.5 207.3, 264.4 206.3, 263.9 206.1 C263.3 205.8, 263.8 206.3, 263.9 205.8 C264.1 205.2, 264.6 203.6, 264.8 202.8 C265.1 202, 264.9 201.3, 265.4 201 C265.9 200.7, 267.3 201, 267.8 200.9 C268.3 200.9, 268.7 200.7, 268.5 200.8&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M268.9 201.9 C269.6 202, 270.4 202, 270.6 202.4 C270.8 202.9, 270.1 203.8, 270 204.7 C269.8 205.5, 270.3 207, 269.6 207.4 C268.9 207.8, 266.8 207.2, 265.9 207 C265 206.8, 264.5 206.7, 264.1 206.1 C263.7 205.5, 263.4 204.2, 263.5 203.5 C263.5 202.8, 264 202.6, 264.3 202.2 C264.6 201.7, 264.4 200.9, 265.2 200.8 C266 200.7, 268.4 201.3, 268.8 201.5 C269.2 201.6, 267.8 201.9, 267.7 201.8 M267 202.2 C268 202.3, 269.6 201.2, 270.2 201.4 C270.8 201.6, 270.5 202.4, 270.7 203.2 C270.9 203.9, 271.4 205.1, 271.2 205.9 C270.9 206.7, 270.1 207.8, 269.2 207.8 C268.3 207.7, 266.4 206.2, 265.7 205.6 C265 205, 265.1 204.7, 264.9 204.2 C264.8 203.7, 265.2 202.8, 264.9 202.6 C264.7 202.4, 263.3 203, 263.6 202.9 C263.9 202.9, 266.2 202.6, 266.7 202.3 C267.3 202, 266.7 201.1, 266.6 200.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M283.4 201 C283.9 201.2, 284.3 201.9, 284.9 202.2 C285.5 202.6, 286.5 202.6, 286.7 203.2 C287 203.8, 286.8 205.4, 286.4 205.9 C286 206.5, 285.1 206.3, 284.2 206.4 C283.4 206.4, 282.2 206.7, 281.5 206.4 C280.7 206.1, 279.8 205, 279.7 204.5 C279.5 204, 280.2 203.8, 280.4 203.3 C280.5 202.8, 280.1 201.9, 280.8 201.6 C281.4 201.3, 283.5 201.5, 284.1 201.6 C284.8 201.7, 284.8 202.1, 284.7 202.1 M284.9 199.7 C285.4 199.8, 285.2 202.3, 285.2 203.1 C285.2 204, 284.7 204.4, 284.9 204.9 C285.1 205.4, 286.7 205.6, 286.3 206.1 C286 206.7, 284 208, 283.1 208.3 C282.1 208.6, 281.5 208.4, 280.8 207.8 C280.1 207.2, 279.2 205.5, 279 204.9 C278.8 204.2, 279.4 204.6, 279.5 203.9 C279.7 203.2, 279.5 201.2, 280.1 200.6 C280.8 200, 282.9 200.2, 283.5 200.2 C284.1 200.2, 284 200.5, 283.9 200.5&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M285.1 202.2 C285.6 202.6, 285 203.1, 285.2 203.5 C285.5 203.9, 286.8 204, 286.6 204.5 C286.4 204.9, 284.6 205.7, 284.1 206.2 C283.5 206.7, 283.8 207.6, 283.2 207.5 C282.6 207.5, 280.9 206.3, 280.4 205.8 C279.8 205.3, 280 205.3, 280 204.6 C280.1 203.9, 280.3 202.3, 280.5 201.7 C280.8 201.1, 281.3 201, 281.8 201 C282.3 200.9, 283.2 201.3, 283.6 201.4 C283.9 201.6, 283.5 201.8, 283.7 201.9 M285 200.4 C285.6 200.4, 283.7 201.7, 284.1 202.4 C284.5 203.1, 287.5 203.9, 287.5 204.5 C287.5 205.2, 284.6 205.7, 284 206.3 C283.4 206.8, 284.1 207.7, 283.8 207.7 C283.5 207.8, 282.8 207.2, 282.2 206.8 C281.6 206.4, 280.3 206, 280.1 205.4 C279.8 204.8, 280.7 204, 280.7 203.3 C280.7 202.5, 279.9 201.2, 280.3 200.9 C280.6 200.6, 282.2 201.5, 283 201.7 C283.7 201.9, 284.7 201.8, 284.6 201.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M267 221 C271.6 217, 274.5 217.9, 275.8 217.3 M268.5 219.6 C270.2 216, 272.4 216.1, 272.9 219.5 M275 219 C275.4 220.3, 278.2 221.9, 284.4 217.1 M273.4 219.9 C276.8 221, 279.6 218.9, 284.8 218.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;275&quot; y=&quot;288.0&quot;&gt;the real CPU&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M410.9 188.4 C442.1 194, 473.9 194, 505.7 190.4 C505.5 192.5, 513.2 195.5, 507.5 195.4 C507.9 208.5, 513.1 217.1, 510.6 229.3 C509.2 234.4, 504.4 235.5, 503.8 236.2 C480 238.4, 458.5 237.3, 410.2 232.4 C405 239.4, 398.2 233.9, 398.9 226.8 C397.8 218.7, 398.6 209.6, 402.8 200.4 C399.4 189.5, 403 192.2, 406.9 192.1&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M408.3 188.7 C439 190.7, 473.8 188.5, 502.9 191.6 M406.9 189.2 C430.8 190.4, 454.8 189.2, 502.7 190.2 M502.3 190 C506.5 191.7, 508.6 192.5, 509.2 198 M502.6 191.3 C507 188, 507.8 192.3, 511.2 197.1 M510.6 199.3 C510.7 206.7, 511 218, 511 228.4 M509.3 197.1 C509.8 206.5, 510.7 215.4, 510.7 227.8 M510 228.3 C511.7 234.3, 506 236.7, 501.6 235.3 M511.1 230 C511.8 235.4, 506.2 234.9, 502.7 237.5 M501.6 237.3 C466.9 236.5, 426.9 237.1, 409.6 234.6 M502 235.4 C475.9 235.2, 447.4 236.6, 408 235.8 M407.7 236 C401.8 237, 400.8 232.6, 399.1 229.8 M409.5 237.3 C403.9 233.7, 401.8 232.4, 401.4 226.8 M399 229 C399.5 219.1, 400.1 212, 399.7 197.8 M399 228.7 C399.7 220.1, 400.6 212.2, 400 196.8 M400 197.7 C400.1 192.1, 401.8 191.4, 409.3 189.4 M401.8 196.5 C400.6 191.4, 404.3 190.5, 408.3 188.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M402.5 202.3 C388.7 204.2, 377.2 206.9, 343.2 213.5 C358.9 216.5, 374.3 220.8, 401 220.6 C398.2 222.4, 398.3 211.7, 397 202.1&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M401.2 200.6 C379.7 203.3, 363.4 206.1, 346 209.8 M400.1 202.4 C382.7 204, 364.6 207.6, 343.4 210.6 M343.3 208.4 C355.4 213.4, 365.3 216, 400.6 222.7 M344.8 209.7 C362.1 215, 380.2 219.3, 400.7 224.5 M398.7 225.3 C401.3 215.8, 400.7 208.6, 398 200.4 M399.4 224.2 C399 217.4, 400.9 210.8, 400.6 201.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;455&quot; y=&quot;213.0&quot;&gt;…sure.&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;So there are two machines stacked on top of each other — the pretend one I built, and the real one it runs on. Hold on to that picture. The rest of this series is about what that real one is actually doing.&lt;/p&gt;
&lt;h3 id=&quot;one-addition-two-machines&quot;&gt;One addition, two machines&lt;a class=&quot;anchor&quot; href=&quot;#one-addition-two-machines&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To make that concrete, follow a single addition — &lt;code&gt;2 + 3&lt;/code&gt; — through both.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In my VM&lt;/strong&gt;, the bytecode has already pushed &lt;code&gt;2&lt;/code&gt; and &lt;code&gt;3&lt;/code&gt;, and the next instruction is &lt;code&gt;ADD&lt;/code&gt;. Here&#x27;s the part of Cecile&#x27;s VM that runs it, lightly trimmed:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;loop&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read_u8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;// fetch: read the next byte, move ip forward&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;op&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ADD&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;op_binary_add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;op&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;MUL&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mul&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;// ...one arm for every instruction&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;op_binary_add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;mut&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;           &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;// 3&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;           &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;// 2&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;as_number&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;as_number&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()).&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;into&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;// 5&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Fetch is &lt;code&gt;read_u8&lt;/code&gt;. Decode is the &lt;code&gt;match&lt;/code&gt;. Execute is &lt;code&gt;op_binary_add&lt;/code&gt;: pop two values, add them, push the result. That&#x27;s one bytecode instruction — and every line of it is ordinary Rust, which means it all becomes &lt;em&gt;real&lt;/em&gt; machine instructions that the real CPU runs. Reading the byte, jumping to the right arm, two pops, a push: one &lt;code&gt;ADD&lt;/code&gt; in my VM costs the real CPU a whole handful of instructions. And in the middle of it, that &lt;code&gt;a + b&lt;/code&gt; is itself compiled to the CPU&#x27;s own add instruction (a floating-point one, because Cecile&#x27;s numbers are 64-bit floats).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In the real CPU&lt;/strong&gt;, the same addition is one instruction. Say &lt;code&gt;2&lt;/code&gt; is already in a register called &lt;code&gt;eax&lt;/code&gt;, and the next instruction is &lt;code&gt;add eax, 3&lt;/code&gt;. In memory that&#x27;s just three bytes: &lt;code&gt;83 C0 03&lt;/code&gt;. The CPU&#x27;s instruction pointer — on x86-64, a register called &lt;code&gt;rip&lt;/code&gt; — points at them. The chip fetches the bytes, its decoder recognises &quot;add 3 to &lt;code&gt;eax&lt;/code&gt;&quot;, a circuit called the ALU does the addition, &lt;code&gt;eax&lt;/code&gt; now holds &lt;code&gt;5&lt;/code&gt;, and &lt;code&gt;rip&lt;/code&gt; moves on to the next instruction. No loop, no &lt;code&gt;match&lt;/code&gt;, no program running it. The fetch–decode–execute cycle is wired into the silicon.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -16 592 405&quot; width=&quot;592&quot; role=&quot;img&quot; aria-label=&quot;One addition, two machines&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M4.9 1.6 C88.1 1.9, 171.3 0.3, 254.7 -0.5 C255.6 -1.5, 261.4 1.2, 260.6 8.9 C262.7 12, 261.8 24.9, 262 31.9 C258 39.1, 256.6 39.5, 254.9 38.6 C188.6 48.4, 122.2 42.6, 5 39.9 C0 45.6, -2.4 37.2, 0.9 34.7 C-1.3 27.3, 0.9 25, 1.3 7.6 C0.3 3.5, 5.3 -2.3, 3.5 -1.5&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M7.3 -0.7 C95.4 2, 183.5 2.1, 252.5 -0.9 M7.1 -0.6 C93.5 -0.5, 180.2 -0.6, 253.3 0.5 M253 0 C258.7 0.9, 259.8 4.2, 260.7 7.8 M252.7 -0.4 C256.1 -1.8, 259.4 4.4, 261.6 7 M259.7 5.8 C261.1 18.7, 258.4 26.9, 260.7 33.9 M260.5 7.8 C260.4 15.6, 260.1 27, 259.4 35.1 M260 35 C259.2 41.3, 258.5 40.5, 254.4 40.3 M258.9 34.9 C260.5 37.7, 255.9 42.4, 252.2 43.6 M253.7 41.3 C203.5 39.7, 151.4 39.2, 5.7 42.3 M253.3 42.4 C173.9 41.6, 92.6 41.6, 6.2 42.3 M7 42 C0.9 41.8, -1.6 38, -1.6 36.9 M8.1 40.6 C1.2 41.9, -1.4 39, -1.5 35.9 M-1.5 34.5 C0.8 27.2, -1.5 20.5, -0.5 7.5 M-0.7 34.2 C0.7 24.5, -0.4 14.8, -0.8 7.7 M0 7 C0 2.4, 0.4 0.3, 8.4 0 M-1.7 6.4 C-0.6 2.6, 3 0.6, 6.4 1.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;130&quot; y=&quot;21.0&quot;&gt;my VM: ADD&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M8.5 59.6 C77.4 61.9, 146.2 59.9, 249.8 58.4 M10.4 60.8 C75.7 60.1, 142.2 60.7, 250.8 60.2 M250 60 C256.4 62, 260.1 61.3, 260.8 69.3 M251.5 61.7 C255 61.3, 261.3 61.7, 262.1 69.5 M258.1 70.3 C258.8 84.1, 262 95, 261.2 113.3 M259.8 69.9 C259.1 85.2, 260.1 98.3, 260.5 111.4 M260 112 C260.7 118.6, 256.3 121.3, 249 122 M261.1 110 C260.5 120.7, 256.5 122.5, 247.7 120.6 M249 121.9 C198.1 123.9, 147.5 122.8, 10.9 122.8 M249.8 121.7 C168.3 121.8, 85.9 121.2, 9.2 122.6 M10 122 C1.6 122, 0.8 118.4, -1 110.2 M9.9 122.2 C2.9 120.4, -1.9 118.7, -1.1 113.4 M1.9 111.9 C0.4 101.9, 1.2 90.1, -2 68.9 M-0.5 112.9 C0.3 99, -0.7 87.2, 0.6 69.9 M0 70 C1.5 61.7, 2.8 61.4, 10.3 58.5 M-0.6 68.1 C-2.1 61.8, 5.4 57.7, 11.8 58&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;130&quot; y=&quot;81.0&quot;&gt;fetch: read_u8()&lt;/tspan&gt;&lt;tspan x=&quot;130&quot; y=&quot;101.0&quot;&gt;reads the ADD byte&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M11.5 151.6 C63.1 152.5, 111.8 155.3, 250.8 150.8 M9.5 151.9 C103.6 152.6, 197.5 153.4, 250.4 152.1 M250 152 C255.7 151.5, 261 155.9, 261.4 162.1 M251.3 150.5 C255.2 149.7, 262.1 157.6, 259.3 160.5 M260.9 161.7 C262.3 177.2, 262.1 188.8, 260.4 205.3 M260.4 161.1 C259.7 179.3, 259.4 194.6, 259.6 203.3 M260 204 C260.8 210, 256.6 213.7, 251.9 213.9 M259.5 203.3 C262 212.4, 254.8 215.4, 248.3 215.1 M251.4 214.3 C170.5 212.1, 86.6 212.2, 9.3 212.5 M250.2 214.8 C171.4 213.8, 92.9 215.3, 10.1 213.6 M10 214 C2.9 212.1, -0.8 210.4, 1.2 205.9 M11.4 215.3 C3.3 216.3, 0.1 209.3, 0 204 M-0.4 204.9 C-1.6 192.6, 1 179.8, -1.8 162 M-0.7 203.7 C-0.7 186.7, -1 169.9, -1 161.7 M0 162 C-1.2 153.5, 3.4 150.3, 9 151.5 M0.2 161.3 C0 153.6, 2.6 153.2, 8.6 149.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;130&quot; y=&quot;173.0&quot;&gt;decode: match&lt;/tspan&gt;&lt;tspan x=&quot;130&quot; y=&quot;193.0&quot;&gt;→ op::ADD&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M130.9 128.5 C128.7 134.1, 131.1 143.9, 130 147.6 M129.4 128.6 C130.2 135.5, 130.7 141, 130.3 146.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M136.8 133.8 C132.7 137.6, 132.2 144.6, 130 147.2 M135.6 133.9 C133.9 138.7, 132 142.4, 130.2 146.2 M130.5 145.3 C127.5 143.1, 127.9 140, 123.1 133.9 M129.9 146.6 C127.8 141.9, 125.5 137.3, 124.3 133.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M8.5 244.6 C77.8 243.4, 144.5 241.5, 248.5 244.9 M9.2 244.3 C58.7 244.4, 106.6 244.6, 249.2 244.1 M250 244 C255.8 242.9, 258.5 246, 258.2 254.6 M251.8 244.4 C258.9 242.3, 260.6 247.1, 257.9 256 M258.1 255.9 C258.9 267.1, 259.5 277.1, 260.2 297.3 M260.8 253.4 C259 269.2, 260.1 282.8, 260.9 296.1 M260 296 C259.3 302.2, 257.6 304.6, 249.5 307.9 M260.4 295.7 C258.3 302.4, 258.6 305.4, 251.9 308.1 M250.8 306.4 C162.7 306.3, 75 309.5, 9.5 306.1 M250 305.8 C185.8 304.1, 122.5 304.1, 9.3 306.7 M10 306 C5 306.1, 0.2 304, -1.4 297.9 M9.4 305.2 C3.6 307.5, -1.4 303.3, 1 295.4 M-0.2 297.8 C1.1 281.9, -1.7 266.3, -1.6 255.9 M0.1 296.7 C0.8 284.7, -1.1 273.5, 0.3 254.5 M0 254 C1.2 248.6, 3.7 243.5, 8.7 243.6 M1.5 252.3 C-0.2 246.3, 3.1 245.1, 8.3 243.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;130&quot; y=&quot;265.0&quot;&gt;execute: pop 3, pop 2,&lt;/tspan&gt;&lt;tspan x=&quot;130&quot; y=&quot;285.0&quot;&gt;push 5&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M128.4 220.3 C129 226.2, 128.8 232.9, 128.9 236.3 M129.2 219.2 C129.5 224.7, 130.1 231.3, 130.3 237.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M134.8 225.6 C132.9 229.7, 130.3 234.4, 129.2 236.7 M135.5 224.7 C133.8 228.6, 132.4 233.2, 130.2 237.3 M130 236.9 C127.1 234.3, 126.2 228.7, 124.6 224.6 M130.2 237.5 C129.3 235, 127.5 233.1, 123.8 225.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;130&quot; y=&quot;344.6&quot;&gt;each step is Rust code —&lt;/tspan&gt;&lt;tspan x=&quot;130&quot; y=&quot;363.4&quot;&gt;many real CPU instructions&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M304.8 2.2 C373.6 2.1, 444.6 1.7, 554.7 1.7 C560.2 -3, 558.1 1.4, 556.5 8.9 C563.6 13.5, 559 20.8, 556.4 38 C562.6 38, 555.6 39.2, 554.3 43.5 C455.5 42.2, 354.4 41, 309.3 43.8 C301.9 44.8, 298.5 41.8, 298.3 31.9 C297.7 26.6, 299.6 19.2, 297.1 9.2 C298.9 -0.1, 302 -0.1, 304.6 0.4&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M305.5 -0.2 C398.3 3.1, 491.4 2.6, 551.4 0.6 M307.2 0.8 C386.4 -1.3, 464.3 -1.2, 553.6 -0.1 M553 0 C557.5 0.7, 560.3 3.2, 560.1 7.2 M554.6 0.6 C555.8 1.7, 558.9 1.1, 561.9 7.4 M559.1 8.5 C561.9 18, 561.2 27.8, 560.3 35.3 M560.2 6.8 C560.2 14.1, 561 20.5, 561 34.1 M560 35 C559.9 41, 555.8 41.9, 551.6 41.9 M559.4 34.7 C561.4 41.5, 558.8 40.4, 554.2 42.6 M553.6 40.7 C464.8 43.8, 374.6 42.1, 305.5 40.8 M553 42.6 C466.2 40.1, 380.7 40.3, 306.5 42 M307 42 C301.3 41.1, 298.9 40, 298.8 35.5 M308.2 40.3 C301.3 42.6, 301.2 40.9, 301 36.7 M298.2 34.1 C299.7 24.8, 301.5 14.7, 301.3 8.3 M299.3 34.5 C300.4 23.4, 300.8 13.5, 299.7 7.6 M300 7 C300 3.2, 301.4 1.3, 306.2 -0.2 M301.7 5.7 C298.3 1.9, 301.3 0.2, 306.2 -0.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;430&quot; y=&quot;21.0&quot;&gt;real CPU: add eax, 3&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M310.4 61.2 C361.6 61.2, 414.5 59.6, 551.1 59.6 M309.8 59.7 C396.8 58.6, 483.1 58.9, 549.4 60.6 M550 60 C555.6 60.6, 560.9 64.4, 560.2 69.1 M549.2 60.3 C558.9 60.3, 558.4 61.6, 558.5 71.3 M558.7 69.2 C561.4 80.4, 558.2 91.9, 560 110.2 M559.8 70 C560.7 84.9, 560 98.9, 559.1 112.9 M560 112 C558.5 119.8, 557.5 121.5, 549.7 120.4 M558.5 112.9 C560.2 120.5, 558 120.1, 548.3 123 M548.7 123.5 C496.1 121.7, 439.5 120.2, 308.3 123.7 M550.7 122.4 C497.1 123.2, 444.6 123, 309.2 122.2 M310 122 C301.5 123.3, 300.8 120.4, 298.6 111 M309.3 123.2 C301.5 123.4, 301 118.1, 300.4 114 M298.3 113 C299.8 97.4, 299.9 80.2, 299 69.7 M300.9 111.5 C300.1 95.6, 299.2 79.7, 299.4 69.8 M300 70 C298.1 63.1, 302 58.7, 309.5 59 M300.7 70.4 C298.8 62.4, 305.4 58.1, 311.2 59.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;430&quot; y=&quot;81.0&quot;&gt;fetch: bytes 83 C0 03&lt;/tspan&gt;&lt;tspan x=&quot;430&quot; y=&quot;101.0&quot;&gt;at rip&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M310 153.2 C395.3 155.1, 479.4 155, 548.8 152 M310.6 152.5 C376.6 152.7, 442.4 151.6, 550.6 152.6 M550 152 C554.9 150.1, 561.8 155, 560.8 161.9 M549 153.1 C554.5 153.4, 559.2 157.4, 560.3 162.4 M561.4 160.6 C560.9 173.5, 558.3 185.6, 559.2 202.2 M560.5 161.2 C561.2 179, 559.4 195.3, 560.1 204.9 M560 204 C558.6 211.2, 557.7 213.9, 548.5 212.3 M560.9 202.2 C561.8 212.2, 556.3 213, 548.8 212.9 M551.2 212.6 C465.1 213.9, 382 213.6, 310.1 213.3 M549.5 213.9 C500.2 212.8, 451.7 213.1, 310.1 214.8 M310 214 C302.8 213.4, 299.3 212.4, 300.8 202.7 M310.8 212.2 C301.8 214.6, 298.4 208.7, 301.5 204.6 M300 206 C298.6 196.5, 300.6 186.7, 299.2 162.9 M300.7 204.3 C301 191.7, 300.9 179.2, 299.9 161.5 M300 162 C299.5 154.9, 302.6 151.7, 308.2 151.9 M301.6 163.6 C301 154.2, 302.5 153.5, 308.1 151&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;430&quot; y=&quot;173.0&quot;&gt;decode:&lt;/tspan&gt;&lt;tspan x=&quot;430&quot; y=&quot;193.0&quot;&gt;“add 3 to eax”&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M430.1 129 C429.1 132.7, 430.9 134.5, 428.5 147.4 M429.5 127.2 C429.9 133.7, 429.5 139.2, 429.4 146.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M436.2 134.1 C434 136.7, 434.1 137.8, 428.8 147.1 M435.7 132.8 C434 137.3, 431.7 141.2, 429.5 146.2 M429.4 145.1 C427.7 144.3, 428.5 138.8, 423.8 134.3 M429.6 146.2 C429.1 143.6, 426.5 139.9, 423.6 133.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M310.5 243.5 C374.5 246.4, 439.5 245.8, 548.4 243.4 M310.8 244.8 C360.1 245, 409.9 245.2, 550.8 244.8 M550 244 C557.5 242.3, 558.7 245.8, 559.5 253.7 M549.6 245.9 C554.9 242.8, 560 245.9, 559.1 252.2 M560.9 252.9 C561.4 266.8, 560.5 275.9, 560.7 294 M559.9 254.7 C559.1 271, 559.7 286.9, 560.4 296.2 M560 296 C560.2 304.3, 557.1 304, 550.9 307.1 M560.8 295.1 C561 304, 558.6 304.6, 552 303.9 M549.4 307.6 C469.9 306, 393.1 306.6, 310.4 305.7 M549.3 305.7 C487.1 306.6, 423.8 306.7, 309.2 306.6 M310 306 C301.9 307.4, 299.8 301.3, 300.1 296.8 M309.7 306.6 C305.2 307.7, 297.9 302.2, 299.3 295.8 M299.3 294.6 C299.7 286.4, 298.2 276.9, 299.9 253.2 M299.1 296.8 C300.9 288.4, 299.3 278.5, 299.8 254.9 M300 254 C299.7 247.5, 302.8 244, 308.2 244.3 M302 253 C300.6 245.7, 303.9 244.9, 311.4 245.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;430&quot; y=&quot;265.0&quot;&gt;execute: the ALU adds&lt;/tspan&gt;&lt;tspan x=&quot;430&quot; y=&quot;285.0&quot;&gt;eax: 2 → 5&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M431.2 220.8 C429.4 224.8, 428.6 227.2, 431 239.7 M429.3 219.6 C429.2 224.7, 430.7 229.5, 429.4 238.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M437 226 C434.2 228.8, 432.3 230.4, 430.8 239.3 M435.5 225.1 C433.9 228.7, 433.5 232.1, 429.5 238.7 M428.9 236.8 C427.1 232.6, 426.6 230.2, 422.6 225 M429.9 238.5 C428.2 234.1, 426.4 230.6, 424.5 225.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;430&quot; y=&quot;344.6&quot;&gt;each step is circuitry —&lt;/tspan&gt;&lt;tspan x=&quot;430&quot; y=&quot;363.4&quot;&gt;no program underneath&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;The same addition, through both machines.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Same addition, same answer. But in my VM, a single &lt;code&gt;ADD&lt;/code&gt; is a little program running on the real CPU. In the real CPU, &lt;code&gt;add&lt;/code&gt; is the bottom: there&#x27;s nothing underneath it but circuits.&lt;/p&gt;
&lt;p&gt;Let me prove the whole thing works by tracing our six instructions by hand.&lt;/p&gt;
&lt;h2 id=&quot;watch-the-stack-compute-2-3-4&quot;&gt;Watch the stack compute 2 + 3 * 4&lt;a class=&quot;anchor&quot; href=&quot;#watch-the-stack-compute-2-3-4&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;We run the bytecode top to bottom. I&#x27;ll draw the stack after each step, top on the right.&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;start          stack: [ ]

PUSH 3         stack: [ 3 ]
PUSH 4         stack: [ 3, 4 ]
MUL            → pop 4, pop 3, push 3*4      stack: [ 12 ]
PUSH 2         stack: [ 12, 2 ]
ADD            → pop 2, pop 12, push 12+2    stack: [ 14 ]
STORE x        → pop 14 into variable x      stack: [ ]   (x = 14)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-22 -29 684 287&quot; width=&quot;684&quot; role=&quot;img&quot; aria-label=&quot;The stack after each instruction&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;45&quot; y=&quot;0.0&quot;&gt;PUSH 3&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M3.2 113.2 C19.3 109.3, 40.5 106.8, 82.3 106.6 C88.4 106.9, 91.1 114.2, 87.4 117.1 C93.3 124.2, 86.4 124.8, 88.2 142.4 C92.1 147.3, 90.6 149.6, 83.6 148.1 C61.6 149.8, 46.9 153.5, 3.8 152.1 C3.7 153.6, -2.9 144.6, -2.7 144.4 C0.7 134.9, -2.9 121, -0.5 114.7 C1.5 112.4, -1.3 112.2, 6.9 111.5&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M7.9 108.7 C29.2 111, 53.4 111.6, 84.2 111.9 M6.1 109.2 C22.3 110.9, 37 110, 84.1 109.5 M83.3 110 C87.3 111.4, 88.8 110.8, 91.3 116.2 M82.3 110.6 C87.1 111.1, 89.3 111.2, 89.5 115.7 M91.9 117.4 C91.5 126.1, 88.6 138.4, 88.7 144.4 M90.4 115.8 C89.4 125.3, 90.1 135.4, 89.7 142.7 M90 143.3 C91 149.7, 86.7 151.5, 84.5 150.5 M89.3 143.6 C88.3 148.8, 89.7 149.7, 84.8 150.1 M83.2 151.8 C51.2 151.2, 23.6 151.9, 6.7 148.1 M83.1 150.6 C61.4 151.5, 39.6 150.4, 6.9 149.9 M6.7 150 C2.3 151.1, 1 147.6, 1.7 144.1 M8.6 150.9 C3.4 149.1, 0.9 145.5, 1.9 143.8 M1.6 141.4 C1.7 132.9, -0.2 122.3, -2 116.1 M-0.7 142.7 C0.9 136.8, 0.2 132.5, 0.9 116.3 M0 116.7 C0 113.4, 2.5 109.5, 5.6 108.1 M-1.7 116.8 C0.9 110.7, 2.7 108.3, 8 110.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;45&quot; y=&quot;130.0&quot;&gt;3&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M-7.1 159.7 C20.4 157.6, 48.1 156, 95.4 157.3 M-6.9 158 C34.4 157.9, 75.5 158.7, 96.9 158.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;155&quot; y=&quot;0.0&quot;&gt;PUSH 4&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M118.5 111.2 C136.1 113.4, 159.6 109.4, 194.8 111.1 C198.5 110, 200.1 110.9, 198.6 116 C199.7 127.7, 202.4 132.8, 202.9 145 C196.5 147.9, 197.8 153.1, 192.4 149.3 C176.4 151, 156.7 153.5, 118.7 153.4 C111.8 149.5, 113 150.2, 107.6 143.6 C110.1 134.2, 111.8 127.6, 111.1 120.1 C110.2 112.1, 114.1 108, 116.5 109&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M115.4 109.6 C140.4 109.4, 164.5 108.6, 192.3 109 M116.9 109 C144.3 110, 171.2 110.8, 193.9 110.9 M193.3 110 C198.6 111.7, 201.2 112.9, 198.5 115.9 M193.1 110.4 C196.7 110.8, 200.5 114.4, 199 114.5 M200.5 116.7 C200.7 124, 199.3 133.8, 198.3 142.5 M199.2 115.9 C200.5 121.9, 199.2 127.6, 199.2 143.7 M200 143.3 C200.3 148.9, 196 149.4, 192.7 151.8 M199.3 142.9 C199.4 149.4, 198 150.6, 191.8 148.4 M193.4 148.7 C165.2 151.4, 136.5 149.5, 118.4 149.1 M192.8 150.1 C173.9 150, 154.5 149.1, 117.6 149.3 M116.7 150 C110.3 149.6, 111.3 147.6, 110.1 144.2 M115.9 151.6 C113.4 150.7, 111.4 149.8, 110.8 145.1 M108.1 142.3 C111.9 134.8, 111.7 129, 109.8 116 M110 142.4 C110.6 134.4, 110.8 126.1, 110.2 116.7 M110 116.7 C110.2 110.7, 112.5 108.3, 117.9 110.4 M109.3 117.2 C110.9 113, 112.7 109.2, 117.4 109.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;155&quot; y=&quot;130.0&quot;&gt;3&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M115.6 63.6 C145.6 61.3, 173.3 66.3, 196.2 67.4 C197.8 60.7, 197 64.4, 196.9 72.5 C203.8 77.6, 201.5 88.8, 200.5 97.6 C203 99.9, 196.8 101.8, 192.5 101.8 C165 104.8, 143.3 99.3, 118.9 105 C112.5 104.6, 111.6 101.3, 106.5 97.3 C111.6 89.6, 108.1 84.5, 113.1 69.2 C108.8 65.6, 114.9 60.5, 118.1 66.1&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M116 62.8 C141.1 63.2, 166.4 63, 192.9 64.4 M116.9 63.5 C140.5 63.8, 163.2 62.5, 193.6 63.1 M193.3 64 C197.5 64, 198.2 68.1, 199.3 69.6 M192.7 62.9 C196.4 64.7, 197.8 67.4, 200.8 70.4 M201.6 69.6 C201.5 77.8, 201.3 87.3, 200.8 95.8 M200.3 70.1 C200.6 78.3, 199.5 84, 199.1 97.8 M200 97.3 C199.3 102.5, 199.4 104.7, 193.5 105.2 M201.8 97.4 C198.9 102, 199.4 105.6, 194.4 102.8 M194.7 102.4 C172.9 105.5, 152.3 103.3, 115 102.6 M192.8 104.6 C167.2 103.6, 141.4 104, 117.6 103.9 M116.7 104 C111.4 104.1, 111.3 101.4, 108.4 96.5 M116.1 103.3 C113.8 106.1, 107.9 100.5, 108.7 98.9 M108.7 96.3 C108.4 91, 108.6 84, 108.1 71.8 M110.3 96.8 C110.1 87.2, 110.2 79.2, 110.2 70.3 M110 70.7 C109.3 67, 113.4 63.8, 117.6 65.6 M108.7 72 C109.2 66.7, 114.3 62.8, 115.7 64.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;155&quot; y=&quot;84.0&quot;&gt;4&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M105.2 159.2 C130.8 158.7, 156.7 158.4, 207 158 M104.7 158.8 C129.3 159.3, 153.1 157.5, 206.9 157.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;265&quot; y=&quot;0.0&quot;&gt;MUL&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M226 110.6 C247.3 110.9, 261.9 110.4, 300.8 111.4 C310.7 110.9, 309.5 114.3, 312.5 115 C308.8 127.2, 310.7 134.1, 307 144.6 C309.1 150.4, 309.7 152.4, 302.7 153.1 C282.2 149.7, 267.6 147.8, 229.8 150.1 C225.7 150.3, 223.6 149.8, 220.7 143 C218.8 133.3, 219.8 130.6, 216.6 119.6 C220.8 114.6, 220 110.3, 225.3 112.5&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M226.6 110 C257.8 110, 285.1 108.6, 305 109.6 M227.6 110.5 C242.2 108.7, 258.8 110.3, 302.9 109.9 M303.3 110 C306.7 108.2, 310.2 111.4, 308.8 116.3 M305.3 110.5 C306.4 109.2, 308.5 112.5, 311.9 115.7 M310.7 117.4 C308.3 123.6, 311.1 132.6, 311 145.2 M310.2 116.3 C310.5 124.4, 309.4 130.1, 310.9 144.1 M310 143.3 C308.2 146.7, 308.2 150.8, 304.6 149.4 M311.5 144.5 C309.5 150.1, 307.4 150.2, 304.4 149.2 M302.2 149.4 C278 149.6, 256 151.7, 225.3 148.1 M303.1 149.4 C280.6 150.5, 256.7 150.4, 227.2 149.9 M226.7 150 C223.1 151.8, 221.7 145.9, 219.8 141.5 M228.2 151.8 C222.3 147.9, 217.8 148.6, 220.6 142.8 M222 141.7 C219.1 135.4, 221.3 124.5, 221.5 117 M219.3 143.1 C220.7 137.6, 219.3 131.4, 219.9 115.7 M220 116.7 C220.9 113.6, 223 109.8, 226.7 111.7 M219.1 116.2 C220.4 112.1, 223.3 110.7, 226.8 109.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;265&quot; y=&quot;130.0&quot;&gt;12&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M212.9 158.8 C241.1 159, 268.7 157.6, 317.2 156.5 M213.4 158.4 C237.7 156.8, 261.2 158, 315.9 158.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;265&quot; y=&quot;182.6&quot;&gt;pop 4, pop 3&lt;/tspan&gt;&lt;tspan x=&quot;265&quot; y=&quot;201.4&quot;&gt;push 12&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;375&quot; y=&quot;0.0&quot;&gt;PUSH 2&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M338.9 111 C363.2 111.6, 386.3 109.7, 415.4 108.4 C414.3 112.5, 420.4 115.4, 417.5 113.9 C419.9 126.2, 422.5 136.1, 423.2 139.9 C419.3 144.4, 420.8 152.6, 410.2 149 C390 152.3, 361.6 148.2, 333.2 148.1 C332.5 149.6, 327.5 150.2, 331.7 140.5 C332.3 135.6, 328.7 124.9, 327.6 118.8 C330.1 112.8, 330.4 111.5, 334.7 113.1&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M336.7 108.9 C360 109.9, 379.7 112.1, 413.3 108.8 M336.1 109.2 C366.3 110.3, 396.1 110.2, 413.7 109.9 M413.3 110 C417.4 111.7, 421.9 111.4, 418.4 117.5 M414.9 109 C419.3 108.1, 421.2 111.3, 417.7 116.3 M421.6 117.4 C419.8 127, 419.6 134.8, 419.5 143.8 M420.2 116.9 C419.3 126.7, 420.9 137.3, 420.4 143 M420 143.3 C421.3 148.2, 417 150.2, 412 151.1 M418.4 144.7 C417.8 148.9, 417.1 149.2, 414.9 148 M414 148.2 C391.7 148.8, 367.9 151.2, 336.4 148.6 M413.4 149.6 C383.8 150.4, 352.1 150.6, 336.6 150.8 M336.7 150 C331.6 149.5, 329.3 148.8, 328 143.3 M338.6 150.2 C330.7 151, 329.4 148, 331 142.5 M330.3 142.2 C331.1 133.4, 331.1 128.6, 328.7 115.2 M329.5 142.9 C330.9 136.2, 329.5 130.2, 330.2 116.9 M330 116.7 C330.8 112, 330.5 111.1, 335.8 109.2 M331.8 118 C331.8 110.5, 330.8 108.7, 337.3 107.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;375&quot; y=&quot;130.0&quot;&gt;12&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M335.2 66.6 C359.8 62.5, 387.7 64.1, 416.7 63 C416.8 65.6, 423 67.2, 416.9 71.7 C423.1 82.1, 418.6 87.4, 420.6 98 C416.8 102.2, 414.7 103.4, 416.1 103.6 C399.9 104.7, 378.5 99.9, 335.5 107.3 C334.9 100.8, 332.2 103.1, 331.2 98.3 C327.5 90.4, 329.6 81.9, 330 72.5 C331.8 63.9, 332 61.9, 335.6 62.6&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M335.8 65.3 C351.3 64.9, 369.8 63.4, 411.9 63.3 M335.9 64.7 C356.4 63.6, 378.4 64.3, 413.6 64.8 M413.3 64 C417.2 63.9, 420.2 67.4, 420.1 70.8 M414.3 64.6 C416.7 61.8, 420.9 64.8, 421.2 68.7 M419.4 71 C420.4 80.8, 420.6 91.7, 421 97.5 M420.3 71 C419.5 80, 420.2 88.3, 419.7 98.2 M420 97.3 C419.1 100.5, 417.3 102.2, 413.7 105.9 M419.3 96.7 C418.9 100.7, 418.9 104.3, 412.1 105.3 M414 102.7 C386.5 102.2, 359.4 103.8, 335.3 105.1 M413.5 104.8 C389 104.1, 367 104.3, 337.6 104.9 M336.7 104 C332.1 103.5, 330.8 103.3, 331.1 96.6 M334.9 105.9 C331.6 103.9, 330.8 99.9, 332.2 99.5 M328.5 96 C328.8 89.6, 331.1 80.9, 330.6 71.9 M329.6 97.9 C328.9 90.6, 329.2 83.3, 330.7 71.5 M330 70.7 C330.1 65, 334.2 63.8, 336 63.1 M330 70.4 C330.4 67.2, 333.2 63.7, 334.7 65.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;375&quot; y=&quot;84.0&quot;&gt;2&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M325.7 158.2 C357.6 156.1, 388.6 158.7, 427 159.6 M324.5 158.8 C363.2 158.5, 400.3 157.6, 425.7 157.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;485&quot; y=&quot;0.0&quot;&gt;ADD&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M445.3 108.2 C471.4 113.3, 495.8 113, 520.9 112 C528.6 113.6, 532 115.8, 529.9 117.2 C528 122.5, 529.6 131.1, 531.2 146.9 C527.8 149.5, 530.5 147.7, 524.6 149 C503.4 154.1, 485.8 153.3, 445.3 147.2 C443.9 151, 441.9 147.9, 440.2 141.3 C442.4 136, 437.3 125, 442.4 113.2 C442 111, 445.8 113, 445.3 109.2&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M447.3 111.2 C465.3 111, 480.2 109.9, 521.8 109.8 M447.3 110.4 C462.2 109.7, 479.5 110, 522.8 110 M523.3 110 C527.6 110.6, 530.9 111.5, 530 118.4 M521.8 108.6 C527.5 109.3, 528.2 111, 529.5 118.6 M530 117.7 C531.7 124.3, 529 130.4, 529 143.9 M529 117.4 C528.8 123.9, 529.4 132.4, 531 142.7 M530 143.3 C528.2 148.6, 528.9 148, 525.2 151.2 M530.2 141.5 C529.5 149.5, 530.1 149.8, 523 150 M522.5 148.4 C497.4 148.1, 470.6 149.9, 446.9 148.5 M522.7 149.2 C502.1 149.4, 482.3 149.9, 446.7 149.5 M446.7 150 C441.7 149.5, 441.2 147.9, 440.9 143.2 M448.4 150.1 C441.3 149.5, 441.1 147.4, 438.3 141.3 M440.7 144 C441.6 135.6, 438.8 128.5, 438.9 114.9 M439.1 143 C439.8 133.8, 439.4 122.4, 440.8 116.5 M440 116.7 C441.6 110.3, 441.1 109.5, 445.2 109.5 M440.4 116 C441.4 111.8, 441.8 108.6, 446.6 110.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;485&quot; y=&quot;130.0&quot;&gt;14&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M433.5 157.8 C463.9 158.5, 496.6 155.9, 537.2 158.1 M433.2 158.4 C471.6 158, 508.4 158.1, 536.7 158.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;485&quot; y=&quot;182.6&quot;&gt;pop 2, pop 12&lt;/tspan&gt;&lt;tspan x=&quot;485&quot; y=&quot;201.4&quot;&gt;push 14&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;595&quot; y=&quot;0.0&quot;&gt;STORE x&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;595&quot; y=&quot;130.0&quot;&gt;empty&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M545.9 158.8 C576.5 157.9, 607.2 157, 646.1 156.2 M543.5 158.5 C575.8 158.1, 607.7 156.7, 645.9 157.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;595&quot; y=&quot;182.6&quot;&gt;pop 14 into x&lt;/tspan&gt;&lt;tspan x=&quot;595&quot; y=&quot;201.4&quot;&gt;(x = 14)&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;232.0&quot;&gt;each column: the stack after that instruction runs, top of the stack is up&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;The same trace as a picture: the stack after each instruction, with the top of the stack up.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Look at what just happened. Nowhere did the machine &quot;know&quot; about precedence, or trees, or the fact that multiplication comes first. &lt;strong&gt;The order was already baked into the instruction list&lt;/strong&gt; — the compiler put &lt;code&gt;MUL&lt;/code&gt; before &lt;code&gt;ADD&lt;/code&gt; back when it walked the tree. The VM understands nothing. It just pushes and pops in the order it&#x27;s told, and the right answer falls out the bottom.&lt;/p&gt;
&lt;p&gt;The first time I watched my own stack do this — printing itself after every instruction — was the moment the whole thing stopped feeling like magic. It&#x27;s just a pile of numbers and a loop.&lt;/p&gt;
&lt;h2 id=&quot;functions-the-stack-grows-up&quot;&gt;Functions: the stack grows up&lt;a class=&quot;anchor&quot; href=&quot;#functions-the-stack-grows-up&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Guessing games need functions, and functions are where the stack earns its keep.&lt;/p&gt;
&lt;p&gt;When Cecile calls &lt;code&gt;guessGame()&lt;/code&gt;, the VM can&#x27;t just jump into it and forget where it came from — it has to come &lt;em&gt;back&lt;/em&gt; afterward. So it pushes a little bookkeeping bundle onto the stack first: where to return to, and room for the function&#x27;s local variables. That bundle is called a &lt;strong&gt;call frame&lt;/strong&gt;. Call a function, push a frame. Return, pop the frame — and the finger jumps right back to where it left off.&lt;/p&gt;
&lt;p&gt;Nest calls and the frames stack up on top of each other. And now the scariest phrase in programming stops being scary: a &lt;strong&gt;stack overflow&lt;/strong&gt; is &lt;em&gt;literally&lt;/em&gt; this stack growing taller than the room you gave it — usually because a function keeps calling itself and never returns, piling up frames forever. It&#x27;s not a mysterious error. You can see it. It&#x27;s this exact pile, hitting the ceiling.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-26 -13 753 387&quot; width=&quot;753&quot; role=&quot;img&quot; aria-label=&quot;Call frames and stack overflow&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M-10.4 29.2 C167.6 27.9, 346 28.4, 660.8 30.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;end&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;650&quot; y=&quot;12.0&quot;&gt;ceiling: the room you gave the stack&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M5.3 258.5 C58.9 257.4, 108.6 260.4, 179.1 254.6 C187 255.4, 186.8 256.5, 188.4 264.1 C186.7 273.7, 188.1 277.8, 191.2 291.9 C189.2 300.6, 187.7 296.9, 183.6 300.8 C115.6 294.7, 48.1 299, 10 301.6 C4.1 297.6, 1.4 299.4, -1.8 289.2 C1.8 278.1, 1.5 271, -1.9 264.1 C-3.4 261.5, 1.2 253.9, 6.8 252.5&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M9.2 255.8 C52.9 257.2, 98.7 255.9, 184.6 257.6 M6.4 255.1 C46.2 253.5, 83.6 255.1, 182.2 256.5 M182.7 256 C187 257.8, 188.4 260.1, 191.8 263 M181 255.5 C186.9 254.3, 188.3 259, 190.2 261.2 M188.3 262 C190.3 272.4, 191.4 280.3, 191.2 293.9 M189.9 263 C190.4 271.5, 189.1 279, 189.7 293.3 M190 292.7 C189.9 297.5, 189.4 298.8, 183.2 298.3 M188.6 293.5 C187.9 296.6, 188.8 300.6, 180.7 302.2 M182.5 299.6 C122.8 296.9, 61.2 297.6, 8.4 300.5 M183.2 300.1 C126 301.2, 70.9 299.6, 6.9 300.5 M7.3 300 C2.6 301.9, 0.7 296.4, -1.2 292.6 M8 298.7 C2.7 298.7, 0.8 299.6, -1.9 291.8 M1.3 294.4 C-1.5 285.3, 1.1 275.6, -1.3 264.9 M0.8 291.8 C-0.3 284.1, -1 275.3, -0.4 262.6 M0 263.3 C-0.8 260.2, 1.5 255.4, 8.5 256 M-0.1 263.4 C-0.8 258.1, 0.2 256.4, 9.3 256.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;95&quot; y=&quot;278.0&quot;&gt;top-level script&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M8.5 214.4 C52.1 211.9, 101.7 216.8, 183.8 209.6 C184.7 214.8, 188.3 215.1, 189.9 216.7 C187.6 231, 190.7 238.1, 190.4 250.3 C189.6 250.9, 184.3 254.1, 182 256.7 C121.1 255.6, 55.3 257.5, 10.9 256.2 C5.2 254.3, -3.2 252.6, 3 251.8 C-0.7 244.3, 0 234.6, -3 219.4 C2.1 214.5, 4.4 210.8, 10.2 215.3&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M5.8 210.3 C54.2 213, 99.3 212.6, 180.7 210.2 M7.9 212.8 C43.4 210.8, 79.9 212.4, 182.9 212.4 M182.7 212 C188.7 211.3, 191.7 215.6, 190.1 219.1 M181.9 211.4 C186.6 213, 192 216.6, 189.1 219.5 M191.5 221.2 C189 225.5, 190.7 235.4, 191.9 249.4 M190.7 220.1 C189.4 226.5, 189.1 233.3, 190.3 249.6 M190 248.7 C188 255.4, 187.6 254.2, 183.2 257.8 M188 247.5 C190.6 254.7, 185.6 254.3, 183 253.8 M181.7 257.8 C136.8 255.7, 90.8 257.6, 9 256.8 M183.1 256.7 C118.3 254.3, 54 255.7, 7.1 256.2 M7.3 256 C4.3 254.7, 1 254.7, 0.7 250.1 M8.8 255.9 C0.3 256.4, 0.5 253.5, 0.8 248.8 M0.3 246.9 C0 237.1, -0.7 228.9, -1.4 219.5 M0.5 248.3 C1 239.7, -0.2 229.2, 0.3 218.6 M0 219.3 C-0.3 215, 3.9 212.4, 9.1 213 M0.5 220.8 C-1.6 216.7, 3.3 213.6, 8.5 213.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;95&quot; y=&quot;234.0&quot;&gt;guessGame()&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;205&quot; y=&quot;224.6&quot;&gt;return address&lt;/tspan&gt;&lt;tspan x=&quot;205&quot; y=&quot;243.4&quot;&gt;+ room for locals&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M429.1 257.8 C497.5 254.5, 565.9 256.9, 605.2 258.8 C607.7 252.7, 612.7 255.3, 609.5 265.8 C609.4 266.5, 606.9 274.8, 607.8 294.4 C609.8 299.9, 607.3 297.8, 601.6 299.3 C541 302.7, 481.5 304.1, 428.5 301.4 C420 299.8, 423.5 295.8, 421.4 292.4 C421.4 283.8, 419.7 276.3, 421.1 263 C419 261.7, 420.8 254.3, 424.3 257.5&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M427.4 255.9 C475.6 254.9, 528.3 257.5, 602.9 254.3 M427.8 256.5 C464.2 254.4, 500.6 253.9, 602.2 256.6 M602.7 256 C606.3 254.7, 608.2 256.9, 608.1 262.7 M604.5 255.6 C607.5 257.8, 608.9 259.6, 610 261.3 M609.3 265.3 C611 271.7, 611.8 282.2, 610.4 292.1 M610.5 263.2 C610.7 270.9, 609.3 279.5, 610.1 293.3 M610 292.7 C608.3 298.2, 606.9 300.2, 603.4 301.3 M611.8 293.4 C609.8 295.7, 608.5 300.4, 603.5 300.5 M601.1 300.1 C561.6 299.8, 519 298.6, 426.2 300.6 M601.9 300 C547.2 299.4, 492.5 298, 428.3 300.1 M427.3 300 C421.4 301.7, 418.7 298.1, 421.7 293.2 M428.6 300 C423.9 301.3, 420.5 295.6, 420.1 290.8 M418.8 292 C419.5 286.7, 418.5 277.3, 418.7 261.4 M419.3 292.5 C419.2 286.4, 420.4 280.3, 420.6 262.7 M420 263.3 C421.9 257.4, 423 255.7, 425.9 255.6 M419.3 264.4 C419.3 260.6, 420.7 256, 426.8 255.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;515&quot; y=&quot;278.0&quot;&gt;f()&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M428.3 213.3 C498.6 208.3, 559.8 211.1, 602.6 211.3 C608.3 215.2, 613.6 213.5, 613.2 220.5 C612.4 230.2, 607.3 238, 609.5 246.2 C610.6 253, 606.7 254.1, 603.6 258.6 C558 259.3, 520.7 254.7, 427.7 254.5 C423.4 252.6, 423.5 254.8, 423.4 246.8 C417.8 240.7, 421.2 233.9, 417.7 217.8 C419 214.1, 425.8 209.4, 428.9 213.3&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M427 212 C465.9 212.9, 505.9 213.2, 604.1 210.8 M426.7 211.4 C484.6 210.7, 541 210.5, 601.7 212.5 M602.7 212 C605.6 212.2, 609.1 215.5, 608.7 219.5 M604.3 212.4 C607.7 210.3, 609.6 214.8, 611.8 221 M608 220.7 C610.4 228.3, 611.9 238.9, 609.6 248.1 M609.1 218.4 C609.2 228.4, 610.6 238.5, 609.2 249.3 M610 248.7 C608.5 253.6, 607.2 256.6, 602.2 257.2 M610.2 250.6 C611.3 251.5, 606.8 257.3, 604.1 254.4 M604 256.6 C538.4 255.8, 477.9 256, 428.3 257.8 M602.4 255.4 C549.4 256.9, 497.9 256.2, 427.4 256.9 M427.3 256 C422.7 255.8, 421.1 254.1, 419.9 248.9 M426.1 257 C424.2 256.6, 417.9 254.8, 421.2 250.1 M420.5 249 C421.6 241.6, 418.4 231.4, 418.9 218.6 M419 249.3 C420.2 239.2, 420.1 229.3, 419.1 218.5 M420 219.3 C419.3 213.2, 423.7 212.6, 428.5 212.6 M420.1 217.5 C421.5 216.3, 422.5 210.9, 428.3 211.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;515&quot; y=&quot;234.0&quot;&gt;f()&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M427.4 168.8 C492.5 169.3, 560.9 165.2, 599.9 171 C609 170.5, 607.2 171.6, 609.7 175.2 C608.1 186.8, 607.7 194, 611.2 205.2 C611.4 206.2, 606 210.5, 605.6 210.6 C540 215.9, 482.5 212.5, 426.9 214.8 C419.6 212.6, 423.6 206.6, 418.3 201.2 C421.4 197.7, 422.7 191.4, 421.4 172.6 C418.9 173.6, 423.7 164.6, 426.4 169.1&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M426.5 168 C487.3 167.4, 549.7 165.5, 601.4 167.2 M427.7 168.3 C470 167, 511.1 167.1, 603.2 168.3 M602.7 168 C608.9 169.7, 610 170.1, 609.3 176.3 M604.2 169.2 C607.9 167.3, 610.4 170.1, 609 176.1 M610.8 176 C609.8 184.9, 612 199.7, 608.7 204.1 M609.8 175.6 C609.7 185.8, 609.9 197.5, 610.2 205.2 M610 204.7 C608.6 209, 607.5 213.1, 601.1 213.1 M608.6 203.9 C608.2 211.8, 609.6 214.1, 604.6 212.9 M602.9 213 C554.2 211.2, 502.9 212.9, 426.4 211 M603 212.8 C553.6 212.4, 503.3 212.3, 426.4 211.6 M427.3 212 C424 213.9, 419.6 210.2, 418 204.7 M427.5 210 C424.6 211.9, 419.9 209.4, 417.8 204.7 M418.1 206 C420.2 196.4, 418.9 189.5, 419.1 175.7 M420.8 204.1 C419.2 198, 419.8 192.2, 419.5 176.2 M420 175.3 C420.6 169, 424.3 169.5, 427.2 169.5 M421 174.7 C419 172.1, 424.3 165.8, 425.1 167&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;515&quot; y=&quot;190.0&quot;&gt;f()&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M426.6 124.2 C493.6 123, 562 126.6, 604.5 123.6 C609.7 125.8, 608 129.8, 613.4 129.9 C611.1 137.4, 608.1 145.4, 612.9 164.2 C612.3 166.6, 605.3 166.9, 600.5 169.9 C557 172.5, 514.5 170.3, 426.1 167.9 C423 165.4, 416.4 165.6, 420.3 162.8 C417.8 154.6, 416.9 141.7, 418 134.6 C418.9 126, 421.5 127, 423.8 124.9&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M426.1 124.1 C477.6 121.4, 527.3 125.2, 602.6 123.7 M426.7 123.3 C490.4 123.3, 551.5 123.7, 602.7 124.2 M602.7 124 C608.2 123.2, 610.8 124.6, 609.9 133 M604 126 C608.1 124.4, 611.2 125.4, 610.8 131.2 M609.5 131.4 C609.2 139.6, 608.1 144.7, 611.9 160.2 M610.4 130.8 C609.6 137.3, 610.6 144.8, 609.2 161.2 M610 160.7 C608.8 164.3, 607.7 169.5, 604 168.9 M611 161.1 C609.7 167.5, 607.9 166.4, 600.5 166.8 M601.8 169.4 C566.1 167.2, 528 166.3, 428.5 168.2 M603.5 168.2 C555.8 166.4, 506.7 167, 427.5 168.4 M427.3 168 C421.3 168, 418.1 166.2, 420.2 160.4 M429 167 C420.3 167.1, 421.9 164, 418.9 159.3 M419.8 159 C418.3 151.3, 418.8 143.6, 419.3 132.9 M420.5 160.9 C420.1 150.8, 419.4 143.2, 419.9 132 M420 131.3 C418 124.8, 420.9 122.4, 425.8 122.5 M421.8 131.9 C421.1 127.9, 421.5 125.2, 426.5 122.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;515&quot; y=&quot;146.0&quot;&gt;f()&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M425.8 79.7 C494.7 84, 563.1 80.8, 601.9 83.3 C610.3 81, 608.9 80.8, 610 84.6 C613 94, 607.5 108.6, 607.4 116 C613.1 119.7, 604.6 123.2, 602.5 121.9 C539 129.1, 476.4 128.1, 425.3 121 C419.3 125.3, 416.5 124.6, 422.3 117.3 C421.3 111.5, 418.4 99.3, 421.7 89.4 C418.9 85.6, 419.3 82.2, 428.5 80.7&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M425.7 80.2 C467.9 79.4, 504.9 80.9, 603.8 80.2 M427.6 80.2 C473.8 81.6, 521.7 80.3, 602.2 80.1 M602.7 80 C607.5 80.7, 611.7 83.2, 610.4 85.8 M603.9 78.8 C608.4 81.5, 611.9 80.6, 608 86.2 M608.3 86.7 C608.6 96.1, 608.2 101.4, 611 116.2 M609.1 88 C610 96.7, 609.9 103.8, 610.3 117.2 M610 116.7 C608.9 119.7, 608 126, 602.8 124.8 M609.3 118.4 C611.2 123.2, 606.2 123.3, 601.1 125.3 M600.7 125.9 C542.8 126.6, 486.9 127.2, 426.6 125.3 M602 123.6 C558 123.9, 512.1 123.1, 426.6 123.1 M427.3 124 C422.6 122.2, 420.5 122.2, 418.4 116.1 M426.5 124.1 C420.7 122.4, 419.3 123.3, 420 118.6 M421.4 116 C420.3 106.1, 418.7 97.7, 419.6 86 M420.2 115.8 C421.1 105.7, 421.1 94.3, 420.4 87.8 M420 87.3 C419.4 80.7, 421.5 79.4, 428.5 79.4 M418.6 89.1 C418.7 83.7, 423.2 80.1, 427.9 78.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;515&quot; y=&quot;102.0&quot;&gt;f()&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M424.2 34.4 C467.4 36.9, 506.8 40.3, 599.5 32.8 C604.6 35.2, 612.6 36.4, 611.3 45.6 C612 51.1, 611.6 56.6, 609.7 70.1 C606.8 76, 606.5 79.5, 599.7 78.5 C539.2 78.7, 478.8 76.4, 425.4 79.6 C421.7 79.5, 419.5 76.2, 422.7 69.2 C417.1 62.5, 420.6 53.6, 421.9 41.1 C418.7 37.7, 420.5 32.6, 428.3 32.9&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M427.6 37.7 C482.4 35.2, 539.3 34.9, 603.1 37.1 M427.4 37 C472.5 34.6, 517.4 34.9, 602.7 36 M602.7 36 C606.2 36.8, 611.9 40.1, 609.2 43.4 M602.5 37.7 C607 37.5, 609.5 37.4, 608.9 44.5 M608.6 42 C611.7 55.5, 609.4 62.5, 608.2 73.7 M610.9 42.7 C609.7 51.7, 610.1 61, 609.1 73.3 M610 72.7 C611.5 78.2, 607.1 78.1, 601.4 80.6 M611.3 73.9 C610.3 79.3, 608.1 82.2, 602.1 78.7 M602.6 79.6 C544.1 81.9, 487.4 80.2, 426.2 78.3 M602.4 80.8 C558 81.5, 512.2 82.1, 427.7 80.7 M427.3 80 C420.6 78.3, 419.7 76.6, 420.8 70.9 M427.6 81.5 C423.1 77.9, 421.2 77, 418.7 71.6 M419 72.3 C421 65, 422.1 53.5, 418.4 43.7 M420.2 72 C420.7 60.8, 419.5 49.7, 419.2 43.4 M420 43.3 C421.3 40.2, 424.1 37.6, 428.1 35.2 M419.2 43.3 C421 40.3, 423 35.1, 427.6 38.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;515&quot; y=&quot;58.0&quot;&gt;f()&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;640&quot; y=&quot;43.4&quot;&gt;stack&lt;/tspan&gt;&lt;tspan x=&quot;640&quot; y=&quot;64.6&quot;&gt;overflow&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M637.5 55.2 C630.2 55.7, 628.3 52.4, 619.7 53.3 M636.3 53.8 C629.6 54, 624 53.5, 618.7 53.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M631.8 61 C626.4 59.9, 625.3 55.8, 619.3 53.5 M630.9 59.9 C626 58.2, 622.1 55.8, 618.6 53.9 M619.1 53.1 C623 52.1, 626.3 49.5, 629.3 47.1 M617.3 54.2 C621.8 53, 624.7 50.8, 630.1 48.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-10.7 304.5 C160.5 306.6, 331.4 306.1, 659.7 304.6 M-10.3 304.4 C241.6 305.8, 493.9 305.7, 659.9 304.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;328.0&quot;&gt;call: push a frame&lt;/tspan&gt;&lt;tspan x=&quot;0&quot; y=&quot;348.0&quot;&gt;return: pop it, jump back&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;420&quot; y=&quot;328.0&quot;&gt;f() calls itself and&lt;/tspan&gt;&lt;tspan x=&quot;420&quot; y=&quot;348.0&quot;&gt;never returns&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;Each call pushes a frame; a function that never returns keeps piling frames up until they hit the ceiling.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;the-part-nobody-warns-you-about-cleaning-up&quot;&gt;The part nobody warns you about: cleaning up&lt;a class=&quot;anchor&quot; href=&quot;#the-part-nobody-warns-you-about-cleaning-up&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Here&#x27;s where the tutorial stopped being comfortable.&lt;/p&gt;
&lt;p&gt;In Cecile, you can write &lt;code&gt;let name: string = &quot;Bataa&quot;&lt;/code&gt; and never think about where those letters live. But &lt;em&gt;somewhere&lt;/em&gt;, the VM had to find a free patch of memory, put the string there, and remember it. And when that string is no longer used by anyone — the function returned, the variable&#x27;s gone — that memory has to be handed back, or the program slowly eats all the memory on the machine and dies.&lt;/p&gt;
&lt;p&gt;Here&#x27;s the trap I didn&#x27;t see coming. I was writing Cecile&#x27;s VM in Rust, and I assumed Rust&#x27;s famous memory safety would just handle this for me. It doesn&#x27;t — not for &lt;em&gt;this&lt;/em&gt;. Rust cleans up its own values automatically, but the objects a &lt;em&gt;Cecile&lt;/em&gt; program creates at runtime — strings, arrays, objects that can point at each other and form cycles — live in a heap the VM manages by hand. As far as Rust is concerned, that&#x27;s just one big blob of memory I&#x27;m responsible for. Which Cecile object is still alive is a question only Cecile can answer. So I had two options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Make the Cecile programmer do it&lt;/strong&gt; (like C: you allocate, you free, you get it wrong, everything crashes).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Do it automatically&lt;/strong&gt; — which means writing a &lt;strong&gt;garbage collector&lt;/strong&gt; for the guest language&#x27;s objects.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I wanted Cecile to feel like JavaScript, where you never think about this. So: garbage collector it was.&lt;/p&gt;
&lt;h3 id=&quot;how-a-garbage-collector-actually-thinks&quot;&gt;How a garbage collector actually thinks&lt;a class=&quot;anchor&quot; href=&quot;#how-a-garbage-collector-actually-thinks&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The idea is simpler than its reputation. A garbage collector answers one question, over and over: &lt;strong&gt;&quot;Is this piece of memory still reachable?&quot;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The trick is called &lt;strong&gt;mark-and-sweep&lt;/strong&gt;, and it&#x27;s exactly what it sounds like:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Mark.&lt;/strong&gt; Start from the things you &lt;em&gt;know&lt;/em&gt; are alive right now — the variables on the stack, the current call frames — and follow every reference outward. That string, the array it&#x27;s in, the object that array belongs to. Paint everything you can reach.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sweep.&lt;/strong&gt; Walk through &lt;em&gt;all&lt;/em&gt; the memory you ever handed out. Anything you didn&#x27;t paint is unreachable — no living variable can ever touch it again — so it&#x27;s garbage. Free it.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That&#x27;s the whole algorithm. Reachable means alive; unreachable means dead; you can prove which is which by just... following the arrows from the stack.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-26 -28 722 354&quot; width=&quot;722&quot; role=&quot;img&quot; aria-label=&quot;Mark and sweep&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:19px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;0.0&quot;&gt;1. Mark: follow every reference from what is alive&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M13.6 38 C38.6 38.4, 63.1 40.1, 141.1 42.8 C147.8 40.4, 149 44.7, 147.8 48.4 C148.9 65.4, 149.9 75.8, 150.1 98.5 C153.5 107, 148.9 108.5, 140.5 107.8 C88.9 110, 39 109, 7.1 112.8 C0.8 108.5, 2.2 103.4, 0.6 102.4 C-1.3 81.8, 1.5 56.7, -2.9 51.5 C-3.5 44.5, 2.4 41.5, 9.7 40.5&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M8.6 38.6 C56.3 39.9, 105 40.5, 138.1 38.6 M9.6 39.8 C46.8 39.1, 83.8 38.4, 141 40 M140 40 C148.6 38.7, 148.4 44.4, 150.9 50.3 M141.9 41.5 C148.7 40.8, 147.8 42, 148.2 49.3 M150.6 50.1 C149.4 60.3, 149.3 76.2, 150.9 98.5 M149.1 50.3 C149.9 61.7, 149.7 73.5, 149.2 99.7 M150 100 C148.3 105.8, 147.4 109.3, 139.2 109.8 M150.5 98.7 C148.6 108.5, 148.6 107.9, 138.3 111.4 M140.1 108.9 C96.8 107.9, 52.5 109.6, 9.2 110.2 M139.7 109.2 C110.8 111.3, 79.1 112.2, 9.5 109.3 M10 110 C4.2 110.1, 0.8 104.9, 1.4 98.3 M11.8 109.9 C5.3 110.2, 0.6 105.2, -1.4 102.2 M-0.1 101.8 C1.2 91.6, 1.9 81.3, -0.7 51.5 M0.6 100.1 C-0.2 80.2, 0.1 60.7, -0.8 50.7 M0 50 C-0.5 42.9, 4.1 40.3, 10.6 38.4 M-1.1 50.8 C-1.5 41.4, 1.9 38.7, 8.2 39.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;75&quot; y=&quot;63.8&quot;&gt;stack +&lt;/tspan&gt;&lt;tspan x=&quot;75&quot; y=&quot;86.3&quot;&gt;call frames&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M229.3 41.5 C255.9 37.1, 286.1 38.1, 331.1 37.9 C333.1 39.8, 342.4 46.5, 338.7 52.3 C340.2 70.1, 337.5 84.5, 336.6 98.5 C336.5 105.1, 335 112.1, 330.9 106.9 C306.1 108.4, 283.1 111, 230.6 109.9 C223.9 111.7, 220 105.6, 220.3 98.8 C219.5 89.9, 222.3 73.5, 221.9 50.4 C221.4 40.2, 226.7 39.7, 232.1 42.8&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M229.8 41.3 C256.9 38.7, 280.1 39.6, 330.8 38.7 M230.4 40.3 C251 40.2, 273.3 39.4, 329.6 40.2 M330 40 C336.2 41.9, 341.4 42.3, 339.5 48.4 M329.5 38.5 C336.6 40.5, 340.2 43.4, 340.2 49.5 M341.7 50.8 C339.6 60.3, 339 69.7, 340.5 98.4 M340.8 49.4 C340.5 65.3, 340.6 82.7, 340.5 99.6 M340 100 C338.2 105.7, 337.5 109.7, 328.5 109.7 M341.5 99.3 C341.8 105, 335.8 111.7, 330.6 110.2 M331.1 110.8 C291.9 110.6, 254.2 110, 230 108.3 M330.3 109.5 C295.9 110.4, 262.5 110.1, 229.7 110.2 M230 110 C222.4 109.7, 220.4 107.8, 219.7 100 M228.1 109.9 C224 110.2, 217.9 107.8, 221.6 98.4 M218.4 99.7 C218.9 86.7, 217.9 73.1, 218.5 49.2 M219.1 100.4 C219.5 82.9, 220.3 66.7, 219.7 49.3 M220 50 C218.9 43.9, 222.8 38.3, 228.8 40 M221.4 49.5 C221 41.9, 222.9 38.1, 232.3 40.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;280&quot; y=&quot;75.0&quot;&gt;object&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M412.8 37.1 C434.2 41, 456.3 36, 497.5 40.6 C504 40, 509.3 41.6, 511.8 49 C513 64.5, 507 73.3, 510.4 103.5 C512.3 106.4, 507.6 109.2, 503.4 112.4 C472.2 110.4, 439 111.9, 410.2 107.6 C403.9 112.9, 403.5 105.1, 402.5 103.5 C401.8 88.7, 400.6 74.4, 402.8 47.2 C399.8 43.5, 402 40.4, 407.7 39.4&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M411 40.8 C442.2 38.7, 473.4 39.6, 498.5 38 M409.3 39.1 C431.8 41.4, 452.7 41.2, 500.6 39.5 M500 40 C508.5 38.2, 510 43.1, 511.3 49.4 M498.9 39.8 C507.3 40.3, 508 42.6, 512 47.7 M509.5 48.1 C512.3 67.2, 509.4 88.7, 510.7 101.7 M510.7 50.8 C510.8 67.9, 510.6 84.8, 509.1 99.7 M510 100 C508.3 107.2, 506 112, 498.8 111.3 M510.3 101.8 C511.8 105.9, 507.5 111.2, 501.6 110.1 M499.3 110.6 C471.6 109.8, 444.6 111, 409.9 111.3 M500.8 110.1 C474.8 110.4, 447.9 111.7, 409.5 110.2 M410 110 C401.5 111.3, 399.7 108, 398.5 100.7 M408.3 109.7 C402.9 110.9, 400.5 108.6, 401.2 98.9 M400.1 98.7 C399.7 81.5, 401.7 63, 400.8 49.6 M399.6 99.8 C399.2 84.4, 400.2 67.5, 399.9 50.5 M400 50 C401.5 44.3, 401.4 39.6, 408.9 41.5 M398.4 50.8 C399.6 44.7, 404.9 40.9, 408 40.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;455&quot; y=&quot;75.0&quot;&gt;array&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M578.9 43 C597.1 38.1, 613.2 42.2, 658.2 40 C667.9 39.8, 669.3 42, 667.1 49.1 C668.1 70.4, 668.7 85, 668.4 97 C670.8 109.4, 668.1 110.5, 662.5 108 C638.5 108.8, 614.6 108.7, 577.5 106.7 C569.9 106.4, 570.2 108.8, 566.7 101.5 C570.7 85, 568.9 69.3, 571.9 48.5 C566.8 46.8, 574.9 37.3, 580.4 43.5&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M581.9 39.6 C610.8 38, 641.4 37.8, 658.4 41 M579.2 39.9 C598.1 40.6, 616.3 40.2, 660.5 40.6 M660 40 C666.4 40, 671.3 43.7, 671.1 48.9 M659.4 41.4 C665.5 41.8, 669.1 45.4, 668.8 50 M671 51.8 C669.8 62.1, 669.9 70.4, 668.5 101.9 M669.2 49.2 C669.4 66, 669.9 80, 670 99.2 M670 100 C669.5 105.3, 665.4 110.8, 660.5 111.8 M668.2 100.9 C667.8 105, 665.4 108.3, 657.9 112.2 M659 110.1 C628.1 111.4, 597.9 112.4, 580.1 111.9 M660.3 109.8 C633.1 109.3, 604.7 109.9, 580.1 109.5 M580 110 C574.7 110, 570.7 106.9, 568.9 98.9 M581 111.6 C573.1 108.2, 570.3 108.7, 570.2 98.9 M572 100.5 C571.2 89.6, 570.4 74.7, 571.2 50.9 M569.9 100.4 C570.1 80.7, 570.9 61.5, 569.2 50.4 M570 50 C571.1 42.5, 571.5 40.5, 580.6 38.7 M568.3 49.7 C571.5 41.9, 573.3 39.5, 578.5 37.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;620&quot; y=&quot;75.0&quot;&gt;string&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M157.3 73.2 C170.5 73.3, 184.8 74.3, 215.2 77 M156.4 75.5 C174 76.3, 190.7 74.9, 213.8 74.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M202.3 67.7 C204.3 69.2, 207 71.5, 214.9 76.4 M201.7 69.3 C205.4 71.5, 208.5 72.4, 213.9 74.8 M213.1 74.3 C210.1 76.7, 208 77, 201 80.6 M214.5 75 C210 77.7, 206.5 78.7, 201.7 80.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M347.9 73.1 C358 75.7, 370.2 75, 392.6 75.1 M345.3 74.7 C364.5 74.3, 382.1 75.2, 394.8 75.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M382.7 67.6 C384.3 70.8, 387.4 71.9, 393 75.1 M380.9 68.7 C386.6 70.6, 391.2 73.5, 394.6 75 M394.2 74.1 C388.3 77.7, 382.6 80.9, 381.7 80 M394.7 75.2 C391.4 75.8, 387.3 77.5, 381.4 80.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M514.5 77 C528.1 73.1, 540.9 74.7, 564 73.3 M516.2 75.9 C526.5 74.3, 538.6 75.6, 563.8 75.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M550.3 70.3 C554.4 69.3, 557.8 72, 564 73.8 M551.5 69.6 C553.9 69.8, 557.5 72.1, 563.9 75.3 M565.4 74 C559.1 77.4, 555.2 79.6, 552.5 82.1 M563.4 75.3 C558.8 76.9, 554.4 78.9, 551.1 80.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;420&quot; y=&quot;134.0&quot;&gt;reachable: painted&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M-10.1 170.7 C169.3 166.8, 349.2 167.7, 679.5 169.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:19px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;200.0&quot;&gt;2. Sweep: free everything that was not painted&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M233.4 240 C262.6 245.1, 302.5 241.4, 326.5 240.1 C335.5 236.8, 343.1 243.4, 340.2 249.2 C337.8 265.6, 338.7 284.8, 343.3 300.2 C339.8 303.5, 337.8 307.3, 328.9 311 C297.8 310.5, 263.3 308, 232.4 306.9 C224.9 310.2, 218.5 303.6, 221.4 298.4 C221.4 284.1, 216.5 273.6, 222.7 249.4 C219.7 246.8, 220.6 238.1, 228.7 238.8&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M229.4 238.5 C262.4 239.4, 292.8 239.6, 330.3 240.6 M330 240 C335.3 239.5, 342 243.9, 341.6 249.3 M340.3 252 C340.8 264.2, 342.3 276.4, 338.6 300.1 M340 300 C341.3 304.9, 338 311, 328.6 311 M329.3 310.8 C291.3 309.6, 252 308.4, 231.1 308.9 M230 310 C224.2 309.8, 219.3 305.1, 221.3 301.1 M218.9 299.4 C219.7 285.6, 222.3 267.4, 221.6 249.1 M220 250 C221.5 244.8, 222.2 241.6, 228.3 239.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;280&quot; y=&quot;275.0&quot;&gt;object&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M407.7 243 C441.1 238.8, 466.5 239.8, 501.6 239.6 C506.6 243, 509.1 245.4, 506.8 248 C511.1 261, 508.8 277, 510.4 297.1 C509.9 303.2, 508.1 310.3, 501 311.8 C481.3 310.7, 462.6 311, 413.5 306.9 C400.1 311.7, 402.6 306.8, 403.2 302.3 C401.5 287.9, 403.4 271.9, 402.8 248 C398.1 243.8, 402.2 240.9, 408.2 240.9&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M410.1 241.7 C440 241.4, 468.4 238.2, 500.8 238.1 M500 240 C507.9 239.4, 509.1 241.4, 510.4 250.1 M509.7 248.4 C511.1 267.7, 510.7 282.5, 509.6 301.2 M510 300 C508.8 306.6, 507.6 310.9, 498.1 309.4 M501.5 308.5 C476.9 308.9, 451.3 307.7, 408.8 310.5 M410 310 C404.9 308.5, 398.5 307.4, 399.7 300.4 M398.7 300 C398.7 284.9, 398.3 269, 400.5 248.6 M400 250 C400 241.3, 404.4 241.9, 411.6 240.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;455&quot; y=&quot;275.0&quot;&gt;object&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M345.7 274.9 C358.2 276.7, 366.1 273.5, 395 275.6 M345.1 275.4 C357.4 275.3, 371 275, 394.2 274.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M381.2 268.8 C385.3 271.3, 386.1 270.4, 394.7 275.4 M380.7 269.2 C384 270.6, 388.1 272, 394.1 274.5 M392.8 275.7 C390.4 276.1, 388.9 276.7, 381.8 279.9 M394 275.4 C388.5 278.1, 384.5 280.2, 381.4 281.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M358.4 281 C356.9 280.5, 352.1 276.9, 346.7 275.4 M357.9 281.3 C354.7 279.6, 352.4 277.8, 346.1 274.5 M344.8 275.7 C347.7 273.6, 351.4 271.6, 359 267.8 M346 275.4 C350.5 273.2, 356.5 270.5, 358.6 269.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;265.0&quot;&gt;no path from&lt;/tspan&gt;&lt;tspan x=&quot;0&quot; y=&quot;285.0&quot;&gt;the stack&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;530&quot; y=&quot;265.0&quot;&gt;unreachable:&lt;/tspan&gt;&lt;tspan x=&quot;530&quot; y=&quot;285.0&quot;&gt;freed&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;Mark follows references from the stack and paints what it reaches; sweep frees whatever stayed unpainted.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;I&#x27;ll be honest: getting this right was the hardest, buggiest week of the whole project. Free something too early and your program reads garbage and crashes in a way that makes no sense. Free it too late and you leak. But when it finally worked — when Cecile could churn through thousands of strings in a loop and hold steady instead of ballooning — that felt like more of an achievement than getting the language to run in the first place.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-27 -10 623 302&quot; width=&quot;623&quot; role=&quot;img&quot; aria-label=&quot;The garbage collector week&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M26 6 C1.5 21.2, -0.9 35.1, 27.4 50.8 C17.6 35.6, 14.4 23.6, 27.8 6.5 C26 6, 26 6, 26 6&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M26 6 C2.1 21.9, 2.9 35.4, 24.5 51.4 M24.5 4.5 C-0.5 21.5, -0.1 36.2, 25.6 48 M26 50 C16.5 34.4, 14.1 20.5, 26.7 7.2 M26.3 49.7 C14.4 35.4, 13 18.9, 25.3 5.6 M26 6 C26 6, 26 6, 26 6 M26 6 C26 6, 26 6, 26 6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M66.3 120 C70.6 119.9, 76.5 122.6, 80 125.9 C83.4 129.2, 86.4 135.3, 86.9 140.1 C87.5 144.8, 86 150.4, 83.4 154.2 C80.8 157.9, 75.6 161.4, 71.3 162.6 C67.1 163.7, 62.1 163.1, 58 161.3 C53.8 159.6, 48.6 156, 46.5 152.1 C44.3 148.3, 43.8 142.6, 44.9 138 C46 133.4, 48.7 127.6, 53.1 124.7 C57.6 121.7, 67.6 120.6, 71.5 120.4 C75.5 120.3, 76.8 123.2, 76.7 123.7 M65.6 119.9 C69.8 119.7, 75.9 122.4, 79.5 125.7 C83.1 128.9, 86.7 134.8, 87.4 139.4 C88.1 144, 86.2 149.4, 83.7 153.1 C81.2 156.8, 77 160, 72.6 161.8 C68.3 163.6, 61.7 165.4, 57.8 163.9 C53.9 162.4, 50.9 157.1, 49 152.8 C47.2 148.5, 45.8 142.9, 46.6 138.3 C47.4 133.7, 50.4 128.3, 53.8 125.2 C57.2 122, 64.8 119.9, 67 119.2 C69.1 118.5, 66.7 120.7, 66.7 121.2&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M74.1 121.9 C78.2 123.5, 82.6 128.6, 84.9 132.7 C87.1 136.8, 88.5 142.3, 87.6 146.7 C86.6 151.1, 83.1 156.2, 79.2 159 C75.4 161.7, 69 163.6, 64.3 163.3 C59.6 163, 54.2 160.4, 51 157.1 C47.9 153.8, 45.8 148.2, 45.4 143.5 C45 138.8, 46 132.7, 48.6 128.9 C51.1 125.1, 55.5 121.6, 60.6 120.7 C65.8 119.8, 76 122.3, 79.3 123.3 C82.7 124.3, 81 126.5, 80.8 126.9 M75.8 122.6 C79.4 124.8, 83.4 130.2, 85.2 134.4 C87.1 138.6, 88.2 143.7, 86.8 147.8 C85.3 152, 80.4 156.7, 76.6 159.3 C72.8 161.9, 68.3 163.9, 63.9 163.5 C59.6 163.1, 53.5 160.4, 50.5 156.8 C47.4 153.3, 45.5 147.1, 45.4 142.3 C45.3 137.6, 47 132.4, 49.9 128.6 C52.7 124.7, 58.1 120.2, 62.4 119.2 C66.7 118.1, 73.4 121.4, 75.7 122.1 C78 122.9, 76.3 123.2, 76.2 123.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M53.4 136.5 C55.7 135.6, 57.1 136.2, 61.4 135.6 M54 136.3 C55.8 136, 58 135.7, 61.1 136.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M70.6 136.5 C72.7 136.2, 74.3 136.3, 77.5 136.4 M70.7 136.1 C73.5 136.1, 75.7 135.9, 77.7 136.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M58.7 151.9 C62.5 150.2, 66.1 151.9, 72.9 150.5 M58.9 150.6 C63.9 151.3, 69.9 151.1, 73.1 150.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M66.1 165.2 C65.9 179.8, 67 195.6, 67.3 231.4 M66.8 164.6 C65.3 180.8, 65.4 197.2, 65.2 229.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M66.7 231.1 C62.2 239.4, 55.3 252.9, 44.7 275.6 M65.7 229.8 C59.9 245.1, 52.9 257.7, 46.2 275.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M67.3 230.9 C71.1 241.5, 73.9 249.3, 86.1 277.8 M66.6 231 C73 246.3, 80.5 264, 85.2 276.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M67.9 182.8 C62 188, 55.8 194.5, 45.5 211.9 M65.5 182.2 C60.9 188.1, 57.1 196.2, 44.2 212.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M64.4 182.7 C71.9 189.9, 76.3 194.7, 86.9 210.1 M66.4 181.4 C73.1 190.4, 79.8 200.6, 87.2 212.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M197.9 118.5 C273.4 116.4, 353.5 119.9, 429.3 119.6 C436.5 118.9, 441.7 118.9, 440.5 129.2 C441.1 172.1, 439.3 208.1, 438.3 234.8 C437.8 248.2, 434.3 249.5, 432.2 250.5 C365.6 242.3, 306.3 248.3, 202.8 248.4 C190.9 246.4, 187.4 243.2, 191.8 234.5 C186.3 216.3, 186.4 186.2, 186.6 126 C186.7 123, 195 119.8, 202.9 118.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M200.9 118.7 C258.5 117.5, 315.4 118.9, 428.4 119.3 M199.8 118.4 C282.7 118, 364.7 116.7, 430.6 117.7 M430 118 C437.5 118.2, 440.8 122.6, 438 128.6 M431.5 119.2 C437.4 117.1, 440.6 119.1, 440.5 127.5 M440.5 127.6 C441.7 166.9, 443 202.7, 441.8 238.9 M440.7 127.4 C439.7 155.7, 440.9 181.2, 440.1 238.9 M440 238 C438.7 243.4, 436.7 248.2, 430.9 246.6 M441.7 237.8 C441.5 243.3, 439 248.5, 430.6 248.1 M428.6 246.3 C346.9 249.3, 264.1 247.8, 199.4 247.4 M429.5 247.5 C348.6 248.9, 266.9 249.8, 199.2 247.4 M200 248 C193.5 247.9, 189 245.7, 189.8 239.5 M200.7 246.4 C194.4 246, 189.8 244.7, 189.8 237.3 M189.9 239.7 C188.8 209.1, 188.1 177.3, 191.3 128 M189.4 238.2 C188.9 209.4, 190.8 183, 189.2 128.6 M190 128 C191 119.9, 191.9 117.2, 198.1 116.6 M191 128.6 C188.1 121.6, 193.3 116.2, 198.5 118.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M214 129.5 C286.1 127.1, 365.3 130.4, 419.7 132.8 C421.2 127, 424.6 134.3, 430.9 137.9 C428.4 171.8, 425.6 201.1, 429.6 222.5 C425.2 229.8, 424.8 235.6, 414.6 234.2 C360.9 236.2, 299.3 240.7, 214.9 237.5 C205.3 236.3, 202.4 230.4, 205.1 224.4 C204.8 191.6, 201.5 163.8, 201.2 136.5 C204 130, 208.3 129.5, 213.1 127.5&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M213.4 130.6 C264.7 129.1, 312.6 129.1, 417.6 129.7 M212.6 129.7 C256.4 127.8, 302.4 128.5, 417.7 130 M418 130 C425.6 131.9, 428.6 134.6, 428.9 138 M419.7 128.7 C424.3 131.9, 430.3 132.6, 427.5 140.7 M429.2 140.1 C427.7 171.9, 429.1 204.1, 427.9 226.2 M428.7 140.3 C427.1 172.7, 427.4 204.6, 427.8 225.4 M428 226 C427.3 233.7, 424.1 237.7, 418.4 235.7 M429.9 226.4 C427.4 230.9, 423.8 237.7, 416.1 235 M416.9 234.8 C359.2 237, 298.2 235, 211.3 237.1 M418.1 235.2 C371.5 235.1, 323.7 235.2, 212 236.8 M212 236 C204.7 237.3, 200.2 231.4, 200.4 225 M213.3 236.4 C204.8 234.8, 200.7 231.6, 200.2 227.7 M201.6 225 C200 203.2, 201.1 175.9, 202 138.1 M201.5 225.9 C203.2 202.8, 201.6 180.1, 201.1 139.1 M202 140 C202.7 131.5, 204.7 129.2, 211.6 130.4 M203.1 140.6 C200.7 132.5, 203.6 129.3, 211.9 130.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M167 256.5 C278.7 252.3, 389.4 249, 462.2 255.9 C468.1 260.8, 481.9 265.1, 485.9 275.8 C404 275.4, 320.9 277.1, 143.3 274.3 C151.5 267.7, 156.8 258.6, 167.9 250.7&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M164.7 254.4 C238.4 252.3, 312.9 251, 464.7 255.4 M165.6 254.6 C249.6 255.4, 333.4 256.2, 464.5 254.3 M463.5 254.4 C471.6 262, 476.7 265.2, 487.7 274.8 M464.9 253.4 C471 261.5, 477.5 267.3, 486 276.8 M486.1 275.3 C392.8 276.4, 299.7 276.6, 143.6 276.5 M486 276.3 C369.7 275.7, 253.1 275.7, 143.4 276.3 M142.1 276.5 C149.6 267.5, 158.1 261.6, 165.1 253.2 M143.3 275.6 C149.2 270.1, 156.2 263.3, 166.8 254.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;216&quot; y=&quot;152.0&quot;&gt;freed too early?&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;216&quot; y=&quot;176.0&quot;&gt;freed too late?&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M0 276.1 C143.2 273.7, 288.1 274.2, 580.4 276.1 M0.1 276.2 C154.7 275.4, 310 275.4, 579.9 275.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M514.2 239.2 C516.5 237.7, 519.9 237.6, 522.5 238.1 C525.1 238.7, 527.8 239.9, 529.8 242.4 C531.7 245, 534 250, 534 253.3 C534 256.5, 531.5 259.5, 529.6 261.7 C527.7 264, 525.6 266.1, 522.8 266.6 C520.1 267.1, 515.6 266.5, 513 264.6 C510.5 262.8, 508.8 258.3, 507.7 255.4 C506.7 252.5, 505.1 250.1, 506.6 247.2 C508 244.2, 513.9 239.4, 516.5 237.8 C519 236.2, 521.8 237.5, 521.8 237.8 M514.2 240.1 C517 238.8, 522.2 236.7, 525.1 237.3 C528 237.8, 530.1 240.7, 531.4 243.5 C532.8 246.2, 533.8 250.8, 533.2 253.9 C532.7 256.9, 530 260, 528 261.8 C525.9 263.6, 523.6 264.4, 520.9 264.6 C518.1 264.8, 513.6 264.9, 511.3 263.1 C509 261.3, 507.4 257, 507 253.8 C506.7 250.7, 507.8 246.6, 509.2 244.1 C510.6 241.7, 514.8 239.8, 515.6 239.2 C516.4 238.7, 513.7 240.8, 513.9 240.8&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M521.1 238.1 C523.9 237.8, 526.1 239, 528.2 240.8 C530.3 242.6, 533.1 246, 533.8 248.9 C534.5 251.8, 534 255.5, 532.3 258.2 C530.7 261, 526.9 264.2, 524.1 265.4 C521.3 266.6, 517.9 266.3, 515.3 265.4 C512.8 264.4, 510.2 262.2, 508.7 259.5 C507.2 256.7, 505.8 251.8, 506.3 248.9 C506.8 246, 509.3 243.9, 511.8 242.1 C514.4 240.3, 519.2 238.7, 521.5 238.1 C523.7 237.4, 525.4 238.2, 525.3 238.4 M515.2 238.2 C517.7 236.6, 520.2 237.9, 522.9 238.9 C525.7 239.9, 530.1 242, 531.7 244.2 C533.2 246.4, 532.6 249.1, 532.4 252.1 C532.2 255.1, 532.5 260.2, 530.5 262.4 C528.5 264.5, 523.1 264.9, 520.2 265 C517.3 265, 515.2 264.2, 513.1 262.6 C510.9 260.9, 508 257.5, 507.2 255 C506.5 252.5, 507.7 250.3, 508.6 247.6 C509.5 245, 512 240.1, 512.8 238.9 C513.5 237.8, 512.8 240.2, 513.1 240.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M543.7 247.7 C545.8 247, 549.3 247.9, 551.6 248.8 C554 249.6, 556.6 251, 557.8 252.8 C559 254.5, 559.3 257.1, 558.8 259.2 C558.3 261.4, 556.6 264.1, 554.9 265.8 C553.2 267.5, 550.9 269.2, 548.6 269.1 C546.4 269, 543.5 266.9, 541.6 265.2 C539.6 263.5, 537.5 261.1, 536.9 259 C536.4 256.9, 536.9 254.7, 538.1 252.9 C539.3 251.1, 542.9 249.1, 544.1 248.3 C545.3 247.5, 544.8 247.9, 545.1 248 M553.6 248 C555.7 249.1, 556.4 252.3, 557 254.4 C557.7 256.5, 557.9 258.4, 557.3 260.6 C556.7 262.8, 554.9 266.2, 553.4 267.6 C551.9 269, 550.4 269.6, 548.4 269.3 C546.4 269, 543.3 267.7, 541.3 265.8 C539.2 263.9, 536.4 260.1, 535.9 257.7 C535.5 255.3, 536.8 253, 538.4 251.5 C540 250, 543.1 249.3, 545.6 248.7 C548.1 248.1, 552.5 247.6, 553.4 247.8 C554.4 248, 551.6 249.3, 551.2 249.8&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M547 247.7 C549.3 247.7, 552.7 248.6, 554.7 250.2 C556.8 251.8, 559.2 254.9, 559.4 257 C559.7 259.2, 557.5 261.2, 556.4 263.1 C555.3 265.1, 554.6 267.9, 552.7 268.7 C550.7 269.5, 547.3 268.9, 544.9 268 C542.5 267.1, 539.2 264.9, 538 263.1 C536.8 261.3, 537.1 259.3, 537.5 257.3 C537.8 255.3, 538.2 252.7, 540.1 251 C542.1 249.3, 547.3 247.8, 549.2 247.2 C551.1 246.6, 551.6 247.2, 551.5 247.3 M545.4 247.3 C547.8 246.9, 551 248.3, 553.3 249.6 C555.6 250.9, 558.8 253.4, 559.4 255.3 C560.1 257.1, 558.2 258.4, 557.2 260.5 C556.2 262.6, 555.3 266.3, 553.5 267.7 C551.6 269.2, 548.4 269.5, 546.2 269.2 C543.9 268.8, 541.5 267.6, 540 265.8 C538.5 264.1, 537 261.1, 537.1 258.7 C537.3 256.2, 539.2 253, 540.9 250.9 C542.5 248.8, 546.3 247, 547.2 246.2 C548.1 245.5, 546.5 245.9, 546.2 246.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M531.7 225.7 C533.9 225.1, 537.5 225.6, 539.7 226.7 C541.9 227.8, 543.9 230, 544.8 232.5 C545.8 235, 545.9 239.3, 545.2 241.8 C544.5 244.3, 542.9 246, 540.8 247.4 C538.7 248.9, 535.2 250.8, 532.7 250.5 C530.2 250.3, 527.6 247.8, 525.9 245.7 C524.2 243.6, 522.8 240.3, 522.6 237.7 C522.3 235.2, 522.7 232.5, 524.3 230.4 C525.9 228.3, 530.4 225.7, 532.1 225.1 C533.9 224.5, 534.6 226.2, 534.7 226.6 M536.8 227.3 C539.3 227.9, 542.6 229, 544.2 231.1 C545.8 233.3, 547.2 237.5, 546.6 239.9 C546.1 242.3, 542.8 244, 541.1 245.5 C539.3 247.1, 538 249, 535.9 249.2 C533.9 249.5, 530.8 248.2, 528.7 246.9 C526.6 245.7, 524.1 244, 523.3 241.7 C522.6 239.4, 523.6 235.4, 524.5 233 C525.3 230.6, 526.3 228.5, 528.5 227.1 C530.8 225.8, 536.8 224.7, 538 224.8 C539.2 224.8, 535.8 226.8, 535.6 227.3&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M533 226.1 C535.6 225.7, 539.8 226, 541.8 227.7 C543.8 229.4, 544.6 233.5, 544.9 236.3 C545.3 239.1, 544.9 242.4, 543.8 244.5 C542.7 246.6, 540.6 248, 538.5 248.8 C536.4 249.6, 533.6 250, 531.1 249.4 C528.7 248.8, 525.3 247.4, 523.9 245.3 C522.5 243.2, 522.5 239.4, 522.8 236.8 C523.1 234.3, 523.5 231.8, 525.9 230 C528.3 228.1, 535 226.1, 537.4 225.6 C539.8 225.1, 540.5 226.5, 540.5 226.9 M535.6 226.5 C537.9 227, 541.1 228.5, 542.7 230.5 C544.2 232.5, 544.8 236.2, 544.8 238.5 C544.9 240.7, 544.4 241.8, 543 243.8 C541.6 245.8, 538.5 249.6, 536.4 250.4 C534.3 251.1, 532.5 249.7, 530.2 248.5 C528 247.3, 524.4 245.5, 523 243 C521.7 240.6, 521.2 236.1, 522.1 233.8 C523 231.4, 526.2 230.1, 528.5 228.9 C530.8 227.7, 534.4 227.2, 535.7 226.6 C537 226, 536.6 225.6, 536.3 225.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M506.3 253 C508.2 253, 510.4 254.1, 511.7 255.3 C513 256.4, 513.7 258.1, 514 260 C514.4 261.9, 514.7 264.8, 513.8 266.5 C512.9 268.3, 510.4 269.8, 508.7 270.5 C507 271.2, 505.1 271.3, 503.6 270.7 C502.1 270.1, 500.7 268.5, 499.5 266.8 C498.3 265, 496.3 262.3, 496.3 260.4 C496.3 258.5, 497.9 256.5, 499.6 255.3 C501.2 254.1, 504.7 253.8, 506 253.4 C507.3 253, 507.2 252.9, 507.4 252.9 M505.3 253 C506.9 253.1, 509.6 254.2, 511.2 255.4 C512.7 256.6, 514.2 258.3, 514.7 260.2 C515.2 262.1, 515.4 265.2, 514.4 266.9 C513.4 268.7, 510.8 270.3, 508.6 270.8 C506.4 271.4, 503.1 271.4, 501.2 270.4 C499.4 269.4, 498.3 266.5, 497.7 264.8 C497.1 263.2, 497.3 262.2, 497.6 260.4 C497.9 258.7, 498 255.3, 499.7 254.3 C501.4 253.2, 506.9 254.2, 507.9 254.1 C508.8 254.1, 505.8 254.2, 505.3 254&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M505.2 253.7 C506.9 253.7, 508.9 254.2, 510.5 255.3 C512.1 256.5, 514.1 259, 514.6 260.7 C515.2 262.4, 514.7 264, 513.7 265.6 C512.7 267.2, 510.4 269.5, 508.9 270.2 C507.3 270.9, 506.1 270.5, 504.5 269.9 C502.9 269.4, 500.2 268.2, 499.1 266.7 C498 265.2, 497.8 263, 498 261 C498.2 259, 499.2 256.1, 500.4 254.7 C501.6 253.3, 504.1 252.9, 505.2 252.5 C506.4 252.2, 507.1 252.4, 507.1 252.7 M507.8 252.5 C509.6 253.2, 513.3 257.5, 514.4 259.2 C515.5 260.9, 515 260.8, 514.5 262.7 C514 264.5, 512.9 268.9, 511.3 270.4 C509.7 271.8, 506.6 271.4, 504.7 271.2 C502.8 271.1, 501.1 271.2, 499.8 269.7 C498.4 268.2, 496.9 264.3, 496.5 262.3 C496.1 260.3, 496.1 259.5, 497.4 257.9 C498.8 256.4, 502.4 253.6, 504.3 252.9 C506.3 252.2, 508.4 253.6, 509.1 253.8 C509.8 254, 508.8 254, 508.5 254.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;h2 id=&quot;step-back-what-did-we-just-build&quot;&gt;Step back: what did we just build?&lt;a class=&quot;anchor&quot; href=&quot;#step-back-what-did-we-just-build&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A whole language runtime, and it fits in your head:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;compiler&lt;/strong&gt; that turns your code into a flat list of bytecode (last post).&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;stack&lt;/strong&gt; that holds values while it computes.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;loop&lt;/strong&gt; that fetches each instruction and acts on it — a tiny software CPU.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Call frames&lt;/strong&gt; that let functions call each other and come back.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;garbage collector&lt;/strong&gt; that quietly reclaims what you stop using.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That&#x27;s not a toy version of how JavaScript or Python works. Structurally, it &lt;em&gt;is&lt;/em&gt; how they work. The real ones add a thousand optimizations on top — the biggest being &lt;strong&gt;JIT compilation&lt;/strong&gt;, where the VM notices the hot parts of your program while it runs and compiles &lt;em&gt;those&lt;/em&gt; down to real machine code on the fly — but the beating heart is the loop and the stack you just watched.&lt;/p&gt;
&lt;h2 id=&quot;and-yet-i-still-hadnt-touched-the-metal&quot;&gt;And yet — I still hadn&#x27;t touched the metal&lt;a class=&quot;anchor&quot; href=&quot;#and-yet-i-still-hadnt-touched-the-metal&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Cecile now had everything: it lexed, parsed, compiled, ran, and cleaned up after itself. By every reasonable measure, it was done. A real language.&lt;/p&gt;
&lt;p&gt;But go back and reread that last section. &quot;A tiny software CPU.&quot; &quot;Compiles down to real machine code.&quot; I kept writing sentences like that and gliding right past them. My VM is a software CPU — running on top of a &lt;em&gt;real&lt;/em&gt; CPU. My JIT would compile to machine code — but what &lt;em&gt;is&lt;/em&gt; machine code? Every explanation I gave myself ran out at the same place, one floor further down than I could see.&lt;/p&gt;
&lt;p&gt;I had built a machine inside my machine. And I still couldn&#x27;t tell you what the machine at the very bottom actually does with a few letters.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-2 -16 634 268&quot; width=&quot;634&quot; role=&quot;img&quot; aria-label=&quot;A machine inside my machine&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M37.1 79.2 C41.3 79.2, 46.8 83, 50.2 86.3 C53.7 89.6, 57.2 94.4, 57.8 98.9 C58.5 103.5, 56.6 109.7, 54.1 113.9 C51.5 118, 47.2 122.1, 42.6 123.6 C38.1 125.2, 30.6 125.3, 26.5 123.3 C22.5 121.3, 19.8 116.2, 18.1 111.7 C16.4 107.2, 15.5 101.2, 16.5 96.5 C17.6 91.7, 19.9 85.9, 24.3 83.3 C28.7 80.8, 39.2 80.9, 43 81.2 C46.8 81.5, 47.2 84.9, 47 85.1 M28.3 80.6 C32.1 78.5, 37.4 78.5, 41.6 79.8 C45.7 81.1, 50.8 84.7, 53.1 88.4 C55.5 92.2, 55.8 97.6, 55.6 102.5 C55.4 107.3, 54.4 114, 51.7 117.6 C48.9 121.2, 43.8 123.7, 39 124.2 C34.2 124.6, 26.8 122.9, 22.9 120.3 C18.9 117.6, 16.5 112.5, 15.5 108.1 C14.5 103.7, 15 98.6, 17.1 94 C19.1 89.5, 26.1 82.8, 27.9 80.7 C29.7 78.7, 27.8 81.1, 27.9 81.7&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M41.8 81.2 C46 82.3, 51.3 85.2, 53.7 89.3 C56.1 93.5, 57 101.2, 56.2 106.1 C55.4 110.9, 52.5 115.5, 49 118.6 C45.6 121.6, 40.1 124.2, 35.7 124.5 C31.3 124.8, 26.1 123.4, 22.8 120.4 C19.4 117.4, 16.4 111, 15.6 106.3 C14.7 101.5, 15.7 96.1, 17.8 91.9 C20 87.8, 23.9 83, 28.6 81.4 C33.3 79.8, 42.9 82.1, 45.9 82.4 C48.9 82.7, 47 82.8, 46.6 83.1 M36.9 79.5 C41.1 79.2, 48 81.5, 51.4 85.1 C54.9 88.7, 57.2 96.4, 57.7 101.1 C58.2 105.8, 57.2 109.8, 54.6 113.4 C52 116.9, 46.9 120.7, 42.2 122.4 C37.4 124.1, 30.3 125.7, 26 123.7 C21.6 121.7, 18.1 115.1, 16.3 110.4 C14.5 105.6, 14.2 99.4, 15.3 95 C16.4 90.7, 19.1 86.9, 22.9 84.3 C26.8 81.7, 35.7 80, 38.4 79.3 C41.1 78.5, 39.2 79.5, 39.2 80&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M29 92.7 C29.4 92.6, 29.9 92.8, 30.3 93.5 C30.7 94.1, 31.3 95.7, 31.3 96.5 C31.4 97.2, 31.2 97.7, 30.6 98 C30 98.4, 28.4 98.2, 27.8 98.4 C27.2 98.7, 27.8 99.5, 27.2 99.2 C26.6 99, 24.7 97.9, 24.4 97.1 C24 96.4, 24.5 95.6, 25 94.8 C25.5 94, 26.8 92.9, 27.4 92.5 C28 92.1, 28.4 92.3, 28.6 92.3 C28.8 92.4, 28.6 92.6, 28.7 92.8 M29.1 93.7 C29.3 93.8, 29 92.9, 29.1 93.4 C29.2 94, 29.5 96.2, 29.8 97 C30.1 97.7, 31.2 97.4, 30.9 97.9 C30.7 98.4, 29.2 99.8, 28.2 100.1 C27.1 100.4, 25 100.5, 24.7 99.6 C24.3 98.8, 26 95.7, 25.9 95 C25.9 94.3, 24.1 95.5, 24.2 95.3 C24.3 95.1, 25.4 94, 26.4 93.9 C27.4 93.7, 29.6 94.7, 30.1 94.5 C30.6 94.2, 30 92.8, 29.6 92.6&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M28.4 93.7 C29.1 93.9, 30.5 93.9, 31 94.5 C31.4 95.1, 31.2 96.4, 30.9 97.1 C30.7 97.9, 29.9 98.5, 29.4 98.9 C29 99.4, 29 99.8, 28.4 99.8 C27.9 99.8, 26.7 99.3, 26.3 98.9 C25.8 98.6, 25.9 98.2, 25.9 97.4 C25.8 96.7, 26 95.3, 26 94.6 C26 93.9, 25.4 93.7, 25.9 93.5 C26.3 93.4, 28.3 93.8, 28.8 93.7 C29.2 93.6, 28.7 93, 28.7 92.9 M29.3 94 C30 94, 31.5 93.6, 31.5 93.8 C31.5 94, 29.9 94.2, 29.4 95.2 C28.9 96.2, 28.8 99.3, 28.5 99.7 C28.3 100.1, 28.5 97.9, 28.1 97.7 C27.7 97.5, 26.9 98.4, 26.2 98.3 C25.5 98.2, 24.2 97.9, 23.9 97.3 C23.7 96.7, 24.3 95.6, 24.7 94.7 C25 93.8, 25.3 92.6, 26.1 92.1 C26.8 91.6, 28.6 91.6, 29 91.9 C29.4 92.2, 28.6 93.4, 28.6 93.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M44.1 92.7 C44.7 93, 46.3 94.1, 46.8 94.6 C47.2 95.2, 46.9 95.2, 46.8 96 C46.7 96.7, 46.7 98.4, 46.2 99.1 C45.7 99.8, 44.5 100, 43.9 100 C43.3 100, 43.2 99.4, 42.6 98.9 C42 98.5, 40.6 97.8, 40.4 97.1 C40.3 96.3, 41.3 94.9, 41.9 94.4 C42.5 93.9, 43.4 94.1, 43.9 93.9 C44.5 93.7, 44.7 93.4, 45.1 93.3 C45.5 93.3, 46.1 93.4, 46.1 93.6 M43.4 92 C43.9 92.4, 45.5 94.9, 46.2 95.3 C47 95.7, 47.8 94, 47.9 94.6 C48 95.2, 47.4 98, 46.8 98.7 C46.1 99.4, 45 98.6, 44.1 98.6 C43.2 98.5, 42.1 98.9, 41.6 98.6 C41 98.4, 41 97.6, 41 97.2 C41.1 96.8, 41.9 96.9, 41.9 96.2 C41.9 95.5, 40.5 93.6, 41.1 93.2 C41.8 92.7, 45.1 93.6, 45.8 93.4 C46.5 93.2, 45.4 92.2, 45.1 92&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M44.6 93.7 C45.2 93.8, 45.1 92.9, 45.6 93.4 C46.1 94, 47.5 96.2, 47.6 97 C47.6 97.7, 46.5 97.6, 45.9 97.9 C45.3 98.2, 44.3 98.4, 43.7 98.6 C43.2 98.7, 43.1 99.2, 42.6 98.8 C42 98.5, 40.5 97.4, 40.5 96.6 C40.4 95.8, 42 94.5, 42.3 94 C42.7 93.5, 41.9 93.5, 42.5 93.4 C43.1 93.4, 45.3 93.5, 45.8 93.5 C46.3 93.4, 45.2 93.3, 45.2 93.2 M44.4 91.8 C45.2 91.7, 46.1 92.4, 46.3 92.6 C46.5 92.9, 45.9 92.7, 45.8 93.5 C45.7 94.4, 46 97.1, 45.9 97.7 C45.8 98.3, 45.5 97, 45.4 97 C45.3 97, 45.7 97.6, 45.4 97.8 C45 98.1, 44.3 98.7, 43.4 98.2 C42.5 97.8, 40.3 95.8, 39.8 95.2 C39.4 94.6, 40.1 94.9, 40.5 94.7 C40.9 94.5, 41.8 94, 42.3 93.9 C42.9 93.9, 43.7 94.8, 43.7 94.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M28 113 C31.3 111.1, 34.9 107.8, 34.1 111.1 M28.3 113.4 C32 108.2, 35.4 109.6, 38 110.9 M36 111 C38.2 113.8, 40.5 112.2, 45.2 111.4 M37.6 109.5 C38.8 111.3, 40.9 111.3, 45.7 110.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M34 124.8 C34.5 135.9, 36.6 149.1, 37.3 188.7 M35.5 123.9 C37.1 144.2, 36 163.5, 35.8 189.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M34.6 190.7 C31.2 200, 29.7 207.4, 14.7 236.9 M36.4 189.1 C28.4 207.2, 21.2 223.7, 16.8 235.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M35.2 190.6 C39.1 197.9, 42.4 207.7, 56.1 235.1 M35.3 190.3 C40.5 199.4, 46 209.9, 55.8 236.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M35.7 142.4 C30.4 148.5, 25.6 153.3, 15.5 173.2 M36.2 141.5 C30.5 149.7, 24.3 158.9, 14.8 172.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M36.5 142.2 C43.4 139.7, 72.4 135.6, 76.2 127.6 C80 119.5, 61.9 99.4, 59.2 93.7 M35.3 141.2 C42.1 138.9, 71 136.6, 75.3 128.9 C79.7 121.1, 64.2 100.7, 61.6 94.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M220 1.2 C234.4 0.4, 251.1 1.5, 265.3 3.1 C279.5 4.8, 294.2 7.7, 305.2 11.1 C316.3 14.5, 325.4 18.6, 331.8 23.4 C338.2 28.1, 342.6 33.9, 343.6 39.5 C344.6 45, 343.2 51.9, 338 56.9 C332.9 61.8, 323.2 65.5, 312.8 69.2 C302.3 72.8, 288.9 76.5, 275.3 78.8 C261.7 81.2, 246.2 82.8, 231.3 83.2 C216.4 83.6, 200.3 82.8, 185.9 81.2 C171.6 79.6, 156.6 77, 145.2 73.5 C133.8 70, 123.8 65.3, 117.3 60.2 C110.8 55.2, 107 48.6, 106.3 43.1 C105.7 37.7, 108.6 32.4, 113.6 27.4 C118.6 22.5, 126.4 17.2, 136.4 13.3 C146.4 9.4, 158.6 6, 173.7 3.9 C188.7 1.8, 217.1 0.9, 226.8 0.7 C236.4 0.4, 231.7 1.7, 231.5 2.5 M215.9 1.1 C230.4 0.4, 248 2, 262.1 3.8 C276.3 5.5, 289.3 8.1, 300.9 11.3 C312.4 14.5, 323.9 18.6, 331.3 23.1 C338.6 27.7, 343.5 33.6, 344.8 38.6 C346.1 43.7, 343.6 48.5, 338.9 53.2 C334.2 58, 326.2 63, 316.6 67.2 C307 71.5, 294.8 76, 281.4 78.7 C267.9 81.5, 251.4 83.4, 235.9 83.8 C220.4 84.2, 203.1 82.6, 188.3 81.1 C173.5 79.6, 158.8 78.1, 147.3 74.7 C135.7 71.3, 125.9 65.1, 119 60.5 C112.1 55.9, 106.9 52.3, 105.7 47 C104.5 41.8, 107 34.5, 111.7 29.2 C116.3 23.9, 123.8 19.1, 133.6 15.2 C143.3 11.4, 156.8 8.4, 170.2 6.1 C183.5 3.9, 206.3 2.6, 213.6 1.7 C220.8 0.7, 213.1 -0.1, 213.7 0.4&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M231 0.6 C245.6 0.3, 262.6 3.1, 276.2 5.4 C289.7 7.7, 302.1 10.6, 312.4 14.4 C322.6 18.2, 332.5 23.1, 337.7 28 C342.9 33, 344.7 38.6, 343.8 43.9 C342.9 49.2, 339 54.8, 332.4 59.7 C325.7 64.7, 315.4 70.1, 304.1 73.5 C292.7 76.9, 278.4 78.5, 264.3 80.3 C250.2 82.1, 234.6 84.3, 219.6 84.1 C204.5 83.9, 188 81.2, 174.2 78.8 C160.3 76.4, 146.5 73.5, 136.3 69.7 C126.1 65.9, 118 60.9, 112.8 56 C107.6 51.1, 104.5 45.5, 105.2 40.2 C105.9 35, 110.5 29.2, 117.2 24.5 C123.8 19.8, 133.9 15.6, 145 11.8 C156.2 8.1, 168.2 4.1, 184.3 2.1 C200.3 0.1, 230.3 -0.2, 241.6 0 C252.8 0.3, 251.8 2.5, 251.7 3.5 M273.7 3.9 C287.4 5.6, 299.1 9.9, 309.6 13.9 C320.1 17.9, 331.1 23.1, 336.7 28 C342.4 33, 344.2 38.3, 343.6 43.6 C343 48.9, 339 55.4, 333.1 59.9 C327.3 64.5, 319.2 67.6, 308.6 71.1 C298 74.6, 284.2 78.8, 269.7 81 C255.3 83.2, 237.3 84.2, 222 84.1 C206.8 84, 191.9 82.7, 178.2 80.6 C164.6 78.5, 150.8 75.6, 140.3 71.5 C129.9 67.4, 121.5 61, 115.5 55.9 C109.6 50.9, 104.6 45.9, 104.7 40.9 C104.7 35.9, 109.8 30.6, 115.8 25.9 C121.8 21.2, 129.7 16.7, 140.8 13 C151.8 9.2, 167.7 5.2, 182.2 3.2 C196.7 1.1, 212.8 0.6, 227.6 0.6 C242.4 0.6, 263.6 2.6, 271 3.2 C278.5 3.8, 273 3.6, 272.5 4.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M158 82.8 C159.8 83.6, 161.6 85.8, 162.6 87.2 C163.5 88.6, 164 89.8, 163.5 91.2 C163 92.7, 161.5 94.8, 159.6 96 C157.7 97.2, 154.6 98.4, 152.3 98.4 C150 98.3, 147.1 97.2, 145.8 95.9 C144.4 94.5, 144.3 92.4, 144.1 90.5 C144 88.6, 143.7 85.9, 144.8 84.5 C145.8 83.2, 147.7 82.6, 150.3 82.3 C152.9 82.1, 158.5 82.4, 160.2 82.9 C162 83.5, 160.7 85.4, 160.7 85.5 M154 82 C155.9 82.1, 158.8 83.2, 160.1 84.2 C161.5 85.2, 162.1 86.4, 162.3 88.3 C162.5 90.1, 162.5 93.7, 161.4 95.4 C160.3 97.1, 157.9 98.2, 155.8 98.4 C153.6 98.7, 150.4 97.9, 148.3 96.9 C146.1 95.8, 143.5 93.4, 142.9 92 C142.3 90.6, 144 90.2, 144.8 88.5 C145.7 86.7, 146.4 82.6, 148.1 81.6 C149.8 80.6, 154.1 82.4, 155 82.3 C156 82.1, 154.3 80.6, 154 80.7&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M156.3 81.7 C158.4 82, 160.1 83.7, 161.2 85 C162.4 86.4, 163.3 87.9, 163.1 89.8 C162.9 91.6, 161.5 94.8, 160 96 C158.5 97.2, 156.4 96.9, 154.4 97 C152.3 97.2, 149.6 97.7, 147.9 96.8 C146.2 96, 144.8 93.8, 144.3 91.9 C143.8 90, 144.3 86.8, 145 85.3 C145.8 83.9, 146.6 83.7, 148.7 83 C150.8 82.3, 155.9 81.1, 157.6 80.9 C159.3 80.8, 159.1 81.7, 159 82 M149 82 C150.9 81.2, 154.2 81, 156.3 81.7 C158.4 82.3, 160.1 84.3, 161.5 85.9 C162.9 87.4, 164.9 89.2, 164.7 90.8 C164.4 92.4, 161.9 94.1, 160 95.3 C158 96.5, 154.9 97.4, 153 97.8 C151 98.2, 149.8 98.7, 148.3 97.7 C146.9 96.8, 145.1 93.8, 144.4 92 C143.6 90.2, 143.1 88.7, 144.1 86.8 C145 85, 149.2 81.5, 150.1 80.7 C151.1 79.8, 150 81.3, 149.7 81.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M96.2 92.1 C97.5 91.6, 98.6 90.8, 99.7 91.1 C100.8 91.4, 102 92.7, 102.7 93.7 C103.5 94.6, 104.2 95.8, 104.2 96.8 C104.1 97.8, 103.5 98.8, 102.4 99.5 C101.3 100.3, 98.7 101.1, 97.5 101.3 C96.3 101.5, 96 101.4, 95.1 100.7 C94.2 99.9, 92.7 98.1, 92.1 97 C91.6 95.9, 91.2 95.1, 91.8 94.2 C92.4 93.4, 95.1 92.5, 95.8 91.8 C96.4 91.2, 95.8 90.4, 95.7 90.4 M98.5 90.3 C99.8 90, 101.1 90.9, 102.1 91.7 C103.1 92.5, 104.4 94.2, 104.5 95.1 C104.5 96, 103.4 96.3, 102.6 97.1 C101.8 97.8, 100.8 98.8, 99.7 99.6 C98.6 100.5, 97 102.2, 96 102.2 C94.9 102.2, 94.2 100.9, 93.5 99.5 C92.8 98.2, 91.9 95.2, 91.8 94.2 C91.7 93.2, 91.9 94.1, 93 93.6 C94 93.1, 97.4 91.8, 98 91.2 C98.6 90.6, 96.9 90, 96.7 90&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M99.9 91.5 C101.2 91.6, 102.2 91.6, 102.9 92.3 C103.6 93, 104.2 94.6, 104.1 95.7 C103.9 96.8, 102.7 98.1, 101.9 98.9 C101.2 99.8, 100.8 100.6, 99.6 100.8 C98.4 101, 96.3 100.6, 94.8 100.2 C93.4 99.9, 91.7 99.5, 91.1 98.5 C90.6 97.6, 90.7 95.6, 91.4 94.6 C92.1 93.6, 94 92.8, 95.4 92.5 C96.8 92.1, 98.7 92.6, 99.9 92.5 C101.1 92.4, 102.8 92.1, 102.7 92 M97.7 92 C99.2 92, 100.3 91.5, 101.4 92.1 C102.4 92.7, 103.9 94.8, 104 95.8 C104.1 96.8, 102.7 97.3, 101.9 98 C101.2 98.7, 100.5 99.8, 99.6 100 C98.7 100.3, 97.7 99.5, 96.7 99.5 C95.6 99.4, 94.1 100.3, 93.4 99.5 C92.6 98.7, 92.1 96, 92 94.7 C91.9 93.4, 92.1 92.4, 93 91.9 C93.8 91.4, 96.2 92, 97.1 91.9 C98 91.8, 98.1 91.3, 98.3 91.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;225&quot; y=&quot;30.8&quot;&gt;what&#x27;s at the very&lt;/tspan&gt;&lt;tspan x=&quot;225&quot; y=&quot;53.3&quot;&gt;bottom?&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M401.9 69.7 C446 69.1, 484.6 67.7, 562.7 69.9 C564.2 68, 572.7 72.2, 569.8 79.9 C568.9 107.4, 574.2 139.9, 571.3 180.3 C572.1 185.2, 568.6 191.4, 560 188.1 C505.7 190.8, 447.5 186.5, 397.6 192 C396.9 190.4, 390.2 190.1, 392.9 176.6 C393.2 153.8, 388.1 135.6, 388.1 83.3 C391.1 75.9, 390 70.8, 398.9 68.6&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M398.8 70.6 C451.3 70.7, 503.3 72.8, 559.5 69.1 M399.4 69.4 C438 70.1, 477.1 69.7, 561 69.9 M560 70 C568.6 71.9, 571.3 75.1, 568.6 79.7 M559.3 71.4 C567.3 69.4, 570 73.3, 571.4 81.9 M569.2 78.9 C570.2 117.9, 569.8 153.4, 568.5 179.1 M569.8 79.3 C568.8 118.9, 570 158, 570 179.8 M570 180 C569.5 186.1, 564.8 190.7, 560 190.4 M571.7 181.5 C571.2 186.7, 565.5 189, 559.2 191.9 M558.6 188.6 C503.3 189.9, 446.9 189.9, 400 190.8 M559.5 189.1 C525.5 190.1, 488.6 189.6, 400.3 189 M400 190 C394.9 191.2, 391.7 184.9, 388.4 179.3 M401.1 191.9 C394.7 189.8, 391.3 186.2, 387.9 181.5 M391.8 178.2 C391.4 143.1, 389.2 108.6, 391.2 78.5 M390.9 180.5 C390.3 142.3, 389.9 105, 390.8 80.6 M390 80 C388.9 74.6, 394.9 70.2, 400.6 70.2 M390.9 81 C391.5 74.8, 395.1 69.5, 397.9 70.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M411.5 80.6 C450.4 85.3, 494.1 83.4, 546.3 83.2 C556.1 83.2, 555.5 87.6, 560.2 88.7 C556 116.2, 560.2 136.8, 555.5 167.9 C559.4 174, 551.8 177.5, 549.7 179 C497.9 178.8, 447.3 179.7, 409.6 181.2 C404.1 180.3, 405.2 177.3, 399 166.5 C400.8 137.9, 399.6 109.3, 402.7 93.7 C401.2 82.9, 403.3 80.6, 409 84.8&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M411.3 82.5 C455.6 82.8, 500.3 83.2, 548.9 83.3 M412.3 82.6 C453.2 81.9, 493.9 81.8, 548 82.2 M548 82 C552.8 81.6, 559.1 87.2, 559.4 93.1 M547.4 80.9 C554.2 84.2, 559.8 86.9, 558.4 90.6 M557.8 91.4 C557.9 122, 557.7 152.9, 558.7 166.5 M557.8 92.2 C558.3 117.7, 556.6 141.3, 557.7 168.3 M558 168 C558 176.5, 556.2 176.2, 547.5 179.5 M559.9 166.1 C557 174.3, 555 178.2, 549.3 178.7 M546.9 177.2 C510.7 177.8, 470.8 177.1, 411.8 176.7 M548.1 178.8 C509 176.9, 468.6 177.4, 411.3 178.7 M412 178 C406.2 176.6, 402.9 174.6, 403.1 168.8 M413.7 177.9 C405.1 178.6, 402.1 173, 402.9 167.3 M403.5 167.6 C400.6 139.6, 400.2 108.2, 401.9 92.6 M401 168.2 C402.5 138.7, 402.6 110.1, 402.8 91.1 M402 92 C400.6 86.3, 403.7 82.3, 410.1 80 M403 92.9 C404 85.6, 405.4 82.6, 411.3 82.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M365.3 196.6 C415.7 197.1, 461.1 197.6, 593.9 196.2 C599.1 206.2, 608.8 215.4, 619.4 218.7 C547.9 217.3, 480.5 218.1, 346.7 215.3 C353.8 208.5, 361.2 202.2, 365.2 195.7&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M365.9 196.3 C439.8 196.1, 515 195.1, 592.5 195.5 M365.3 195.8 C449.9 197, 533.8 197.2, 594.9 196.5 M595.2 196.9 C602.7 202.7, 608 209.6, 615.9 216.6 M593.1 195.1 C601.1 203.3, 607.7 209.4, 615.8 217.4 M615.3 219.5 C545.9 219.7, 477.1 220.6, 344.6 217.8 M615.6 217.4 C526 220, 436 219.8, 343.3 217.5 M343.4 219.6 C350.8 210.6, 355.2 205.9, 365.3 195.8 M343.5 217.9 C349.4 213.6, 353.8 208, 366.8 196.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M453.9 109.5 C472.1 106.2, 493.5 103.5, 504.8 102.6 C515.5 106.4, 517.7 110.6, 515.9 111.3 C517.7 121.2, 512.6 128.8, 513 145.2 C516.1 152.2, 515.4 156.9, 505.9 153.5 C493.6 152.1, 485.6 156.1, 449.6 152.5 C450.2 152.9, 445.8 152.4, 443.6 148.1 C446.8 139.5, 445.9 128.7, 442.6 112.6 C446.7 110.5, 447.2 107.2, 452.5 102.8&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M452.5 106.2 C469.7 106.9, 489.4 104, 507.7 107.6 M452.1 107 C465.8 105.6, 478 106.2, 508 106.9 M508 106 C511.7 104.8, 516.6 106.7, 515.1 113.9 M507.7 107.9 C515.3 104.5, 516.6 108.8, 514.5 115.1 M517.2 114.3 C514.4 120.3, 514.5 130, 517.1 147.1 M515.8 114 C516.2 126.3, 516.8 139.8, 517 145.4 M516 146 C517.1 149.9, 513.5 155.3, 506.5 153.6 M514.4 145.2 C515.3 150.2, 512 152.1, 508.9 152.4 M507.6 154.4 C488.9 154.1, 469.7 152.1, 451.6 152.5 M507.4 154 C494 153.9, 482 154.4, 451.1 153.9 M452 154 C446 155.3, 443.4 150.7, 442.5 145.9 M450.9 153.8 C447.7 156.2, 441.7 152, 441.7 145.6 M444.8 144.4 C444.2 137.4, 443.5 130.9, 445.2 114.8 M443.3 145.7 C443.7 139.9, 442.9 132.9, 444.7 114.1 M444 114 C442.1 109, 446.6 106.3, 453 107.6 M445.2 114.8 C442.5 106.6, 448 104.2, 453.9 106.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M460.6 106.1 C459.8 101.8, 461 97.5, 460.6 93.9 M460.6 106.1 C459.9 102.3, 460.2 99.3, 459.4 93.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M461 154 C459.8 158.9, 459 161.4, 459.1 167.2 M459.9 153.6 C460 158.1, 459.7 161.9, 460 165.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M442.9 120.9 C439.9 120.9, 435.4 120.8, 431.9 121.1 M444.5 121.3 C441.9 121.1, 438.5 120.9, 431.4 121&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M515.3 121.7 C520.9 121.7, 524.4 120.9, 527.2 120.8 M516.2 120.4 C520.8 121.7, 525.2 121.1, 527.5 120.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M473 106.7 C474.4 101.4, 474.3 98.1, 473.4 95.1 M472.9 106.1 C472.9 102.7, 473.5 100.7, 473.5 93.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M473.3 154.6 C474.5 158.6, 472.2 162.1, 474.2 166 M473.4 153.7 C473.1 157.3, 473.1 160.7, 472.9 166&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M444.4 127.5 C441.1 126.5, 435.3 127.5, 431.3 125.9 M443.4 127.4 C439.9 126.8, 435 126.9, 432.1 127.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M516.7 127.5 C521.1 127.7, 523.5 127.6, 528.1 127.2 M516 126.9 C518.1 126.9, 520.8 127.1, 527.6 127.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M487.7 106.4 C485.4 101.5, 486.6 98.9, 487.6 93.1 M487.2 105.4 C486.4 102.6, 487 99.7, 486.8 93.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M485.7 154.3 C485.5 158.7, 487 163, 486.1 166.4 M486.5 154.1 C486.9 158.4, 487 162, 486.2 165.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M443.3 133.2 C439 132.6, 436.8 131.9, 432.3 132.3 M444.4 132.7 C442 133.3, 439 133, 432.2 132.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M515.7 133.2 C518.9 133.9, 525.1 132.2, 529.1 133.6 M515.7 133.4 C519 133.5, 522.4 133.3, 527.6 133&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M500 106.1 C499.1 101.7, 499.2 97.4, 499.5 93.5 M500.2 105.9 C500 101.4, 499.6 97.5, 500.2 94.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M500.4 154.9 C500.1 158.4, 500.2 161.4, 501.2 165.2 M500 154.2 C500 157.5, 500.3 160.8, 500.3 165.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M444.8 139.8 C440.2 138.3, 436.6 138.6, 431.6 139.5 M444.5 138.7 C440 139, 435.5 139, 431.7 139.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M517.1 139.8 C520.3 139.6, 525.1 138.9, 528.5 138.4 M515.9 139.4 C518.1 139.3, 521.1 139.4, 528.3 139.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M472.9 118.9 C473.2 119, 473.6 120.2, 473.9 120.9 C474.2 121.6, 474.7 122.5, 474.6 122.9 C474.5 123.3, 473.9 123.1, 473.3 123.4 C472.7 123.6, 471.6 124.4, 470.9 124.6 C470.2 124.9, 469.6 125.3, 469.3 125 C469 124.6, 469.1 123.2, 469 122.5 C468.9 121.8, 468.6 121.2, 468.8 120.8 C469.1 120.4, 469.4 120.4, 470.4 120.1 C471.3 119.8, 473.6 119, 474.3 119 C474.9 119, 474.7 119.7, 474.4 119.9 M472.1 119.1 C472.5 119, 473.6 119.3, 474.3 119.9 C475 120.4, 476.1 121.4, 476 122.2 C475.9 123.1, 474 124.3, 473.7 124.8 C473.4 125.3, 474.8 125.3, 474.3 125.5 C473.7 125.6, 471 125.7, 470.2 125.4 C469.4 125.2, 469.5 124.6, 469.4 123.8 C469.4 123, 469.6 121.8, 469.9 120.9 C470.2 119.9, 471 118.6, 471.2 118.2 C471.5 117.9, 471 118.5, 471.2 118.7 C471.4 119, 472.5 119.4, 472.6 119.8&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M472.1 119.2 C472.5 119.6, 473.2 120.4, 473.6 121 C474.1 121.6, 474.7 122.4, 474.8 123 C474.9 123.6, 474.7 124.5, 474.2 124.8 C473.7 125.1, 472.7 124.8, 472.1 124.6 C471.5 124.4, 471.4 124.1, 470.8 123.7 C470.2 123.3, 468.4 122.7, 468.3 122.2 C468.2 121.6, 469.6 121, 470.1 120.4 C470.6 119.8, 470.8 119, 471.2 118.7 C471.7 118.5, 472.3 118.6, 472.8 118.7 C473.3 118.8, 474.3 119.2, 474.2 119.3 M469.3 119.8 C469.8 119.5, 473.1 119.7, 474.1 119.9 C475 120.1, 475.1 120.5, 475.2 121 C475.3 121.5, 474.9 122, 474.9 122.7 C474.8 123.3, 475.6 124.8, 474.9 125 C474.3 125.1, 471.3 123.5, 470.8 123.6 C470.2 123.7, 471.8 125.7, 471.6 125.4 C471.4 125.1, 470 122.8, 469.7 121.9 C469.4 121, 469.7 120.2, 469.7 119.8 C469.8 119.5, 469.6 119.8, 469.9 119.8 C470.2 119.8, 471.4 119.9, 471.7 119.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M487.1 118.8 C487.6 118.3, 487.8 118, 488.2 118.1 C488.7 118.2, 489.3 118.8, 489.7 119.5 C490 120.1, 490.4 121.3, 490.4 121.9 C490.4 122.5, 490.3 122.6, 489.8 123.2 C489.3 123.9, 488 125.5, 487.4 125.8 C486.8 126.1, 486.8 125.5, 486.4 125.1 C486.1 124.7, 485.5 124, 485.2 123.3 C484.9 122.7, 484.1 122, 484.6 121.4 C485 120.7, 487.4 119.6, 487.9 119.3 C488.3 119, 487.1 119.7, 487.1 119.6 M486.3 117.6 C487 117.3, 487.5 118.4, 488.3 118.8 C489 119.2, 490.7 119.2, 490.9 119.8 C491.1 120.4, 489.6 121.8, 489.4 122.4 C489.3 123.1, 490.6 123.4, 490.2 123.7 C489.8 124, 488.2 124.4, 487.2 124.3 C486.3 124.1, 485.1 123.4, 484.7 123 C484.3 122.6, 484.5 122.3, 484.8 121.9 C485 121.5, 485.7 121.4, 486.1 120.7 C486.4 120, 486.5 118.1, 486.8 117.9 C487.2 117.6, 487.7 119.1, 488.1 119.3&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M488.3 119.2 C488.8 119.2, 489.8 119.3, 490.3 119.9 C490.8 120.5, 491.4 122.2, 491.5 122.9 C491.5 123.5, 491.3 123.3, 490.6 123.7 C490 124.2, 488 125.5, 487.4 125.4 C486.8 125.4, 487.5 124, 487.1 123.6 C486.7 123.3, 485.3 123.9, 484.9 123.3 C484.4 122.7, 484.2 120.6, 484.4 119.8 C484.5 119, 485 118.9, 485.8 118.7 C486.7 118.4, 488.9 118.3, 489.6 118.4 C490.3 118.5, 490.3 119.2, 490.2 119.3 M487.2 120.4 C487.5 120.5, 487.3 120.1, 488.2 120.4 C489 120.7, 491.8 121.7, 492.3 122.2 C492.8 122.6, 491.5 122.7, 491 123.3 C490.6 123.8, 490.3 125.1, 489.7 125.5 C489.1 125.9, 487.8 125.7, 487.2 125.4 C486.7 125.1, 486.8 124.4, 486.5 123.9 C486.2 123.4, 485.2 123.1, 485.2 122.6 C485.1 122, 486.1 121, 486.2 120.4 C486.4 119.7, 486 118.6, 486.1 118.6 C486.1 118.6, 486.3 120.1, 486.6 120.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M472 139 C473.7 135.2, 478.9 135.7, 480.7 136.6 M471 138.7 C477.1 133.5, 479.2 137, 480.9 138.1 M480 137 C484 137.1, 486.2 139.4, 488.9 136.7 M479 136 C480.9 137.5, 482.9 136.4, 489.2 135.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;So I stopped adding to Cecile. Cecile was a language that &lt;em&gt;runs&lt;/em&gt; — but always in software, always inside a VM I controlled, never touching the silicon. If I wanted the real answer, I needed a different kind of language. One that doesn&#x27;t run on a cozy VM at all, but compiles all the way down to the instructions the bare chip eats.&lt;/p&gt;
&lt;p&gt;I needed to build a language that &lt;em&gt;compiles&lt;/em&gt;. And I wanted its keywords to be in my own language. That language became &lt;strong&gt;Mon&lt;/strong&gt; — the six lines at the very top of Part 1.&lt;/p&gt;
&lt;h2 id=&quot;one-floor-down&quot;&gt;One floor down&lt;a class=&quot;anchor&quot; href=&quot;#one-floor-down&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;That&#x27;s where this stops being about Cecile, and starts being about the metal.&lt;/p&gt;
&lt;p&gt;New language, new book, and this time the code compiles all the way to the bare chip. We&#x27;re going down — through a real compiler, past LLVM (and why I skipped it), into assembly and the CPU itself, all the way to the syscalls and linkers where a program finally meets the operating system.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What does a language look like when there&#x27;s no VM left to hide behind?&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>This Time, There&#x27;s No Interpreter to Hide Behind</title><link>https://your-moon.github.io/s2-1-compiler/</link><guid>https://your-moon.github.io/s2-1-compiler/</guid><pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate><description>&lt;h1 id=&quot;this-time-theres-no-interpreter-to-hide-behind&quot;&gt;This Time, There&#x27;s No Interpreter to Hide Behind&lt;a class=&quot;anchor&quot; href=&quot;#this-time-theres-no-interpreter-to-hide-behind&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Building my own programming language — Season 2: To the Metal · Part 1: The Compiler&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Remember the six lines at the very top of Part 1 — the program I said took me three years to understand? This is the year it was born. And this is the first thing my new compiler ever wrote that I couldn&#x27;t fully read:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;eax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;eax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;eax&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;My compiler wrote that file, saved it to disk, and walked away. No virtual machine ran it. No runtime of mine stood behind it. It was just &lt;em&gt;instructions&lt;/em&gt;, sitting there, waiting for a bare CPU to pick them up — and I&#x27;d generated them without truly understanding what a single one meant.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-2 19 518 203&quot; width=&quot;518&quot; role=&quot;img&quot; aria-label=&quot;Assembly I couldn&#x27;t read&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M28.9 52.4 C32.8 50.9, 39.8 50.2, 44.2 51.8 C48.6 53.4, 53.2 57.7, 55.3 61.8 C57.5 66, 58.1 72, 57 76.6 C55.9 81.2, 52.6 86.8, 48.9 89.6 C45.1 92.3, 38.9 93.3, 34.3 92.9 C29.7 92.5, 24.4 90.2, 21.2 87 C18 83.8, 15.8 78.3, 15.1 73.8 C14.4 69.4, 13.5 64.1, 17.1 60.2 C20.7 56.4, 32.5 52.3, 36.6 50.9 C40.6 49.5, 41.3 51.6, 41.3 52 M32.5 52.1 C36.9 51, 42.5 51.5, 46.2 53.6 C49.9 55.8, 53.1 60.9, 54.6 65.1 C56.1 69.2, 56.3 74, 55.3 78.3 C54.2 82.6, 51.8 88.1, 48.1 90.8 C44.4 93.4, 38.1 94.9, 33.2 94.2 C28.3 93.5, 21.6 90.6, 18.7 86.8 C15.8 83.1, 15.8 76.3, 15.7 71.7 C15.5 67.1, 15.2 62.4, 17.9 59 C20.6 55.6, 29.6 52.5, 31.7 51.6 C33.7 50.6, 30.1 53, 30.2 53.2&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M38.2 50.9 C42.4 50.9, 46.7 53.1, 49.9 56.3 C53.1 59.6, 56.6 65.8, 57.3 70.4 C58 75, 56.8 80.1, 54.1 83.8 C51.5 87.6, 45.9 91.4, 41.3 92.6 C36.7 93.9, 30.7 93.2, 26.6 91.4 C22.4 89.5, 18.2 85.8, 16.3 81.7 C14.3 77.6, 13.4 71.1, 14.7 66.8 C16.1 62.5, 19.8 58.2, 24.3 55.7 C28.8 53.1, 38.2 51.6, 41.7 51.2 C45.3 50.9, 45.8 53.1, 45.7 53.5 M37.6 51.1 C41.7 50.7, 47 52.5, 50.2 55.5 C53.4 58.4, 56.4 63.9, 56.8 68.6 C57.2 73.2, 55.1 79.3, 52.7 83.5 C50.2 87.7, 46.4 92.5, 42 93.7 C37.5 94.9, 30.3 92.8, 26 90.8 C21.7 88.9, 18.2 86.1, 16.2 82.1 C14.1 78.1, 12.6 71.2, 13.9 66.9 C15.3 62.6, 20.2 58.7, 24.2 56.2 C28.2 53.8, 36 52.8, 37.9 52.1 C39.9 51.5, 36.1 52.5, 36.1 52.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M27.5 63.6 C28.2 63.4, 29.2 63.2, 29.7 63.6 C30.2 63.9, 30.4 64.8, 30.6 65.5 C30.7 66.2, 30.8 67.1, 30.7 67.7 C30.6 68.2, 30.6 68.6, 29.9 68.7 C29.2 68.9, 27.2 68.8, 26.5 68.6 C25.8 68.5, 26 68.3, 25.6 67.8 C25.2 67.2, 24.3 65.9, 24.2 65.2 C24.1 64.5, 24.3 63.6, 25 63.4 C25.7 63.2, 27.9 63.9, 28.4 63.9 C28.9 63.9, 28.1 63.4, 28 63.4 M26.7 62.5 C27.1 62.2, 26.8 62.6, 27.5 62.8 C28.3 63, 30.5 62.8, 31.3 63.6 C32.1 64.3, 32.4 66.7, 32.2 67.3 C32 68, 30.7 67.3, 30.1 67.5 C29.5 67.8, 29.2 68.8, 28.7 68.8 C28.1 68.9, 27.3 68.1, 26.7 67.6 C26.1 67.2, 25.2 66.7, 25.1 66.1 C25.1 65.4, 26.1 64.3, 26.5 63.7 C26.8 63.2, 27.5 62.5, 27.3 62.6 C27.2 62.7, 25.4 64.1, 25.5 64.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M29.1 63.1 C29.6 63.3, 29.3 63.8, 29.7 64.3 C30.1 64.8, 31.3 65.4, 31.6 66.1 C31.8 66.8, 31.6 67.9, 31.3 68.6 C30.9 69.2, 30.3 69.9, 29.5 69.9 C28.7 69.9, 27.1 69.1, 26.4 68.6 C25.7 68.1, 25.7 67.6, 25.5 66.9 C25.2 66.3, 24.9 65.1, 25 64.7 C25 64.3, 25 64.8, 25.7 64.4 C26.4 64, 28.7 62.6, 29.2 62.4 C29.8 62.2, 29 62.9, 28.9 63 M30.3 64.3 C30.8 64.3, 30.1 63.2, 30.3 63.5 C30.4 63.7, 31.4 65.2, 31.2 65.9 C31 66.6, 29.8 67.1, 29.1 67.9 C28.5 68.6, 28 70.1, 27.4 70.4 C26.9 70.7, 26.6 70.2, 26 69.5 C25.4 68.8, 23.8 66.9, 23.9 66.3 C24.1 65.7, 26 66.4, 26.7 65.8 C27.4 65.2, 27.5 63.1, 27.9 62.7 C28.2 62.3, 28.8 63.6, 28.9 63.5 C29 63.4, 28.8 62.1, 28.8 62&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M44.7 63.8 C45.5 63.5, 46.1 62.6, 46.4 62.8 C46.6 63, 46.2 64.4, 46.2 65 C46.2 65.7, 46.4 66.1, 46.4 66.7 C46.3 67.2, 46.5 67.9, 46.1 68.1 C45.6 68.4, 44.5 68.3, 43.8 68.2 C43 68.1, 42 68.2, 41.5 67.7 C41.1 67.1, 41 65.6, 41 64.9 C41 64.1, 40.8 63.3, 41.5 62.9 C42.1 62.6, 44.3 63, 44.9 62.9 C45.6 62.8, 45.8 62.3, 45.5 62.3 M43.8 64.2 C44.5 64.3, 46.2 63.4, 46.7 63.9 C47.2 64.4, 46.7 66.5, 46.7 67.1 C46.6 67.6, 47 67, 46.5 67.4 C45.9 67.8, 43.9 69.2, 43.3 69.5 C42.7 69.8, 43.4 69.8, 43 69.4 C42.5 69, 40.9 68, 40.5 67.1 C40.1 66.2, 40 64.7, 40.5 64.3 C41 63.8, 42.6 64.9, 43.5 64.6 C44.4 64.2, 45.8 62.1, 45.9 62 C45.9 62, 44 64, 43.8 64.2&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M43.3 63.4 C44 63.3, 45.9 63, 46.4 63.4 C46.8 63.9, 46.3 65.3, 46.2 65.9 C46.1 66.6, 45.9 66.9, 45.7 67.3 C45.5 67.7, 45.3 68.2, 44.8 68.4 C44.3 68.5, 43.1 68.3, 42.7 68.2 C42.2 68.1, 42.3 68.3, 42.1 67.9 C41.9 67.6, 41.2 66.8, 41.3 66.2 C41.3 65.7, 41.9 65.2, 42.3 64.6 C42.8 63.9, 43.5 62.6, 43.9 62.3 C44.3 62.1, 44.4 63, 44.6 63.1 M42.4 62.5 C43 62.3, 44.2 62.3, 45 62.6 C45.9 62.9, 47.3 63.8, 47.6 64.3 C47.8 64.8, 46.9 64.9, 46.5 65.7 C46 66.6, 45 68.9, 44.8 69.4 C44.6 69.9, 45.5 69.1, 45.3 68.7 C45 68.3, 44.1 67.4, 43.5 67 C43 66.6, 42.1 66.7, 41.9 66.4 C41.7 66.2, 42.3 66.1, 42.3 65.5 C42.4 64.9, 42 63.3, 42.2 62.8 C42.5 62.4, 43.8 62.8, 43.9 63&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M28 83 C32.5 77.9, 33.9 79.5, 34.9 83 M26.2 82.2 C33.1 79.5, 34.8 78, 37.2 79.1 M36 81 C38.5 82.9, 38.9 81, 45.4 78.1 M35 82 C40.2 83.4, 38.7 82.1, 44.5 82&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M34.8 93.8 C36.7 110.3, 36 127.5, 35.7 159.7 M35.6 94.2 C37 117.5, 37 140.4, 36.5 160.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M35.4 159.7 C31.5 169.3, 26.5 184, 17.1 207.8 M36.5 159.4 C31.2 170.4, 27.9 180.2, 15.5 205.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M36 159.6 C42 171.5, 47.3 180.4, 54.5 206 M35.4 160.6 C41.7 173.2, 47.3 186.3, 56.5 205.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M36.5 111.4 C31.5 117.7, 27.1 125, 13.9 140.2 M36.3 111.8 C29.3 122.8, 20.9 131.6, 13.5 141.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M37.1 111.3 C50.6 110, 61.8 106.4, 93.3 104.3 M35.2 111 C46.6 109.7, 58.1 109.1, 92.5 104.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M122.5 69.8 C209.6 66.9, 295.7 69.4, 344.1 70 C352.4 75.9, 357 76.8, 372 99.2 C372.7 121.5, 368.6 147.5, 371 178.8 C291.7 177.8, 216.2 178.7, 117.6 184.2 C118.6 152.9, 122.9 114.7, 120.5 70.3&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M121.4 69.3 C175.5 68.2, 228.5 68.8, 342.9 68.7 M120 70.2 C178.9 69.6, 237.2 70.7, 343.6 70.4 M342.2 70.9 C353.9 80.6, 364.3 90.8, 368.2 96.8 M343.7 69.1 C351.7 77.4, 358 84.8, 370.5 96.2 M370.7 96.7 C370.9 129.9, 371.5 162.3, 369.9 181.7 M370.6 95.6 C369.2 116.9, 369.6 139.2, 369.5 182.6 M371 181.5 C309.4 180.9, 247 179.9, 118.7 182.4 M369.6 182.2 C314.9 182.9, 258.6 183.5, 120 182.2 M120.3 183.1 C121.2 157.8, 118.5 136.1, 120.2 71.9 M120.8 181.9 C119.4 144.4, 119.7 105.5, 119.4 69.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M343.2 70.9 C343 75.5, 338.6 92.3, 342.9 96.7 C347.3 101, 364.8 97, 369.3 97 M345 70.3 C345.1 74.6, 341.2 90.8, 345 94.9 C348.9 99.1, 363.9 95.2, 368.2 95.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;136&quot; y=&quot;101.0&quot;&gt;mov   eax, 2&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;136&quot; y=&quot;126.0&quot;&gt;add   eax, 3&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;136&quot; y=&quot;151.0&quot;&gt;mov   [x], eax&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:56px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;430&quot; y=&quot;70.0&quot;&gt;?&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:40px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;490&quot; y=&quot;120.0&quot;&gt;?&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;That&#x27;s the whole difference between Season 1 and Season 2. Cecile &lt;em&gt;ran&lt;/em&gt; your code; I stayed safe inside a VM I controlled. This second language &lt;strong&gt;compiles&lt;/strong&gt; your code — translates it down to the real instructions a chip eats, then leaves, and the bare processor takes it from there. And I decided its keywords would be in Mongolian. That&#x27;s &lt;strong&gt;Mon&lt;/strong&gt;, and its &quot;hello world&quot; is the program from the top of Part 1:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;extern функц мөр_хэвлэх(м мөр) -&amp;gt; хоосон {}   // extern fn print_line(m: string) -&amp;gt; void

функц үндсэн() -&amp;gt; тоо {                         // fn main() -&amp;gt; int
    мөр_хэвлэх(&quot;Өдрийн мэнд&quot;);                  // print_line(&quot;Good day&quot;)
    буц 0;                                       // return 0
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Өдрийн мэнд
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Same greeting as Season 1. Completely different journey underneath. This post is about that difference — what a compiler actually &lt;em&gt;is&lt;/em&gt;, and why building one drops you straight through the floor toward the metal.&lt;/p&gt;
&lt;h2 id=&quot;wait-didnt-cecile-already-compile&quot;&gt;Wait, didn&#x27;t Cecile already &quot;compile&quot;?&lt;a class=&quot;anchor&quot; href=&quot;#wait-didnt-cecile-already-compile&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Fair catch. In Season 1 I said Cecile compiles your code to bytecode. So what&#x27;s new?&lt;/p&gt;
&lt;p&gt;The difference is &lt;strong&gt;where the translation stops, and who runs the result.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Cecile compiled your code to bytecode and then &lt;em&gt;immediately ran it itself&lt;/em&gt;, on a VM I wrote. The bytecode never left my software. It&#x27;s the live-translator deal from Season 1: convenient, instant, but forever one step above the hardware.&lt;/p&gt;
&lt;p&gt;A real compiler makes a different bargain. It translates your program into the &lt;strong&gt;actual instructions of a real CPU&lt;/strong&gt;, writes them into a file, and then &lt;em&gt;walks away&lt;/em&gt;. No VM. No runtime of mine standing between the program and the processor. When you run the result, the bare chip is executing your logic directly.&lt;/p&gt;
&lt;p&gt;That&#x27;s the whole reason I switched languages to learn this. An interpreter lets you &lt;em&gt;avoid&lt;/em&gt; understanding the machine. A compiler forces you to meet it.&lt;/p&gt;
&lt;h2 id=&quot;the-new-book-writing-a-c-compiler&quot;&gt;The new book: &lt;em&gt;Writing a C Compiler&lt;/em&gt;&lt;a class=&quot;anchor&quot; href=&quot;#the-new-book-writing-a-c-compiler&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For Cecile I had Crafting Interpreters. For this, after digging through half of Reddit, I got a physical copy of &lt;strong&gt;Nora Sandler&#x27;s &lt;em&gt;Writing a C Compiler&lt;/em&gt;&lt;/strong&gt; — a book that had barely just come out.&lt;/p&gt;
&lt;p&gt;It&#x27;s the perfect companion to the interpreter book, because it refuses to let you stay in the comfort zone. You don&#x27;t build a VM that runs your code. You build a program that reads C and emits &lt;strong&gt;real x86-64 assembly&lt;/strong&gt; — text a real processor runs directly. The output isn&#x27;t &quot;a result.&quot; The output is &lt;em&gt;instructions&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;I pointed it at my own Mongolian-keyword language — I call it &lt;strong&gt;Mon&lt;/strong&gt; — instead of plain C, wrote the whole compiler in Go, and got to work. When it&#x27;s done producing assembly, it shells out to the system assembler and linker (&lt;code&gt;as&lt;/code&gt; and &lt;code&gt;cc&lt;/code&gt;) to turn that into a real executable. (One funny wrinkle: my Mac has an ARM chip, but Mon emits x86-64, so on my own machine the result runs under Rosetta translation. More on that two posts from now.)&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:509px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -16 509 514&quot; width=&quot;509&quot; role=&quot;img&quot; aria-label=&quot;From Mon source to the bare CPU&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M7.7 1.5 C62.8 4, 120.8 2, 229.8 -2 C238 -1.8, 241.3 2.2, 239.1 6.7 C237.3 19.7, 238 32.9, 242.9 47.2 C238.9 48.5, 237.3 55.5, 234.6 54 C158.7 54.1, 93.6 53, 10.8 52.3 C2 54.4, 0.4 48.7, -1.4 43.3 C3 35.9, -3.4 20.5, 1.5 10.6 C-1.4 6, 0.7 -0.8, 11.7 3.2&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M10.3 0.1 C78.8 0.3, 146.5 1.8, 232.5 -0.2 M9.5 0.1 C66.4 0.4, 124 0.2, 231.8 0.4 M231 0 C236.6 0.7, 240.1 2, 239.8 10.1 M230.8 -0.7 C237.2 -0.4, 239.6 1.5, 239.2 7.1 M238.9 10.6 C238.1 22.4, 241.4 33.9, 238.7 43.5 M240 8.4 C240.4 19.4, 239.7 29, 239.2 45.3 M240 45 C241.3 52, 239 52.8, 231.5 55 M240.7 44.4 C237.9 52.4, 235.2 55.1, 230.3 53.5 M231.4 55.2 C148.4 54.4, 63.5 52.6, 10.4 55.2 M231.1 53.3 C170 54.5, 110.8 53.9, 8.5 54.2 M9 54 C3.8 53.6, 1.4 52.1, -0.5 46.4 M7 55.4 C2.6 55.7, -1 52.6, 1 43.1 M-2 46.1 C0 30.6, -0.6 18.9, -1.8 8.6 M-0.6 45.1 C-0.4 34.7, -0.9 25.4, -0.3 9.5 M0 9 C-0.1 4.6, 2.9 0, 9.6 0.3 M-0.9 7.6 C2.1 1, 1.4 -1.1, 7.7 1.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;120&quot; y=&quot;27.0&quot;&gt;Mon source&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M10.7 90.6 C59 89, 103.6 92.1, 232.7 90.8 C238.2 93, 239.2 92, 242.2 98.1 C239.2 113.9, 240.4 123, 236.6 134.3 C237.6 138.4, 236.1 143.3, 231.8 141 C175 140.4, 115.8 140.6, 10.1 145.7 C0.6 147.3, -1.4 138.9, -1.9 136 C2 120.3, 3 108, -2.1 100 C3.4 93.2, 0.7 88.1, 12.4 91.8&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M10.1 90.3 C97.5 91.9, 182.9 91.6, 232.3 89.6 M8.4 89.5 C63.4 90.4, 115.5 89.9, 231.3 90.5 M231 90 C235.3 88.7, 239.3 94.8, 238.8 100.5 M230.9 88.7 C238.5 88.5, 241.1 94, 238.2 101.1 M238.3 98 C239.9 110.5, 240 119.7, 241.7 136 M239.7 99.5 C239.4 110.3, 240.7 122.2, 240.7 135.6 M240 135 C240.7 140.4, 237.7 144.4, 229.2 144.8 M241.1 134 C239.7 141.6, 235.5 142.8, 233.1 144 M230.1 142.7 C153.8 142.4, 71.7 142.6, 7.8 144.6 M231.8 144.4 C153.8 142.9, 74.5 143.8, 8.6 143.6 M9 144 C3.8 143.4, 0.7 140, 1.5 133.7 M9.3 144.6 C0.9 144.8, -1.9 140.5, 1.3 136.7 M-0.7 133.4 C0.9 122.2, 0.8 112.3, -1.2 98.4 M-0.5 135.1 C-0.4 120.6, 0.5 108.5, 0.2 99 M0 99 C1.2 92.9, 1.9 88.1, 10.3 88 M-2 98.5 C0.9 93, 2 90.8, 10.1 88.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;120&quot; y=&quot;117.0&quot;&gt;Mon compiler (in Go)&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M7.8 179.4 C80.1 184.2, 151.6 180.2, 233.5 177.6 C237.8 178.3, 241.1 180.6, 240.4 188.2 C243.5 206.3, 243.6 213.7, 238.2 222.5 C240.8 232.1, 234.1 235.3, 232.2 231.1 C152.8 230.2, 74.4 232.5, 12 234.5 C2.8 231.5, 1.6 230.3, -3.3 222.6 C-2.8 217.4, -1.9 206.2, -0.7 190.8 C-2.6 186.2, -0.5 182.3, 12.3 181.3&quot; style=&quot;fill:var(--xd-orange)&quot;/&gt;&lt;path d=&quot;M8.4 179.9 C82.2 178.4, 158.1 180.5, 231.2 179.5 M8.2 179.7 C60.6 180.4, 111.7 179.9, 230.8 180.6 M231 180 C238.1 181, 239.1 183.4, 241 188.9 M232.7 178.7 C238.8 177.9, 239.3 183.9, 238.9 188.7 M240.5 187.7 C240.2 199.9, 239.7 209.5, 238.9 224.4 M240.5 188.5 C240.4 196.3, 240.1 204, 240.5 225.9 M240 225 C240.5 229.2, 236.4 235.2, 230 235.6 M239 226.7 C242.2 231.7, 235.4 232.9, 230 232 M232.6 233.1 C175.5 232.8, 115.8 235, 7.9 233.8 M230.7 234.7 C171.5 233.8, 112 234.3, 9.4 233.7 M9 234 C1.1 235, 1 229.5, -1.3 223 M9.2 232.6 C2.6 232.7, 0.7 229.9, -1.4 226.9 M0.5 224.2 C0 216, 0 205, -2 190.5 M0.7 225.4 C0 212.1, -1 199.3, 0.1 188.4 M0 189 C-0.4 182.5, 2.5 178.9, 7.2 180 M1.5 187.5 C-0.3 181.7, 1.1 181.7, 10.5 178.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;120&quot; y=&quot;207.0&quot;&gt;x86-64 assembly (text)&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M6.1 270.3 C60.9 265.2, 116.6 266.5, 229.7 269.6 C236.9 273.5, 241.6 275, 237.1 276.3 C239.1 286.8, 239.8 304.4, 240.7 316.5 C242.7 317.8, 236 320.6, 230.9 321.7 C178.1 327.8, 131.6 327.8, 6.5 326.6 C0.7 323.2, 1.9 321.2, 2.5 313.9 C1.2 303.8, -1.6 285.3, 2.4 279.5 C-1.8 275.4, -0.6 268.8, 11.1 267.8&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M10.4 269.7 C82.5 270.8, 156.5 272.9, 231.3 271.1 M9.5 270.5 C77.4 270.9, 146.6 271.1, 231.8 270.7 M231 270 C235.2 270.9, 239.9 273, 241.3 280.6 M231.8 269.8 C235.4 272.2, 239 273.2, 241.4 277.8 M238.7 280.3 C239 291.2, 239.5 305.5, 241.2 315.9 M239.4 278.1 C239.5 290.9, 239.3 303.3, 240.1 314.3 M240 315 C238.4 320.4, 238.8 322.2, 229.8 322.9 M241 314.5 C240.2 322.4, 236.8 323.1, 231.4 322 M230 323.9 C154.7 323.8, 80.7 321.3, 8.6 324.9 M230.7 323.7 C152.4 323.8, 73.3 323.3, 9 324 M9 324 C3.8 322.4, -1.2 319.9, -1.8 314.6 M7.7 323.5 C4.2 324.2, 1.2 322.8, -2.2 313.4 M0.1 315.4 C0.4 303, 0.3 291.4, 1.7 280.9 M-0.1 315.5 C-0.9 302, -0.4 287.5, -0.4 279.8 M0 279 C1.3 271.4, 3.4 270, 8.6 271.1 M-0.9 279.9 C-0.2 273.7, 1.9 268.1, 10.6 268.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;120&quot; y=&quot;297.0&quot;&gt;as + cc&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M7.6 362.7 C97.7 361.3, 181.1 358.5, 229 360.7 C240 362.8, 240 359.7, 237.4 368.1 C240.5 383.6, 237 397.8, 240.7 408.2 C236.9 408.2, 239 416.1, 233.6 415.2 C151.8 412.5, 71.4 412.5, 9.2 414.9 C-0.4 416.7, -2.5 409.7, -0.2 401.8 C-3.7 389, -0.7 376.5, -0.2 368.2 C-3 366.6, -0.2 363.3, 6.1 361.7&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M9.2 360.3 C67.5 359.1, 125.4 356.9, 231.3 359.4 M9.6 359.5 C73.3 361.7, 136.8 362.2, 231.7 360.6 M231 360 C237.1 361.3, 238 362.3, 239.9 370.4 M231.1 361.3 C235.8 357.9, 240.7 362.7, 239.2 368.5 M238.6 370.2 C239.4 379.8, 239.3 392.8, 240.1 405 M240.4 370 C239.4 377.1, 239.7 385.8, 240.4 404.5 M240 405 C241.4 409.7, 237.4 412.7, 232.6 412.2 M238.8 403.2 C241 411.7, 234.8 416.2, 232.6 416.2 M232.5 415.4 C145.8 415.5, 59.6 413, 9.2 413.5 M230.9 414.1 C146.8 413.3, 63.7 414.1, 9.6 413.8 M9 414 C1.3 413.8, -0.3 410, 0.1 405.8 M7.2 415.4 C2.8 416.3, 0.2 410.1, 1.9 405.4 M-0.9 405.7 C0.5 393.9, 0.1 383.7, 0.8 369.5 M-0.4 405.7 C0 393.7, 1.2 381.1, 0.4 368.7 M0 369 C-0.4 361.3, 4.3 358.4, 8.1 359.8 M-1.1 367.2 C-0.1 361.8, 1.9 360.8, 7.9 360.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;120&quot; y=&quot;387.0&quot;&gt;executable&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M120.3 58.1 C119 67.5, 119.4 75.4, 120.6 84.2 M119.6 60.3 C120.7 65.9, 119.2 69.7, 120.2 84.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M126.3 70 C123.5 75.3, 122 79.7, 120.4 84.2 M125.8 71.6 C125.3 74.6, 123.1 76.4, 120.2 84.6 M120.1 84.8 C119.2 79.7, 116.9 74.5, 113.4 72.6 M119.9 84.1 C118.3 79.9, 116.2 75, 113.2 71.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M120.9 151.9 C118.9 155.5, 119.8 165.8, 118 172.4 M120.4 149.5 C119.3 155.6, 118.8 163.2, 119.2 173.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M126.7 162.8 C123.5 164.1, 122.4 170, 118.6 172.9 M126.4 161 C124 164.2, 122.1 168.4, 119.5 173.4 M121.3 174.6 C119.6 170.6, 115.8 165.4, 114.2 162 M120.1 174.3 C117.6 171.1, 115.9 166.9, 114.4 161.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M121.5 241.8 C119.3 247.6, 120.8 256.2, 119.4 264.5 M119.3 240.7 C120.4 247.3, 121 256.7, 120.2 263.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M127.1 252.7 C123.7 255.5, 123 260.2, 119.6 264.4 M125.6 251.9 C124.3 255.1, 122.7 260.4, 120.2 263.7 M119.6 264.5 C119.9 261.4, 117.4 259, 115 251.3 M120.2 264.4 C117.4 258.5, 114.7 253.8, 114.1 251.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M118 331.7 C119.2 335.6, 121.2 342.6, 120.8 352.7 M120.2 329.9 C121 339, 120.6 348.3, 119.2 353.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M124.7 342.6 C123.7 344.1, 123.3 347.6, 120.6 353.1 M126.2 341.3 C124.3 346.1, 121.7 350.9, 119.5 353.9 M120.8 354.3 C116.4 349.7, 116.9 344.8, 113 340.6 M120.4 354.6 C118.1 349.7, 115.8 345.7, 113.8 341.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M118.6 421.6 C119 430.7, 121.6 438.9, 118.2 454.9 M119.1 419.1 C119.6 428.4, 120.4 437.2, 120.3 454.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M125.1 442.5 C123.7 445.6, 123.7 448, 118.7 454.6 M125.5 440.8 C124.2 444.5, 123.2 447.9, 120.2 454.1 M119.1 454.1 C116.7 450.5, 115.8 445.7, 113.7 442.8 M120.5 453.3 C118.9 450.9, 116.8 447.6, 113.6 441.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;120&quot; y=&quot;472.0&quot;&gt;bare CPU runs it, no VM in between&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;290&quot; y=&quot;117.0&quot;&gt;frontend + backend&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;290&quot; y=&quot;185.8&quot;&gt;mov   eax, 2&lt;/tspan&gt;&lt;tspan x=&quot;290&quot; y=&quot;207.0&quot;&gt;add   eax, 3&lt;/tspan&gt;&lt;tspan x=&quot;290&quot; y=&quot;228.3&quot;&gt;mov   [x], eax&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;290&quot; y=&quot;287.6&quot;&gt;shells out to the system&lt;/tspan&gt;&lt;tspan x=&quot;290&quot; y=&quot;306.4&quot;&gt;assembler and linker&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;Mon&amp;#x27;s path from source to a running program: the compiler writes assembly, the system tools turn it into an executable, and the bare CPU runs it.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;so-what-is-a-compiler-really&quot;&gt;So what &lt;em&gt;is&lt;/em&gt; a compiler, really?&lt;a class=&quot;anchor&quot; href=&quot;#so-what-is-a-compiler-really&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Here&#x27;s the mental model that organized everything for me. A compiler has two halves, and they&#x27;re named after where they sit:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The &lt;strong&gt;frontend&lt;/strong&gt; understands your language. The &lt;strong&gt;backend&lt;/strong&gt; understands the machine. In the middle, they hand off a shared, simplified description of your program.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The beautiful part: the frontend from Season 1 &lt;em&gt;already exists&lt;/em&gt;. Lexer, parser, AST — understanding the text — that work is identical whether you&#x27;re building an interpreter or a compiler. Text becomes tokens becomes a tree, exactly as before.&lt;/p&gt;
&lt;p&gt;The fork happens &lt;em&gt;after&lt;/em&gt; the tree. An interpreter walks the tree (or its bytecode) and &lt;strong&gt;does&lt;/strong&gt; what it says. A compiler walks the tree and &lt;strong&gt;writes down&lt;/strong&gt;, in the machine&#x27;s own language, the instructions that would do what it says — then saves them and leaves.&lt;/p&gt;
&lt;p&gt;Same front half. Totally different back half. That back half is the entire subject of Season 2.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-26 -46 793 502&quot; width=&quot;793&quot; role=&quot;img&quot; aria-label=&quot;Same front half, different back half&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;325&quot; y=&quot;-20.0&quot;&gt;source text&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M324.2 -7 C326 -3.1, 325.6 -0.6, 324.4 2.9 M324.5 -7.6 C325.3 -5.1, 324.5 -2.2, 325.2 4.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M330.2 -7.4 C330 -3.3, 327.4 -1, 324.3 2.7 M330.5 -8.1 C330.1 -5.5, 327.7 -2.4, 325.2 4.3 M324.8 3.4 C323.7 2, 320.8 -0.7, 319.9 -8.7 M325.3 4.5 C323.5 1.3, 322.2 -1, 319.5 -9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M233.6 10.4 C304.2 14.3, 376.8 11.7, 415.9 12.9 C421 9.8, 421.4 13.5, 421.6 18.1 C426.7 24, 428.1 34, 422.7 50.1 C424.3 59, 423.9 63.1, 413.1 62.3 C372.1 54.6, 323.4 55.3, 230.3 59.3 C228 63.1, 223.8 56.1, 223.7 50.3 C223.2 41.9, 222.6 33.1, 226.9 20.7 C227.4 14.9, 231 10.5, 230.3 10.6&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M234.5 10.1 C303.5 9, 377.1 8, 417.3 9.7 M233 10.9 C285.3 11.4, 338.7 10.5, 416.7 10.4 M416.7 10 C424 11, 425.8 11.8, 426.4 17.3 M417.9 8.8 C420.7 10, 425.4 11, 423.8 17.3 M426.9 17.4 C427.1 25.9, 426.8 35.1, 423.9 50.2 M424.5 19.1 C424.2 27, 424.3 38.4, 424.1 52.4 M425 51.7 C425.6 56.6, 424 60.9, 416.1 58.8 M426.5 53.3 C427.1 58, 424.5 59.2, 418.9 59.3 M418 61.5 C347.6 60.3, 277.5 61.5, 233.6 58.7 M417.3 59.9 C369.3 60.7, 321.4 60.6, 232.6 60.6 M233.3 60 C226.3 61.4, 223.8 57, 226.4 51.8 M233.6 61.7 C227 59.4, 224.6 55.2, 225.2 51.9 M225.2 50.9 C224.3 40.6, 225.4 30.2, 225.1 16.4 M225.8 51 C225 39.5, 224.2 27.7, 224.1 17.9 M225 18.3 C223.7 12.4, 226.3 10.1, 232.5 9.3 M225.7 17.4 C225.7 14.6, 228.4 7.9, 235.4 10.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:19px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;325&quot; y=&quot;35.0&quot;&gt;Lexer&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M235.6 101.5 C271.9 95, 311.4 99.6, 413.5 100.1 C419.8 96.9, 422.9 102.5, 426.3 108.3 C425.2 120.3, 422 134.9, 426.4 139.5 C426.6 145.7, 420.5 149.8, 414 153.4 C353.7 145.5, 292.1 146.2, 232.7 146.9 C227.4 149, 226.4 145.2, 227.7 145.2 C229 132.7, 222.6 121, 223 107.9 C226.1 101, 230.9 97.5, 235.4 98.6&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M233.1 101.8 C300.8 99.7, 365.3 100, 418.6 100.9 M232.6 101 C290 99.2, 345.5 100, 416.3 100.6 M416.7 100 C420.5 101, 423.8 102.7, 425.5 108.1 M418.3 100 C422.6 98.6, 427.2 102.7, 423.1 110.2 M426.7 107.4 C423.6 119.4, 426.3 127.7, 423 141.5 M424.1 108.7 C424.3 118.2, 424.9 129.1, 424.1 141.9 M425 141.7 C425 148.6, 421.1 150.3, 417.8 148.1 M426.6 140.3 C424 148.7, 423.4 150.4, 415.2 148.3 M417.9 149.2 C368.1 149.6, 318.9 148.7, 234.2 149.2 M416.4 151 C363.9 149, 313.1 149.2, 234.3 150.8 M233.3 150 C229.7 149.8, 224.4 145.7, 224.7 139.8 M234.7 151.2 C230 149.2, 223.8 146.8, 223.3 140.4 M225.6 142.4 C226.9 131, 226.6 120.9, 224.5 110 M225.4 141.4 C225.3 129, 226.1 117.6, 224.2 109 M225 108.3 C224.4 102.5, 228.3 100.2, 234.3 98.9 M225 110.1 C223.9 104.4, 226 100.7, 234.8 99&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:19px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;325&quot; y=&quot;125.0&quot;&gt;Parser&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M236.4 188.5 C291.4 192.1, 349.9 187.9, 418.7 186.6 C418.9 192.3, 426.3 192.2, 422.8 200.2 C422.9 205.5, 424.3 215.6, 428.1 229.7 C423.3 234.9, 424.3 236.8, 414.3 241.7 C352.2 236, 295 239.4, 234.7 237.2 C229.7 242.6, 222.4 236.1, 227.6 229.1 C227.4 218.6, 222.1 208.5, 226.8 201.7 C227.1 191, 230.7 189.8, 230.9 190.1&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M232.6 189 C279.3 191.6, 323.3 190.4, 416.5 189.1 M233.6 189.3 C305.5 191.5, 378.7 190.5, 417.6 189.6 M416.7 190 C423.9 190.6, 423.7 193, 426.5 196.9 M418.3 189 C424.2 190.7, 425.3 191.4, 423.6 197.9 M423.3 198 C426.1 207.1, 426.4 211.4, 424.6 230.3 M424.3 198.9 C425.7 205.7, 425.2 212.9, 424.3 231.5 M425 231.7 C426.1 236.5, 421 238.4, 415.7 241.9 M423.8 231.1 C423.3 237.5, 421.3 241.2, 417.1 238.6 M418.6 240.5 C369.1 239, 321.3 239, 233.4 240.4 M417.1 240.4 C358.5 240.3, 301.4 241, 234.3 240.8 M233.3 240 C227.6 240.5, 226.3 239, 223.9 233.6 M234.7 238.9 C227.9 239.2, 223.3 239.5, 224.7 232.8 M226.6 232.7 C224.1 220.1, 224.5 205.3, 224 196.5 M224.6 231 C225.4 224.7, 225 217.6, 224.2 197.5 M225 198.3 C225.4 191.5, 226.9 190.8, 233.7 188.2 M224.8 199.6 C225.9 191.4, 226.3 188.5, 232.8 190.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:19px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;325&quot; y=&quot;215.0&quot;&gt;tree (AST)&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M326 67.3 C326.8 77.4, 324.4 85.5, 325.6 92.8 M325.7 65.5 C326 72.9, 324.8 82.2, 325.4 93.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M331.8 82.3 C330.2 86.8, 326.3 90, 325.4 93.1 M331.6 81 C330.1 84.3, 327.6 88.9, 325.3 93.9 M323.8 92.7 C323.9 90, 322.5 87.6, 320.2 81.5 M324.6 93.8 C323.1 89.8, 322 86.5, 318.4 80.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;380&quot; y=&quot;80.0&quot;&gt;tokens&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M326.6 157.1 C326.7 165.4, 324.8 175.9, 323 184.9 M324.6 156.7 C324.6 164.8, 324.5 174.3, 324.4 184.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M332.2 172.2 C330.1 175.5, 326.6 180.3, 323.6 184.7 M330.8 171.9 C328.7 175.3, 326.6 179.5, 324.6 184.1 M325 185.3 C323 178.3, 321.7 176.2, 318.2 170.8 M324.7 183.9 C323.8 181, 323 178.4, 319.5 170.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;18.8&quot;&gt;frontend:&lt;/tspan&gt;&lt;tspan x=&quot;0&quot; y=&quot;40.0&quot;&gt;understands&lt;/tspan&gt;&lt;tspan x=&quot;0&quot; y=&quot;61.3&quot;&gt;your language&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M-10.5 262.4 C229.6 264.2, 471.2 264.6, 660.3 262.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;284.8&quot;&gt;backend:&lt;/tspan&gt;&lt;tspan x=&quot;0&quot; y=&quot;306.0&quot;&gt;understands&lt;/tspan&gt;&lt;tspan x=&quot;0&quot; y=&quot;327.3&quot;&gt;the machine&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M150.4 287.9 C209.1 291.5, 261.5 293.9, 351.5 291.1 C356.2 290.1, 360.7 291.2, 358.1 299.4 C360.9 318.6, 359.9 336.2, 358.3 363.4 C361 366.2, 358.3 371.1, 352.9 372.9 C284.9 371.1, 210.5 372, 147.8 369.8 C145.6 373.1, 137.7 366.1, 143.2 360.4 C137.8 342.2, 139.6 322.7, 136.9 302.8 C141.9 291.8, 142.3 292.5, 151.5 290.1&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M150.9 288.4 C200.8 288.6, 250 289, 349.9 289.4 M149.3 290.2 C223.3 288.2, 297.4 288.8, 350.7 290.8 M350 290 C357.8 290.5, 359.4 292.5, 358.1 299.6 M351.3 289.8 C356.7 289.5, 361.7 293.8, 360.1 300 M360.5 298.2 C358.8 315.8, 358 326.9, 361.4 360.6 M360.8 299.3 C359.4 320.7, 360.2 341.2, 360.8 360.3 M360 360 C360.7 366.6, 358.5 368.6, 349.2 371.4 M358.8 360 C358.8 365.3, 357.6 370.6, 348.1 368.6 M350.2 370.8 C298.1 369.8, 245.4 368.9, 149 371.4 M349.7 369.2 C288.3 369.7, 228.2 369.8, 149.3 370.2 M150 370 C145.2 369.8, 140.9 368.4, 141.4 360.6 M151.2 370.7 C143.5 369.5, 140.7 368.1, 141.3 358.1 M139.2 359 C139.8 336.1, 138.6 313.6, 141.6 299.8 M139.6 360.9 C141 340.4, 140.9 322, 139.9 300.3 M140 300 C140 292.1, 144.7 289.2, 149.7 288.6 M139.4 300 C137.9 292.3, 144.4 290, 148.5 288.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;250&quot; y=&quot;307.5&quot;&gt;Interpreter&lt;/tspan&gt;&lt;tspan x=&quot;250&quot; y=&quot;330.0&quot;&gt;walks the tree&lt;/tspan&gt;&lt;tspan x=&quot;250&quot; y=&quot;352.5&quot;&gt;and does it&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M417.7 290.4 C507.2 288.3, 589.1 291.8, 650.5 292.9 C657.6 292, 659.3 291.1, 661.5 299.3 C664.2 324.8, 657.5 344.2, 662.7 362.9 C660.8 365.8, 657.3 366.6, 649.8 367.6 C560.6 371.3, 469.9 369.6, 421.8 368.2 C416.6 371.4, 407.3 363.1, 410.6 359.5 C410.9 345.1, 407.8 331.4, 408.2 299.7 C407.4 294.9, 410.2 289.6, 418.8 288.2&quot; style=&quot;fill:var(--xd-orange)&quot;/&gt;&lt;path d=&quot;M420.7 288.7 C506.7 290.3, 592.1 290.2, 648.4 291.2 M419.9 289.7 C472.1 291.9, 524.2 292.5, 649.7 289.2 M650 290 C655.5 290.7, 661.4 291.3, 658.5 301 M651.8 288.9 C656.2 288.4, 658.3 294.4, 661.9 301.7 M658.3 300.5 C661.6 318.6, 660.3 339.2, 661.2 358.3 M659.7 299.7 C659.9 312.5, 658.7 324.7, 659.6 359.7 M660 360 C658.3 366.1, 655.1 371.6, 650.3 371.9 M660.7 358.7 C662 368.9, 656.7 369.3, 649.2 371.4 M649.4 370.4 C563.1 369.1, 476.3 369.8, 421.2 368.9 M650.1 370 C590.9 368.9, 533.7 369.5, 420.8 370.7 M420 370 C414.6 370.9, 408.3 367.9, 409 359 M419.2 368.5 C412.4 367.9, 410.8 365.3, 409.1 358.5 M411.7 361.2 C410.4 337.3, 410.8 317.8, 408.3 301.5 M409 360.9 C410.5 343.3, 409.9 326.4, 410.9 300.3 M410 300 C411.2 294.3, 413 289.6, 420.1 290.5 M411.9 298.3 C409.3 292.6, 414.5 291.8, 421.1 288.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;535&quot; y=&quot;307.5&quot;&gt;Compiler&lt;/tspan&gt;&lt;tspan x=&quot;535&quot; y=&quot;330.0&quot;&gt;writes down the CPU&#x27;s&lt;/tspan&gt;&lt;tspan x=&quot;535&quot; y=&quot;352.5&quot;&gt;instructions, then leaves&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M306.5 243.5 C296.3 257.4, 290.9 267.1, 280.4 284.6 M304.8 245.2 C300.3 252.5, 295.4 259.8, 279.7 284&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M292.1 276.7 C286.9 280.4, 284.9 281.3, 280.1 284.7 M290.9 277.9 C289.1 278.9, 287 279.8, 279.6 284.3 M280.1 284.9 C280.1 281.1, 279.2 276.2, 281.5 270.3 M280 285 C280.3 281.5, 279.6 279.5, 281.8 271.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M377.5 241.2 C398.2 255.3, 424.2 268.6, 455.1 288.9 M376.2 242.3 C397.8 254.9, 418.4 266.1, 456.1 286.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M449.7 274.6 C450.1 278.3, 454.3 282, 455.6 288.3 M448.7 275.3 C451.3 278.7, 453 281.5, 456.3 286.7 M455.7 286.9 C453.6 287.5, 449.8 285.9, 443.8 287.8 M456.1 287.3 C451.7 286.6, 447.1 286.9, 443.1 286.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;250&quot; y=&quot;410.0&quot;&gt;runs now,&lt;/tspan&gt;&lt;tspan x=&quot;250&quot; y=&quot;430.0&quot;&gt;inside my VM&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;535&quot; y=&quot;410.0&quot;&gt;file of real instructions,&lt;/tspan&gt;&lt;tspan x=&quot;535&quot; y=&quot;430.0&quot;&gt;run later by the bare CPU&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M249.3 378 C249 382.9, 249.4 388.1, 248.6 396.2 M250.9 375 C250.6 381.6, 249.2 385.2, 250.4 396.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M255.6 384.8 C253.6 387.9, 252.1 391.1, 249 396.2 M256.7 382.7 C255 387, 252.5 389.2, 250.3 396.3 M249.7 395.3 C248.9 393.2, 247 389.1, 244.5 382.8 M249.9 396.7 C247.5 392.7, 246.7 388.6, 243.5 383.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M534.9 377.9 C534 381, 534.9 388.5, 535 394.4 M534.8 376.2 C534.2 383, 533.8 388.2, 534.4 396.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M541 384.7 C538.6 386.5, 537.5 391.4, 535 394.9 M541 383.5 C538.7 387.9, 536.5 391.2, 534.6 396.5 M535.8 395.1 C534.2 394.1, 533.7 389.9, 527.5 382.1 M535 395.4 C533.3 394, 532.7 390.5, 529.6 383.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;figcaption&gt;Both paths share the frontend; they differ in what they do with the tree.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;watch-one-line-become-assembly&quot;&gt;Watch one line become assembly&lt;a class=&quot;anchor&quot; href=&quot;#watch-one-line-become-assembly&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Let me make it concrete with a line from my language. Say a program computes:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;зарла x: тоо = 2 + 3;   // let x: int = 2 + 3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In Cecile, this became bytecode that my VM ran. In the compiler, the backend turns that same tree into instructions for a real CPU — something close to this x86-64 assembly:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;eax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; put 2 into a register called eax&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;eax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; add 3 to it        -&amp;gt; eax now holds 5&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;eax&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; store eax into the memory slot for x&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Look at what changed from Season 1. There&#x27;s no &lt;code&gt;PUSH&lt;/code&gt;/&lt;code&gt;POP&lt;/code&gt; onto a stack I invented. There&#x27;s &lt;code&gt;eax&lt;/code&gt; — a &lt;strong&gt;register&lt;/strong&gt;, a tiny storage slot &lt;em&gt;physically on the CPU&lt;/em&gt;. There&#x27;s &lt;code&gt;mov&lt;/code&gt; and &lt;code&gt;add&lt;/code&gt; — instructions the silicon itself knows how to perform. My compiler didn&#x27;t run this. It &lt;em&gt;wrote&lt;/em&gt; it into a file and stopped. When you execute that file, the processor reads &lt;code&gt;mov&lt;/code&gt;, &lt;code&gt;add&lt;/code&gt;, &lt;code&gt;mov&lt;/code&gt; and does them with its own hands.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -29 725 360&quot; width=&quot;725&quot; role=&quot;img&quot; aria-label=&quot;One line becomes three instructions&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;0.0&quot;&gt;зарла x: тоо = 2 + 3;&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M119.4 16 C118.8 25.3, 119.3 38.1, 120.4 62 M119.8 16.6 C120.3 25.1, 118.9 35.3, 120.9 62.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M125.6 49.4 C123.9 51.5, 122.9 56.1, 120.3 62 M126 49.8 C125 51.4, 122.8 54.4, 120.6 62.6 M121.2 60.9 C116.7 57.5, 115.6 53.4, 112.6 50.8 M120.1 62 C118 56.6, 115.3 52.2, 113.3 50&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;185&quot; y=&quot;40.0&quot;&gt;backend&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;125&quot; y=&quot;80.0&quot;&gt;instruction&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;345&quot; y=&quot;80.0&quot;&gt;the CPU after it runs&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M6.2 105.8 C64.6 100.3, 116 101.5, 241.3 107.5 C249.3 101.7, 251.5 107.1, 252.7 113.3 C251.4 124.4, 250.3 141.8, 247.3 148.2 C248 151.6, 249.4 157.4, 242.7 153.1 C190.9 158.3, 141 157.9, 10.9 153.2 C0.6 152.2, 1.5 152.5, 3 145.3 C-0.7 139, -2.9 126, -0.6 114.5 C-3 111, 5.2 101.5, 7.1 102.7&quot; style=&quot;fill:var(--xd-orange)&quot;/&gt;&lt;path d=&quot;M7.9 103.5 C65.2 105.2, 123.6 107.4, 241.3 103.4 M8.1 105.8 C62.5 105.6, 117.3 105.9, 240.9 105.1 M241.7 105 C246.2 104.2, 251.7 107.6, 248.8 111.4 M242.5 105.9 C248.1 105.2, 248.9 109.3, 250.8 111.8 M250.3 114.2 C249.6 124.9, 250 137.6, 250.8 147.9 M250.6 114 C249.4 123.6, 249.2 133, 250.8 146.1 M250 146.7 C250.1 154, 248.3 156.1, 241.9 153.3 M249.9 148.4 C248.4 153.1, 245.4 154.3, 242.1 156.4 M242.2 155.6 C170.4 154.8, 99.9 154, 8.6 154 M241.9 155.5 C177.1 153.2, 112.7 154.6, 8.7 155.4 M8.3 155 C3.4 153, -1.6 151, -0.7 146.4 M8.4 154.8 C1.5 156.9, -0.9 151.8, 1.3 146.3 M1.8 144.8 C0.7 135.7, 1.7 122.3, -1 113.6 M0 147.4 C-0.5 136.6, -0.4 127.6, -0.5 113.7 M0 113.3 C1.3 107.6, 4.7 106, 9.9 106.8 M1.6 112.3 C-0.1 108.6, 4 107.2, 8.5 106.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;125&quot; y=&quot;130.0&quot;&gt;mov   eax, 2&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M309.4 104.8 C344 107.9, 379.2 105.6, 424.6 104.5 C427 106.2, 427 107.2, 429.1 112.4 C430.4 119.4, 431.5 129.6, 433.2 145.1 C430.4 154, 429.2 157.2, 421.9 153.5 C386.6 150.6, 353.3 155.6, 309.4 153.4 C300.1 153.5, 300.5 154.8, 302.6 147.8 C299.7 132.4, 297.1 119.7, 298.6 111.6 C300.8 110.1, 305 101.8, 305.7 107.3&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M310.3 103.1 C351.5 105.5, 395.9 103.9, 423.3 106.8 M307.6 105.7 C348.2 105, 386.5 105.6, 421.9 104.6 M421.7 105 C428.5 106.5, 430 107.7, 429.5 112.8 M420.5 106 C425.3 104.8, 430.3 109.5, 431.4 115.2 M431.5 113.6 C427.9 123.7, 429.8 132.7, 429.3 145.2 M430.4 114.1 C429.1 122.8, 429.1 133.7, 429.5 146.4 M430 146.7 C429.9 150.4, 426.5 153.8, 419.8 154.3 M430.6 145.5 C429.1 152, 427.2 154.7, 423.1 157.1 M422 153.5 C388.1 154.7, 351 153.7, 309.6 153.5 M421.7 155.3 C380.7 155.2, 342 156.6, 308 154.4 M308.3 155 C304.6 154.5, 301.2 153.7, 301.5 145.7 M307 155.6 C303.6 155.8, 302.2 153, 299 148.5 M301 146.5 C301.5 136.6, 301.1 121, 301.3 111.4 M300.2 147 C299.2 135.4, 300.5 123.3, 299.9 113.5 M300 113.3 C299.3 107.6, 304.2 106.5, 309.9 103.9 M299.1 113.3 C298.4 107, 304.3 105.4, 306.3 104.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;365&quot; y=&quot;130.0&quot;&gt;eax = 2&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M254.2 129.4 C263.8 131.1, 271.6 129.2, 293.4 128.8 M256.3 130.6 C267.9 130.6, 280.2 130.5, 294 130.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M280.2 123.5 C283.8 126.1, 286 126.1, 293.6 129.2 M281.6 124.3 C285.2 126.2, 289.2 128.1, 294 130.4 M295.3 130.9 C289.8 132.3, 286.8 133.7, 281.2 136.9 M293.5 129.4 C289.7 133.1, 283.6 134.2, 280.8 136.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;460&quot; y=&quot;130.0&quot;&gt;put 2 into the register&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M9 186.2 C86.2 184.8, 159 187.4, 243.1 185.8 C247.1 184.8, 248.6 186.8, 252.5 193.7 C248.5 202.9, 247.3 214, 251.7 225.5 C247.6 234.1, 246.7 236.5, 241.8 237.5 C171.9 233.2, 100.7 238, 5.8 236.8 C3.1 233.6, -2.8 230.1, 0.3 226 C3 217.6, -0.7 209.9, 2.8 195.7 C-0.1 184.6, -0.4 185.4, 5.9 184.5&quot; style=&quot;fill:var(--xd-orange)&quot;/&gt;&lt;path d=&quot;M9.4 186.3 C99.1 186.9, 189.3 185.4, 242.4 185.6 M8.8 185.7 C62.4 186.1, 116.4 185.4, 241.4 185.4 M241.7 185 C248 183.6, 250.4 188.5, 250 195.2 M240.2 185.8 C245.1 184.8, 252.1 188.2, 252.1 194.9 M248.5 194 C249.5 205.1, 250.7 216.2, 251.8 228 M250.4 194.3 C250.6 201.8, 249.1 208.2, 250.6 226.6 M250 226.7 C249.2 232, 246.6 235.9, 241.1 235.6 M251.8 227.2 C247.9 232.2, 246.4 235.8, 242.8 234.5 M242.1 235.1 C164.7 233.7, 87.8 232.9, 9 233.5 M241.8 235.2 C168 234.8, 93.3 233.7, 7.8 234.3 M8.3 235 C3 234.8, 0.3 231.6, -0.7 226.8 M7.2 234.7 C1.8 236.2, -0.1 231.4, 1.9 227.3 M-0.8 225.5 C-1.6 214.7, -0.5 202.8, -1.2 192.8 M1 226.9 C0.6 216.5, 0.8 205.3, 0.5 192.4 M0 193.3 C1.7 189.4, 4.5 183.7, 7.8 185.4 M-0.2 194.9 C-0.4 186.4, 1.9 184.6, 9.3 186.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;125&quot; y=&quot;210.0&quot;&gt;add   eax, 3&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M305.6 185.3 C331 185.1, 352.8 184.5, 419.6 182.5 C424.9 182.1, 431.3 186.9, 428.9 192.9 C426.3 198, 427.3 209, 430.4 229.5 C430 229.3, 426.5 236.3, 420.9 237.8 C377.1 236.9, 338.9 233.6, 310.6 237.7 C302.6 234.9, 303.5 232.5, 299.9 228.4 C303.5 211, 299.2 203.6, 302 192.8 C296.5 191, 299.5 185.6, 311.7 181.8&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M308.1 186.4 C342.8 184.2, 380.2 182.1, 420.6 185.4 M308.4 185.5 C348.4 186, 386 185.6, 422.6 184.9 M421.7 185 C426.3 185.9, 428.7 188.7, 430.7 192.6 M422.2 185.8 C426.8 184.3, 428.9 188.4, 428.2 193.6 M429.7 193.4 C431.8 199.9, 430.5 211.3, 430.4 225.4 M430.3 192.4 C430.3 201, 429.1 210.9, 429.4 227 M430 226.7 C429 232.4, 428.8 233.6, 422.9 236.7 M428.5 228.3 C428.6 231.1, 428.2 236.2, 423.9 235.2 M421.9 236.9 C381.4 233.8, 344.7 232.9, 310.1 236.9 M421.5 234.9 C376.6 237, 332.3 235.4, 309 235 M308.3 235 C304.3 236.3, 299.1 230.3, 301.4 226 M309.8 235.5 C303.8 235.1, 298.4 232.6, 299.6 224.9 M298.4 227.3 C300 215.5, 299.6 205.5, 301.1 194.6 M299.2 226.5 C300.2 213.3, 299.7 200.9, 300.8 194.2 M300 193.3 C299.7 189.4, 303.9 184.2, 307.7 186.5 M301.3 191.9 C298.1 189.4, 302.2 182.9, 307.1 184.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;365&quot; y=&quot;210.0&quot;&gt;eax = 5&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M255.8 208.4 C270.4 209, 282.4 212, 293.8 211.1 M255.8 209.7 C267.4 209.4, 281.4 211.1, 295 209.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M281.3 202.8 C286.7 205.2, 290.4 209.3, 293.9 210.7 M281.2 203.7 C284.9 205.4, 290.1 208.5, 294.7 209.8 M294.2 210.3 C289.7 213.5, 284 215.2, 281.5 215.9 M293.5 210.2 C289.9 211.9, 287.1 212.8, 281.9 216.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;460&quot; y=&quot;210.0&quot;&gt;add 3 to it&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M5.6 268 C76.3 266.1, 141.2 266.5, 239.8 265.2 C244.1 267.5, 246.5 269, 247.8 271.2 C252.3 283.1, 253.4 295.4, 251.4 304.2 C249.9 313.9, 244.3 317, 241 316.7 C153.1 319.3, 64.8 317.1, 6.7 318 C4.6 317.1, -2.7 313.5, -0.8 308 C2.6 297.8, 3.2 282.7, -3 274.5 C2.8 265, 4 263.1, 5 262.7&quot; style=&quot;fill:var(--xd-orange)&quot;/&gt;&lt;path d=&quot;M8.2 266.7 C58 265, 106.1 266.4, 241.8 264.5 M8 265.4 C82.4 265.5, 155.4 265, 241.1 264.4 M241.7 265 C246.1 266.3, 251.9 269.1, 250.2 274.5 M240.3 263.2 C246.9 264.9, 250.3 268.8, 249.6 272.3 M249.3 273.9 C248.3 286, 251.9 294.5, 251.8 307 M249.2 272.6 C250.3 285.8, 249.6 297.9, 250.8 307.2 M250 306.7 C251.4 313.1, 246.9 315.3, 242.4 316.9 M248 308.3 C248.4 310, 248.7 314.2, 240.9 315.7 M240.7 313.5 C189.3 317.2, 134.1 315.3, 8.7 316.3 M242.4 314.2 C177.7 316.2, 113.7 316.3, 9.2 314.8 M8.3 315 C3.4 314.9, -0.6 311.9, 0.4 304.8 M7.6 314.8 C4.9 316.8, 0.4 312.6, -1 307.8 M-1.7 304.8 C-1.4 294.3, 1.8 281.7, 1 273 M-0.8 305.8 C-0.2 295, 0.4 285.6, -0.5 272.9 M0 273.3 C-1.9 266.9, 4.7 266.1, 8.3 263.5 M1.7 273.6 C-1.1 268.8, 1.1 264.6, 8.5 263.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;125&quot; y=&quot;290.0&quot;&gt;mov   [x], eax&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M308.7 267.4 C348.5 265.9, 390.2 262.8, 422.8 261.8 C429.1 264.8, 429.2 269.1, 431.4 270.3 C430 284.7, 426.2 296.5, 430.1 308.3 C432.3 309.1, 424.1 316.8, 420.1 317.1 C397.2 312.1, 366.5 314.9, 311.7 311.9 C304.1 318.4, 303.5 308.7, 298.8 303.2 C303 297.8, 303.1 289.8, 303.4 271.6 C299.5 271.3, 303.9 263.4, 310.8 267.3&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M306.7 266.9 C345.6 265.5, 384.6 262.9, 419.9 264.1 M307.5 265.1 C333.6 265.3, 361.2 265.1, 422.1 265.8 M421.7 265 C428.4 264.6, 430.2 269.2, 430.9 271.9 M422.3 263.3 C428.6 264.5, 431.7 269, 430.2 275.6 M430.5 273.4 C430.6 280.7, 431.6 289.7, 430.4 308.4 M429 272.7 C430 287.1, 429.6 298.6, 429.6 307.6 M430 306.7 C431.2 313.5, 429.1 313, 420.2 314 M428.7 305.5 C429.1 313.6, 425.9 314.5, 422 316.5 M420.2 315 C394.7 313.7, 368 315.4, 309.8 316.3 M422.3 315.8 C381.1 315.1, 342.5 315.1, 308.6 315.6 M308.3 315 C304.7 316.4, 298.2 310.6, 298.5 308.1 M310.2 315.6 C302.3 315.7, 299 313.8, 301.3 305.4 M301.5 306.6 C300.2 295.1, 301.9 284.4, 299.3 274.8 M299.4 307.4 C299.5 300.4, 299.3 292.6, 299.8 272.7 M300 273.3 C300.1 266.9, 304.1 266.7, 308.3 264.6 M299.2 274.6 C302 267.3, 301.4 262.8, 306.3 266.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;365&quot; y=&quot;290.0&quot;&gt;[x] = 5&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M254.1 292 C270.7 288.9, 281 289.1, 295.4 291.7 M255.3 290.5 C269.7 289.7, 283.7 288.8, 295 291&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M280.1 285.3 C287 285.2, 289.5 287.4, 295 291.2 M280.9 284.3 C285.8 286.1, 290.4 287.7, 294.7 290.7 M293.1 289.7 C290.2 291, 286.1 295.2, 281.8 296.1 M294.1 289.4 C288.9 292, 284.3 294.8, 280.8 296.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;460&quot; y=&quot;290.0&quot;&gt;store eax in x&#x27;s memory slot&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;The three instructions, with what the CPU holds after each one runs.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;That&#x27;s the moment the abstraction ended for me. In Season 1 the bottom of the stack was &lt;em&gt;my&lt;/em&gt; code. Here, the bottom of the stack is a register with a name that Intel chose.&lt;/p&gt;
&lt;h2 id=&quot;the-whole-language-compiling&quot;&gt;The whole language, compiling&lt;a class=&quot;anchor&quot; href=&quot;#the-whole-language-compiling&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;After grammar, lexer, parser, and a backend that emits assembly, here&#x27;s a full program in my Mongolian-keyword language — the same guessing game from before, but this one compiles to a real executable:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;extern функц мөр_хэвлэх(м мөр) -&amp;gt; хоосон {}        // extern fn print_line(m: string)
extern функц унш() -&amp;gt; тоо64 {}                      // extern fn read() -&amp;gt; int64
extern функц санамсаргүйТоо(н тоо64) -&amp;gt; тоо64 {}    // extern fn randomInt(n) -&amp;gt; int64

функц таахТоглоом() -&amp;gt; хоосон {                     // fn guessGame() -&amp;gt; void
    мөр_хэвлэх(&quot;Та таамгаа оруулна уу:&quot;);           // print_line(&quot;Enter your guess:&quot;)

    зарла зорилтотТоо: тоо64 = санамсаргүйТоо(100);  // let target = randomInt(100)
    зарла оролдлого: тоо64 = 0;                      // let tries = 0
    зарла хамгийнИхОролдлого: тоо64 = 10;            // let maxTries = 10

    давтах оролдлого &amp;lt; хамгийнИхОролдлого бол {      // while tries &amp;lt; maxTries {
        зарла таамаглал: тоо64 = унш();              // let guess = read()
        оролдлого = оролдлого + 1;

        хэрэв таамаглал == зорилтотТоо бол {         // if guess == target {
            мөр_хэвлэх(&quot;баяр хүргэе, та зөв таалаа 🎉&quot;);
            буц;                                      // return
        }

        хэрэв таамаглал &amp;lt; зорилтотТоо бол { мөр_хэвлэх(&quot;бага байна&quot;); }  // &quot;too low&quot;
        хэрэв таамаглал &amp;gt; зорилтотТоо бол { мөр_хэвлэх(&quot;их байна&quot;); }    // &quot;too high&quot;
    }
}

функц үндсэн() -&amp;gt; тоо {
    таахТоглоом();
    буц 0;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Loops, conditionals, typed variables, function calls, an emoji in a string — with keywords in Mongolian — and at the end of the pipeline, out fell a file of raw assembly instructions. Not a result my program printed. &lt;em&gt;Instructions&lt;/em&gt;, sitting in a file, waiting for a CPU. I could open that file and read the &lt;code&gt;mov&lt;/code&gt;s and &lt;code&gt;add&lt;/code&gt;s my own compiler had written — a language I&#x27;d taught a machine to emit before I could fluently read it myself.&lt;/p&gt;
&lt;h2 id=&quot;but-now-i-had-a-new-floor-i-couldnt-read&quot;&gt;But now I had a new floor I couldn&#x27;t read&lt;a class=&quot;anchor&quot; href=&quot;#but-now-i-had-a-new-floor-i-couldnt-read&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;And here&#x27;s the trap I walked straight into.&lt;/p&gt;
&lt;p&gt;My compiler produced assembly. Great. Except I could barely read it. I had this file full of &lt;code&gt;mov eax, 2&lt;/code&gt; and &lt;code&gt;add eax, 3&lt;/code&gt;, and I understood the &lt;em&gt;shape&lt;/em&gt; of it — but I didn&#x27;t truly know what a register was, or how the CPU marches through these lines, or what happens the instant &lt;code&gt;мөр_хэвлэх&lt;/code&gt; needs to actually put letters on a screen. My compiler had confidently written a language I didn&#x27;t speak.&lt;/p&gt;
&lt;p&gt;In Season 1, &quot;how does code run?&quot; bottomed out at &lt;em&gt;my&lt;/em&gt; VM. Now it bottomed out one floor lower, at &lt;strong&gt;assembly and the CPU&lt;/strong&gt; — and this floor I didn&#x27;t build. Intel and ARM did.&lt;/p&gt;
&lt;p&gt;I had gone from &lt;em&gt;avoiding&lt;/em&gt; the machine to &lt;em&gt;generating code for&lt;/em&gt; the machine. The next step was obvious and unavoidable: I had to actually understand the machine.&lt;/p&gt;
&lt;p&gt;But there&#x27;s one more surprise before we get there. My compiler was emitting assembly by hand, one instruction pattern at a time — and it turns out almost no serious compiler does it that way anymore. They all funnel through a shared middle layer first, and understanding &lt;em&gt;why&lt;/em&gt; is the key to how clang, rustc, and Swift all share the same backend.&lt;/p&gt;
&lt;h2 id=&quot;one-floor-down&quot;&gt;One floor down&lt;a class=&quot;anchor&quot; href=&quot;#one-floor-down&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;But my compiler doesn&#x27;t actually leap straight from the tree to those &lt;code&gt;mov&lt;/code&gt;s. It stops at a middle stage first — a flat, simplified version of the program that&#x27;s neither my language nor assembly. And building that middle by hand was a real choice: everyone told me to just use LLVM and skip it. I said no, on purpose.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why would anyone build that middle by hand when LLVM exists?&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Why I Didn&#x27;t Use LLVM</title><link>https://your-moon.github.io/s2-2-llvm/</link><guid>https://your-moon.github.io/s2-2-llvm/</guid><pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate><description>&lt;h1 id=&quot;why-i-didnt-use-llvm&quot;&gt;Why I Didn&#x27;t Use LLVM&lt;a class=&quot;anchor&quot; href=&quot;#why-i-didnt-use-llvm&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Building my own programming language — Season 2: To the Metal · Part 2: LLVM, and the middle I built instead&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Every time I mentioned I was writing a compiler, someone said the same thing: &lt;em&gt;&quot;just use LLVM.&quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;They weren&#x27;t wrong, exactly. LLVM is what real compilers are built on. It would have handed me fast, optimized machine code for practically every chip on Earth, for free. And I looked at it, understood what it does, and deliberately chose &lt;em&gt;not&lt;/em&gt; to use it — and to hand-write my own path down to the metal instead. This post is about what LLVM actually is, why it&#x27;s the obvious professional choice, and why I said no to it anyway. That last part turned out to be the most important decision in the whole project.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 4 602 268&quot; width=&quot;602&quot; role=&quot;img&quot; aria-label=&quot;Just use LLVM&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M8.6 33.4 C66 32.9, 129.3 30.2, 195.9 29.2 C194.5 28.8, 197.2 34.8, 198.9 35.3 C199.4 46, 196.4 56.2, 202.6 65.7 C198.8 70.6, 194.6 76.9, 194.7 73 C131 69.1, 68.6 72, 8.8 75.3 C5 78.3, -2 70.3, -2.1 67.2 C1.9 59.1, 0.4 53.4, 1.3 37.9 C-1.7 35.9, -0.1 26.6, 7.2 27.5&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M9.1 29.1 C44.8 29.7, 84.3 29.9, 190.4 31.6 M7.8 30.1 C56.6 30.9, 104 29.9, 192.5 30.3 M192.3 30 C195.9 28.1, 200.7 34.3, 199.3 36.1 M190.4 29.8 C195.4 29, 201.7 32.2, 201.2 38.7 M199.9 37.2 C199.5 49.2, 199.3 60.1, 201.7 68.4 M199.7 37 C201.2 46.1, 199.5 53.8, 200.5 69 M200 68.3 C198.9 75.3, 198.9 77.9, 190.4 74.1 M201.3 70.3 C201.1 75.7, 196.4 74.2, 192.2 73.8 M191 75.3 C139.1 78.2, 85.5 78.7, 7.5 77.4 M192 75 C146.3 76.9, 98 75.2, 7.7 75.1 M7.7 76 C3.5 74.3, 1.9 72.4, 0.2 67.3 M6.9 76.1 C1.6 77, 1.7 71.9, -0.5 67.9 M-0.3 67.9 C-0.1 58.3, -0.9 49.9, -1.5 37.6 M-0.1 68.7 C0 61, -0.3 53.9, -0.5 36.9 M0 37.7 C-1.8 31.9, 3.1 31.8, 8.8 30.4 M-0.6 38.4 C0.5 31, 1.7 27.9, 7.4 32.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M52.9 76.6 C49.5 87.2, 51.5 104.6, 48.1 111.8 C52.7 105.3, 56.6 93.8, 73.3 78.3 C65.8 74.2, 55.4 76.6, 49.4 78&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M52 75 C49.4 81.7, 48.1 91.5, 49.5 111.8 M51 75.3 C49.2 86.6, 49.5 99.7, 49.1 112.7 M49.7 112.5 C56.4 102.9, 60.5 97.4, 70 77.3 M51 111.5 C57.6 98.6, 66.8 84.5, 71.7 75.7 M73.7 77.2 C64.5 75.3, 56.6 77, 50.5 75.9 M72.8 75.6 C66.7 75.9, 62.5 75.5, 50.7 75.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;100&quot; y=&quot;53.0&quot;&gt;just use LLVM&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M51.9 113.6 C56.1 114, 62.2 116.9, 65.3 120.1 C68.4 123.3, 70.2 128.3, 70.5 132.7 C70.8 137.1, 69.6 142.8, 67.1 146.5 C64.6 150.2, 59.9 153.8, 55.4 154.9 C50.9 155.9, 44.2 154.9, 40.1 152.9 C35.9 150.9, 32.1 146.9, 30.5 142.8 C28.9 138.8, 29.1 133, 30.6 128.5 C32.1 124, 35.1 118.6, 39.6 116.1 C44 113.6, 53.6 113.2, 57.3 113.4 C60.9 113.7, 61.7 117.1, 61.5 117.4 M50.4 113.1 C55 112.4, 60.6 114.2, 64 116.8 C67.3 119.5, 70 124.6, 70.6 128.9 C71.2 133.2, 69.8 138.5, 67.6 142.7 C65.5 146.9, 61.6 152.2, 57.7 153.9 C53.9 155.7, 48.9 154.3, 44.6 153.1 C40.3 152, 34.6 150.9, 31.9 147.1 C29.3 143.3, 28 135.3, 28.4 130.4 C28.9 125.6, 31 120.9, 34.6 117.9 C38.2 114.9, 47.3 113.5, 49.9 112.5 C52.6 111.5, 50.6 111.7, 50.4 111.9&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M43.3 114.4 C47.1 112.9, 52.7 112.6, 56.9 114 C61 115.5, 65.8 119, 67.9 123.2 C70 127.4, 70.5 134.4, 69.6 139.1 C68.7 143.8, 66.2 148.9, 62.7 151.5 C59.3 154, 53.4 154.9, 48.9 154.6 C44.3 154.2, 39 152.2, 35.6 149.2 C32.3 146.3, 29.3 141.6, 28.6 137.1 C27.9 132.5, 28.7 126.2, 31.4 122.2 C34.2 118.1, 42.1 114.6, 44.9 113 C47.8 111.3, 48.3 112.1, 48.5 112.3 M52.7 112.3 C56.9 112.5, 60.4 114.8, 63.5 118.2 C66.5 121.7, 70.2 128.5, 71 132.9 C71.8 137.4, 70.5 141.4, 68.2 145 C65.9 148.5, 61.7 152.4, 57.4 153.9 C53.1 155.5, 46.8 155.8, 42.2 154 C37.6 152.1, 32 147, 29.9 142.9 C27.8 138.8, 28.4 133.6, 29.6 129.3 C30.8 125, 33.5 119.9, 37 116.9 C40.6 113.8, 48.6 111.8, 50.8 111.2 C53 110.7, 50.5 112.8, 50.4 113.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M42.7 126.1 C43.4 126.2, 44.3 127, 44.5 127.8 C44.7 128.6, 43.9 130.2, 43.9 131 C43.9 131.7, 44.7 132.1, 44.3 132.3 C43.9 132.5, 42.4 132.3, 41.6 132.3 C40.8 132.2, 40.1 132.2, 39.7 132.1 C39.3 132, 39.4 132.4, 39.2 131.7 C39.1 130.9, 38.4 128.4, 38.8 127.7 C39.2 126.9, 41.2 127.2, 41.8 127.2 C42.4 127.1, 42.3 127.6, 42.6 127.5 C42.9 127.4, 43.4 126.5, 43.5 126.5 M41.5 126.2 C42.1 125.6, 42.5 126, 42.9 126.6 C43.3 127.1, 43.3 128.8, 43.8 129.5 C44.4 130.2, 46.4 130, 46.2 130.7 C46 131.5, 43.2 133.6, 42.7 134 C42.1 134.4, 43.7 133.5, 43 133.2 C42.2 132.9, 38.9 132.8, 38.5 132.2 C38 131.7, 39.9 130.8, 40.3 129.9 C40.7 129.1, 40.4 127.7, 40.7 127.1 C41.1 126.5, 42.1 126.4, 42.5 126.2 C42.8 126, 42.7 125.4, 42.7 125.8&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M41.2 126.1 C41.7 125.6, 42.2 125.9, 42.8 126.2 C43.4 126.5, 44.3 127.1, 44.6 127.8 C44.8 128.4, 44.3 129.6, 44.3 130.2 C44.3 130.8, 45.2 131, 44.8 131.6 C44.3 132.2, 42.4 133.7, 41.7 133.8 C40.9 134, 40.7 133.2, 40.3 132.6 C39.8 131.9, 39 130.7, 38.9 129.9 C38.7 129.1, 39 128.5, 39.5 128 C39.9 127.5, 41.1 127.1, 41.6 126.9 C42.1 126.6, 42.5 126.1, 42.6 126.3 M42.6 127.9 C43.2 128, 43.4 128.4, 43.9 128.6 C44.4 128.9, 45.6 129, 45.8 129.4 C45.9 129.9, 45.4 130.8, 44.9 131.3 C44.4 131.7, 43.8 132.3, 42.8 132.3 C41.8 132.3, 39.4 131.4, 39 131.3 C38.6 131.2, 40.3 132.4, 40.3 131.8 C40.3 131.1, 39 127.7, 39 127.2 C39 126.6, 40.1 128.4, 40.6 128.6 C41 128.7, 41.5 128, 41.9 128 C42.3 128, 43.3 128.3, 43.2 128.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M59.9 126.4 C60.4 126.8, 60.8 128.5, 61 129.2 C61.3 129.8, 61.5 129.8, 61.3 130.4 C61.1 131.1, 60.4 132.6, 59.8 133.1 C59.2 133.6, 58.5 133.7, 57.8 133.5 C57 133.2, 55.5 132.2, 55.1 131.6 C54.7 130.9, 55.2 130.2, 55.3 129.5 C55.4 128.8, 55.6 127.9, 55.7 127.4 C55.9 127, 55.8 127, 56.3 126.9 C56.9 126.8, 58.6 126.7, 59 126.8 C59.5 126.9, 58.9 127.6, 58.8 127.6 M55.8 128 C56.6 127.8, 58.9 126.1, 59.8 125.9 C60.8 125.8, 61.3 126.3, 61.6 127.2 C61.9 128.1, 62.3 130.4, 61.7 131.2 C61.2 131.9, 59.3 131.7, 58.5 131.8 C57.7 131.9, 57.2 131.7, 56.9 131.6 C56.7 131.4, 57.1 131.2, 56.8 131.1 C56.5 131, 55.5 131.2, 55.3 131 C55.1 130.8, 55.2 130.8, 55.7 129.9 C56.1 129.1, 57.7 126.5, 58.2 125.8 C58.6 125.1, 58.5 125.5, 58.2 125.8&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M57.4 126.4 C58 126.3, 58.8 127.1, 59.4 127.4 C60 127.6, 60.9 127.1, 61.1 127.7 C61.3 128.3, 60.9 130.2, 60.7 131 C60.5 131.7, 60.5 131.7, 60 132.1 C59.6 132.5, 58.5 133.5, 58 133.4 C57.5 133.3, 57.4 131.9, 56.9 131.5 C56.4 131.2, 55.4 132, 55.2 131.4 C55.1 130.8, 55.9 128.9, 56.1 128.2 C56.4 127.4, 56.5 127.1, 56.6 126.8 C56.8 126.5, 57 126.3, 57.1 126.4 M57.7 126.1 C58 126, 58.4 127.4, 58.7 127.7 C58.9 128, 58.5 127.6, 59.1 127.8 C59.7 128.1, 62.1 128.5, 62.2 129.1 C62.4 129.7, 60.8 130.6, 60.1 131.3 C59.5 132, 58.7 133.3, 58.2 133.5 C57.6 133.7, 57.5 133, 56.8 132.5 C56.2 132.1, 54.5 131.5, 54.2 130.8 C53.9 130.1, 54.4 129, 55.1 128.4 C55.7 127.9, 57.7 127.7, 58.3 127.3 C58.8 127, 58.4 126.5, 58.3 126.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M42 144 C47.4 148.2, 51 147.5, 56.1 142.8 M42.7 145.6 C45.7 145.8, 50.8 147.9, 56.6 142.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M236.1 72.9 C308 70.1, 384.3 71.8, 424 71 C430.6 69.7, 427.3 70.1, 431.3 81.2 C431 90.7, 427.8 102.1, 427.5 110.4 C431.2 116, 427.3 118, 422.2 118.8 C369.2 111.5, 317.5 114.6, 238.6 116.9 C230 117.2, 226.9 111.9, 229.9 105.7 C231.5 103.7, 227.7 93.2, 227.7 74.1 C229.6 69.4, 231.8 72.1, 238.5 68.3&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M239.1 68.2 C275.6 70, 311.2 70.3, 422.2 70.8 M238 70.6 C291.1 69.2, 346.1 68.6, 421.5 70.7 M422.3 70 C426.9 71.5, 429.1 70.7, 429.3 77.7 M421.4 68.3 C427 70, 430.1 74, 428.9 78.4 M430.6 76.5 C431.9 86.6, 428.7 97.6, 431 107.8 M429.7 77.4 C430.3 88.2, 430.7 101, 430 108.9 M430 108.3 C428.7 111.8, 428.4 116.6, 421 117.7 M428.8 106.5 C429.7 113, 427.4 113.7, 423.1 114.9 M423.4 115.6 C383.2 116.2, 344.2 116.3, 236.7 114.7 M422.7 116.4 C355.4 114.4, 287.9 116, 238.2 116.5 M237.7 116 C232.3 115.8, 230.5 112.4, 229 109.8 M237.2 114 C234 118, 228 113.1, 232.2 106.6 M231.4 109.6 C231.5 102.8, 231.1 96.8, 231 76.3 M230.7 108.8 C229.1 98.4, 230.6 90.2, 229.2 78.2 M230 77.7 C230.1 73.6, 234.6 72, 237.2 70.9 M230 77.8 C229.7 72.1, 233.8 71, 237.5 68.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M298.6 118.3 C297.7 125.5, 299.9 134.9, 302.5 152.3 C309.1 137.5, 315.3 130, 325.6 116.2 C315 119.4, 305.6 114.5, 302.2 115.5&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M298 114.1 C300.4 124.2, 298.9 130.1, 301.3 150.9 M299.2 115.8 C299.3 129.4, 299.1 142, 300.2 151 M299.2 150.9 C302.5 143.8, 308.6 135.4, 323.8 114.6 M300.6 151.1 C305.2 144.9, 309 137.1, 323 115.1 M322.1 116.9 C312.1 115.4, 307.2 115.1, 301 114.4 M321.1 115.4 C312.9 116.2, 304.6 114.8, 299.5 115.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;330&quot; y=&quot;93.0&quot;&gt;just use LLVM&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M290.5 155.7 C294 153.4, 299.4 152.4, 303.9 153.5 C308.4 154.5, 314.6 158.3, 317.5 162 C320.5 165.7, 321.9 171.2, 321.6 175.7 C321.3 180.2, 318.8 185.7, 315.5 188.9 C312.3 192.1, 306.9 194.3, 302.2 194.9 C297.6 195.5, 291.5 195.1, 287.7 192.6 C283.9 190.1, 280.6 184.5, 279.3 179.9 C278 175.4, 277.4 169.8, 279.7 165.4 C282 161.1, 290 155.7, 293 153.9 C296 152, 297.7 154, 297.8 154.3 M290.1 153.8 C294.3 152.1, 301.6 152.5, 306.2 154 C310.9 155.4, 315.7 158.8, 318.2 162.4 C320.6 165.9, 321.2 170.7, 320.7 175.2 C320.3 179.8, 319.1 186.1, 315.7 189.7 C312.2 193.2, 305 196.3, 300.1 196.6 C295.2 196.9, 289.5 194.3, 286.1 191.4 C282.6 188.4, 280.5 183.7, 279.3 179.1 C278.2 174.5, 277.2 168.1, 279.3 163.8 C281.4 159.4, 289.9 154.6, 292 153 C294 151.4, 291.6 153.6, 291.5 154.3&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M304.4 153.3 C308.6 153.9, 314 156.6, 316.8 160.1 C319.6 163.7, 321.3 170, 321.2 174.6 C321 179.2, 318.8 184.4, 315.9 187.8 C313.1 191.3, 308.5 194.6, 304 195.3 C299.5 196, 292.7 194.5, 288.8 192 C284.8 189.5, 281.9 184.4, 280.3 180 C278.6 175.6, 277.5 169.8, 278.9 165.6 C280.3 161.3, 283.8 156.4, 288.7 154.5 C293.6 152.7, 304.3 154.2, 308.3 154.4 C312.3 154.6, 312.7 155.6, 312.7 155.9 M301.3 151.5 C306 151.4, 311.8 154.4, 315.2 157.4 C318.6 160.5, 321.2 165, 321.5 169.8 C321.8 174.5, 319.7 181.8, 317.3 185.8 C314.8 189.9, 311 192.8, 306.8 194.2 C302.6 195.7, 296.2 195.9, 291.8 194.5 C287.5 193.1, 283.4 190.2, 280.9 185.8 C278.5 181.5, 276 173.1, 277.1 168.5 C278.1 163.9, 283.3 161, 287.2 158.4 C291.1 155.7, 298.3 153.4, 300.4 152.4 C302.5 151.5, 299.5 152.5, 299.7 152.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M290.3 167.8 C290.8 167.4, 291.8 166.2, 292.5 166.3 C293.1 166.5, 293.9 167.9, 294.3 168.5 C294.6 169.1, 294.6 169.3, 294.5 170 C294.4 170.6, 294.4 171.8, 293.9 172.2 C293.3 172.7, 291.7 172.5, 291 172.7 C290.3 172.8, 289.8 173.7, 289.7 173.2 C289.5 172.8, 290 171, 290 170.1 C290 169.2, 289.2 168.4, 289.5 167.8 C289.7 167.1, 291 166.2, 291.4 166 C291.8 165.8, 291.9 166.3, 292 166.6 M293.6 168.3 C294.5 168.6, 295.8 167.8, 295.8 168.4 C295.8 169, 293.8 171.2, 293.7 171.8 C293.6 172.4, 295.5 171.6, 295.2 172 C295 172.5, 293 174.4, 292 174.4 C291.1 174.4, 289.7 172.9, 289.4 172 C289.2 171.2, 290.3 169.8, 290.3 169.3 C290.3 168.8, 288.8 169.8, 289.2 169.2 C289.5 168.6, 291.4 166, 292.2 165.8 C292.9 165.7, 293.7 168, 293.8 168.1 C294 168.2, 293 166.7, 292.9 166.6&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M292.9 167.3 C293.4 167.4, 294.3 168.1, 294.6 168.5 C295 169, 295 169.4, 294.9 170 C294.8 170.7, 294.6 172, 294.2 172.6 C293.8 173.2, 293 173.9, 292.5 173.8 C291.9 173.8, 291.5 172.6, 290.9 172.1 C290.3 171.7, 289.1 171.7, 288.8 171.3 C288.4 170.9, 288.5 170.5, 288.8 169.7 C289.1 168.9, 289.6 167.1, 290.4 166.6 C291.1 166.2, 292.8 167, 293.4 167 C294 167, 293.9 166.5, 293.7 166.4 M291.9 166.9 C292.5 166.9, 295.1 167.7, 295.7 168.2 C296.3 168.7, 296.1 169.2, 295.6 170 C295.1 170.8, 293.6 172.4, 292.9 172.9 C292.2 173.4, 291.5 173.2, 291.2 173 C291 172.8, 291.6 172, 291.2 171.7 C290.7 171.4, 288.8 171.7, 288.6 171.1 C288.5 170.6, 289.9 169.4, 290.4 168.6 C291 167.8, 291.5 166.9, 291.8 166.4 C292.1 166, 292 165.8, 292.3 166 C292.5 166.2, 293.1 167.3, 293.3 167.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M307.5 167.9 C308.2 167.8, 308.8 167.5, 309.2 167.5 C309.6 167.5, 309.8 167.4, 310 168 C310.1 168.6, 310.2 170.4, 310.2 171 C310.3 171.6, 310.4 171.5, 310.1 171.7 C309.7 171.9, 309.1 172.4, 308.3 172.3 C307.6 172.2, 306.1 171.6, 305.5 171.2 C304.9 170.7, 304.7 170.4, 304.7 169.7 C304.8 169.1, 305.3 167.7, 305.9 167.2 C306.4 166.8, 307.3 167, 307.9 167.1 C308.5 167.1, 309.4 167.6, 309.4 167.5 M307.9 166.8 C308.5 166.9, 309.3 167, 309.9 167.4 C310.6 167.9, 311.6 168.5, 311.8 169.4 C312 170.2, 311.7 172.1, 311.1 172.6 C310.4 173.1, 308.8 172.3, 308 172.5 C307.2 172.7, 306.8 174, 306.3 173.8 C305.9 173.6, 305.8 172, 305.4 171.4 C305 170.8, 303.6 170.8, 303.8 170.3 C304.1 169.8, 305.9 168.9, 306.9 168.4 C307.8 167.9, 309.3 167.7, 309.5 167.3 C309.8 167, 308.3 166.4, 308.4 166.3&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M309.1 167.6 C309.5 167.7, 308.9 167.2, 309.3 167.6 C309.7 168, 311.3 169.2, 311.5 169.9 C311.7 170.5, 311.3 170.9, 310.6 171.3 C310 171.7, 308.3 172.3, 307.8 172.3 C307.2 172.4, 307.6 172.1, 307.2 171.8 C306.8 171.4, 305.7 170.8, 305.4 170.3 C305 169.9, 304.8 169.8, 305.1 169.3 C305.4 168.7, 306.5 167.2, 307 166.8 C307.5 166.5, 307.7 167, 308.2 167 C308.7 167, 309.7 166.7, 309.8 166.6 M307 168.2 C307.1 168, 306.5 167.3, 307.3 167.3 C308.2 167.4, 311.4 167.9, 311.9 168.4 C312.3 169, 310.2 170.1, 310.2 170.7 C310.1 171.3, 312 171.4, 311.6 171.9 C311.1 172.5, 308.5 173.9, 307.5 173.8 C306.4 173.8, 305.6 172.1, 305.3 171.9 C305 171.6, 305.6 172.6, 305.8 172.2 C305.9 171.8, 306.3 170, 306.3 169.4 C306.3 168.7, 305.7 168.6, 305.5 168.5 C305.4 168.3, 305.1 168.6, 305.4 168.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M292 184 C296.3 186.8, 303.1 188.7, 307.8 182.4 M292.8 182 C298.9 185.4, 302.4 188.9, 309.7 183.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M478 23.1 C501.6 22.5, 526.3 15.8, 559.8 22.1 C565.3 21.2, 571.4 23.1, 567.5 27.1 C573.5 33.2, 571.9 41.2, 566.5 56.8 C568.1 63.9, 564.2 66.9, 559.7 68.5 C535 66.5, 503.1 64.5, 478.5 63.3 C472.5 66.6, 472.7 65.9, 471.5 57.6 C470.6 48, 467.7 32.7, 467.1 26.6 C472.9 21.9, 475 19.6, 476.6 20.4&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M477.7 20.3 C503.6 18.2, 525.4 21.2, 563.3 19.6 M476.9 19.5 C501.7 19.9, 525 20.1, 561.6 20.6 M562.3 20 C566.5 18.4, 569.3 24.5, 568.1 27.5 M561.5 19.2 C566.2 20.4, 569.2 22.5, 570.5 28.2 M571.5 27.5 C570.1 35.8, 569.6 41.4, 571.5 59.7 M570.7 27.9 C570.3 37.3, 570.5 47.5, 569.5 58.2 M570 58.3 C570.3 62.7, 565.6 65.3, 562 66.1 M568.1 59 C568.2 61.3, 565.9 65, 562.3 66.4 M562.6 65.6 C537.5 66.4, 516.7 68, 476.8 65.9 M562.9 65.7 C538 65.5, 513.5 65.8, 477.2 66.7 M477.7 66 C472.3 65.5, 468 62.3, 468.4 60.3 M478.9 67.7 C471.7 65.3, 468 62.8, 471.8 59.5 M468.2 58.8 C470 45.7, 472.1 34.7, 468.9 28.3 M469 57.8 C469 48.9, 469.8 41, 469.1 26.8 M470 27.7 C471.7 24, 471.7 20.6, 477.6 20.9 M471.6 26.5 C469 21.3, 472.4 21.6, 477.8 18.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M513.2 65.8 C510.2 75.9, 509.1 95, 511 100.3 C519.9 91.7, 523.8 82.3, 529.2 63.7 C526.3 67.7, 517 63.7, 511.5 68.2&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M510.6 66.2 C511.4 76.8, 509.2 83.9, 508.3 101.7 M510.2 66.7 C509.2 76.8, 510.1 88.8, 510.2 101 M510 99.1 C515.4 87.6, 525.7 76.2, 533.6 64 M509.7 100.8 C515.6 90.9, 520.5 83.5, 531.8 65.6 M531.1 65 C525 67.5, 516.8 66, 508.4 64.6 M531.6 66.6 C524.8 66.9, 517.4 66.5, 509.2 66.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;520&quot; y=&quot;43.0&quot;&gt;no.&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M526.1 101.6 C530.2 103.6, 533.6 109.7, 535.5 114.3 C537.4 118.9, 538.7 124.9, 537.5 129.2 C536.3 133.5, 532.4 137.7, 528.2 140.1 C524 142.6, 517.1 144.3, 512.2 143.8 C507.4 143.3, 501.9 140.7, 499 137.3 C496 133.9, 494.9 128.4, 494.8 123.6 C494.6 118.7, 495.3 112.2, 498.2 108.3 C501.2 104.4, 507.5 100.8, 512.3 100 C517.1 99.3, 524.3 103.3, 527.1 103.9 C529.8 104.5, 529 103.5, 528.8 103.8 M521.8 99.5 C526.1 100.5, 532.5 105.4, 535 109.4 C537.4 113.5, 537.1 118.9, 536.6 123.7 C536.1 128.5, 535.2 134.7, 531.9 138.1 C528.6 141.6, 521.7 144.1, 516.7 144.3 C511.8 144.5, 505.5 142.5, 502 139.5 C498.5 136.5, 496.7 130.8, 495.7 126.4 C494.6 121.9, 493.9 116.9, 495.8 112.8 C497.7 108.7, 502.7 103.8, 507 101.7 C511.2 99.7, 518.9 100.3, 521.4 100.4 C524 100.4, 521.9 101.6, 522 102&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M516 99.1 C520.4 98.5, 526.9 100.7, 530.5 103.8 C534 106.8, 536.3 112.6, 537.1 117.5 C537.9 122.3, 537.7 128.6, 535.3 132.9 C532.9 137.2, 527.3 141.8, 522.9 143.4 C518.4 145, 512.6 144.2, 508.5 142.6 C504.4 141, 500.5 137.8, 498.1 133.6 C495.7 129.5, 493.4 122.5, 494 117.7 C494.6 112.9, 497.1 107.8, 501.7 104.8 C506.3 101.8, 517.5 100.1, 521.7 99.9 C525.9 99.6, 526.7 102.7, 526.7 103.4 M514.9 99.7 C519.3 99.1, 525.9 100.3, 529.5 103.1 C533.2 106, 535.4 112, 536.5 116.8 C537.7 121.5, 538.6 127.3, 536.4 131.5 C534.1 135.7, 527.6 139.8, 523 141.8 C518.5 143.8, 513.5 144.6, 509.1 143.4 C504.8 142.2, 499.4 138.5, 497.1 134.4 C494.9 130.3, 494.8 123.4, 495.6 118.9 C496.5 114.3, 499.2 110.2, 502.2 107 C505.2 103.8, 511.3 101.1, 513.6 99.9 C516 98.6, 515.8 99.2, 516.2 99.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M507.6 112.7 C508 112.5, 508 112.6, 508.5 112.8 C509 113, 510.2 113.4, 510.7 113.9 C511.2 114.5, 511.5 115.4, 511.3 116.3 C511.2 117.2, 510.1 118.7, 509.7 119.2 C509.3 119.6, 509.4 119.3, 509 119 C508.5 118.7, 507.5 117.7, 507 117.3 C506.4 116.9, 505.8 117.2, 505.4 116.7 C505 116.1, 504.2 114.9, 504.5 114.2 C504.8 113.6, 506.2 113, 506.9 112.9 C507.6 112.7, 508.8 113.2, 509 113.2 M509.4 113.5 C509.6 113.4, 508.7 112.5, 509.1 112.9 C509.5 113.3, 511.6 114.9, 511.9 115.8 C512.2 116.7, 511.6 117.7, 510.9 118.4 C510.2 119.2, 508.6 119.9, 507.9 120.2 C507.1 120.4, 506.8 120.2, 506.4 119.9 C506 119.5, 505.3 119.3, 505.2 118.3 C505.2 117.2, 506.4 114.6, 506.3 113.8 C506.3 112.9, 504.8 113.4, 505 113.2 C505.2 112.9, 507 112, 507.4 112.1 C507.9 112.2, 508 113.3, 507.9 113.7&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M508.5 112.7 C508.8 112.7, 508.6 113.4, 509.1 113.8 C509.5 114.1, 510.8 114.1, 511.2 114.9 C511.5 115.6, 511.5 117.7, 511.2 118.2 C510.9 118.7, 510.2 117.9, 509.5 117.9 C508.8 117.8, 507.8 118.2, 507.1 118 C506.3 117.8, 505.3 117.1, 505 116.8 C504.6 116.6, 504.7 116.9, 505 116.3 C505.3 115.8, 506.1 114.3, 506.7 113.6 C507.2 113, 508.4 112.4, 508.5 112.3 C508.6 112.2, 507.3 112.7, 507.3 113 M509.7 114.2 C510.5 113.9, 510.8 113.1, 511 113.5 C511.2 113.8, 510.8 115.7, 510.9 116.3 C511 116.9, 511.7 116.8, 511.5 117 C511.2 117.3, 510.1 118, 509.4 118 C508.7 118, 508.2 117.5, 507.3 117.2 C506.5 116.9, 504.4 116.3, 504.2 116.1 C504 115.9, 505.5 116.5, 506.1 116 C506.7 115.5, 507.1 113.8, 507.7 113.2 C508.3 112.6, 509.7 112.5, 509.7 112.5 C509.8 112.5, 508.1 113.1, 508 113.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M522.7 112.5 C523.4 112.5, 524.5 113.3, 525.2 113.7 C525.8 114.2, 526.1 114.7, 526.4 115.3 C526.7 115.9, 527.2 116.8, 527.1 117.4 C527 118, 526.4 118.6, 525.9 118.9 C525.5 119.2, 524.7 119.2, 524.2 119 C523.7 118.7, 523.5 117.9, 522.8 117.5 C522.1 117, 520.4 117, 520.1 116.3 C519.8 115.7, 520.3 114, 520.9 113.5 C521.4 113.1, 522.8 113.5, 523.4 113.6 C524 113.6, 524.5 113.9, 524.4 113.8 M523.7 111.9 C524.1 112, 525.6 114, 526.1 114.8 C526.6 115.5, 526.7 116.1, 526.8 116.3 C526.9 116.6, 527.1 115.7, 526.6 116.1 C526.1 116.4, 524.4 118, 523.8 118.4 C523.3 118.9, 523.9 118.9, 523.4 118.7 C522.8 118.6, 520.8 118.1, 520.5 117.4 C520.1 116.8, 520.8 115.6, 521.1 114.8 C521.5 114, 522.4 112.7, 522.8 112.6 C523.1 112.5, 523 114, 523.1 114.1 C523.2 114.3, 523.3 113.4, 523.3 113.3&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M524.7 112.7 C525.2 112.4, 525.2 112.3, 525.7 112.7 C526.2 113, 527.4 113.9, 527.8 114.7 C528.1 115.4, 528.1 116.4, 527.6 117.1 C527.1 117.8, 525.5 118.2, 524.8 118.6 C524.1 119.1, 523.9 120, 523.4 119.9 C522.8 119.8, 521.9 118.7, 521.6 118 C521.3 117.4, 521.4 116.6, 521.3 115.8 C521.3 115.1, 521 114.3, 521.3 113.6 C521.6 113, 522.9 112.1, 523.3 112 C523.6 111.8, 523.3 112.6, 523.3 112.8 M521.8 112.3 C522.7 111.8, 524.7 112.1, 525.6 112.5 C526.4 112.9, 527 114.3, 527 114.7 C527 115.1, 525.7 114.5, 525.6 114.9 C525.6 115.3, 527 116.3, 526.7 117 C526.3 117.8, 524.6 119, 523.7 119.4 C522.7 119.9, 521.3 120.4, 521 119.9 C520.6 119.5, 521.3 117.3, 521.6 116.6 C521.8 116, 522.1 116.8, 522.3 116 C522.6 115.2, 522.9 112.1, 523 111.8 C523.1 111.5, 523.2 113.8, 523.1 114.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M508 130 C512.1 132.9, 519.8 133.1, 523.9 131.7 M506.4 129.8 C515.6 134.4, 518.1 131.9, 523.6 128.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M516.1 145 C515.9 163.9, 516.5 182.8, 516.1 210.1 M516.2 143.2 C515.9 157.2, 515.3 170.8, 515.5 210.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M516.7 210.8 C509.8 222, 505.1 237.4, 497.5 254.3 M515.1 210.4 C511.1 222.1, 504.1 234.7, 496.5 256.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M517.3 210.7 C522.2 224.3, 529.8 238, 534.9 256.4 M516 209.6 C521.8 225.1, 530 240.8, 535.5 256.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M517.9 162.6 C509.6 169.6, 501.4 180.9, 494.3 190.6 M516.9 162.8 C507.1 174.1, 498.9 186.7, 494.5 191.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M514.4 162.5 C522.5 171.6, 527.7 181.2, 539.7 192.8 M515.8 162 C522.1 170.2, 527.3 176.9, 537.5 191.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;h2 id=&quot;what-llvm-is-and-the-problem-it-solves&quot;&gt;What LLVM is, and the problem it solves&lt;a class=&quot;anchor&quot; href=&quot;#what-llvm-is-and-the-problem-it-solves&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To see why people push LLVM so hard, look at the problem it solves. Picture the naive way to build compilers: every language compiles straight to every chip.&lt;/p&gt;
&lt;p&gt;I write my language → x86-64. Fine. Now I want it on the ARM chip in a Raspberry Pi — a completely different instruction set where &lt;code&gt;mov eax, 2&lt;/code&gt; means nothing. So I write a &lt;em&gt;second&lt;/em&gt; backend from scratch. Want RISC-V too? A third. Now scale up: imagine building clang (C), rustc (Rust), and swiftc (Swift), each targeting x86, ARM, and RISC-V. That&#x27;s 3 languages × 3 chips = &lt;strong&gt;nine&lt;/strong&gt; separate translators. Every new language multiplies against every new chip. It explodes.&lt;/p&gt;
&lt;p&gt;The fix is to stop connecting languages directly to chips, and put one shared language in the middle:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Every &lt;strong&gt;frontend&lt;/strong&gt; compiles &lt;em&gt;down&lt;/em&gt; to the middle. Every &lt;strong&gt;backend&lt;/strong&gt; compiles the middle &lt;em&gt;down&lt;/em&gt; to one chip. Nobody talks directly to anybody else.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now three frontends reach the middle, and the middle reaches three chips: three plus three is &lt;strong&gt;six&lt;/strong&gt;, not nine — and the gap widens fast. Every new language becomes &lt;em&gt;one&lt;/em&gt; frontend that instantly runs on every chip. That middle language is called an &lt;strong&gt;intermediate representation&lt;/strong&gt; — &lt;strong&gt;IR&lt;/strong&gt;.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -29 722 385&quot; width=&quot;722&quot; role=&quot;img&quot; aria-label=&quot;Direct translators versus a shared middle&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:21px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;150&quot; y=&quot;0.0&quot;&gt;Direct: 3 × 3 = 9&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M44 100.2 C45.8 161.8, 44.9 223.7, 46.7 258.3 M44.4 102.4 C45.4 146.4, 45 191.3, 44.4 258.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M44.6 100.1 C85.8 164.4, 126.5 224.7, 149.1 256.5 M45.3 101.6 C80.8 156.4, 118.3 211.3, 150.4 257.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M45.1 103.6 C128.6 160.8, 211 223.1, 255.4 258.5 M44.3 102.7 C89.3 134.6, 133.8 168.2, 254.6 257.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M150.7 103.8 C109.6 164.1, 69.3 225, 46.9 256.8 M150.1 102.1 C121 145.6, 90.9 189.3, 45.5 257.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M151.3 103.7 C149.7 162.1, 147 225.4, 149.3 258.9 M151 101.3 C148.4 154.8, 148.2 206.5, 149.5 258.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M151.9 103.6 C192.9 163.5, 231.9 225.1, 255.7 257.1 M149.8 102.5 C190.8 165.2, 233.5 226.9, 255.5 258.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M253.8 103.2 C173.3 162.3, 89.7 225.7, 43.5 259 M255.6 101.7 C199.8 142.9, 144.9 183.4, 44.6 258.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M254 103.4 C216.6 163.5, 174.4 221.8, 149.5 257.4 M254.6 102.9 C219.1 153.4, 186.1 203.9, 150.5 257.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M254.6 103.2 C256.7 162.4, 256.2 223, 255.9 259.6 M255.5 102.1 C253.5 161.1, 253.4 221.6, 254.5 257.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M5.1 59.7 C22.5 56.8, 40 58.2, 79.6 58.1 C90.7 59.1, 93.4 59.1, 93.5 70.1 C91.1 80.5, 91.6 87.7, 86.9 93.4 C87.7 101.1, 84.2 100.6, 80.6 102.8 C53.5 100.2, 27.4 103, 10.4 103.9 C3.9 99.9, -1.9 101.3, 2.8 97.1 C0.9 88.1, -1.3 80.1, -0.9 65.2 C1.7 63.6, -0.6 61.1, 7.6 62&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M8.1 59.3 C24.5 58.9, 39.4 61.1, 81.5 60.7 M6.9 59.6 C29.4 60.2, 53.9 60.9, 82.4 59.1 M83 60 C88.2 58.4, 88.4 63.9, 89 67.2 M83 60.9 C86.1 61, 90.4 62.7, 88.5 68.2 M90.4 67 C92 76.7, 90.3 86.5, 89.6 94.1 M90.9 67.1 C89.8 78.3, 89.9 87.5, 90.4 95.2 M90 95 C91.6 100.5, 86.2 101.1, 84 102.5 M89.4 93.3 C88.1 100.5, 89 102.8, 84.3 103.6 M82.8 100.8 C60.9 100.8, 42.8 103.6, 5.5 100.3 M83.2 101.3 C56.5 102, 29 101.5, 6.1 101.5 M7 102 C3.1 103.1, 0.6 99.7, 0.5 93.8 M6.9 100 C3 102.7, -0.8 98.6, -0.6 95.5 M-1.4 93.5 C1.9 88.2, -0.6 82.4, 0.5 66.9 M0.5 95.5 C-0.9 84.8, 0.3 75.1, -0.5 67.5 M0 67 C1.9 63.7, 1.6 59.5, 5.8 60 M-0.3 66.7 C-0.3 61.6, 0 61.4, 6.7 61.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;45&quot; y=&quot;81.0&quot;&gt;C&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M108.5 62.5 C127.9 60.9, 145.8 60.2, 186.9 62.6 C190 60.5, 197.8 65.9, 198.5 64.7 C196.4 76.7, 197.3 84.1, 191.6 96.1 C196.3 101.3, 189.8 102.6, 187 102.8 C169.8 101, 154.9 103.8, 112.8 101.2 C110.4 99.5, 103.2 101.5, 105.9 96.5 C101.7 87.6, 102.5 75.8, 104.2 66.2 C107.1 61.8, 104.5 56.9, 109 59.7&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M110.7 60.1 C141.4 61.4, 169 60, 188.4 59.1 M113 60.3 C130.1 58.8, 149.3 60.3, 187 59.1 M188 60 C193.8 58.6, 193.2 62.6, 193.3 66.8 M186.4 60.2 C190.7 60.6, 193 62.2, 195.4 65.3 M196.5 66.9 C196.3 75.9, 196.6 87.5, 196.5 95.2 M194.8 67.3 C195.1 72.8, 195.4 79.8, 194.7 94.8 M195 95 C194.6 101.4, 191.8 103.4, 186.6 103.1 M195.9 93.6 C193.4 98.5, 191.9 100.3, 187.4 103.4 M188.4 102.6 C174 100.2, 158.6 102.9, 112.4 103.6 M187.8 102.8 C165.7 102.6, 145.1 102.5, 112.7 101.2 M112 102 C109.2 101.9, 106.6 101.6, 105.1 95.6 M110.5 101.6 C107.3 101.7, 103.9 97.7, 104.9 94.7 M106.2 96.2 C104.8 87.3, 106.7 83.4, 106.1 68.8 M105.8 95.4 C105.5 86.3, 105.1 75.9, 106 66.8 M105 67 C106.1 62.9, 106.2 60.6, 113.4 61.2 M103.1 66.6 C105.9 64.5, 105 59.7, 111.7 58.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;150&quot; y=&quot;81.0&quot;&gt;Rust&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M219.1 58 C233.3 57.8, 251.7 62.2, 294.2 59.9 C296.6 61.9, 302.2 65.5, 303.4 66.5 C301.6 72.9, 303 80.6, 303.5 91.5 C297.6 101.5, 295.4 104.6, 293.5 102.8 C270.9 101.8, 244.8 104.5, 215.2 98.4 C209.7 99.2, 208.3 101.7, 209 96 C210.7 92.8, 207.4 82.7, 209.4 67.3 C212.5 60, 209.6 60, 217.6 57.5&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M217.4 60.8 C243 59.9, 264.1 58.8, 291.2 61.6 M217 60.9 C246 60.9, 275.1 61.2, 293.6 59.1 M293 60 C299.4 58.8, 301.9 61.3, 301.6 66.3 M293.9 59.5 C299.8 60.3, 300.2 61.8, 297.7 67 M298.5 66.8 C301.1 75.1, 299.5 84.6, 299.5 96.3 M300.7 67.5 C301 74.8, 299.5 85.2, 301 94.3 M300 95 C301.6 98.3, 297.3 101.6, 293.3 103.8 M298.3 94 C298.7 101.1, 299.4 102.4, 295 103.2 M294.1 100.5 C267.9 101.2, 240.1 103.9, 215.3 102.9 M292.4 102.3 C277 101.2, 259.2 101.4, 217.4 102.9 M217 102 C211.3 100.7, 208.6 99.4, 209.8 93.5 M218 103.2 C211.5 100.6, 208.6 101.5, 210.5 94 M209.8 95 C211.8 86.4, 209.9 80.3, 211.7 66.7 M209 95.3 C209.8 85.8, 209.9 76.6, 210.5 66 M210 67 C210.2 62.1, 210.8 61.6, 216.9 58.3 M210.5 66.4 C212 62.9, 210 58.1, 216.8 59.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;255&quot; y=&quot;81.0&quot;&gt;Swift&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M7.2 257 C25.8 258.9, 39.3 257.7, 81.1 255.5 C91 260, 88.2 259.1, 92.6 265.4 C92.3 275.4, 92.2 276.1, 89.2 295 C86.5 299.3, 85.6 297.7, 82.3 302.3 C69 298, 46.9 298.6, 7.3 298.3 C4.6 301.2, -3.6 299.9, 3.2 291.1 C-1.8 281.3, -0.4 267.2, 0.7 264.8 C1.1 259.2, 5.6 260.1, 8.2 261&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M7.3 259.8 C27.7 255.7, 46 258.9, 82.9 259.4 M7 258.9 C30.1 257.9, 53.9 257.6, 82.8 258.9 M83 258 C89.3 259.6, 89 260.1, 88.1 264.3 M83.4 259.9 C86.1 255.9, 90.6 260.8, 88.2 266.5 M90.6 266.9 C91.3 275, 88.6 283.5, 88.1 293.5 M90.8 265.2 C89.2 274.7, 90.9 284.1, 89.1 293.5 M90 293 C91.1 296.3, 86.9 298.1, 85 299.5 M88.2 292.7 C88.2 296.1, 86.5 298.4, 81.2 299.5 M81.8 300.5 C66.1 300.1, 47.8 298.8, 8.1 301.8 M83.8 299.2 C52.6 300.8, 24.3 300.4, 7.2 299.5 M7 300 C3.6 298.5, -1.4 296.3, -1.5 293.2 M5.8 300.7 C0.5 301.6, 1.8 295.6, 2.3 294.1 M0.2 292 C-1.6 285.9, 1.5 278, 1.6 266.3 M0.3 293.8 C0.6 284.8, -0.6 276.9, -0.4 264.7 M0 265 C1 260.7, 2.7 258.5, 7.3 256.2 M0.9 267 C-1.3 259.1, 1.4 260.3, 8.4 259.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;45&quot; y=&quot;279.0&quot;&gt;x86-64&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M110.6 259.8 C131.2 260.3, 145.1 257, 188.4 260 C190.4 261.4, 192.6 258.7, 197.5 267.2 C197.5 271.6, 197.8 279.7, 193.9 290.5 C195.1 299.5, 191.3 299.7, 188.8 302.3 C162.9 298.8, 144 299.4, 109.7 302.8 C103.8 300.9, 101.6 300.1, 106.3 290.6 C106.3 286.5, 103.4 274.2, 105.9 265.9 C106.5 257.4, 110.6 256, 109.6 258.7&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M113.9 256.5 C129.4 258.2, 145.1 257.7, 189.8 257.9 M111.1 257.5 C130.8 258, 149.3 258.5, 187.4 258.9 M188 258 C190.9 259.8, 193.7 258.8, 196.4 263.9 M186.9 259.3 C190.6 260.1, 193.2 260.3, 195.1 263.5 M196.7 266.8 C195.6 274.2, 194.9 284.6, 195.1 294.6 M194.7 265.4 C194.5 271.2, 194.4 276.4, 195.4 293.1 M195 293 C194.1 297.2, 192.5 300.4, 187.6 300.2 M194.6 293 C193.5 298.7, 194 300.5, 188.8 299.3 M187.4 298.4 C160 299.5, 133.2 298.2, 111 301.1 M188.4 300.7 C163.8 299.4, 138.4 299.3, 111.9 299.2 M112 300 C105.7 301.3, 104.6 298.1, 103.2 291.1 M113.4 298.3 C109.3 300.5, 106.5 299.4, 103.2 293.4 M103.8 294.7 C105.3 285, 104.8 278.9, 103.2 264.2 M105.5 293.7 C105 284.3, 104.2 277.6, 104.2 266 M105 265 C105.1 259.9, 107.3 259.6, 110.8 257.3 M104.4 266.8 C104.9 262, 106.4 258.6, 113.5 256.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;150&quot; y=&quot;279.0&quot;&gt;ARM&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M214.1 255.3 C229.3 257.1, 251 259, 295.7 257.3 C296.9 255.6, 297 258.3, 302.5 261.8 C303.7 273.3, 297.3 287.3, 298.6 293.2 C296.5 299.6, 296.9 301.7, 295.2 302.3 C264 296.9, 241.1 297.4, 219.3 300 C210.3 300.5, 206.7 300.3, 209.4 290.1 C208.1 286, 208.2 269.9, 211 267 C211.9 262.8, 215.7 259.1, 218.2 256.5&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M216.6 257.3 C246.2 256.7, 274.6 256.6, 292.7 256.4 M217.2 258.2 C246.6 256.6, 277 257.9, 294 258.9 M293 258 C296.5 259.9, 298.5 261.5, 300.7 263.4 M294.3 258.6 C299.7 259.7, 300.4 259.9, 302 265.2 M298.7 266.8 C300.4 273.4, 301.8 281.7, 298 291.7 M300.7 265.6 C299.8 273.3, 299.9 281.8, 299.7 292.6 M300 293 C301.1 298.1, 298 298.6, 294.2 300.8 M301.1 293.4 C298.8 296.7, 296.9 298, 291.9 299.2 M293.1 300.3 C269.1 300.5, 249.1 299.1, 217.9 300.4 M293 300.2 C273.1 300, 254.5 300.3, 216.5 300.9 M217 300 C211.8 300.1, 210.6 296, 211.9 292.9 M216.9 299.9 C213.6 299.5, 211.2 298.5, 208.7 292.6 M211.4 293.5 C208.3 284.1, 208 279.9, 208.8 266.1 M210.8 293.6 C209.4 285.8, 209 278.3, 210.7 265.2 M210 265 C209.3 259.1, 212 256.7, 218.4 258.4 M211.8 266.7 C211 260.4, 211.4 257, 218.6 257.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;255&quot; y=&quot;279.0&quot;&gt;RISC-V&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:21px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;540&quot; y=&quot;0.0&quot;&gt;Shared IR: 3 + 3 = 6&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M397.7 61.3 C417.1 60, 437.5 58.7, 471.8 61.4 C476.2 56.6, 478.8 65.5, 482.6 64.4 C482 72.5, 479.7 79.7, 481.7 96.9 C482.5 99.3, 479.7 103.5, 470.7 100.3 C447.7 103.6, 421.2 103.4, 394 104.3 C393.4 104.6, 389.3 98, 389.3 96.2 C389.2 89.4, 389.1 78.3, 387.3 66.2 C388.1 58.8, 394.1 62.7, 393.9 57.5&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M395.3 60 C424.3 57.9, 448.3 59.8, 471.1 59.7 M396.8 59.1 C413.7 59.5, 429.8 59.4, 472.2 59.4 M473 60 C479 61.7, 482 61.7, 481.1 68.6 M471.4 58.1 C477.2 61.1, 482 62, 480.7 66.9 M481.7 68.4 C479.4 75.3, 478.8 84.1, 478 97 M480.5 66.1 C479.9 73, 480.4 80.4, 480.5 94 M480 95 C478.2 99.8, 479.6 101.1, 474.9 103.5 M479.6 95 C477.9 100.2, 479.3 103.1, 472.7 102.2 M473.1 101.7 C449.4 100.5, 425.8 103, 396.8 102.3 M472.1 102.9 C455 102, 438.5 101, 396.3 103 M397 102 C390.7 101.7, 390.9 97.9, 388.2 96.1 M398.9 100.8 C394.2 101.8, 388.3 100.3, 391.4 95.8 M390.2 94.7 C388.4 87.9, 389.9 80.4, 391.5 67.4 M389.9 95 C390.3 88.2, 389.5 83.4, 390.6 66.2 M390 67 C389.9 63.4, 390.3 59.2, 395.9 60.3 M389.7 66.9 C390.7 63.7, 393.2 58.3, 395.2 58.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;435&quot; y=&quot;81.0&quot;&gt;C&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M501.2 56.8 C522.5 64.1, 543.3 60.7, 579.1 58.6 C582.8 58, 583.2 65.1, 587.6 66.2 C587.2 75.9, 585.3 76.2, 586.4 92.4 C583.8 99.5, 585.3 105.5, 577.1 100.4 C548.8 104.5, 518.3 104.2, 503.6 101.6 C499.9 104.3, 494.4 98.2, 492.4 95.7 C498.2 88.9, 493.9 74.1, 492.4 67.3 C493.5 64.1, 499.2 58.6, 502.5 62.4&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M501.9 60.8 C521.9 60.4, 547.5 58.6, 578 58.2 M502.9 59.8 C529.5 59.6, 555.5 60.3, 578.8 59.4 M578 60 C584.6 61.9, 586.7 60.4, 585.4 68.2 M578.9 61.4 C581.7 60.8, 584.6 61.5, 583 68.5 M583.7 68.3 C584.2 74.5, 585.7 81.1, 585 94.1 M584.4 66.3 C585.2 75.1, 585.9 83.8, 584.8 95.6 M585 95 C585.2 100.7, 581.1 103.3, 577.5 100.2 M586.1 95.3 C583.2 98.2, 582.1 100.6, 575.7 102 M578.8 103.6 C558.5 99.9, 541.7 102.4, 503.7 101.6 M578.7 102.4 C551.1 102.1, 522.3 101.5, 502.9 102.7 M502 102 C496.8 100.5, 496.9 99.7, 496.9 94 M502.4 102.4 C498.4 100.7, 493 99.5, 496.9 95 M493.8 93.4 C495.3 87.1, 493.2 81.4, 493.2 65.3 M495.1 94.9 C494.7 84.1, 494.3 73, 495.1 67.5 M495 67 C494 62.6, 499 60.3, 503.4 61.5 M493.2 66.8 C496.9 62, 498.2 61.2, 500.2 59.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;540&quot; y=&quot;81.0&quot;&gt;Rust&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M604.6 59.6 C627.9 58.2, 649.1 59.9, 686.4 63.1 C689.3 59.4, 687.6 64.7, 692.5 68 C693.5 77.7, 692 91, 691.1 95.1 C692.4 99.7, 690.9 100.3, 683.6 100.4 C665.1 105.3, 645.8 105, 606 98.8 C599.2 103.9, 599.5 98.4, 602.7 95.2 C599 81.3, 597.7 69.8, 597.6 68.4 C598.9 62.3, 604.3 61.7, 603.9 60.2&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M608.6 61.5 C623.6 58.9, 642.6 61.5, 684.9 60.6 M607 60.4 C630.2 60.2, 652.9 59.7, 683.4 59.4 M683 60 C686.2 58.1, 691.5 63.1, 689.7 67.7 M682.3 60.7 C686.3 60.4, 691.8 61, 689.9 65.6 M689.7 68.3 C688.4 73.7, 688 82.2, 691.9 95.2 M690.3 66.5 C690.6 77.1, 689.4 87.3, 689 95.1 M690 95 C688.2 101.5, 686.6 101.6, 684.1 100.8 M688.5 95.7 C688.5 100.8, 689.6 102.7, 683.3 101.8 M684.4 101.5 C656.4 100.9, 627.1 103.3, 606.6 101 M683.4 102 C660.3 102.7, 638.4 102.4, 607.5 102.3 M607 102 C602.8 103.3, 598.9 101.6, 601.6 95.8 M605.9 104 C602.7 104.3, 602.3 98.6, 597.8 94.3 M601.3 96.1 C598.3 86.2, 600.5 78.4, 598.8 67.2 M600.4 94.8 C599.1 83.6, 599.1 73.7, 599.6 66.8 M600 67 C598.2 61.8, 603.6 61.4, 607 58.6 M600.6 66.7 C598.5 60.4, 603.2 59.5, 605.3 60.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;645&quot; y=&quot;81.0&quot;&gt;Swift&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M399.3 162.3 C456.7 157.8, 512.1 156.3, 681 159.7 C690.3 162.9, 687 159, 687.1 168.2 C693.5 175.1, 689.6 179.3, 689.5 196.1 C689.5 200, 685 206, 680.6 202.5 C620.6 205.9, 561.6 207.4, 398.6 204 C394.8 204.3, 393.6 202.7, 391.7 196.9 C386.5 184.6, 389.6 175.3, 389.7 170.9 C387 159, 390.9 158.5, 397.7 160.6&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M396.2 159.9 C489.8 161.1, 585 162.6, 682.1 158.7 M398.2 160.6 C505.1 161.8, 613.5 162, 682.8 160.2 M682.3 160 C685.8 158.2, 689 161.6, 690.9 166.7 M680.8 161 C688.8 158.2, 688.2 162.1, 691.1 167.1 M690.6 168.9 C690.1 174.2, 689.7 181.8, 688.9 199.9 M690 166.9 C690.6 178.6, 689.1 187.5, 690.6 198.1 M690 198.3 C688.3 202.9, 686.6 207.6, 684.1 204.5 M689.8 197.4 C691.4 202.4, 689.4 207.7, 684.1 205.3 M683.4 204.5 C579.6 207.4, 478.6 207, 397.7 206.7 M682.2 206.7 C584.6 205.2, 486.8 205.3, 397.8 205.5 M397.7 206 C393.2 206.8, 390.2 204.7, 391.8 198.6 M397.9 204.6 C394.1 203.7, 390 205.6, 389.5 198.2 M389 198.8 C388.8 193, 389.2 185.7, 389.4 169.4 M391 198.5 C390.6 187.6, 390.7 178.5, 390 167.4 M390 167.7 C389.7 164.1, 390.7 159.6, 396.2 161 M388.1 166.3 C391.5 162.6, 393.5 161.8, 397.5 161.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;540&quot; y=&quot;183.0&quot;&gt;IR&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M397.5 254.9 C417.1 256.1, 442.8 256.9, 475.9 255.2 C478 259.8, 476.6 258.3, 480.1 264.1 C478.8 273.2, 478.3 286.3, 481.4 294.6 C478.2 295.1, 478.1 303.3, 471.9 301.8 C446.6 303.5, 419.8 297.6, 399.6 297.3 C392.9 297.1, 386.6 294.5, 393.3 292 C388.6 283.9, 390.9 278.3, 388.4 265.9 C389.2 259.6, 391.6 259.9, 398.2 259.8&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M396 256 C420.7 259.9, 446 257.6, 471.3 256.1 M397.1 258.6 C418.6 258, 438.3 257.3, 472.1 257 M473 258 C479.3 257, 479.3 261, 481.2 264.4 M474.8 258.4 C479.6 259.5, 477.8 261.5, 481.1 266.4 M478.4 266.8 C480.3 270, 477.9 277.6, 480 293 M480.8 265.8 C480.4 271, 480.7 279.2, 480.8 293.3 M480 293 C481.4 299.4, 477.2 299.5, 473 301.2 M480.8 291.9 C478.4 297.2, 478.7 299.3, 474.4 298.6 M472.9 301.3 C452 301.8, 434 300.8, 396.7 299.2 M472.5 300.4 C456.8 299.5, 440.2 299.6, 396.5 299 M397 300 C392.4 301.5, 391.7 295.9, 391.1 294.7 M398.4 298.9 C393.9 302.3, 388.4 296.5, 391.2 292.8 M388.7 293.9 C391.9 282.8, 390 273, 391 266.5 M390.8 292.4 C390.4 286.9, 390 282.2, 390.7 264.4 M390 265 C390.5 259.2, 390.9 259.7, 398.3 259.4 M388.1 266.3 C390.6 262.2, 391.5 259.3, 397.9 259.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;435&quot; y=&quot;279.0&quot;&gt;x86-64&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M501 257.7 C522.4 257.4, 548.6 256.2, 576.1 259.7 C584.5 261.2, 588.2 257.9, 585.1 265.9 C585 276.6, 585 282.7, 586.1 290 C586.8 295.3, 583.7 298.1, 578.4 301.8 C562.9 301.6, 547.3 295.6, 502 301.8 C499.3 296.7, 491.7 294.7, 496.4 291.5 C496.6 283.4, 494.8 274.1, 493.5 266.9 C494.6 257.7, 496.7 255.8, 499.6 257.5&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M502.7 256.8 C522.3 256.9, 545.1 258.9, 578.2 258.6 M501.2 257.2 C517.3 258.2, 533.7 258.2, 578.7 257 M578 258 C580.9 257.2, 584.1 259.7, 585.5 264 M578.2 257.7 C584.1 259.1, 584.9 261.1, 583.4 263.5 M584.5 266.7 C585.2 274.8, 584.8 285.8, 587 294.1 M584.7 264 C585.7 273.1, 584.2 282.7, 585.1 292.8 M585 293 C584.4 296.2, 582.7 301.7, 579.7 301.9 M583.3 292.3 C583.7 299.8, 581.6 301.4, 577.5 298.4 M578.6 299.2 C545.9 301.2, 519.4 300.2, 503.6 298.5 M577.1 299.9 C550.8 300, 523.9 298.5, 501.1 300.7 M502 300 C498.5 300.3, 493.7 297.8, 495.7 292.6 M501.9 300.5 C498.2 301.2, 493.1 295.7, 496.7 292 M496.3 292.6 C494.8 281.9, 493.2 273.9, 496.6 264.4 M494.1 292.3 C494.8 282.8, 494.8 271.8, 495.2 265.7 M495 265 C494.7 258.4, 495.5 256.8, 501.9 256.6 M495.5 266.1 C496.8 260.5, 496.5 257.7, 503 256.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;540&quot; y=&quot;279.0&quot;&gt;ARM&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M604.4 260.5 C627.8 261.5, 654.4 258.2, 683.4 257 C691.1 255.4, 692.6 257.5, 690 267.7 C690.2 272.7, 690.7 279.1, 690.8 292.7 C688.2 295.5, 689.3 300.1, 684.8 301.9 C664 302.4, 637.2 296.4, 604.4 299 C605.8 303.6, 596.8 294.9, 599.5 291 C598.5 288.6, 599.6 281, 598.7 268 C600 263.1, 601.8 258.9, 608.2 255.3&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M605.3 257.6 C624 259.4, 644.3 257.8, 681 257 M607.2 257.9 C633.1 256.7, 661.5 257.6, 683.2 257.1 M683 258 C686.5 257.3, 688.8 258.4, 689.8 263.5 M681.7 257 C688.6 258.7, 692.1 260.6, 690.3 265.1 M690.5 266.6 C689.4 274, 691.1 286.9, 689.9 291.2 M690.7 264.2 C691 275.1, 689.7 286.1, 689.4 292.4 M690 293 C691.4 297.1, 688.3 300, 682.3 298.5 M689.7 292.6 C688.9 297.7, 689.1 298.9, 685.1 298.2 M684.2 301.1 C659 302.2, 631.3 301.1, 606.5 301.8 M683.7 299.4 C662.1 300.1, 640 301, 607.7 300.4 M607 300 C600.6 299.1, 599.7 299.6, 600.4 294.5 M605.4 298.1 C602.4 300.2, 597.7 299.4, 602.2 291.3 M599.9 291.4 C597.8 285, 600.5 274.9, 598.2 266.3 M599.3 292.2 C601.1 282.3, 599.6 272.5, 599.7 265 M600 265 C598.8 261.6, 604.2 257.8, 605.4 257.7 M598.9 266 C598.4 258.9, 601.5 256, 608.1 257.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;645&quot; y=&quot;279.0&quot;&gt;RISC-V&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M435.6 103.3 C433 121.2, 433.1 138.6, 434 156 M434.6 101.2 C434.4 122.5, 435.8 142.8, 435.2 157.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M441.5 146.3 C437.8 150.1, 435.8 153.6, 434.3 156.6 M440.8 144.8 C438.6 150.2, 437.3 154.9, 435.1 157.7 M436.2 159 C433.7 156.2, 432.3 150.9, 429.1 144.1 M434.5 158.5 C432.9 154.1, 432.1 150.4, 428.7 145.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M541.2 103.2 C537.7 119.2, 538.4 139, 540.4 158.2 M540.5 102.4 C540 115, 540.4 125.9, 539.2 157.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M546.9 146.2 C542.7 148.7, 541.2 153.9, 540.3 158.1 M546.4 145.7 C544.8 148.6, 543.8 150.4, 539.4 157.9 M539.6 158.9 C537.8 154.5, 536.5 149.6, 534.8 146.3 M539.7 158.7 C538.7 155.4, 536.7 152.4, 533.4 145.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M646.8 103.1 C643.5 121.3, 644.7 139.4, 646.8 156.3 M644.4 101.6 C645.6 118.7, 645.1 133.4, 645.2 158.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M652.3 146.1 C648 150.1, 646.8 154.1, 646.3 156.8 M650.7 145.1 C649.9 149.6, 647.8 152.4, 645.1 158.1 M645.7 158.7 C643.4 155.3, 640.7 150.4, 637.8 145.6 M644.9 157.5 C643.5 154.2, 640.5 149.3, 639.6 145&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M433.4 209 C433.2 222.8, 435 240.5, 434.2 256.5 M435.3 208.8 C434.2 223.6, 434.7 241.4, 434.2 256.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M439.9 244.1 C437.9 246.9, 437.1 252.4, 434.4 256.3 M441.3 243.9 C438.5 247.2, 436.8 252.4, 434.4 256.4 M434.1 256.5 C433.7 254.1, 432.3 249.2, 428.6 242.9 M435 255.6 C432.8 253.3, 431.6 249.1, 429.3 243&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M538.9 208.8 C538.9 224.8, 541.2 240.9, 540.6 254.7 M539.2 208 C539.8 217.2, 539.4 228.7, 540.2 256.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M545.4 244 C543.1 248.3, 542.7 252.6, 540.4 255.1 M545.5 243.4 C544.8 245.6, 543.3 249.3, 540.1 256.6 M540.2 256.4 C537.8 252.4, 533.7 245.1, 534.4 242.3 M540.2 255.8 C537.3 250.7, 535.2 246, 534 242.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M644.5 208.7 C643.7 222.9, 646.5 241.3, 647 256.8 M645.1 207.2 C645.4 220.4, 644 233.2, 644.2 255.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M650.8 243.9 C648.1 246.9, 648.1 252.8, 646.4 256.6 M651.1 242.8 C649.8 246.4, 647.3 249.8, 644.4 255.4 M646.4 256.2 C643.3 250.4, 640.7 248.7, 640.1 244.4 M645.3 255.9 C643.3 252, 641.5 247.9, 638.8 242.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M345.1 -11.3 C345.7 99.8, 344.9 210.2, 345.5 320.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;150&quot; y=&quot;330.0&quot;&gt;9 translators to build&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;540&quot; y=&quot;330.0&quot;&gt;3 frontends + 3 backends&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;Without an IR every language needs its own translator for every chip; with a shared IR each language and each chip is written once.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;LLVM is that idea at industrial scale.&lt;/strong&gt; One well-specified IR, plus mature backends for x86-64, ARM, RISC-V, WebAssembly and more, plus hundreds of battle-hardened optimization passes living in the middle. Emit LLVM IR from your frontend and you inherit &lt;em&gt;all&lt;/em&gt; of it — every backend, every optimization — for free. It&#x27;s why clang, rustc, and swiftc can each reach every chip without any of them writing a backend. They all emit LLVM IR and share the same middle.&lt;/p&gt;
&lt;p&gt;So when people said &quot;just use LLVM,&quot; this is what they meant: don&#x27;t reinvent the hardest, most valuable machinery in compilers. They had a point.&lt;/p&gt;
&lt;h2 id=&quot;why-i-said-no&quot;&gt;Why I said no&lt;a class=&quot;anchor&quot; href=&quot;#why-i-said-no&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;And I still chose not to. Here&#x27;s the honest reasoning.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Using LLVM would skip the exact thing I was trying to learn.&lt;/strong&gt; My whole goal was to understand how a program becomes machine instructions — registers, the stack, calling conventions, how &lt;code&gt;2 + 3&lt;/code&gt; turns into something a CPU runs. LLVM does precisely that part &lt;em&gt;for&lt;/em&gt; you. You hand it clean IR and fast x86-64 falls out the other end, and you learn nothing about how. Using LLVM would have been bolting a sealed engine onto the one door I came to open.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. LLVM is enormous.&lt;/strong&gt; It&#x27;s a massive C++ dependency with a sprawling API, a steep learning curve, and long build times. For a learning project, &quot;learn LLVM&#x27;s API&quot; is arguably a &lt;em&gt;bigger&lt;/em&gt; mountain than &quot;learn how a CPU works&quot; — and it&#x27;s the wrong mountain. I&#x27;d be studying a framework instead of the machine.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. I only had one language and one chip.&lt;/strong&gt; LLVM&#x27;s giant payoff is the N×M explosion — many languages times many chips. I had exactly one of each: my language, targeting x86-64. The benefit that justifies LLVM&#x27;s complexity didn&#x27;t apply to me. I&#x27;d pay the full cost and collect almost none of the reward.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4. The book I was following teaches the hard way on purpose.&lt;/strong&gt; Nora Sandler&#x27;s &lt;em&gt;Writing a C Compiler&lt;/em&gt; doesn&#x27;t reach for LLVM. It has you build a small IR of your own and generate x86-64 by hand, specifically so you learn the whole path. That pedagogy was the entire reason I picked it.&lt;/p&gt;
&lt;p&gt;So I built my own middle, by hand, targeting x86-64 directly. In the book it&#x27;s called &lt;strong&gt;Tacky&lt;/strong&gt;, and it became my favorite stage.&lt;/p&gt;
&lt;h2 id=&quot;the-middle-i-built-tacky&quot;&gt;The middle I built: Tacky&lt;a class=&quot;anchor&quot; href=&quot;#the-middle-i-built-tacky&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Tacky is my own IR — deliberately dumber than my source language and simpler than assembly. Its rule: &lt;strong&gt;every instruction does exactly one operation&lt;/strong&gt;, and anything complex is broken into steps with temporary variables holding the in-between results.&lt;/p&gt;
&lt;p&gt;Take a line from my language:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;зарла x: тоо = 2 + 3 * 4;   // let x: int = 2 + 3 * 4
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;My frontend parses that into a tree (Season 1). Then, instead of leaping to registers, it lowers the tree into Tacky:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;tmp.0 = 3 * 4
tmp.1 = 2 + tmp.0
x = tmp.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;4 -16 765 350&quot; width=&quot;765&quot; role=&quot;img&quot; aria-label=&quot;Tree flattened into Tacky&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M122.4 0 C127.5 -1.2, 134.9 1.3, 139.9 3.7 C144.9 6.2, 150 10.3, 152.4 14.9 C154.7 19.5, 155.5 26.6, 153.9 31.5 C152.3 36.4, 147.8 41.7, 142.9 44.3 C138 46.9, 130.2 47.8, 124.5 47.2 C118.8 46.5, 112.7 44.2, 108.9 40.5 C105 36.7, 101.7 30, 101.4 24.8 C101.2 19.6, 103.9 13.1, 107.6 9.2 C111.2 5.2, 120.3 2.7, 123.3 1.2 C126.4 -0.4, 125.5 -0.2, 125.8 0.1 M132.7 2 C138.1 2.8, 146.4 5.3, 150 8.9 C153.5 12.5, 154.5 18.5, 154 23.8 C153.6 29.1, 151.1 36.7, 147.4 40.8 C143.7 44.9, 137.2 47.6, 131.8 48.4 C126.4 49.1, 120.2 48.2, 115.2 45.2 C110.1 42.3, 103.3 35.5, 101.4 30.7 C99.5 25.9, 101.5 21.1, 103.9 16.5 C106.3 12, 110.8 6.3, 115.6 3.6 C120.3 0.8, 129.3 0.2, 132.2 -0.1 C135.1 -0.5, 133.1 1.2, 132.9 1.6&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M140.8 3 C146 5, 151.7 11, 153.7 15.7 C155.8 20.5, 155 26.5, 153.1 31.5 C151.3 36.4, 147.5 42.4, 142.8 45.2 C138 48.1, 130.3 49.5, 124.5 48.6 C118.7 47.8, 111.9 44, 108.1 40.2 C104.3 36.4, 102 31, 101.7 25.7 C101.4 20.4, 103.2 12.5, 106.5 8.4 C109.9 4.2, 115.3 1.1, 122 0.8 C128.6 0.6, 142 5.3, 146.5 6.9 C151 8.6, 149.6 10.4, 149.2 10.5 M128.1 0.1 C133.3 -0.5, 141 1.7, 145.3 4.9 C149.6 8.2, 153 14.1, 154.1 19.6 C155.1 25, 154.8 33.3, 151.8 37.6 C148.8 41.8, 141.7 43.7, 135.9 45.2 C130.1 46.8, 122.4 48.7, 117.1 46.8 C111.7 45, 106.5 38.6, 103.8 34.1 C101 29.7, 99.4 24.6, 100.6 20 C101.7 15.4, 105.9 9.9, 110.6 6.5 C115.2 3.2, 125.5 1.1, 128.4 0 C131.2 -1.1, 127.4 -0.5, 127.6 -0.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:18.04px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;128&quot; y=&quot;24.0&quot;&gt;=&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M57.1 91.2 C62.6 92.3, 67.7 97.5, 70.9 101.6 C74.2 105.8, 77 111.1, 76.5 116 C75.9 121, 72.3 127.9, 67.7 131.3 C63.2 134.7, 55.1 136.2, 49.1 136.4 C43.2 136.7, 36.8 136.1, 32 133 C27.2 130, 21.4 123.2, 20.1 118.2 C18.8 113.1, 21.4 107.1, 24.2 102.8 C27.1 98.6, 31.5 94.3, 37.4 92.8 C43.4 91.2, 55.4 93, 59.7 93.3 C64.1 93.6, 63.8 94.4, 63.6 94.6 M43 91.9 C48.5 90.7, 56.8 91.2, 61.9 93.7 C67.1 96.3, 71.7 102.5, 73.9 107.2 C76 111.8, 76.8 117.3, 74.9 121.8 C72.9 126.3, 67.4 131.7, 62.1 134.3 C56.8 136.9, 49.2 138.4, 43.1 137.3 C37.1 136.2, 29.6 131.7, 25.7 127.7 C21.8 123.8, 19.6 118.3, 19.7 113.8 C19.7 109.2, 22.5 104.4, 26.1 100.5 C29.8 96.7, 38.9 91.9, 41.7 90.6 C44.5 89.3, 42.6 92.6, 42.9 92.8&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M43.4 91.8 C48.9 90.8, 57.5 91.8, 62.7 94.2 C68 96.5, 73.1 101.5, 75 106.2 C77 110.9, 76.7 117.7, 74.5 122.3 C72.4 127, 67.6 131.8, 62.3 134.1 C57.1 136.5, 48.8 137.5, 42.9 136.5 C37 135.6, 30.9 132.5, 27 128.7 C23.1 124.8, 19.8 118.2, 19.7 113.4 C19.7 108.6, 22.3 103.6, 26.7 99.8 C31.1 96, 42.4 92, 46.3 90.6 C50.1 89.2, 49.8 91.4, 49.7 91.7 M51.4 90 C57 90.2, 65.4 94.4, 69.4 98.2 C73.4 102, 75.5 107.7, 75.5 112.8 C75.4 117.8, 72.9 124.2, 69.3 128.4 C65.7 132.5, 59.7 136.5, 53.8 137.6 C48 138.8, 39.5 137.9, 34 135.2 C28.5 132.5, 22.9 126.3, 20.7 121.5 C18.5 116.7, 18.8 111, 20.9 106.3 C23 101.6, 28.2 95.7, 33.1 93.3 C38.1 90.9, 47.6 92.1, 50.6 91.9 C53.7 91.7, 51.5 92.1, 51.6 92.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:18.04px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;48&quot; y=&quot;114.0&quot;&gt;x&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M195.8 93.9 C201.1 91.4, 210.2 89.9, 216.1 91.1 C222 92.3, 227.8 96.9, 231.1 101 C234.4 105.1, 236.7 110.8, 236.1 115.6 C235.5 120.3, 231.7 126, 227.5 129.5 C223.4 132.9, 217.2 135.8, 211.1 136.3 C205.1 136.9, 196.5 135.7, 191.2 132.8 C185.9 130, 181 124.2, 179.4 119.4 C177.8 114.5, 178.4 108.6, 181.8 103.9 C185.2 99.1, 195.9 93, 199.7 91 C203.4 88.9, 203.9 90.9, 204.1 91.5 M213.7 91.9 C219.5 92.6, 228 96.1, 232.1 99.7 C236.3 103.3, 238.8 108.8, 238.4 113.6 C238.1 118.5, 234.5 124.8, 230 128.7 C225.5 132.7, 218 136.5, 211.6 137.3 C205.2 138.1, 196.9 135.9, 191.8 133.4 C186.6 130.9, 182.5 126.9, 180.8 122.3 C179.1 117.7, 179.3 110.6, 181.7 105.8 C184.1 101, 189.6 95.8, 195.3 93.3 C201 90.7, 212.5 91, 215.9 90.5 C219.3 90.1, 215.8 90, 215.6 90.7&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M218.3 92.7 C224.1 94, 230.8 98.4, 233.9 102.7 C237 107, 237.9 113.6, 236.7 118.5 C235.5 123.4, 231.9 128.8, 226.9 132.1 C222 135.4, 213.5 138.2, 207.1 138.1 C200.7 138, 193.4 134.9, 188.7 131.6 C184.1 128.2, 180.2 123.1, 179.1 118.1 C178.1 113.1, 179.2 105.9, 182.5 101.6 C185.7 97.4, 191.4 93.6, 198.6 92.6 C205.7 91.7, 219.9 94.9, 225.3 96 C230.6 97.1, 230.9 98.9, 230.7 99.2 M212.4 91.1 C218.6 91.8, 225.4 95.4, 229.4 98.9 C233.4 102.4, 235.9 107.4, 236.3 112.1 C236.6 116.8, 235.1 122.9, 231.6 127.2 C228 131.5, 220.7 136.3, 214.8 137.6 C208.8 139, 201.5 137.8, 195.8 135.4 C190.2 132.9, 183.3 127.9, 180.8 123.1 C178.3 118.4, 178.9 111.6, 181.1 106.8 C183.3 101.9, 188.6 96.4, 194 93.9 C199.3 91.5, 210.1 92.5, 212.9 92.1 C215.8 91.8, 211.7 91.5, 211.3 91.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:18.04px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;208&quot; y=&quot;114.0&quot;&gt;+&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M130.4 180.1 C136.3 180.1, 143.5 182.8, 148 186.2 C152.4 189.5, 156.4 195.3, 157.1 200.4 C157.8 205.5, 155.8 212.1, 152.2 216.8 C148.6 221.4, 141.3 226.6, 135.5 228.3 C129.7 230, 123 229.3, 117.5 226.9 C112 224.6, 105.4 218.8, 102.5 214.1 C99.6 209.4, 98.7 203.6, 100.1 198.7 C101.6 193.7, 105.2 187.6, 111 184.4 C116.8 181.2, 130.4 179.9, 135.2 179.5 C139.9 179.1, 139.6 181.2, 139.5 181.9 M139.2 181.5 C144.9 183, 150.8 188.6, 153.6 193.3 C156.4 198, 157.1 204.5, 155.9 209.7 C154.7 214.8, 151.3 221.1, 146.3 224 C141.4 227, 132.7 227.5, 126.5 227.1 C120.2 226.6, 113.4 224.4, 108.7 221.3 C104 218.2, 99.1 213.5, 98.5 208.5 C97.8 203.5, 101.4 196.1, 104.6 191.2 C107.8 186.4, 111.7 181.2, 117.4 179.5 C123.2 177.9, 135.9 181, 139.3 181.3 C142.6 181.5, 137.8 180.9, 137.5 181.2&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M119.7 179.4 C125.4 177.7, 134.3 179, 139.9 181.4 C145.6 183.8, 151 188.9, 153.5 193.7 C156 198.6, 156.6 205.7, 155.1 210.6 C153.6 215.6, 149.6 220.4, 144.7 223.4 C139.7 226.4, 131.4 229, 125.4 228.7 C119.4 228.4, 112.6 225.2, 108.4 221.5 C104.2 217.8, 101 211.7, 100.3 206.6 C99.6 201.5, 100.8 195.3, 104.1 191 C107.4 186.8, 117.3 182.8, 120.2 181.1 C123.1 179.4, 121.3 180.5, 121.5 180.8 M131.6 180.4 C137.8 180.5, 145.4 182.6, 149.4 186.2 C153.5 189.7, 155.8 196.2, 156 201.6 C156.2 207, 154.3 214.2, 150.7 218.6 C147.1 222.9, 140.1 226.7, 134.4 227.8 C128.8 228.8, 122.3 227.2, 116.8 225 C111.4 222.8, 104.4 219.3, 101.7 214.5 C99.1 209.6, 99.4 200.9, 100.9 195.9 C102.3 190.8, 105.3 187.1, 110.6 184.1 C115.8 181.2, 128.8 179, 132.3 178.3 C135.8 177.6, 131.8 179.4, 131.5 180&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:18.04px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;128&quot; y=&quot;204.0&quot;&gt;2&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M276.1 182.9 C280.6 180.3, 287.7 179.8, 293.3 180.8 C298.9 181.9, 305.9 185.2, 309.6 189.1 C313.3 193, 315.9 199.2, 315.5 204.4 C315.1 209.6, 311.2 216.6, 307.3 220.3 C303.4 224.1, 297.9 226.4, 292.1 226.9 C286.3 227.5, 277.4 226.3, 272.5 223.7 C267.6 221.1, 264.3 216.1, 262.6 211.4 C260.8 206.7, 259.5 200.5, 262.2 195.4 C265 190.3, 275.4 183.1, 279.2 180.8 C283.1 178.6, 285 181.3, 285.3 181.7 M281 179.9 C286.4 178.6, 294.5 179.7, 299.7 182 C304.8 184.4, 309.5 189.1, 311.9 194.1 C314.4 199, 315.9 206.7, 314.4 211.9 C313 217, 308.4 222.1, 303.2 224.8 C298.1 227.5, 289.1 228.9, 283.4 228.1 C277.7 227.3, 273.2 223.8, 269.2 219.8 C265.2 215.9, 259.8 209.8, 259.4 204.7 C258.9 199.5, 262.6 193, 266.3 189.2 C270 185.3, 278.8 183, 281.5 181.7 C284.2 180.4, 282.3 180.9, 282.5 181.2&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M300.7 182.7 C305.7 184.8, 310.9 189.9, 313.2 194.6 C315.6 199.4, 316.6 206.3, 315 211.1 C313.3 215.9, 308.5 220.9, 303.3 223.5 C298.2 226.2, 290.2 227.8, 284.2 227.1 C278.3 226.5, 271.8 223.1, 267.8 219.5 C263.8 216, 260.5 210.6, 260.2 205.7 C259.9 200.7, 262.7 194, 266.2 189.9 C269.7 185.8, 275.2 182.2, 281.3 181.1 C287.4 180, 299.1 182.7, 302.9 183.3 C306.7 184, 304.7 184.6, 304.2 184.8 M300.3 181.7 C305.2 183.9, 309.8 190.9, 312.3 195.8 C314.8 200.6, 316.9 206.1, 315.3 210.7 C313.7 215.2, 307.6 219.9, 302.7 223 C297.7 226.1, 291 229.8, 285.5 229.2 C280 228.6, 273.8 223.4, 269.5 219.5 C265.2 215.6, 260.3 210.7, 259.6 205.7 C259 200.6, 261.9 193.7, 265.7 189.5 C269.5 185.3, 276.8 181.5, 282.5 180.5 C288.3 179.6, 297.3 183.3, 300.4 183.6 C303.4 184, 301 182.6, 300.9 182.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:18.04px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;288&quot; y=&quot;204.0&quot;&gt;*&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M222.7 270.4 C228.3 269.4, 236.1 271.7, 241.4 274.4 C246.8 277.1, 252.6 282, 254.8 286.6 C257 291.1, 257.1 297, 254.8 301.5 C252.6 306, 246.7 310.8, 241.5 313.5 C236.3 316.2, 229.4 318.5, 223.6 317.7 C217.9 316.9, 210.8 312.9, 207 308.8 C203.2 304.7, 200.9 298, 200.7 293 C200.6 288.1, 201.6 282.6, 206.1 278.9 C210.6 275.3, 222.9 272.1, 227.5 271 C232.1 269.8, 233.5 271.6, 233.6 272.1 M234.9 271.8 C240.4 272.5, 247.1 277.5, 250.7 281.2 C254.2 284.9, 256.5 289.3, 256.1 293.9 C255.6 298.5, 252.2 304.8, 248 308.7 C243.7 312.7, 236.7 316.8, 230.8 317.7 C224.9 318.7, 217.7 317.1, 212.6 314.3 C207.6 311.5, 202.1 306, 200.3 301 C198.5 296.1, 199.6 289.2, 201.9 284.5 C204.3 279.7, 209.2 275, 214.4 272.6 C219.6 270.2, 229.7 270.5, 233.1 270.3 C236.5 270.2, 234.6 270.9, 234.9 271.7&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M233.6 271.6 C239.2 272.2, 244.7 275.9, 248.4 279.7 C252 283.5, 255.3 289.6, 255.3 294.4 C255.4 299.2, 252.4 304.7, 248.5 308.3 C244.6 311.9, 237.8 314.9, 231.9 315.8 C226.1 316.8, 218.2 316.2, 213.2 313.9 C208.3 311.7, 204.1 306.9, 202.3 302.2 C200.5 297.5, 200.5 290.3, 202.3 285.7 C204.2 281, 207.8 276.7, 213.2 274.3 C218.6 272, 230.9 271.7, 234.8 271.5 C238.7 271.4, 236.8 273, 236.6 273.3 M223.9 269.9 C229.6 268.7, 237.1 271, 242.2 273.5 C247.3 276, 252.5 280.2, 254.5 284.9 C256.6 289.6, 256.8 296.6, 254.5 301.6 C252.3 306.6, 246.1 312.2, 240.9 314.9 C235.8 317.6, 229.6 319, 223.7 318 C217.8 317, 209.6 313.1, 205.6 309 C201.6 304.9, 199.6 298.3, 199.7 293.2 C199.9 288.2, 202.8 282.3, 206.5 278.8 C210.2 275.2, 219.3 273.1, 222 272 C224.7 270.9, 222.5 272, 222.7 272.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:18.04px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;228&quot; y=&quot;294.0&quot;&gt;3&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M356.7 270.6 C362.4 271.7, 368.6 276.7, 371.9 281 C375.1 285.4, 377.2 291.8, 376.4 296.7 C375.6 301.6, 371.6 307, 367 310.6 C362.5 314.3, 355 318.1, 349.1 318.6 C343.1 319.1, 336 316.6, 331.2 313.6 C326.5 310.6, 321.9 305.4, 320.5 300.5 C319.1 295.6, 320.4 289, 323.1 284.2 C325.8 279.5, 330.7 274.1, 336.7 272.1 C342.6 270.1, 354.4 272.1, 358.5 272.3 C362.7 272.5, 361.9 273.1, 361.7 273.2 M359.6 272.5 C364.4 274.8, 370 281.3, 372.4 286.2 C374.7 291.2, 375.3 297.3, 373.8 302.2 C372.2 307.1, 368.3 312.9, 363.3 315.6 C358.3 318.3, 349.8 319.3, 343.8 318.4 C337.7 317.4, 330.5 313.7, 326.8 309.8 C323.1 305.8, 321.6 299.6, 321.6 294.8 C321.5 290, 323.1 285.1, 326.8 280.8 C330.4 276.6, 337.9 270.9, 343.4 269.4 C348.9 268, 356.6 271.4, 359.5 272 C362.5 272.7, 360.9 273, 360.9 273.5&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M343.4 269.5 C348.8 268.5, 357.9 270.7, 363 273.5 C368.1 276.2, 371.9 281, 373.8 285.8 C375.7 290.6, 376.6 297.2, 374.4 302.2 C372.2 307.3, 366 313.6, 360.6 316.1 C355.2 318.6, 347.8 318.3, 342.1 317.2 C336.4 316, 329.8 313.5, 326.4 309.4 C322.9 305.3, 321.3 297.9, 321.4 292.7 C321.4 287.6, 322.3 282.5, 326.6 278.6 C330.9 274.7, 343.6 270.7, 347.4 269.3 C351.2 267.8, 349.3 269.5, 349.1 269.9 M352.5 268.9 C358 269.1, 363.3 273.6, 367 277.9 C370.6 282.1, 374.1 289, 374.4 294.2 C374.7 299.4, 372.5 305.4, 368.8 309.2 C365.2 313, 357.9 315.9, 352.4 317 C346.9 318.1, 341 318.3, 336 316 C331.1 313.6, 325.4 308, 322.8 302.9 C320.2 297.7, 319 290, 320.6 285.3 C322.2 280.6, 327.2 277, 332.5 274.5 C337.7 272.1, 348.9 271.1, 352.1 270.6 C355.2 270.2, 351.4 271.6, 351.4 272&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:18.04px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;348&quot; y=&quot;294.0&quot;&gt;4&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M107.2 47.4 C93.9 59.1, 82.9 73, 69.8 91.7 M107.8 48.6 C92.9 64.6, 77.5 80.8, 69.8 91.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M149.6 47.2 C159 61, 172 73.1, 185.3 89.9 M148.6 47.8 C159 58.6, 168.2 67.2, 186.9 89.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M188.3 137.1 C173.5 148.7, 163.6 163.2, 148.6 182 M187.6 137 C175 149.3, 164.6 163, 149.8 179.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M229.5 138.3 C240.8 148.2, 251.9 162.7, 268.1 179.1 M228.7 137.5 C238.6 149.3, 247 158.4, 266.6 179.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M271.9 230.4 C264.1 241.6, 257.5 253.2, 243.6 269 M271.5 228.9 C261.7 240.9, 253.8 253.6, 245.8 268&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M306.9 230.3 C313.8 239.8, 318.5 253.6, 330.6 267.1 M304.8 230.1 C314.9 243.4, 325.5 258.8, 330.4 268.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M398.2 150.4 C418.9 150.4, 434.6 151.5, 463.2 151.1 M400.5 149.5 C415 149.1, 429.6 148.6, 462.6 150.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M448.2 144.2 C453.8 146.2, 455.9 148.7, 462.9 150.8 M449.7 143.6 C452.7 145, 455.7 146.1, 462.4 150.4 M462.8 151.1 C457.4 151.8, 453.7 153.3, 448.4 157.3 M462.2 149.8 C458.2 151.9, 455.1 152.7, 449.1 155.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;431&quot; y=&quot;122.0&quot;&gt;flatten&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;470&quot; y=&quot;50.0&quot;&gt;one operation per line&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M478.9 86.6 C549.4 90.9, 619.1 85.5, 671.7 88.9 C679.7 90.3, 680.8 91.3, 676.7 95 C680.1 104.7, 678.9 122.3, 682.8 128.4 C676.7 134, 679.8 135.7, 673.2 137 C627.6 134, 586.3 132.3, 475.8 135.6 C471.8 135.5, 471.9 134.3, 467.8 128.9 C467.9 121.6, 467.7 112.8, 471.7 100.2 C468.7 96, 474.9 93.2, 476.3 89.3&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M478.7 88.4 C537.5 90.9, 595.2 91.8, 673.1 90.2 M478.5 89.3 C544.8 88.1, 611.8 89, 671.9 89.5 M672.3 90 C679 88.4, 678.6 91.9, 679.3 96.7 M671.7 90.2 C679.3 89.3, 677.8 91.7, 678.3 99.9 M680.2 97.4 C681.2 104.7, 678.4 114.3, 681.3 130.2 M680.9 98 C679.2 107.2, 680.3 116.6, 680.6 127.7 M680 128.3 C679.5 131.9, 677.7 135.1, 671.4 135.6 M678.4 127 C679.6 133.7, 679.6 137.2, 670.9 134.7 M672.5 134.6 C632 133, 589.3 133.2, 478.4 137.7 M672.7 135.7 C622.2 134.4, 571.3 135.6, 477.4 135 M477.7 136 C472.2 136.7, 469.1 132.3, 471.2 127.5 M479 136.8 C470.7 136.8, 468.3 134.6, 468.1 127.9 M469.3 130.3 C470.3 121.5, 469.6 114.6, 469.6 96.9 M470.2 128.3 C470.2 121.7, 469.3 113.7, 469.1 97.9 M470 97.7 C470.9 93.1, 472.7 88.9, 477.9 88.3 M471.1 99.2 C471.4 92, 474.5 88.3, 478.3 89.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:15.579999999999998px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;575&quot; y=&quot;113.0&quot;&gt;tmp.0 = 3 * 4&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M478.1 153.2 C550.5 148.8, 620.1 151, 669 152.6 C680.3 149.6, 681.6 153.5, 680.4 160.9 C683.1 166.4, 679.3 170.2, 677.3 191.4 C677.5 191.2, 679.1 196, 675.2 193 C607.5 194.6, 544.1 194.1, 475 192.7 C475.2 199.5, 471.9 190.1, 469.9 187.3 C471.5 182.5, 469.2 174.4, 468.3 159 C468.7 152.4, 472.7 152.3, 480.9 149&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M478.3 148.5 C522.5 149, 570.3 151.6, 674.3 150.6 M477.5 150.2 C528.6 148.4, 578.7 149.7, 671.3 149.3 M672.3 150 C678.3 149.9, 679.5 154.5, 679.9 157.4 M671.5 151 C679.5 150.3, 678.6 151, 680.1 159 M679 156.8 C680.6 165.3, 678.5 175.2, 680.5 190.2 M679.5 157.2 C679.7 168.7, 679.6 179.8, 679.6 187.7 M680 188.3 C679.6 195.3, 678 195.5, 674.3 195.5 M680.8 188.3 C681.1 193.4, 677.9 198, 671.5 197.2 M671.4 195.1 C606.3 196.7, 543.4 198.3, 476.5 194.9 M673.3 195.1 C624.7 196, 577.2 195.9, 478.4 195.8 M477.7 196 C473.5 194.9, 471.6 192.4, 469.3 187.3 M476.4 197.9 C471 196.1, 470.3 193.2, 469.2 186.5 M471 187.3 C468.4 180.3, 469.5 172.7, 469.8 158 M470 189.1 C471.2 178.4, 471 166.5, 469.6 157.7 M470 157.7 C468.3 152.9, 473.3 149.9, 476.5 149.2 M472 156.4 C469 151.8, 471.7 151.8, 479.7 149.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:15.579999999999998px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;575&quot; y=&quot;173.0&quot;&gt;tmp.1 = 2 + tmp.0&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M477.2 212.7 C544.4 206.6, 613.9 209.2, 673.6 209.1 C681 208.9, 682.4 215.7, 676.9 219.6 C678.8 227.1, 679.8 237.6, 679 247.2 C678.4 255.5, 678.4 256.4, 670 256.3 C626.4 255.2, 579.8 255.9, 474.1 257 C471.4 256.3, 472 253.1, 471.9 245.7 C467.9 243.4, 470.7 235.9, 472.1 217.8 C468.7 216, 470.6 211.5, 478.3 208.8&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M477.9 208.5 C550.5 211.1, 623.2 211.4, 671.5 211.1 M478.4 209.2 C551.2 208.8, 623.5 210.4, 672.8 209.2 M672.3 210 C677.6 211.4, 680.3 213.1, 680.5 218.2 M671.4 211.8 C679.7 211.4, 679.4 214.8, 681.9 218.1 M681.7 216.1 C680 226, 678.6 240, 679.6 250.2 M680.2 218.4 C680.2 224, 680.9 230.7, 680.6 247.7 M680 248.3 C679.8 254.7, 678.3 256, 673.2 255.4 M679.2 249.5 C678 253.1, 676.2 254.3, 672 255.1 M674.3 255.5 C623.6 256.5, 571.4 255.5, 478.6 256.1 M671.8 256.5 C627.1 257.7, 583.1 258.1, 477.5 256.5 M477.7 256 C470.8 257, 470.1 252.4, 471.5 247 M477.9 254.9 C471.4 255.4, 467.7 251.8, 470.3 249.7 M468.6 248.3 C471 239.1, 470 234.8, 470.1 219.2 M469.7 248 C470.2 241.3, 470.6 233.6, 470 217.4 M470 217.7 C469.7 212.7, 473.9 210.8, 479.2 210.2 M468.8 217.6 C471.1 211.6, 473.5 210.7, 476.6 209.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:15.579999999999998px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;575&quot; y=&quot;233.0&quot;&gt;x = tmp.1&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;470&quot; y=&quot;280.0&quot;&gt;top to bottom = order of execution&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;The nested tree for x = 2 + 3 * 4 flattened into Tacky: the multiplication, the addition and the assignment each become one line.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The nested tree became a flat, ordered list, each line doing one thing: one multiply, one add, one assignment. The &lt;code&gt;tmp.0&lt;/code&gt;, &lt;code&gt;tmp.1&lt;/code&gt; are temporaries — scratch variables Tacky invents, and it pretends it has &lt;em&gt;unlimited&lt;/em&gt; of them. That&#x27;s the same trick LLVM IR uses (it writes &lt;code&gt;%1&lt;/code&gt;, &lt;code&gt;%2&lt;/code&gt; instead of &lt;code&gt;tmp.0&lt;/code&gt;, &lt;code&gt;tmp.1&lt;/code&gt;); my hand-rolled Tacky is a tiny, single-target cousin of the big one. Building the small version myself is exactly what made LLVM &lt;em&gt;legible&lt;/em&gt; to me afterward — I finally knew what an IR was &lt;em&gt;for&lt;/em&gt;, because I&#x27;d needed one.&lt;/p&gt;
&lt;h2 id=&quot;the-middle-is-where-you-optimize&quot;&gt;The middle is where you optimize&lt;a class=&quot;anchor&quot; href=&quot;#the-middle-is-where-you-optimize&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Here&#x27;s what turned Tacky from &quot;extra busywork&quot; into the most interesting stage. Because it&#x27;s so flat and simple, it&#x27;s the perfect place to make the program faster &lt;em&gt;before&lt;/em&gt; any assembly exists. Look at that first line:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;tmp.0 = 3 * 4
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Both operands are constants — the answer is always &lt;code&gt;12&lt;/code&gt;, so there&#x27;s no reason to make the CPU compute it every run. A pass called &lt;strong&gt;constant folding&lt;/strong&gt; collapses it at compile time:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;; before:  tmp.0 = 3 * 4   ;  tmp.1 = 2 + tmp.0
; after:   x = 14
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The computation is &lt;em&gt;gone&lt;/em&gt;; the program just stores &lt;code&gt;14&lt;/code&gt;. That&#x27;s one optimization; real compilers stack hundreds — dead-code elimination, hoisting work out of loops, inlining — and nearly all of them happen here on the IR, because that&#x27;s where the program is simple enough to safely rewrite. This is exactly the machinery LLVM would have given me for free, and here I understood every line of it, because I wrote it.&lt;/p&gt;
&lt;h2 id=&quot;the-trade-i-actually-made&quot;&gt;The trade I actually made&lt;a class=&quot;anchor&quot; href=&quot;#the-trade-i-actually-made&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Let me be honest about what this cost, because &quot;I didn&#x27;t use the industry-standard tool&quot; deserves a real accounting.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What I gave up:&lt;/strong&gt; portability (Tacky targets x86-64 and nothing else — no ARM, no RISC-V without writing whole new backends), and a mountain of free, world-class optimization that would make LLVM output far faster than mine.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What I got:&lt;/strong&gt; I actually understand my compiler, top to bottom. There&#x27;s no stage where I shrug and say &quot;and then LLVM does something.&quot; When it breaks, I can read every line of IR and every instruction of assembly, because they&#x27;re mine. For a project whose entire purpose was &lt;em&gt;understanding&lt;/em&gt;, that&#x27;s not a consolation prize — it&#x27;s the whole point.&lt;/p&gt;
&lt;p&gt;If I were shipping a real language for people to use, I&#x27;d emit LLVM IR tomorrow and never look back. But I wasn&#x27;t shipping a language. I was trying to make the machine stop being magic. You can&#x27;t do that by hiding the machine behind LLVM.&lt;/p&gt;
&lt;h2 id=&quot;but-tacky-still-isnt-the-bottom&quot;&gt;But Tacky still isn&#x27;t the bottom&lt;a class=&quot;anchor&quot; href=&quot;#but-tacky-still-isnt-the-bottom&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Reread that Tacky:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;tmp.0 = 3 * 4
tmp.1 = 2 + tmp.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Those temporaries are a comfortable fiction. A real CPU has no unlimited &lt;code&gt;tmp&lt;/code&gt;s — it has a small, fixed set of physical registers with names Intel chose, and when you run out, values spill to slow memory. My backend has to do the hard, unglamorous work of cramming Tacky&#x27;s infinite temporaries onto that cramped real machine. Which means Tacky was never the floor either. It&#x27;s a clean &lt;em&gt;idea&lt;/em&gt; of a machine, and underneath it sits an actual one, made of silicon, running real instructions one line at a time.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -29 712 395&quot; width=&quot;712&quot; role=&quot;img&quot; aria-label=&quot;Unlimited temporaries versus real registers&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;0.0&quot;&gt;Tacky: unlimited temporaries&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;430&quot; y=&quot;0.0&quot;&gt;Real CPU&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M6.5 39.5 C37.5 40.3, 66.4 36.2, 140.9 39.6 C145.8 38.1, 149.3 42.7, 148.8 43.9 C146.7 56.7, 151.1 60.5, 148.5 74.3 C151.5 81.5, 146.6 82.5, 145.3 80.3 C113 82.2, 74.9 80, 9.7 81.4 C0.3 85, -0.4 78.5, 1.6 75.5 C-1.8 71.8, 1.1 60.2, 2 45.6 C1 45.6, 3.2 40, 6.7 41.6&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M6.2 42 C41.2 41.3, 77.7 38.9, 142.2 40.6 M7.1 39 C50.5 40.4, 95.8 41.6, 142.6 39.7 M143 40 C148.8 40.6, 150 42.9, 150 49 M144.1 38.9 C149.3 39, 150.6 44.5, 149.9 48.1 M148.8 48.3 C148.6 53.8, 151.7 65, 149.6 76.2 M150.6 46.9 C150.2 57, 149.7 67.5, 150.8 74.1 M150 75 C148.4 78.9, 146.5 82, 142.6 83.9 M150.2 74.6 C149.5 78.3, 149.5 82.4, 143.7 82.6 M141.8 84 C107.7 82.1, 70.6 82.7, 8 81.4 M143.6 82.4 C115.8 82.2, 87.9 80.6, 6.5 81.5 M7 82 C3.1 81.1, -1.9 77.7, 1.5 75.9 M8.4 80.8 C0.5 80.3, -1.4 77.7, 0.6 74.6 M-0.8 75.3 C-1.5 66.8, -1.7 54.8, 0.3 45.5 M0.1 75.3 C0 66.2, 0.7 56.2, 0.2 47.2 M0 47 C-1.1 40.8, 4.1 39.2, 5.3 41 M-0.2 47.4 C-1.2 44.3, 2.3 38.5, 7.4 38.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;75&quot; y=&quot;61.0&quot;&gt;tmp.0&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M5.7 95 C38.7 94, 67.6 97.5, 145.4 99.3 C146.4 93.4, 150.1 100.9, 152.5 105.8 C149.7 113.2, 151.5 116.3, 150.2 133.3 C152.4 134.7, 145.9 138.8, 140.1 139.5 C99.1 138.7, 52.2 137.7, 8.9 134.5 C3.7 137.7, -0.4 137.5, 3.6 129.9 C1.8 121.6, 2.6 117.7, -1.5 100.4 C1 97.9, 1 95.2, 4.2 97.4&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M5.8 94.1 C61.4 95.1, 114.9 94.4, 143.4 97.1 M6 95.9 C39.2 95.8, 72.7 95.4, 142.1 95.6 M143 96 C148.1 94.1, 150.9 97.5, 150.6 101.7 M143.9 95.7 C149.5 96.1, 151.4 99.7, 151.7 103.2 M151.5 103.7 C148 114.3, 151.8 121.6, 148.8 132.2 M149.3 102.1 C150.6 108.7, 151 115.2, 149.8 130.1 M150 131 C148.6 134.3, 146.8 138.4, 141.5 139.8 M148.5 131.8 C151 134, 147.8 139.3, 144.3 136.5 M144.7 136.4 C89.3 138.4, 35.2 136.3, 6.1 138.6 M142.1 137.8 C90.3 137.5, 37.8 138.6, 7.5 138.2 M7 138 C0.3 139.2, 0.6 133.7, -0.3 131.6 M5.9 137.8 C0.8 140.2, 0.6 136.9, 1.7 129.2 M0.9 132.3 C0.6 121.6, -1.7 109, 0.5 102.7 M-0.1 130.1 C1 124.8, 0.4 118.7, 0.6 103 M0 103 C0.3 96.7, 0.7 96.1, 7.9 98 M0.6 104.6 C1 100.1, 4 98, 8.9 94.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;75&quot; y=&quot;117.0&quot;&gt;tmp.1&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M4.8 150.4 C39.9 154.8, 68.9 151.5, 142.8 151.9 C147.1 148.7, 151 151.8, 149.1 160.5 C152.7 169.6, 151.9 179.3, 151.9 185.1 C153.2 195.1, 145.2 195.2, 142.2 191.6 C112.4 195.3, 76.6 195.5, 8.1 194.8 C-0.1 190.5, -0.3 189.3, -1.6 184.3 C-1.9 178.5, -3.1 175.2, 2.3 162.5 C1 157.5, -1.1 150.4, 8.8 153.2&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M5.4 150.1 C50.3 152.9, 97.8 154, 144.6 153.5 M7 152.9 C55.1 152, 103.9 151.9, 143.6 151.5 M143 152 C147.4 151.6, 151.8 156, 151.2 158.5 M143.8 152.5 C149.7 153.2, 152.1 155, 148.9 158.2 M150.3 159 C151.4 170.8, 151.9 182.2, 151.9 188.2 M149.9 159.3 C150.6 166.1, 149.7 176, 150.8 186.1 M150 187 C148.7 189.7, 147 194.8, 144.4 195.6 M150.9 185.1 C147.9 189.7, 146.1 196.2, 144.8 195 M143.6 192.8 C102.2 190.7, 58.3 194, 8.3 195.8 M142.6 193.2 C91.9 194.7, 42.1 194.5, 6.6 194.9 M7 194 C1.6 193.3, -0.9 189.8, 1.8 187.4 M7.4 194.8 C1.2 195.5, -2 191.5, -1.8 188.4 M-1.5 185.3 C-0.7 176.5, -1.3 167.1, 0.7 159.8 M-0.4 186.9 C0 177.8, 0.1 170.1, -0.9 158.8 M0 159 C1.7 152.5, 1.3 153.1, 6.6 150.9 M1.5 157.8 C-1.5 155.9, 1.2 152.9, 5.7 150.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;75&quot; y=&quot;173.0&quot;&gt;tmp.2&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M4 205.9 C33.8 208.4, 62.9 205.5, 140.2 211.6 C147.8 211.2, 151.8 210, 152.8 215.2 C148.4 220.4, 152.3 231.1, 153.6 244.1 C146.8 248.2, 144.6 251.6, 144.2 250.8 C91.2 251.9, 46.7 253.2, 7.3 247.9 C3.3 250.5, -0.3 248.3, 0.4 245.9 C1.7 235.4, -1.7 232.8, -1.2 217.3 C1 209.9, 3.9 205.6, 6.3 209&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M9 206.2 C43.2 208, 76.6 206.8, 141.8 210 M7.9 207.8 C43.8 208.2, 80.7 208.3, 143.1 207.4 M143 208 C146.7 209.1, 148.7 210.6, 151.8 215.3 M143.7 209.3 C149.9 210.2, 148.3 210.3, 150.7 213.3 M149 214.4 C150.8 221.7, 148 227.6, 151.1 244.3 M150.6 214.5 C149 225.4, 149 234.9, 149.9 242 M150 243 C148.9 249.1, 147.3 251.3, 143.2 251.5 M149.3 242.3 C149.4 245.5, 149 248.5, 140.7 248.9 M142.5 249.3 C111 249.6, 77.3 250.4, 6.4 249 M143.2 250.6 C93.6 249.3, 44.4 249.7, 7.7 249.7 M7 250 C2.9 251.5, 1.5 245.8, 0 243.1 M8.9 251.9 C1.5 250.8, 0 246.1, -0.7 243.1 M0.2 242.3 C1.3 231.4, -1.4 221.2, 0.9 217 M-0.7 243.7 C0.9 236.4, -0.3 232.6, -0.5 214.6 M0 215 C-1 212.3, 1.9 210, 5.2 207.9 M-1.7 215 C0.7 211.7, 3 207.7, 7.1 205.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;75&quot; y=&quot;229.0&quot;&gt;tmp.3&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M10.4 261.3 C35 262.1, 64.2 266.8, 144.7 264.1 C148.4 266.5, 152.6 268.2, 149.3 269.9 C150.4 276.9, 151.7 286.9, 148.1 295.9 C147.6 301.4, 151.1 307.9, 146.2 302.9 C104.5 308.4, 71.2 303.8, 6.5 308.2 C-0.5 303.3, -0.2 300.1, 2.5 300.3 C-1.9 292.3, -0.2 290.3, 2.6 272.1 C1 269.5, 1.7 260.7, 3.7 264.8&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M8.6 262.2 C59.3 261.9, 113.8 262.4, 143.1 262.5 M6.9 264.7 C59.6 264.4, 112 264.8, 142.6 263.3 M143 264 C146 262.5, 149.5 265.2, 148.3 272 M143.5 262.1 C145.5 262.7, 149.1 265.5, 147.9 273 M151.8 269.7 C150.2 278.2, 148.1 288.2, 150.2 300.3 M149.2 271.7 C149.5 282.8, 150.2 293.8, 150.9 300 M150 299 C149 304.5, 147.6 307.7, 142.1 307.4 M151.7 299.6 C150.9 305.8, 147.3 305.3, 141.3 307.4 M141.4 305.7 C92.6 305.9, 45.9 304.1, 8.5 306.1 M143.7 306 C95.2 306.6, 48.7 305.6, 6.8 306.4 M7 306 C4.2 305.6, 0 301.8, -1.8 298.9 M6.3 304.9 C1.9 306, 2 305.3, 0.5 297.7 M1.8 299.3 C0 291.8, -0.9 286.6, 1.2 270.1 M-0.9 298.5 C-0.6 291.3, -1.1 281.9, -0.1 270.3 M0 271 C0.4 268.1, 2.6 262.9, 7.9 264.8 M-0.8 272.1 C-1.8 267.5, 0.2 262.6, 8.5 266&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;75&quot; y=&quot;285.0&quot;&gt;tmp.4 …&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M440 40.3 C489.1 40.1, 536.8 39.7, 669.3 42.5 C676.6 42.7, 676.5 42.6, 676.7 52.4 C684 74.4, 680.8 98.6, 678.3 126.6 C679.7 138.4, 679.1 138.4, 670.5 137.7 C620.2 142.9, 576 143.4, 442.4 139.4 C434 138.4, 428.2 133.7, 430.7 127.3 C428.2 96.6, 426.9 71, 431.7 51.4 C430.8 45.8, 430.4 36.7, 440.4 38.6&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M440.3 39.5 C516.3 42.8, 591.8 42.6, 668.5 41.4 M440.7 39.6 C508.9 38.6, 577.6 39.3, 669.3 39.9 M670 40 C675.6 38.4, 678 44.3, 681.9 51.5 M669.5 38.6 C675.6 40.5, 681.3 45, 681.4 50.1 M680 49.6 C679.6 73.2, 680.9 95.3, 679.4 131.9 M680.6 49.9 C679.5 72.1, 680.2 94.6, 679.4 130.4 M680 130 C681.9 136.5, 674.9 140.4, 669.2 141.9 M680.3 130.7 C678.9 136.5, 674.9 137.9, 669.6 142.2 M669.7 140.2 C600.9 141.9, 533.4 142.5, 440.6 141.2 M670.7 139.9 C593.4 141, 517.7 140.7, 440.5 139.5 M440 140 C434.3 141.9, 428.8 137.6, 430.1 131.3 M438.5 138.3 C432.2 138.6, 429.1 134.9, 432.1 128.7 M429.2 128.6 C427.5 111.8, 429 91.3, 430 51.7 M430.1 130.6 C429.1 111.8, 429.8 93.5, 430.9 49.6 M430 50 C428.8 45.1, 433.3 41.3, 439 41.7 M431.4 48.5 C431.3 43.4, 434.4 40.8, 439.5 41&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;555&quot; y=&quot;78.8&quot;&gt;a small, fixed set of&lt;/tspan&gt;&lt;tspan x=&quot;555&quot; y=&quot;101.3&quot;&gt;registers (about 16)&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M439.3 221.7 C519.6 219.7, 601.3 217.8, 668.1 220.6 C674.6 216.9, 681.2 222.9, 677.5 231.7 C676.4 257.8, 678.6 282.9, 678 307.9 C680.8 318.8, 673.1 316.5, 669.4 322 C603.3 322.6, 534.8 321.4, 442.9 318.8 C430.6 321.4, 428.7 315.6, 431.9 312.5 C427.9 288.1, 427.7 263.5, 431 227.5 C432 224.5, 433.1 217.5, 440.4 217.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M440.4 219.5 C518.3 220.9, 600.7 220.3, 669.9 221.4 M439.2 220.5 C513.4 217.8, 587 219.3, 669.9 219.2 M670 220 C677.2 218.6, 679.4 221.6, 681.7 229.5 M668.9 221.7 C678.5 218.6, 682 223.1, 681.2 231.8 M678.3 229.6 C677.4 258, 681 287.7, 680.1 309.3 M680.5 230 C680.7 258.7, 680.7 288.2, 679.1 309.1 M680 310 C680.9 317.3, 676.5 318.3, 668.7 320.3 M678.1 308.1 C681.8 316.2, 675.9 321, 672.2 320.6 M670.1 321.2 C584.3 320, 498.6 318, 440.7 319.4 M670.6 320.2 C607.9 320.6, 546.7 320.1, 440.1 320.1 M440 320 C432.3 320, 430.4 315, 430 310.1 M441.6 321.2 C435.3 318.1, 431.6 316.2, 431.8 310.3 M430.7 311.6 C430 291.8, 429.8 271.1, 432 228.7 M429.4 309.5 C430.4 293.2, 430.6 275.9, 430.3 229.9 M430 230 C431.5 222, 433.2 220.1, 441.8 220.5 M431 229.6 C432.2 221.5, 433.1 218.9, 441.6 219.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;555&quot; y=&quot;258.8&quot;&gt;memory&lt;/tspan&gt;&lt;tspan x=&quot;555&quot; y=&quot;281.3&quot;&gt;big, but slow&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M160.6 42.9 C162.8 42.7, 170.9 18.8, 173.4 43.4 C175.8 68, 177.4 165.9, 175.1 190.4 C172.9 214.8, 162.6 190.2, 160 190.3 M159.4 44.9 C162 44.9, 173.2 20.8, 175.8 44.6 C178.3 68.5, 177.5 163.7, 175 188.2 C172.4 212.7, 163 191, 160.3 191.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M160 211.7 C162.3 211.9, 170.8 197.4, 173 212.3 C175.3 227.1, 175.6 286, 173.3 300.9 C170.9 315.9, 161.1 301.6, 158.9 302&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;path d=&quot;M178.1 115.6 C238.6 112.6, 297.6 104.3, 429.1 89.1 M177.7 117.2 C241.7 107.6, 305.4 101.5, 428.4 90&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M414.9 84.1 C418.4 87.1, 420.4 86.7, 428.9 89.3 M414.5 85.5 C417.9 85.8, 421 87.7, 428.3 90 M426.8 89 C424.6 91.4, 419.6 96.5, 416.7 98 M428 89.6 C424.7 91.8, 420.6 93.6, 416.5 98.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;300&quot; y=&quot;78.0&quot;&gt;these fit&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M178.6 255.5 C238.8 258.1, 298.3 261.3, 427 270.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;path d=&quot;M416.2 262 C419.1 264.1, 421.3 265.7, 427.1 270.8 M428.7 269.3 C424.1 270.8, 421 274.4, 414.4 276&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;300&quot; y=&quot;286.0&quot;&gt;no room: spill&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;340.0&quot;&gt;the backend has to cram the left onto the right&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;Tacky&amp;#x27;s temporaries are unlimited; the real CPU has a few registers, and whatever does not fit spills to memory.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;I&#x27;d built a middle and optimized on a machine that doesn&#x27;t exist. I still hadn&#x27;t looked the real one in the eye.&lt;/p&gt;
&lt;h2 id=&quot;one-floor-down&quot;&gt;One floor down&lt;a class=&quot;anchor&quot; href=&quot;#one-floor-down&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Time to stop routing around the machine and meet it. Registers you can count on one hand. Instructions the silicon runs directly. And the ancient rift that splits every processor into two families — the x86-64 my compiler targets, and the ARM inside the very Mac I compile on.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So what does the chip actually eat?&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>What the Chip Actually Eats</title><link>https://your-moon.github.io/s2-3-assembly/</link><guid>https://your-moon.github.io/s2-3-assembly/</guid><pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate><description>&lt;h1 id=&quot;what-the-chip-actually-eats&quot;&gt;What the Chip Actually Eats&lt;a class=&quot;anchor&quot; href=&quot;#what-the-chip-actually-eats&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Building my own programming language — Season 2: To the Metal · Part 3: Assembly &amp;amp; the CPU&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;My compiler had been writing a language I couldn&#x27;t read.&lt;/p&gt;
&lt;p&gt;It emitted lines like &lt;code&gt;mov eax, 2&lt;/code&gt; and &lt;code&gt;add eax, 3&lt;/code&gt;, and I understood their &lt;em&gt;shape&lt;/em&gt; — put a number somewhere, add another number to it — but I couldn&#x27;t have told you what &lt;code&gt;eax&lt;/code&gt; really was, or how the processor marches through these lines, or why the ARM chip in my phone speaks a completely different dialect than the Intel chip in my laptop. My program spoke fluent assembly. I didn&#x27;t.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-2 24 529 188&quot; width=&quot;529&quot; role=&quot;img&quot; aria-label=&quot;Fluent assembly, not me&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M29 42.5 C33 40.6, 38.6 41.2, 42.8 42.6 C47 43.9, 51.8 46.6, 54.1 50.5 C56.3 54.4, 57 61.4, 56.3 65.9 C55.7 70.3, 53.4 74.4, 50 77.3 C46.6 80.1, 40.5 82.7, 36 82.9 C31.5 83.1, 26.5 81.3, 22.9 78.4 C19.4 75.4, 15.8 69.8, 14.8 65.3 C13.8 60.8, 14.2 55.2, 17 51.3 C19.7 47.5, 28.8 43.9, 31.3 42.2 C33.9 40.4, 32.4 40.5, 32.3 40.9 M29.3 42.2 C33.6 40.8, 40.5 42.1, 44.4 43.6 C48.4 45.1, 51.4 47.4, 53.3 51.4 C55.1 55.4, 56.2 62.9, 55.4 67.6 C54.6 72.3, 51.7 77.1, 48.4 79.5 C45 81.9, 40.1 82.2, 35.5 81.9 C30.9 81.7, 23.9 80.6, 20.6 78 C17.2 75.3, 15.8 70.4, 15.4 66.1 C15 61.8, 15.4 56.2, 17.9 52.2 C20.4 48.1, 28.4 43.6, 30.4 41.7 C32.4 39.9, 29.7 40.4, 29.9 40.9&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M38.5 41.5 C42.8 42, 48.5 44.3, 51.8 47.7 C55 51, 57.7 56.9, 57.9 61.5 C58.1 66.1, 56 71.6, 53 75.3 C50 79, 44.3 82.9, 39.7 83.8 C35.1 84.6, 29 82.7, 25.2 80.4 C21.5 78.2, 18.8 74.7, 17.2 70.4 C15.5 66.2, 13.8 59.7, 15.2 55.1 C16.6 50.6, 21.7 45.6, 25.8 43.1 C30 40.6, 37.4 40.6, 40.2 40.4 C42.9 40.2, 42.4 41.4, 42.5 41.9 M29.8 41.2 C33.6 39.6, 39 41.2, 42.8 42.8 C46.6 44.5, 50.5 47.4, 52.6 51 C54.8 54.5, 56 60, 55.5 64.4 C55.1 68.8, 53.2 74.2, 49.8 77.5 C46.4 80.9, 39.7 84, 35.2 84.4 C30.7 84.8, 26 82.6, 22.7 79.7 C19.3 76.8, 15.8 71.5, 14.9 67.1 C14.1 62.7, 15 57.2, 17.5 53.2 C20 49.2, 28.2 45, 29.8 43.1 C31.5 41.3, 27.8 42, 27.5 42.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M26.8 53.3 C27.3 53, 29.1 52.5, 29.7 52.9 C30.2 53.2, 30.2 54.9, 30.2 55.4 C30.3 56, 30 55.6, 30 56.2 C30 56.9, 30.7 58.9, 30.1 59.3 C29.6 59.6, 27.5 58.7, 26.8 58.5 C26.2 58.4, 26.4 58.7, 26.2 58.2 C26 57.7, 25.6 56.1, 25.4 55.3 C25.3 54.5, 24.9 53.8, 25.4 53.4 C25.9 52.9, 27.9 52.6, 28.4 52.6 C28.8 52.5, 28 53.1, 28 53.1 M25.3 52.3 C25.8 52, 26.6 53.3, 27.5 53.7 C28.4 54.1, 30.1 54.3, 30.9 54.5 C31.6 54.8, 32.4 54.8, 32.1 55.3 C31.8 55.7, 29.4 56.4, 28.9 57.1 C28.4 57.8, 29.4 59.2, 29.1 59.3 C28.8 59.3, 27.9 58, 27.2 57.4 C26.4 56.8, 25 56, 24.5 55.6 C24.1 55.3, 23.8 56.1, 24.3 55.5 C24.9 55, 27.3 52.6, 27.7 52.5 C28.2 52.4, 27.2 54.6, 26.9 54.8&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M27.7 53.5 C28.4 53.6, 30.1 54.1, 30.5 54.5 C31 54.8, 30.5 54.8, 30.3 55.5 C30.1 56.2, 29.8 58.1, 29.3 58.6 C28.9 59.1, 28.1 58.6, 27.6 58.5 C27.2 58.5, 27 58.6, 26.5 58.4 C26 58.1, 25.1 57.8, 24.8 57.2 C24.5 56.5, 24.6 55.4, 24.7 54.7 C24.9 54, 25 53, 25.7 52.8 C26.4 52.7, 28.3 53.9, 29 54 C29.7 54, 30 53.4, 29.8 53.1 M27.3 53 C27.9 53.3, 29.5 54.3, 30 54.7 C30.4 55.2, 30.2 55.4, 30.1 55.7 C30.1 55.9, 29.9 55.8, 29.6 56.2 C29.4 56.7, 28.9 57.8, 28.5 58.2 C28.1 58.7, 27.9 58.9, 27.3 58.8 C26.7 58.8, 25.5 58.5, 25 57.9 C24.5 57.3, 24.2 55.9, 24.3 55.2 C24.5 54.4, 25.3 53.9, 26 53.6 C26.7 53.2, 28.3 53.1, 28.6 53 C28.9 53, 27.8 53.1, 27.9 53.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M44 53.5 C44.7 53.5, 46 53.8, 46.3 54.1 C46.6 54.3, 45.9 54.4, 45.8 54.9 C45.8 55.4, 46 56.6, 45.7 57.2 C45.5 57.8, 44.6 58.5, 44.3 58.7 C44.1 58.8, 44.5 58.2, 44.1 58.1 C43.8 58.1, 42.8 58.7, 42.1 58.1 C41.5 57.6, 40.3 55.5, 40.2 55 C40.2 54.4, 41.1 55.1, 41.8 54.9 C42.5 54.7, 43.9 53.8, 44.4 53.6 C44.9 53.4, 44.7 53.9, 44.6 53.8 M45.4 53.8 C46.1 53.9, 46.6 54.4, 46.8 54.6 C47 54.8, 46.5 54.4, 46.5 55 C46.5 55.6, 46.8 57.7, 46.6 58.4 C46.4 59.1, 45.8 59.6, 45.3 59.3 C44.8 59.1, 44.1 57.4, 43.4 57.1 C42.6 56.7, 40.9 57.5, 40.8 57 C40.7 56.4, 42.1 54.4, 42.6 53.8 C43.2 53.2, 43.6 53.5, 44.2 53.2 C44.8 52.8, 46.1 51.5, 46.2 51.7 C46.4 51.9, 45.3 54.3, 45.1 54.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M44 53.8 C44.4 53.9, 44.7 53.3, 45.2 53.6 C45.7 53.8, 46.8 54.7, 46.9 55.4 C47 56, 46.1 56.7, 45.8 57.3 C45.4 57.9, 45.4 58.9, 44.9 59 C44.4 59.1, 43.4 58.1, 42.8 58 C42.2 57.9, 41.7 58.8, 41.4 58.2 C41.1 57.6, 40.9 55.1, 41 54.2 C41.2 53.4, 41.9 53.1, 42.3 53 C42.8 53, 43.2 53.9, 43.8 53.9 C44.4 54, 45.7 53.2, 45.8 53.2 M45.3 54.1 C46.1 53.9, 46.6 52.2, 46.9 52.7 C47.2 53.2, 47.2 56.3, 47 57 C46.7 57.7, 46.2 56.4, 45.5 56.7 C44.9 56.9, 43.4 57.7, 43.1 58.3 C42.9 58.8, 44.3 60.4, 43.8 60 C43.3 59.7, 40.8 56.8, 40.2 56.1 C39.5 55.4, 39.6 56.1, 40 55.8 C40.4 55.6, 41.8 55.1, 42.6 54.5 C43.4 54, 44.2 52.4, 44.8 52.4 C45.3 52.3, 45.7 54.3, 45.8 54.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M28 73 C29.8 70, 34.3 68.7, 34.4 69.2 M28.5 73 C33 71.2, 32.8 68.6, 38.2 70.6 M36 71 C39.5 73.6, 38.7 73.9, 44.9 68.9 M36 71.3 C37 72.9, 42.3 74.7, 45.1 71.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M37 84.2 C36 97.1, 36.9 111.4, 37 149.6 M35.4 84.6 C35 99.6, 36.3 113.3, 35 150.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M37.5 150.1 C31.3 160.7, 28.2 168.9, 14.4 197.7 M36.3 149.8 C29.9 164.2, 24.4 176.6, 16 196.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M34.1 149.9 C40.8 159, 47.2 169.5, 55.8 195.9 M35.1 149 C43.3 166.9, 49.8 182.5, 55 195.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M34.7 101.8 C31.2 109.4, 24.8 114.7, 15.2 130.1 M36 102.3 C30.3 107.5, 26.1 115.6, 14 131.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M35.6 101.6 C42.3 99.3, 71.9 96.1, 75.8 88.1 C79.8 80.1, 61.9 59.3, 59.3 53.5 M37.5 100.3 C44.2 98.3, 70.7 97.3, 74.8 89.7 C78.8 82, 64.2 60.5, 61.8 54.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M150.6 51.4 C217.9 52.2, 287.7 55.6, 372.6 51.2 C382.6 59.6, 389.5 62.7, 397.3 75 C398.8 97.7, 397.5 117.6, 401.7 159.2 C305.4 158.6, 206.8 155.7, 151 157.6 C152.1 131.4, 150.8 106, 150.3 50.6&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M149.9 49.6 C199.8 49, 249.1 48.3, 374 48.6 M149.8 50.6 C226.1 49.4, 300.5 49.8, 374 50.1 M375.7 50 C377.6 56.2, 383.4 59.8, 400.5 76.5 M374 50.6 C383.3 58.9, 392.6 69.7, 400.4 77 M401.3 78 C399.3 108.7, 398.7 139.6, 399.6 160.1 M399.3 76.9 C399.8 105.4, 399.7 133.8, 399.2 160.8 M399.9 160.7 C303.9 156.9, 205.9 157.9, 149.4 160.9 M399.4 160.1 C313.1 161.6, 226.7 161.3, 150.6 160 M149.8 161.5 C148.4 115.3, 150 73.4, 151.8 50.2 M150.9 159.7 C148.8 124, 148.2 88.6, 149.9 49.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M372.9 50.1 C373.2 54.5, 370.4 72.6, 375.1 77 C379.8 81.4, 396.9 76.6, 401.1 76.6 M374.5 49.1 C374.9 53.1, 370.3 71.1, 374.7 75.4 C379.1 79.6, 396.5 74.6, 400.8 74.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;166&quot; y=&quot;93.0&quot;&gt;mov eax, 2&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;166&quot; y=&quot;117.0&quot;&gt;add eax, 3&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:44px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;450&quot; y=&quot;70.0&quot;&gt;?&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:44px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;500&quot; y=&quot;140.0&quot;&gt;?&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;So I finally sat down and learned to read what the chip eats. It&#x27;s smaller than you&#x27;d think. A processor&#x27;s entire vocabulary is: hold a few numbers, do arithmetic on them, and jump around. That&#x27;s most of it. Let me show you.&lt;/p&gt;
&lt;h2 id=&quot;registers-the-whole-desk-is-this-small&quot;&gt;Registers: the whole desk is this small&lt;a class=&quot;anchor&quot; href=&quot;#registers-the-whole-desk-is-this-small&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Start with the thing I kept hand-waving: a &lt;strong&gt;register&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;A register is a tiny slot that holds one number, and it lives &lt;em&gt;physically on the CPU&lt;/em&gt; — not in memory, but on the silicon itself, right where the work happens. That&#x27;s what makes it fast: the processor doesn&#x27;t have to reach out to memory to use it. It&#x27;s already holding it.&lt;/p&gt;
&lt;p&gt;And now the part that surprised me. A CPU has almost none of them. An x86-64 processor gives you about &lt;strong&gt;16&lt;/strong&gt; general-purpose registers with names like &lt;code&gt;rax&lt;/code&gt;, &lt;code&gt;rbx&lt;/code&gt;, &lt;code&gt;rcx&lt;/code&gt;, &lt;code&gt;rsp&lt;/code&gt;. Sixteen little slots. That&#x27;s the desk the processor works on. Everything else — every variable, every array, the whole gigabytes of your program&#x27;s memory — is in a filing cabinet across the room, and the CPU can only &lt;em&gt;think&lt;/em&gt; about what&#x27;s on the desk. Its entire life is shuffling numbers between the tiny fast desk and the huge slow cabinet.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -29 712 325&quot; width=&quot;712&quot; role=&quot;img&quot; aria-label=&quot;Registers and memory&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;0.0&quot;&gt;The desk: on the CPU&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;28.0&quot;&gt;about 16 registers, very fast&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M11.1 59.7 C103.5 57.6, 193.9 60.3, 249.7 60.9 M10.2 60.2 C78.6 57.8, 148 57.8, 250.2 60.4 M250 60 C255.1 61, 258.5 64.9, 261.5 70.1 M249.4 58.5 C258.5 61.4, 260.9 64.3, 257.7 69.5 M261.2 70 C259.1 138.5, 258.5 204.4, 258.3 271.1 M260 70.7 C261.3 131.3, 260.4 194, 260 270.1 M260 270 C261.4 277.6, 257.7 279.8, 249 281.8 M259 270.5 C260.4 277.2, 254.8 281, 251.3 280.9 M249.3 279.5 C173.3 280.5, 97.1 281.4, 8.9 281.3 M250.1 279.2 C200.2 281.4, 150.1 281.5, 9.2 279.4 M10 280 C1.6 280.4, -1.9 277.6, -1.5 271.8 M8.9 278.6 C1.8 279.1, 1.8 278.7, -0.7 271.3 M-0.8 269.7 C1.8 193, 2.2 117.9, -0.6 68.8 M-0.1 270.8 C0.4 217.5, -1 166.1, -0.2 70.4 M0 70 C0.5 64, 4.5 61.9, 9.9 61.1 M-1 70.9 C-1 61, 2.4 62.1, 12.1 59.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M29.1 87.9 C53.8 83.6, 85.9 86.5, 111.9 87.8 C118.8 84.4, 120.1 88.1, 120.1 89.6 C116.8 102.7, 120.6 111.4, 117.8 121.3 C119.1 129.6, 118.1 130.3, 115 125.8 C86.1 127.6, 59.2 131.4, 28.7 130.4 C22.5 131.2, 17.8 123, 20.3 121 C18.7 112.2, 23.4 100.6, 18.4 93.6 C18.8 86, 25.8 84.4, 29.8 82&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M26.5 84.7 C60.3 85.1, 93.3 84.7, 112.3 85.3 M27.8 84.6 C44.8 86.1, 62.9 84.8, 113.4 85.2 M112.7 85 C116 86.6, 121.3 85.6, 121.2 93.9 M112.5 85.1 C117.9 83.4, 119.2 89.2, 119.3 91.4 M121.5 94.2 C120.6 101.6, 120.3 113.7, 118.4 120.3 M120.9 91.8 C120.5 99.2, 120.4 107.3, 119.4 122.2 M120 121.7 C118.4 125.9, 117.6 130.5, 112 127 M120.3 121.1 C119.8 124.5, 116.4 130.8, 113.4 128.1 M113 130.5 C81.5 129.3, 46.2 129.1, 26.1 127.8 M112.6 129.1 C87.3 129.1, 63.8 130, 27.1 128 M27.3 129 C22.6 127.9, 19.8 128.4, 18.1 122.2 M28.7 129.5 C24.5 129.4, 19.5 126.2, 21.2 122.7 M19.4 120.9 C20.2 113.4, 18.5 108.8, 20.7 92.1 M19.6 121.3 C20.8 115.6, 20 106.7, 19 91.7 M20 92.3 C20.4 87.9, 23.8 86.2, 26.2 84.2 M20.6 91 C22.2 89, 21.2 85, 25.9 85.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:15.579999999999998px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;70&quot; y=&quot;107.0&quot;&gt;rax&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M144.9 85.6 C170.1 89.1, 200.4 82.4, 229.3 87.9 C237.9 83.8, 237.1 90.5, 239.9 92.4 C241.1 99.4, 238.1 107.2, 240.1 121.1 C243.1 128, 238.8 127.2, 232.8 125.8 C204.4 125.4, 176.3 129.9, 145.1 127 C140.2 125.5, 139.3 129.7, 138.5 122.3 C143.5 119.2, 140.6 112.2, 139.7 92.7 C138.4 89.1, 143.4 87.6, 149.8 82.4&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M145.9 86.4 C175 86.4, 205.8 83.5, 234.4 83.5 M147.4 85.2 C179.6 85.9, 213.9 86.3, 233.6 85.8 M232.7 85 C238.3 84.8, 240.6 89.2, 239 93.8 M231.9 86.2 C239.6 84.3, 240.1 89.4, 239.8 90.4 M238.9 94 C242.1 98.1, 239.4 105.9, 240.1 120.8 M241 92.7 C240 100.3, 239.1 108.5, 239.6 121.1 M240 121.7 C239.1 126.7, 237.9 128.2, 233 127 M238 120 C240.3 125.2, 238.3 130.4, 231.5 127.3 M231.4 128.2 C212.3 130.2, 193.7 130.1, 147.9 128.6 M233.4 128.3 C210.9 128.1, 189.3 129.2, 146.5 129.2 M147.3 129 C142.4 129.9, 140 125.4, 141.6 122 M146.8 129 C141.7 129.9, 141.8 124.4, 138.8 121.9 M138.6 119.9 C138.7 113.4, 142 105.1, 139.6 91.6 M139.3 122.3 C139.7 112.1, 141 102.3, 140.9 92.7 M140 92.3 C138.9 86.3, 143.3 86.6, 148.6 85.4 M138.7 91.4 C139.5 87.2, 141 86.6, 148.8 84.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:15.579999999999998px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;190&quot; y=&quot;107.0&quot;&gt;rbx&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M27.9 148.4 C46.4 149.4, 67.7 147.4, 113.9 153.1 C117 148.2, 121.3 150.8, 119.6 160.2 C117.3 161.1, 121.8 168, 122.4 185.9 C120 191.4, 119.5 196.3, 110.5 190.9 C82.7 195.3, 46.1 193.4, 28.8 195.8 C25.2 192, 20.9 194.1, 16.7 188.5 C21.2 178.2, 17.7 169.9, 20.9 156.7 C17.9 149.9, 21 148.6, 29.7 147.9&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M29.3 149.1 C53.6 148.8, 78.2 151.4, 112.4 150.7 M27 150.8 C59.4 150.7, 90.7 150.8, 111.8 149.4 M112.7 150 C116.5 148.1, 119.8 153.9, 120.8 158.7 M111.2 148.2 C116.7 150.1, 121 154.6, 120.3 159 M120.3 158.9 C119 165.4, 121.8 178.8, 121.7 186.3 M121 156.7 C119.5 168.4, 119.7 176.7, 119.8 187.1 M120 186.7 C119.8 192.4, 118.2 195, 114.1 192.1 M119.8 187.8 C120.9 191, 115.7 195, 114.3 196.2 M113.7 194.9 C90.1 192, 67.1 192.1, 25.6 194.4 M112.3 194.4 C92.6 193.8, 72.9 193.1, 28 193.4 M27.3 194 C22.3 192.8, 20.3 191.5, 21 186.9 M28.9 193.6 C23.5 195.4, 19.4 192.2, 21 186.1 M21.8 188 C21.1 174.3, 21.5 166.4, 18.6 156.2 M19 186.4 C20.6 181.4, 19.9 174.7, 20.7 156.7 M20 157.3 C21.4 153.6, 22.7 148.1, 27.1 151.6 M20.9 156.8 C21.3 150.5, 20.9 148.6, 27 147.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:15.579999999999998px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;70&quot; y=&quot;172.0&quot;&gt;rcx&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M149.4 148.6 C179.5 150.5, 210.3 147.3, 233 149.2 C237 146.8, 240.8 150, 240.1 155.6 C237.5 165.8, 241.5 176.8, 238.5 188.8 C243.4 188, 236.1 196.8, 232 196.6 C202.2 195, 172.6 193.4, 144.6 196 C144.1 192.6, 138.5 189.1, 137.9 188.3 C142 177.4, 143.2 171.1, 140.1 157.8 C138.8 149.6, 142.4 151, 150.5 149.1&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M146.4 149.2 C168.2 152, 189 150, 233.8 150.3 M147.2 149.3 C173.4 151.1, 200.8 150.6, 231.7 149.1 M232.7 150 C237.3 150.7, 241.6 153.7, 238.6 158.5 M230.8 149.4 C239.3 152.2, 239.3 152.4, 241 155.2 M241.6 157.4 C239.3 166.8, 240.7 176.3, 240 184.9 M239.9 158 C239.2 166.9, 240.7 177.3, 240.6 187.4 M240 186.7 C238.2 192.2, 236 195.8, 230.8 194.7 M241.8 186.9 C237.8 192.5, 239.2 192.5, 234.1 192.4 M232.6 195.4 C210.8 193.3, 183.9 194.4, 145.8 192.2 M233.5 194.1 C214.2 194.9, 195.8 194.3, 146.4 194.1 M147.3 194 C142.9 193.2, 141.2 190.3, 141.5 185.1 M147.9 194.3 C140.7 195.3, 140.2 193.2, 141.3 188.5 M139.1 187.2 C139.1 177.5, 138.4 167.7, 138.4 155.7 M139.3 187 C139.1 176.6, 139.3 164.9, 140.9 156.5 M140 157.3 C140.4 151, 142.4 151.8, 147.1 149.7 M141.3 157.2 C138.5 153.7, 141.6 152, 149.1 150.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:15.579999999999998px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;190&quot; y=&quot;172.0&quot;&gt;rsp&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;130&quot; y=&quot;232.0&quot;&gt;… and a dozen more&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;420&quot; y=&quot;0.0&quot;&gt;The cabinet: memory&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;420&quot; y=&quot;28.0&quot;&gt;gigabytes, far away, slow&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M430.9 57.4 C523.3 61.6, 615.4 57.5, 667.4 61.1 C676.5 59.5, 678.1 62.7, 682.4 70.1 C677.3 134.2, 678 193.3, 683.2 272.8 C682.8 273.5, 673.3 276.5, 673.3 277.7 C574.5 280.4, 481.7 282, 432.4 279.5 C422.4 278, 421.3 275.2, 418.3 271.2 C417.7 219, 415.8 164, 422 68 C419 63.3, 426.7 58.6, 433.1 59.1&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M429.3 61 C480.8 59, 532.7 58.4, 670.3 59.5 M430.8 59.2 C514.4 60, 599.7 61.2, 670.2 60.3 M670 60 C676 60.7, 679.4 64.6, 681.3 68.3 M671.4 58.5 C677.1 62, 681.5 63.6, 678 71 M681.3 71.6 C681.5 115.2, 678.8 163.1, 681.8 268.9 M679.7 69.5 C678.3 143.8, 678.3 218.1, 679.9 269.7 M680 270 C681.8 276.4, 676.5 280.7, 669.3 280.5 M682 270.8 C678 277.6, 677.7 277.8, 669.5 280.4 M671 278.8 C608.1 278.7, 543.1 280.9, 430.4 280.2 M670.4 280.7 C607.6 278.3, 544.1 278.5, 430.8 280.6 M430 280 C423.3 281.4, 420.1 275.3, 418 268.8 M430.8 278.1 C423.6 277.9, 422 276.3, 420.1 268.8 M419.5 271.3 C418.3 218.9, 420 164.4, 421.6 69 M419.6 269.7 C418.3 217.9, 419.9 165.8, 419.5 69.4 M420 70 C418.9 62.5, 425.3 59.1, 429.7 58.4 M421.5 69.6 C418.6 64.1, 421.8 60.7, 429.2 61.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;550&quot; y=&quot;147.5&quot;&gt;every variable,&lt;/tspan&gt;&lt;tspan x=&quot;550&quot; y=&quot;170.0&quot;&gt;every array,&lt;/tspan&gt;&lt;tspan x=&quot;550&quot; y=&quot;192.5&quot;&gt;the whole program&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M265 171.9 C314.5 170.2, 368.4 168.8, 416.2 169.2 M264.9 169.8 C311.6 168.3, 358 169.2, 415.8 170.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M404.1 165.2 C406.5 166.5, 412 167.6, 416.1 169.4 M404.1 163.7 C407.9 165.4, 411.5 167.9, 415.9 170.5 M415.2 171.1 C410.1 171.7, 405.8 175.6, 402.5 176.7 M415.5 169.4 C411.5 172.4, 407.6 173.3, 403.1 176.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M277.3 177.4 C271 174.5, 267.9 171.4, 264.1 169.4 M277.3 175.9 C273.3 174, 269.2 172.8, 263.9 170.5 M263.2 171.1 C267.2 167.4, 271.9 167, 275.8 164.5 M263.5 169.4 C267.8 168.5, 272.2 165.4, 276.4 164&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;340&quot; y=&quot;148.0&quot;&gt;mov&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;340&quot; y=&quot;195.0&quot;&gt;shuffle numbers&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;Registers are the small, fast desk on the CPU; memory is the huge, slow filing cabinet, and the CPU shuffles numbers between them.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Remember LLVM&#x27;s IR from last post, with its &lt;code&gt;%1&lt;/code&gt;, &lt;code&gt;%2&lt;/code&gt;, &lt;code&gt;%3&lt;/code&gt;, an infinite supply of imaginary registers? &lt;em&gt;This&lt;/em&gt; is what LLVM&#x27;s backend was quietly doing all along: cramming that infinite imaginary desk down onto a real one with only sixteen slots, deciding what to keep on the desk and what to shove back into the cabinet. That job even has a name — &lt;strong&gt;register allocation&lt;/strong&gt; — and it&#x27;s one of the hardest things a backend does. I&#x27;d been getting it for free and never knew.&lt;/p&gt;
&lt;h2 id=&quot;an-instruction-does-almost-nothing&quot;&gt;An instruction does almost nothing&lt;a class=&quot;anchor&quot; href=&quot;#an-instruction-does-almost-nothing&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Now the instructions themselves. The humbling truth: each one does &lt;em&gt;almost nothing&lt;/em&gt;, and that&#x27;s the point.&lt;/p&gt;
&lt;p&gt;Take the three instructions my compiler wrote for &lt;code&gt;2 + 3&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;eax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; put the number 2 into register eax&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;eax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; add 3 to eax        -&amp;gt; eax now holds 5&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;eax&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; copy eax out to the memory slot named x&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -27 614 317&quot; width=&quot;614&quot; role=&quot;img&quot; aria-label=&quot;Tracing 2 + 3 through eax and memory&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;0.0&quot;&gt;instruction&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;345&quot; y=&quot;0.0&quot;&gt;eax&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;525&quot; y=&quot;0.0&quot;&gt;[x] in memory&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M6.2 30 C88.1 31.7, 168.7 31.5, 233.4 29.8 M7.2 30.1 C55 28.2, 101 28.7, 232.5 29.5 M232.3 30 C238.4 29, 238.8 33.9, 239.9 38.7 M230.6 30.4 C238 31.9, 238.5 33.4, 240.5 35.6 M240.2 39 C238.2 49.5, 240.2 61.8, 242 67.3 M240.1 37.7 C240.7 44.8, 240.8 51.4, 240.6 67.4 M240 68.3 C239.2 72.9, 236.1 74.6, 232.7 75.1 M238.8 68.8 C241.1 73.7, 239 75.6, 234.2 74.4 M231 77.3 C171.1 74.9, 114.6 75, 7.3 77 M232.8 76.3 C155.5 73.3, 78.6 73.5, 7.7 75.8 M7.7 76 C3.7 74.8, 1.1 72.3, -1.8 66.4 M6 76.2 C2.2 76.8, -0.8 73.1, 1.6 66.9 M1.7 70.2 C1.5 58.6, 1.1 48.9, -0.1 36.1 M0.6 67.5 C-0.9 57.9, 0.1 47.9, 0.5 37.3 M0 37.7 C-0.8 31.2, 2.9 30.3, 5.9 30.2 M-0.2 37.5 C0.2 33, 2.8 30.9, 9.5 28.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:15.579999999999998px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;120&quot; y=&quot;53.0&quot;&gt;(before)&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M309.6 30.5 C327 28, 347.4 29.8, 380.7 30.7 M382.3 30 C389.2 30.1, 390.4 31.7, 391.6 38.7 M390 38.3 C388.9 48.6, 389.3 54.3, 390.2 67.2 M390 68.3 C389 75.1, 389 76.8, 383.8 76.2 M381.5 74.7 C355.4 75.9, 329.3 74.1, 309.5 75.8 M307.7 76 C303 75.3, 300.5 73.3, 298.5 69.7 M300 67.9 C300 57.4, 299.3 45.1, 299.1 37.9 M300 37.7 C301.4 33.4, 302.7 28.2, 308.8 31.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;345&quot; y=&quot;53.0&quot;&gt;?&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M487.4 30.7 C510 28, 527.8 29.3, 564.1 29.7 M562.3 30 C569 29.4, 568.9 34.4, 570 37.9 M568.5 39.3 C569.3 50.2, 569.8 63, 571 69.2 M570 68.3 C570.2 73.4, 567.5 75.3, 564.1 74.8 M563.2 77.9 C539.8 75.1, 515 74.9, 488.5 77.1 M487.7 76 C480.8 76.2, 480.8 73.8, 478.4 69.1 M478.2 69 C478.6 55.3, 480.3 42.7, 480.2 39 M480 37.7 C480 31.8, 483.2 29.1, 488.6 30.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;525&quot; y=&quot;53.0&quot;&gt;?&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M5.8 95.1 C55.4 97, 111.4 97.2, 233.9 94.9 C240.8 95.3, 239.2 96.3, 243.2 103.1 C238.6 113.6, 237.3 122.4, 238.4 134.6 C243.4 137.3, 238.6 140.5, 232.9 140.1 C166.9 141.2, 103.2 145.5, 6.9 143.9 C3.4 145.2, -1.8 138.8, -2.1 135.6 C-3.4 128.1, 1.5 120.9, -0.2 102.1 C-1 98.9, 0.6 94.4, 6.9 96.2&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M6.6 94.8 C77.7 95.5, 146.7 95.2, 230.9 94.8 M7.1 95.5 C63.4 97.6, 117.1 97, 232 95.6 M232.3 96 C238.2 96.9, 241 98.9, 241.9 105.6 M232.8 96.1 C237.4 97, 242.1 100.4, 238.1 104.6 M240.5 102.1 C238.5 112.1, 238.9 121.8, 238.7 133.9 M241 103.3 C239.9 114.2, 240.7 125.8, 239.6 134.5 M240 134.3 C241.4 139.1, 239.4 141.1, 231.4 143.7 M240.6 135.4 C238.3 141.6, 235.7 141.6, 230.6 141.3 M233 140.7 C163.4 144.3, 92.6 145.2, 7.4 141.1 M232.3 141.7 C150.3 142.6, 69.9 142.4, 7.4 141.5 M7.7 142 C4.2 142.6, -1.3 140, -0.3 133.7 M8 143.8 C3.8 142.6, -1.1 140.9, 1.3 134.1 M0.6 135.7 C1.4 124.6, 0.9 110.8, -1.3 105 M0.4 135.3 C0.8 123.1, -0.4 112.8, -0.7 103.5 M0 103.7 C1.5 99.6, 2.7 97.5, 9.6 97.8 M0.7 103.2 C2.2 96.3, 0.8 95, 5.8 97&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:15.579999999999998px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;120&quot; y=&quot;119.0&quot;&gt;mov eax, 2&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M305.7 98.2 C331 99.2, 359.5 99.2, 379.9 92.8 C389.4 96.9, 392.3 102.1, 391.6 107 C386.3 112.7, 389.2 121.5, 386.9 134.3 C391.6 140.8, 385.5 140.6, 379.7 144.3 C361.6 143.7, 337.6 138.4, 307.1 142.1 C305.3 143.2, 298.2 142, 298.5 131.3 C298.9 124.2, 301.7 118.7, 301.9 106.9 C299.5 96.6, 304 95, 308.3 98.7&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M306 94.8 C330.3 96.6, 349.8 94.5, 383.1 94.7 M308.1 95.6 C327.8 95.4, 346.5 95.6, 382.7 96.9 M382.3 96 C388 96.6, 389.3 99.3, 389.4 103.2 M382.6 94.8 C385.7 94.5, 390.2 98.9, 392.2 104.2 M389.2 104.2 C388 114.3, 389.6 120.6, 391.4 134.1 M391 104.7 C389.1 110.2, 390.8 116.4, 389.6 133.4 M390 134.3 C388.7 138, 389.2 143.6, 382.5 142 M389 135.3 C389.9 140.9, 388.5 140.6, 381.2 141.9 M383.9 142.7 C356.5 141.5, 329.6 141.6, 308.7 143.1 M382.6 141.3 C366.6 142.6, 352.7 142, 307.6 142 M307.7 142 C304.4 141, 301.8 139.8, 301 132.9 M307.7 140.8 C304.3 140.5, 300.3 139.5, 300.5 132.2 M299.8 136.1 C299.8 125.2, 298.9 118.9, 301.7 103.9 M300.4 134.7 C300.2 125.2, 300 116.9, 300 103.5 M300 103.7 C301 97.7, 301.9 96.5, 308.9 96.8 M298.1 104 C299.4 98.3, 304.3 97.4, 308.7 94.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;345&quot; y=&quot;119.0&quot;&gt;2&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M488.9 97.6 C507.1 97.9, 528.9 97.8, 562.1 96.9 M562.3 96 C568.2 97.2, 568.6 100.2, 569.1 105.6 M568.1 104 C570.5 112.5, 571 122.6, 569.4 133.4 M570 134.3 C569.8 138.3, 567.2 141, 560.9 140.7 M560.6 141.4 C534.3 143.7, 506.3 140.4, 489.5 142.7 M487.7 142 C482 140.8, 481.5 141.3, 478.1 133.1 M480.9 134.1 C481.2 129.1, 478.1 121.6, 479.5 104.1 M480 103.7 C480 97.1, 480.6 97.7, 487.9 94.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;525&quot; y=&quot;119.0&quot;&gt;?&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M8.2 163.2 C55.6 159.8, 99.1 159.3, 232.8 159.3 C240.3 162.2, 242.5 163.4, 240.9 171.3 C241.2 182, 241.7 195.5, 240.9 198.5 C238.1 202.4, 240.8 207.5, 229.3 211.5 C158.9 204.7, 91.9 207.1, 6 209.8 C2.6 210.8, -3 202.9, -0.9 200.3 C1.8 191.3, -3.6 176.7, -1.1 169.2 C-2.9 166.1, 2.6 158.9, 4.5 160.3&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M6.5 162.8 C95.6 161, 184.1 159.9, 233.6 163.5 M8.5 162.7 C79.6 163.3, 152.8 163.7, 232.9 162.7 M232.3 162 C236.8 162, 238.8 164.6, 241 168 M233.4 163.1 C239 164.3, 240.3 165.1, 237.9 168.8 M241.3 171.3 C240.2 180.2, 238.2 188.7, 239.2 202.2 M240.7 170.4 C240.9 179.3, 239.8 191.5, 239.2 201.3 M240 200.3 C240.4 203.7, 237.6 207, 232.5 209.7 M238.7 200.4 C241.2 205.3, 236.6 207.7, 233.3 210.2 M233 206.7 C148.9 206.1, 64.5 207.6, 6.5 207.8 M232.9 208.1 C160.5 209.2, 90.2 208.8, 6.9 208.5 M7.7 208 C4.2 208.5, -0.9 204.7, -0.1 199.5 M8.7 209.2 C1.1 209.9, -2 205.7, 0.3 199.9 M-1.9 199.5 C0.9 188.6, 1.2 178.4, 0 168.8 M-1 201.2 C-0.9 192.7, 0.5 186.7, 1 169.4 M0 169.7 C-0.6 164.2, 3.4 163.2, 6.7 162.7 M1.3 170.4 C-1.2 165.5, 3.2 162.8, 9.7 163&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:15.579999999999998px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;120&quot; y=&quot;185.0&quot;&gt;add eax, 3&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M306.6 165.4 C334.8 162.2, 363.4 161.6, 385.7 163 C384.8 159.2, 388.1 161.4, 390.1 172.2 C392.1 174, 391.5 184.4, 389.3 202.2 C391.3 208.6, 389.8 210.7, 385.1 207.4 C354.9 206.1, 328.4 204.3, 306.8 208.1 C303.8 206.9, 303.4 208.1, 296.9 202.2 C303.1 190.5, 299.8 177.6, 303 170.7 C302.2 161.2, 305.8 162.3, 304.3 162.1&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M308.2 163.6 C330.7 160.2, 351.7 163.7, 383.9 163.6 M307.8 161.1 C328.9 161.7, 351.1 162.4, 381.6 162.8 M382.3 162 C388 162.9, 388.4 165.9, 388.7 170.4 M381.3 161.5 C388.4 162.2, 389 162.7, 390.8 167.6 M389.3 169.7 C389.7 179.8, 391.2 193, 390.4 199.4 M390.5 169.4 C389.3 178.2, 389.1 187.4, 390.3 200.7 M390 200.3 C389.8 205.7, 385.5 206.5, 384.2 208.5 M391.3 199.7 C389 204.5, 385.6 207.1, 380.9 207.6 M381.3 208.1 C364.2 209, 342.5 209.3, 309.4 206.8 M383 208.6 C362.4 208.1, 343 208, 307 207 M307.7 208 C301.3 207.8, 300 204.4, 300.4 198.7 M308.2 209.1 C303.4 209.5, 300 204.4, 301.7 199.6 M299.9 200.8 C299.7 191.7, 298.4 179.8, 300.4 171.3 M299.7 201 C300.6 193.3, 300.5 187.1, 299.3 169.7 M300 169.7 C299 163.6, 303 160.3, 308.2 160.6 M298 171 C298.8 165.2, 302.1 161.9, 306.2 162.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;345&quot; y=&quot;185.0&quot;&gt;5&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M486.6 161.5 C510.6 163.8, 530.4 161.8, 563.3 162.6 M562.3 162 C567 160.5, 568.1 166.2, 568.6 169.6 M571.4 171.1 C568.7 178.5, 571.6 190.3, 571.7 198.7 M570 200.3 C571.5 203.9, 566.1 208.4, 561.9 208 M563 209.9 C537 208.3, 512.7 207.6, 487.1 209.3 M487.7 208 C482.4 207, 480.8 205.1, 481.5 198.5 M480.4 202 C478.1 194.1, 479.5 185.4, 479.1 168.3 M480 169.7 C478.7 163.2, 483.1 161, 489.4 163.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;525&quot; y=&quot;185.0&quot;&gt;?&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M4.8 226 C55.1 224.3, 104.9 226.7, 232.1 225 C239.4 228, 239.1 232.2, 237.5 239.2 C237.3 246.9, 243 254.5, 237.3 265.3 C238.2 271.5, 239.4 277.5, 231 273.6 C169.6 275.7, 104.9 272.5, 6.8 273.9 C5.7 276.7, 1.2 268.2, 3 266 C-3 257.6, -1.5 251.6, 0.8 233.2 C1.1 228.3, 3.9 231.1, 4.2 231&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M7.3 228.9 C57.4 228.3, 105.3 229.7, 232.3 229.4 M8.1 228.4 C95.9 227.9, 185.2 229.2, 231.7 227.5 M232.3 228 C235.6 227.2, 240.5 229.9, 241.8 237.2 M232 228.4 C237.1 227.8, 240.4 232.1, 238.2 233.7 M241 235.4 C238.5 242.6, 241.6 254.2, 240.8 268.2 M239.9 234.8 C240.3 245.3, 239.5 253.4, 239.5 265.8 M240 266.3 C238.3 272.1, 236.3 273.3, 233.1 272.8 M238.8 266 C241.6 271.7, 235.9 272.5, 233.9 272.8 M231.2 273 C183.3 275.9, 135.4 274, 9.4 272.9 M232.6 273.5 C179.7 274.5, 126.9 274.1, 7.4 273.3 M7.7 274 C2.4 275.9, 1.4 271.8, -0.2 268.3 M6.4 274.2 C2.6 272.2, 2.1 273.4, 0.1 266.4 M-0.6 266.8 C1.3 255, -1.2 245.9, 0.7 236.1 M0.6 265.7 C-0.3 259.3, 0.8 250.1, -0.4 234.8 M0 235.7 C-0.1 232, 3.8 228.7, 8.4 229.1 M1.1 235.6 C-0.6 232.3, 1.8 227.1, 8.6 225.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:15.579999999999998px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;120&quot; y=&quot;251.0&quot;&gt;mov [x], eax&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M305.7 226.5 C331.8 230.2, 352.8 228.1, 381.9 226.7 M382.3 228 C385.9 230, 391.9 228.6, 389.1 234.6 M388.1 235.9 C389.7 246.2, 391.6 257.2, 390.8 265.8 M390 266.3 C390.3 272.6, 387.9 273.9, 382.2 273.3 M382.6 273.4 C360.8 273.2, 334.8 272.9, 306.1 274.6 M307.7 274 C303.3 272.9, 299 270, 300.1 267.5 M300.8 266.9 C299.5 256.3, 299.9 250.8, 299.1 235.1 M300 235.7 C301.3 229.2, 302.7 226.3, 309 228.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;345&quot; y=&quot;251.0&quot;&gt;5&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M488.8 231.1 C508.6 228.7, 524.7 228.3, 561.8 230.2 C565 227, 566.7 230.2, 566.9 236.7 C569.3 242.6, 567.2 252.1, 570.8 266.8 C573.4 270.7, 570.8 271.7, 565.9 277.4 C533.8 272.2, 502.8 271.2, 491 271.2 C483.7 277.1, 479.3 269.6, 482.1 267.1 C480.6 256, 477.2 250.7, 477.9 236.7 C480.4 229.2, 481.1 225, 491 227.2&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M487.5 226.8 C510.9 228.7, 533.1 226.1, 561.3 229.7 M488.3 228.2 C515.9 227.9, 542.7 228.8, 562.6 228.6 M562.3 228 C565.7 228, 571.6 232.1, 570.3 234.7 M562.5 229.9 C566.3 226.2, 569.2 230, 571.7 235.1 M568.8 237.3 C571.6 246.7, 571.1 261.5, 570 266.8 M569.5 235.5 C569.6 242.2, 569.5 250.3, 569 266.6 M570 266.3 C570.2 272, 568.5 273.7, 563.2 273.5 M570 267.4 C572 272.8, 568 275.9, 563 273 M564.2 274 C539.1 272.7, 517.7 274.9, 487.8 272.8 M563.2 274.5 C540.7 274.8, 518.6 273.2, 488.7 274.9 M487.7 274 C484 274.6, 480.3 271.7, 478.3 267.5 M488.6 273.4 C483.4 274.6, 480.8 271.5, 481.8 264.3 M481.9 266.7 C478.8 258.8, 478.5 250.2, 480.1 234.5 M480.1 266.5 C479.8 258.2, 479.6 251.5, 480.9 234.9 M480 235.7 C482 228.8, 483 230, 488.6 228.4 M481.9 234.9 C481.8 229.6, 480.6 225.9, 485.4 230&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;525&quot; y=&quot;251.0&quot;&gt;5&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;The three instructions traced step by step: eax takes 2, then 5, then 5 is copied out to the memory slot x.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Read them literally, because literal is all they are. &lt;code&gt;mov&lt;/code&gt; copies a number into a slot. &lt;code&gt;add&lt;/code&gt; adds a number to a slot. The &lt;code&gt;[x]&lt;/code&gt; with brackets means &quot;not the value x, but the &lt;em&gt;place&lt;/em&gt; in the cabinet where x lives.&quot; No loops, no cleverness, no understanding. Move a number. Add a number. Store a number.&lt;/p&gt;
&lt;p&gt;A whole program — your browser, a game, my guessing game with its Mongolian keywords — is &lt;em&gt;millions&lt;/em&gt; of steps this small, run so fast it looks like thought. That was the moment the machine stopped being mystical for me. It isn&#x27;t smart. It&#x27;s just very, very fast at doing almost nothing.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;8 -16 507 258&quot; width=&quot;507&quot; role=&quot;img&quot; aria-label=&quot;Not smart, just fast&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M51.4 71.4 C56 72.5, 61.6 76, 64.4 79.7 C67.1 83.4, 68.3 89, 68 93.5 C67.7 98, 65.8 103.6, 62.4 106.9 C59 110.3, 52.5 113, 47.6 113.5 C42.7 113.9, 37.2 112.3, 33.2 109.6 C29.2 106.9, 24.9 102, 23.6 97.3 C22.3 92.7, 23.4 86, 25.5 81.8 C27.7 77.5, 31.5 73.4, 36.5 71.9 C41.6 70.4, 52 72.6, 55.8 72.9 C59.6 73.2, 59.3 73.4, 59.2 73.6 M42.2 70.3 C46.6 69.7, 53.3 72.2, 57.6 74.5 C61.8 76.8, 66.1 79.6, 67.6 83.9 C69.2 88.1, 69.1 95.1, 67.1 99.9 C65.1 104.7, 59.6 110.2, 55.6 112.7 C51.6 115.1, 47.3 115.6, 42.9 114.5 C38.6 113.4, 32.8 109.8, 29.4 106.1 C26.1 102.4, 22.7 97, 22.7 92.3 C22.7 87.5, 26.3 81.1, 29.4 77.6 C32.5 74, 39 72, 41.2 70.8 C43.4 69.7, 42.3 70.6, 42.6 70.8&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M48.9 70 C53.5 70.7, 60.1 74.2, 63.4 78 C66.7 81.7, 69.1 88, 68.9 92.6 C68.7 97.2, 65.5 101.9, 62.3 105.5 C59.1 109, 54.3 112.7, 49.7 113.7 C45.2 114.8, 38.9 114.1, 34.9 111.8 C30.9 109.5, 27.5 104.4, 25.8 99.9 C24.2 95.5, 23.5 89.2, 25 84.8 C26.5 80.4, 30.7 76.2, 35.1 73.8 C39.4 71.4, 48.2 70.8, 51.1 70.5 C53.9 70.2, 52.1 71.7, 52.1 72 M35.9 72.8 C39.7 70.7, 46.9 69.9, 51.6 70.8 C56.4 71.7, 61.4 74.4, 64.3 78.1 C67.3 81.7, 69.9 87.7, 69.5 92.7 C69.1 97.7, 65.6 104.4, 62 108.2 C58.5 111.9, 53 114.7, 48.1 115.1 C43.1 115.5, 36.5 113.4, 32.4 110.6 C28.2 107.8, 24.1 103.2, 23.2 98.3 C22.2 93.5, 24.1 86, 26.6 81.4 C29 76.8, 36.3 71.9, 37.9 70.6 C39.6 69.3, 36.4 72.9, 36.5 73.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M39.4 84.1 C39.9 84.3, 40.8 83.3, 40.9 83.8 C41.1 84.3, 40.3 86.4, 40.2 87.1 C40.1 87.8, 40.7 87.7, 40.4 88.1 C40.1 88.5, 39 89.8, 38.2 89.7 C37.5 89.6, 36.5 88.1, 35.9 87.6 C35.2 87, 34.4 87.1, 34.4 86.5 C34.4 85.8, 35.5 84.3, 35.9 83.8 C36.4 83.2, 36.5 83.1, 37.1 83 C37.7 82.9, 39.3 83.2, 39.6 83.3 C39.9 83.4, 39.1 83.4, 38.9 83.5 M35.5 81.9 C36.3 82, 39.7 83.7, 40.5 84.2 C41.3 84.6, 40.1 84.2, 40.2 84.8 C40.2 85.4, 40.4 87.1, 40.6 87.6 C40.7 88.1, 41.7 87.8, 41.1 87.9 C40.4 88, 37.5 88.4, 36.6 88.2 C35.7 88.1, 35.9 87.1, 35.8 87 C35.7 86.9, 36.2 88.1, 36 87.6 C35.9 87.1, 34.9 84.5, 34.9 83.8 C34.9 83.1, 35.5 83.3, 35.9 83.2 C36.3 83.1, 36.7 83, 37.1 83.2&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M37.9 83.1 C38.4 83, 39 82.8, 39.3 83.4 C39.7 84, 40.1 85.8, 40.2 86.6 C40.3 87.3, 39.9 87.6, 39.8 88 C39.7 88.5, 40.1 89.4, 39.5 89.5 C39 89.6, 37.6 89.3, 36.8 88.8 C35.9 88.3, 34.8 87, 34.6 86.3 C34.4 85.7, 35.4 85.1, 35.5 84.7 C35.7 84.4, 35.1 84.7, 35.5 84.4 C35.8 84.2, 37.2 83.5, 37.8 83.1 C38.5 82.8, 39.4 82.3, 39.4 82.3 M37.9 82.1 C38.4 82.2, 38.9 83.6, 39.6 83.9 C40.2 84.3, 41.5 83.4, 41.5 84.2 C41.5 84.9, 39.8 87.6, 39.4 88.4 C39 89.2, 39.8 88.8, 39.2 88.8 C38.7 88.8, 36.8 88.8, 36 88.5 C35.3 88.3, 34.5 88, 34.5 87.5 C34.6 86.9, 36 85.7, 36.3 85.2 C36.7 84.7, 36.2 84.6, 36.5 84.4 C36.8 84.2, 37.8 84.4, 38.1 84.1 C38.4 83.7, 38.3 82.6, 38.3 82.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M53.6 84.1 C54.2 83.7, 54.6 83.1, 55.2 83 C55.8 82.9, 56.8 83, 57.2 83.7 C57.6 84.3, 57.5 85.9, 57.5 86.6 C57.5 87.4, 57.7 88, 57.2 88.2 C56.6 88.5, 54.8 88.2, 54 88.3 C53.1 88.4, 52.5 89.3, 51.9 89 C51.3 88.7, 50.4 87.1, 50.3 86.3 C50.2 85.5, 50.8 84.7, 51.3 84.3 C51.8 83.8, 52.9 83.9, 53.4 83.8 C53.8 83.7, 53.9 83.5, 53.9 83.6 M55.7 83.5 C56.2 84, 56.7 84.3, 56.7 85.1 C56.6 85.9, 55.8 87.9, 55.4 88.3 C55.1 88.7, 54.9 87.4, 54.7 87.7 C54.5 88, 54.8 89.8, 54.2 90 C53.5 90.2, 51.6 89.5, 50.8 88.9 C50.1 88.3, 49.6 87.5, 49.7 86.5 C49.8 85.5, 51.1 83.6, 51.5 82.8 C51.9 82, 51.6 81.6, 52.1 81.5 C52.6 81.5, 54 82.2, 54.5 82.5 C55.1 82.7, 55.4 82.7, 55.4 82.9&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M54.2 83.1 C54.7 83.3, 55.5 83.8, 56 84.3 C56.4 84.9, 56.7 85.9, 56.8 86.4 C56.8 86.8, 56.6 86.7, 56.2 87 C55.9 87.3, 55.4 88, 54.8 88.3 C54.3 88.6, 53.7 88.8, 53.1 88.7 C52.4 88.6, 51.4 88.3, 51.2 87.5 C51 86.8, 51.7 84.7, 51.8 84.2 C52 83.7, 51.6 84.6, 52.1 84.4 C52.5 84.2, 54 83.2, 54.6 82.8 C55.1 82.4, 55.4 82.3, 55.4 82.2 M55.9 82.9 C56.6 82.9, 56.1 84.2, 56.5 84.6 C57 85, 58.6 84.7, 58.4 85.4 C58.2 86.2, 56.1 88.4, 55.3 89 C54.6 89.6, 54.3 89, 53.9 89.2 C53.4 89.3, 52.7 90.7, 52.5 90.1 C52.3 89.5, 52.7 86.5, 52.6 85.8 C52.5 85.1, 51.9 86.5, 52 85.8 C52.1 85.2, 52.8 82.5, 53.2 82.1 C53.5 81.6, 54.3 82.9, 54.3 83.1 C54.3 83.2, 53.2 83, 53.2 83&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M44.1 95.3 C45.1 95, 47.6 96.7, 48.7 97.3 C49.8 98, 50.3 98.7, 50.7 99.5 C51.1 100.2, 51.6 100.7, 51.2 101.7 C50.9 102.6, 49.7 104.5, 48.7 105.2 C47.6 105.9, 46.2 105.8, 45.2 106 C44.1 106.2, 43.1 107, 42.4 106.3 C41.7 105.6, 41.1 103.2, 41 101.8 C40.9 100.4, 41.1 98.9, 41.9 97.9 C42.7 96.9, 44.8 96.2, 45.8 95.8 C46.8 95.4, 47.9 95.4, 47.7 95.5 M46.6 95.1 C47.6 95.5, 50.7 97.2, 51.5 98.2 C52.3 99.3, 51.7 100.4, 51.6 101.6 C51.5 102.8, 51.9 104.8, 51 105.6 C50.1 106.4, 47.7 106.3, 46.3 106.2 C44.9 106.1, 43.3 106, 42.5 105.2 C41.8 104.5, 42.1 102.9, 41.7 101.7 C41.4 100.6, 39.8 99, 40.3 98.3 C40.9 97.5, 43.9 97.9, 45 97.3 C46 96.7, 46.4 95, 46.8 94.8 C47.2 94.5, 47.3 95.6, 47.4 95.7&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M46.6 96.4 C47.6 96.3, 49.2 96.3, 50 97.1 C50.8 98, 51.4 100.2, 51.4 101.5 C51.5 102.7, 51.2 103.8, 50.4 104.6 C49.6 105.5, 47.6 106.4, 46.7 106.7 C45.7 106.9, 45.3 106.7, 44.5 106.1 C43.7 105.5, 42.7 104, 41.9 103.1 C41.2 102.2, 39.9 101.8, 40.2 100.6 C40.4 99.5, 42.3 96.9, 43.5 96.1 C44.7 95.3, 46.9 95.9, 47.6 95.8 C48.4 95.7, 47.9 95.2, 47.8 95.5 M47.6 97.4 C48.9 98.1, 50.8 99.2, 51.2 100.1 C51.6 101, 50.6 101.7, 50.1 102.8 C49.6 103.9, 49.3 106.1, 48.3 106.8 C47.3 107.5, 45.1 107.2, 44.3 107 C43.6 106.8, 44.1 106.2, 43.7 105.5 C43.3 104.8, 42.1 104, 41.9 102.8 C41.6 101.5, 41.6 98.8, 42.2 97.7 C42.8 96.6, 44.5 96.6, 45.3 96.3 C46.2 96, 46.9 95.6, 47.3 95.8 C47.7 96, 47.9 97, 47.9 97.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M46.7 114.2 C45.9 134.9, 46.4 159.5, 44.3 181.2 M46.9 114.5 C46.8 141.2, 45.6 165.7, 46.3 179.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M47.2 180.1 C40 196.2, 34.3 212.4, 25.7 225.4 M45.8 179.7 C40.1 191.2, 36.7 203.8, 25.3 225.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M47.8 180 C53.2 194.5, 57.6 213, 67.1 227.6 M46.7 180.9 C52.3 194.3, 59.6 210, 66.3 226.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M44.4 131.8 C39.6 143, 30.3 150.4, 22.5 161.7 M45.6 132.1 C38 143, 29.5 155.8, 23.3 162.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M45 131.7 C54.3 141.1, 60.4 150.8, 67.9 163.9 M46.5 131.3 C50.5 139.1, 56.8 146.1, 68.3 162.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M116.6 0.8 C165.4 -6.2, 211.9 0, 270.7 2 C280.8 0.6, 278.3 3.2, 277.1 5.2 C280.3 15.3, 282.4 24.5, 278.7 38.3 C278.6 43.9, 277.1 46.9, 270.5 48.7 C215.5 52.2, 157.8 50.1, 117.9 47.8 C112.4 48.1, 108.1 45.4, 109.1 38.4 C108.7 33.3, 113.1 24.6, 110.4 10.3 C111.5 0.1, 113.4 2.8, 119.8 -3&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M117.9 -0.4 C171 -0.4, 222 -2.5, 273 0 M117.7 0.5 C165.2 -0.7, 212.4 -0.8, 271 -0.9 M271.7 0 C276.1 -0.7, 278 4.1, 278.1 9.5 M270.8 -1.8 C278.1 1.9, 280.7 4.5, 280.3 8.6 M280.1 10.1 C279.4 19.2, 279.1 26.9, 281.1 42.9 M280.6 7.8 C279.2 19.7, 280.6 30.2, 279.6 41.6 M280 41.7 C278.1 47.2, 278.4 50.5, 269.8 49.7 M279.3 42.8 C282 45.4, 279.2 51.8, 272.5 48.2 M273.4 51.2 C238.3 49.5, 200.7 49.3, 117.9 48.9 M271.2 50.3 C237.5 49.5, 204.4 49.5, 118.8 49.6 M118.3 50 C114.2 50.4, 109.3 48.5, 110.9 42.1 M117.4 49 C110.5 49, 109.1 46.2, 110.7 40.9 M111.1 42 C111.8 31.8, 111.4 19, 108.5 10.2 M110.3 41.3 C110.1 31.5, 109.9 22, 110 7.5 M110 8.3 C110.6 3.5, 111.2 0.4, 119.5 1.2 M111.3 7.2 C109.9 4.3, 115 0.1, 120 -2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M112.4 17.7 C105.2 35, 96.4 49.7, 75.6 92.6 C88.6 73.1, 98.4 55.2, 112.9 36.6 C113.8 29.6, 111.6 26.4, 113.3 15.3&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M109.2 14.2 C98.7 35.4, 91 49.6, 73.6 90.2 M109.7 15.3 C101.3 33, 93.2 48.3, 71 91.8 M73.5 92.6 C86.1 73.3, 101 52.8, 109 36.7 M72.2 91.4 C81.4 77.7, 90.7 63.6, 110.5 38.6 M110.1 37.4 C109.5 31.9, 111 23.9, 109.4 14.8 M109.8 37 C109.4 29.7, 109.1 23.2, 110.4 15.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;195&quot; y=&quot;25.0&quot;&gt;that&#x27;s all?&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M347.5 52.1 C378.8 46.4, 409.7 51.9, 432.1 49.9 C440.2 47.1, 437.5 52.2, 439.2 59.3 C441.1 87.6, 440 108.4, 438.3 127 C437.5 133.6, 436.7 140.5, 432.3 140.8 C396.6 140.7, 370.4 139.3, 353.5 142.9 C342.5 139.9, 336.7 136.6, 339.7 126.7 C341.1 107.2, 339.3 85, 341.6 58 C338.8 56.8, 341.4 52.3, 348.7 48.5&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M350.3 51.9 C367.1 51.3, 388 48.3, 430.4 48.5 M349.5 49.7 C377.5 49.7, 404.7 51.4, 429.1 50.5 M430 50 C437 50.8, 440.2 53.4, 439.1 58.7 M431.7 49.7 C437.6 49.8, 437.8 53.5, 439.2 61.4 M440.6 59.4 C441.5 84.9, 440.8 111.3, 440.5 129.3 M440.8 60.3 C439.1 86.5, 440.3 111.4, 440.1 130.8 M440 130 C440.3 136.4, 437.9 140.6, 428.6 140.2 M441.3 129.4 C441.3 137.4, 436.1 139.2, 432.2 139.8 M428.7 141.6 C411.4 139.1, 392.6 138.2, 348.9 141.3 M430.1 140.9 C410.7 139.4, 392.6 140.9, 350.2 140.2 M350 140 C344.8 140.6, 338.1 134.7, 339.4 129.7 M348.9 140.1 C341.1 140.6, 340.8 137.2, 338.2 129.2 M341.1 129 C339.4 103.4, 338.7 79.8, 341.7 60.1 M340.5 130.7 C340.1 106.6, 339.9 83.3, 339.5 60.9 M340 60 C340.2 53.7, 342.8 49, 350.1 51.2 M339.2 59.2 C340.6 55.1, 342.6 49.7, 350 51&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M356.5 51.1 C355 47.1, 356.7 43.9, 357.1 38.4 M356.2 50.5 C355.5 44.8, 356.2 40, 356 38.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M356.9 141 C355.2 143.9, 357.2 145.3, 355.5 151.3 M355.5 140.1 C355.8 142.8, 356 146.2, 355.4 151.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M338.8 65.9 C336.4 65, 333.5 65, 328.3 65.6 M340.1 64.6 C336.4 64.9, 332.1 65.4, 328.1 64.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M439.2 65.9 C442.1 63.8, 445.1 65.2, 453.2 64.5 M439.4 65.3 C444 64.9, 448.9 64.4, 451.5 64.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M378.2 50.8 C378 47.2, 378.6 44.8, 378.3 38.8 M378.6 49.8 C378.5 47.1, 378.2 43.9, 378.7 38.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M378.5 140.7 C377.9 141.7, 378.9 146.2, 379.1 151.7 M379.1 140.5 C378.8 143.9, 379.1 147.5, 378.1 152.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M340.2 85.6 C336.6 85.1, 335 85.8, 326.9 86 M339.8 85.1 C336.1 85.4, 331.4 85.4, 328.1 85.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M440.6 84.1 C443.4 85.9, 445.2 85.9, 452.6 85.7 M439.6 85.3 C444.3 84.7, 447.6 84.5, 452.2 85.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M402.3 49 C402 46.9, 401.2 45.4, 400.3 37.6 M401.4 49.9 C400.9 45.1, 400.8 40.4, 400.9 38.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M400.2 138.9 C401.9 143.8, 401.5 144.6, 401.2 152.9 M400.8 140.6 C401.2 143.1, 401.7 146.3, 401.5 152.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M339.2 103.9 C337.9 104.7, 334.9 104.1, 328.7 104.8 M340 105.1 C336.5 105.1, 332.6 105.5, 327.6 104.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M439.6 106.2 C443.6 105.9, 446.7 104.2, 451.1 106.1 M440.5 104.6 C444 105.3, 449.2 104.7, 452.2 104.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M423.9 51.1 C424.7 47, 422.9 43.8, 424 38 M423.9 50.3 C423.9 47.5, 423.9 44.2, 423.6 38&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M424.3 141 C424.9 144, 423.4 145.5, 424.8 150.9 M424.4 139.9 C424.1 144.2, 423.6 147.6, 424.2 152.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M340.6 126 C338.1 125, 334 125.1, 327.2 125.2 M339.7 125.6 C336.2 124.4, 330.7 124.4, 327.6 125.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M441 125.9 C443.9 126.2, 445.9 125.2, 452.1 124.1 M440.3 125.1 C442.5 124.7, 445.9 124.9, 452.2 125.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M382.2 84.9 C382.5 84.9, 382.9 84.4, 383.5 85 C384.1 85.5, 385.7 87.5, 385.7 88.2 C385.8 88.9, 384.4 89, 383.9 89.2 C383.3 89.3, 383 89.1, 382.4 89.1 C381.7 89.1, 380.7 89.4, 380.1 89.3 C379.6 89.1, 379.3 88.6, 379.1 88 C378.8 87.5, 378.4 86.6, 378.6 85.9 C378.9 85.3, 379.9 84.3, 380.6 84.1 C381.3 84, 382.4 85.2, 382.8 85.2 C383.2 85.3, 383 84.4, 383 84.2 M383.6 83.1 C384.3 83.2, 383.6 84.8, 384 85.7 C384.5 86.5, 386.1 87.7, 386.1 88.3 C386.2 89, 385.1 89.4, 384.5 89.6 C383.9 89.8, 383.4 89.7, 382.5 89.6 C381.5 89.5, 379.2 89.3, 378.8 88.9 C378.5 88.5, 380.3 88, 380.4 87.3 C380.6 86.6, 379.3 85.5, 379.6 84.8 C380 84.2, 381.8 83.4, 382.4 83.3 C382.9 83.1, 383 83.7, 382.9 83.8 C382.8 84, 382 84.4, 382 84.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M383.4 84.5 C384 84.7, 385 85.5, 385.3 85.8 C385.5 86.2, 385 86.1, 384.8 86.6 C384.5 87.1, 384.2 88, 383.7 88.6 C383.1 89.2, 382.1 90, 381.4 90.2 C380.7 90.4, 380.1 90.3, 379.7 89.8 C379.4 89.2, 379.6 87.7, 379.4 86.9 C379.3 86.2, 378.6 85.6, 378.8 85.3 C378.9 85, 379.8 85.3, 380.4 85.1 C381.1 84.9, 382.3 84.1, 382.6 83.9 C383 83.7, 382.3 83.8, 382.5 83.8 M381.3 84 C381.6 84, 381.9 84.7, 382.4 84.8 C382.9 84.9, 383.7 83.8, 384.2 84.6 C384.7 85.4, 385.9 88.8, 385.5 89.5 C385.2 90.2, 382.5 88.7, 382 88.7 C381.5 88.8, 383.3 89.5, 382.7 89.8 C382.1 90, 379.1 90.4, 378.3 90.1 C377.5 89.8, 378.1 88.6, 378.1 87.9 C378.2 87.2, 377.9 86.6, 378.4 86.1 C378.9 85.5, 381.1 84.9, 381.4 84.5 C381.7 84.1, 380.1 84, 380.4 83.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M399.1 83.3 C399.5 83.5, 399.8 84.4, 400.1 85.1 C400.3 85.8, 400.7 86.9, 400.7 87.6 C400.7 88.3, 400.5 88.9, 400.1 89.3 C399.6 89.6, 399 90, 398.2 89.9 C397.4 89.8, 395.8 89.1, 395.2 88.6 C394.7 88, 394.8 87.2, 394.8 86.7 C394.9 86.1, 395.3 85.8, 395.6 85.4 C395.8 85.1, 395.4 84.9, 396.1 84.7 C396.8 84.6, 399.3 84.3, 399.8 84.3 C400.4 84.3, 399.4 84.5, 399.2 84.6 M400.2 85.4 C401 85.7, 400.5 85.1, 400.7 85.2 C400.9 85.3, 401.7 85.5, 401.6 85.9 C401.5 86.4, 400.8 87, 400.2 87.9 C399.6 88.7, 398.7 90.8, 398 91 C397.3 91.1, 396.7 89.6, 396.2 88.8 C395.6 88.1, 394.6 87.2, 394.6 86.5 C394.6 85.8, 395.8 84.9, 396.1 84.6 C396.4 84.4, 395.5 85.2, 396.2 85 C396.9 84.7, 399.6 83.2, 400.3 83.1 C401 83.1, 400.6 84.6, 400.2 84.8&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M396.5 84.5 C397.1 84.2, 398.6 84.3, 399.2 84.3 C399.8 84.4, 399.8 84.3, 400.1 85 C400.4 85.7, 401.1 87.8, 401.1 88.6 C401 89.3, 400.1 89.1, 399.6 89.3 C399.2 89.4, 398.9 89.5, 398.4 89.4 C398 89.3, 397.2 89.3, 396.8 88.8 C396.3 88.3, 395.9 87, 395.8 86.5 C395.7 86, 395.9 86.4, 396.1 85.9 C396.2 85.3, 396.6 83.3, 396.8 83.2 C397.1 83.1, 397.3 85, 397.5 85.1 M398.6 85.5 C399.3 85.1, 399.6 83, 400.2 83.3 C400.7 83.5, 401.9 86.2, 401.9 87 C401.9 87.7, 400.4 87.3, 400.1 87.7 C399.8 88, 400.6 88.8, 400 89.2 C399.5 89.5, 397.6 90, 396.8 89.8 C396 89.7, 395.3 88.9, 395.1 88.4 C395 87.9, 396 87.1, 396 86.7 C395.9 86.2, 394.3 86, 394.8 85.7 C395.3 85.4, 398.5 85.2, 398.9 84.8 C399.3 84.4, 397.6 83.6, 397.2 83.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M382 101 C389 103.7, 391.3 104.1, 396.8 99.5 M381.3 100.5 C385.5 104.6, 391.1 105.7, 399.2 103&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;390&quot; y=&quot;174.0&quot;&gt;not smart. just fast.&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;h2 id=&quot;how-does-it-ever-make-a-decision&quot;&gt;How does it ever make a decision?&lt;a class=&quot;anchor&quot; href=&quot;#how-does-it-ever-make-a-decision&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;If all it can do is move and add, how does &lt;code&gt;хэрэв таамаглал &amp;lt; зорилтотТоо&lt;/code&gt; — &quot;if the guess is less than the target&quot; — actually work? Programs make decisions constantly. Where&#x27;s the &quot;if&quot; instruction?&lt;/p&gt;
&lt;p&gt;There isn&#x27;t one. Instead there are two dumber instructions that, together, do the job:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;cmp&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;eax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;ebx&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; compare the two numbers&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;jl&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;too_low&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;         &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; &quot;jump if less&quot; — jump to too_low, but only if eax &amp;lt; ebx&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;cmp&lt;/code&gt; compares two numbers and leaves a little note to itself about the result (was it less? equal? greater?). Then &lt;code&gt;jl&lt;/code&gt; — &quot;jump if less&quot; — reads that note and &lt;em&gt;maybe&lt;/em&gt; jumps to a different place in the instruction list, or maybe doesn&#x27;t. That&#x27;s an &lt;code&gt;if&lt;/code&gt;. Compare, then conditionally jump.&lt;/p&gt;
&lt;p&gt;And a loop? The exact same trick, pointed backward: do some work, compare, and jump &lt;em&gt;up&lt;/em&gt; to an earlier instruction if you&#x27;re not done. My &lt;code&gt;давтах&lt;/code&gt; loop, every &lt;code&gt;while&lt;/code&gt; you&#x27;ve ever written, every &lt;code&gt;if&lt;/code&gt; — all of it compiles down to &lt;code&gt;cmp&lt;/code&gt; and a jump. The processor can&#x27;t reason. It can only compare two numbers and decide which instruction to read next. Everything else is built from that.&lt;/p&gt;
&lt;h2 id=&quot;the-great-schism-two-families-of-chip&quot;&gt;The great schism: two families of chip&lt;a class=&quot;anchor&quot; href=&quot;#the-great-schism-two-families-of-chip&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Now the mystery I opened with — why my laptop and my phone speak different dialects.&lt;/p&gt;
&lt;p&gt;Every processor you&#x27;ll meet belongs to one of two families, and they represent a genuine, decades-old disagreement about how a CPU &lt;em&gt;should&lt;/em&gt; be designed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CISC&lt;/strong&gt; — &lt;em&gt;Complex Instruction Set Computer.&lt;/em&gt; The philosophy: give the chip a big, rich vocabulary, including some fancy instructions that do a lot in one step. This is &lt;strong&gt;x86-64&lt;/strong&gt;, the world of &lt;strong&gt;Intel and AMD&lt;/strong&gt;, and it&#x27;s almost certainly what&#x27;s in your laptop or desktop.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RISC&lt;/strong&gt; — &lt;em&gt;Reduced Instruction Set Computer.&lt;/em&gt; The opposite bet: keep the vocabulary &lt;em&gt;small&lt;/em&gt; and every instruction dead simple and uniform, then run a ton of them, very fast, very efficiently. This is &lt;strong&gt;ARM&lt;/strong&gt; — specifically &lt;strong&gt;ARMv8&lt;/strong&gt; (also called AArch64) — and it&#x27;s in your phone, and increasingly your laptop too (Apple&#x27;s M-series chips are ARM).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Why doesn&#x27;t everyone just agree on one? For the same reason there isn&#x27;t one vehicle. A hatchback, a cargo truck and an excavator are all built from engines and parts, but for different jobs — and chips, like languages, are built on different bets. Watch the same &lt;code&gt;2 + 3&lt;/code&gt; in ARMv8 assembly:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;w0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;#2&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; put 2 into register w0&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;w0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;w0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;#3&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; w0 = w0 + 3   -&amp;gt; w0 holds 5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Look closely and you can &lt;em&gt;feel&lt;/em&gt; the different philosophy. Different register names (&lt;code&gt;w0&lt;/code&gt;, not &lt;code&gt;eax&lt;/code&gt;). A &lt;code&gt;#&lt;/code&gt; in front of literal numbers. And notice &lt;code&gt;add w0, w0, #3&lt;/code&gt; names its destination and &lt;em&gt;both&lt;/em&gt; sources explicitly, every time — that rigid, uniform shape is exactly the RISC bet: make every instruction simple and regular. The x86 &lt;code&gt;add eax, 3&lt;/code&gt; is looser and more compact — the CISC bet. Same arithmetic, two worldviews.&lt;/p&gt;
&lt;p&gt;This is also why there&#x27;s no single &quot;assembly language&quot;: there&#x27;s x86 assembly and ARM assembly and RISC-V assembly and more, because there are genuinely different machines underneath, built on different bets. My compiler only speaks one of them — it emits &lt;strong&gt;x86-64&lt;/strong&gt; and nothing else. Which leads to a genuinely funny situation on my own laptop.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;My Mac has an ARM chip. My compiler emits x86-64.&lt;/strong&gt; So when I compile and run one of my own programs on my own machine, the x86-64 instructions my compiler wrote can&#x27;t run natively at all — my Mac&#x27;s ARM core doesn&#x27;t speak them. macOS quietly runs them through &lt;strong&gt;Rosetta&lt;/strong&gt;, Apple&#x27;s on-the-fly translator that turns x86-64 into ARM as the program executes. My compiler generates instructions for a chip I don&#x27;t even own, and a &lt;em&gt;second&lt;/em&gt; translator underneath rewrites them for the chip I do. Layers translating layers, all the way down. (This is exactly the N×M problem from last post, and the honest reason I only built one backend: doing ARM too would&#x27;ve meant a whole second code generator. The pros dodge this by emitting LLVM IR and letting LLVM&#x27;s backends target every chip — the payoff of the shared middle I &lt;em&gt;didn&#x27;t&lt;/em&gt; build.)&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -16 671 442&quot; width=&quot;671&quot; role=&quot;img&quot; aria-label=&quot;x86-64 code running on an ARM Mac&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M11 -1.4 C57 0.9, 108.3 1, 242 2 C250.4 -3.4, 248.9 5, 252.1 9.5 C247.4 17.1, 250.5 34.9, 250.5 43.2 C250.4 44.2, 245.6 46.9, 240.8 53.2 C190.2 48.3, 140.5 53, 7.2 51.8 C5.9 51.7, 0.4 45.6, -2 42 C-0.3 33.2, -1.1 26.5, -2.3 8 C0.2 5.8, -0.3 0.5, 7 0.6&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M9.1 0.1 C91.7 -1.8, 177.4 -0.1, 243 -0.3 M8.9 -0.8 C97.6 -0.7, 187.9 -1.3, 241.7 -0.2 M241.7 0 C248.9 -1.9, 249.9 3.2, 251.5 7.8 M242.7 -1.4 C248.8 1.9, 248.7 0.6, 248.6 9.4 M248.4 8.6 C249.3 19.1, 251.3 30.5, 251 40.5 M251 8 C249.9 18.5, 249.5 26.8, 249.1 41.5 M250 41.7 C248.2 45.6, 246.1 50.5, 241 48.7 M250.7 42.1 C247.7 48.8, 248.3 50, 242 50.9 M241.4 49.2 C162.2 51.2, 78.7 51.7, 7.2 49.1 M241.1 50.1 C159.7 49, 75.6 47.7, 8 50.6 M8.3 50 C3.9 51.2, -0.6 46.2, -0.5 42.4 M9.8 48.8 C4.1 51.4, -0.8 46.2, 1.4 41.5 M1.5 41 C-1.3 30.9, 1.1 24, -1.8 6.5 M-0.9 41.2 C0.8 30.1, -0.9 16.5, 0.3 7.4 M0 8.3 C1.4 1.8, 1.3 -0.1, 6.5 -1.4 M-1 9.9 C-0.9 2.9, 3.5 -2.2, 8 1.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;125&quot; y=&quot;25.0&quot;&gt;my compiler&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;290&quot; y=&quot;25.0&quot;&gt;emits x86-64 only&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M8.6 87.9 C103 89.3, 191.6 92.3, 241.1 88.7 C248.1 92.6, 248.7 90.5, 248.3 95.1 C252.8 109.9, 249.3 118.4, 246.5 128.4 C248.2 136.1, 246.1 136.6, 242.9 137.3 C171.6 145.9, 104.4 145.9, 10.3 137.7 C1.1 137.9, -2.8 136.4, -2.9 132.7 C-1.1 123.9, -3.1 114, 1 95.9 C0.1 93.7, 0.6 92.5, 8.5 89.9&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M8.8 89.1 C94.4 92.4, 179.6 92.6, 243 90 M7.7 90.1 C71.9 89.6, 134.1 90, 241.1 89.5 M241.7 90 C245.3 91.9, 248.7 94.4, 251.6 97.6 M243.1 89.4 C245.2 89.4, 250.2 92.6, 250.8 99.2 M251.9 98.6 C249.5 106.2, 250.2 117.5, 251.7 132.8 M250.5 97.4 C249.2 106.9, 250.4 115.5, 249.5 130.9 M250 131.7 C248.7 138.8, 249.1 140.8, 240.9 138.1 M249.5 132.7 C250.8 136.4, 247.3 139.6, 243.6 138.9 M241.3 141.4 C158 141.6, 71 142.3, 8.1 138.6 M242.2 140.8 C149 140.9, 57.7 140.7, 7.5 140.1 M8.3 140 C3.6 140.6, -1 135.5, -0.2 132 M10.2 139.3 C3.2 139.7, -0.9 135.2, -1.4 131.7 M1.3 131.6 C0 119.6, -0.3 107.3, 1.2 96.6 M-0.2 131 C-0.2 121.5, -0.6 111.3, 1 97.6 M0 98.3 C-1.2 94, 4.8 89.3, 8.3 91.9 M1.2 97.3 C-2.2 94.8, 5 91.4, 9.5 90.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;125&quot; y=&quot;115.0&quot;&gt;x86-64 instructions&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;290&quot; y=&quot;115.0&quot;&gt;mov eax, 2 / add eax, 3 …&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M8.7 179.2 C84.8 178.1, 165.8 178.2, 239.7 181.1 C245.8 177.4, 249.9 182, 252.5 188.5 C247.3 200.4, 248.8 213.8, 249.6 224 C249.1 230.2, 246.6 226.6, 243.3 230 C162.4 234.6, 82.1 234.1, 10.4 229 C3.9 229.6, -3 227.9, -0.3 221.7 C0.6 210.7, 1.5 199.4, 0.4 187.1 C-2 183, 0.9 177.3, 11.8 181&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M7.6 181.5 C95.8 179, 185.9 179.5, 242.6 179.8 M8.7 179.3 C97.6 182.2, 185.1 181.2, 241.1 179.9 M241.7 180 C247.4 178.2, 248.8 181.9, 250.3 190.2 M240.3 181.9 C247.9 180.5, 248.2 182.2, 251.1 189.6 M252 190.3 C249.7 200.5, 251.5 210.4, 248.4 221.6 M249.5 188.6 C249.4 198.2, 249.7 209.9, 249.3 222.2 M250 221.7 C251.9 227.8, 247 229.5, 241.7 229.4 M251.5 223 C250.9 225.6, 248.1 229.2, 241.9 230 M242.9 229 C162 230.3, 79 232.5, 9.1 231.4 M240.9 230 C171.8 228.2, 101.6 228.9, 8.4 230.3 M8.3 230 C1.9 229.5, -0.7 229.1, 1.2 222.3 M10.1 228.1 C0.8 229, -1 229.2, -2.2 220.1 M1.8 221 C-0.3 214.5, -0.5 204.3, -1 186.5 M-0.9 221.3 C0.1 212.9, 0.1 205, 0.1 188.5 M0 188.3 C2 184.5, 3.2 181.3, 6.9 178.4 M0.8 190.1 C0.1 183.6, 2 179.8, 8.5 179.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;125&quot; y=&quot;205.0&quot;&gt;Rosetta&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;290&quot; y=&quot;205.0&quot;&gt;translates on the fly, as the program runs&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M7.5 270.6 C100.9 274.8, 194.9 272.2, 239.2 270 C245.1 269.7, 252.2 274.4, 249.4 278.6 C250.3 286.7, 252.9 298.8, 251.1 313.3 C248.7 317.6, 249.5 317.5, 241.9 319.9 C177 322.1, 110.8 323.4, 7.9 320.9 C4.3 320.7, 2 319.7, 3.4 310.1 C-1.4 299.8, 1 291.6, -2 280.8 C-0.4 273.4, 3.1 266.8, 9.7 269.7&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M6.8 269.9 C98.6 268.5, 189.1 269.1, 241.1 270.9 M8.1 270.2 C68.6 268.6, 128.3 268.3, 242.3 270.8 M241.7 270 C246.5 269.6, 250.1 271.3, 249.2 279.1 M241.9 268.7 C245.4 268, 249.8 270.7, 251.4 278.4 M248.9 280.1 C247.9 291, 251.7 302, 249.3 310.7 M250.7 277.9 C249.4 287.7, 250.9 297.6, 250.6 311.3 M250 311.7 C251.2 316.9, 245.5 320.4, 241.2 321.7 M250.9 310.4 C250.3 317, 245.6 318.9, 241.2 319 M240.7 319.3 C179.8 319, 115.3 319.8, 6.8 320 M241.4 319.3 C190 321.3, 137.5 321.9, 8.9 319.5 M8.3 320 C2.9 321.9, -0.1 319.2, -1.6 313.6 M6.4 320.1 C3.3 321.5, -1.4 316, 1.4 313.7 M0.4 310.7 C-1.3 300.2, -1.5 288.1, 1.1 279.4 M-0.7 311.3 C0.3 305, 0.6 298.6, -0.4 278.7 M0 278.3 C1.1 273.5, 3.4 270.1, 7.9 269.8 M0.1 278.1 C-0.8 275.1, 2.1 269.3, 9.6 269.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;125&quot; y=&quot;295.0&quot;&gt;ARM instructions&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;290&quot; y=&quot;295.0&quot;&gt;e.g. mov w0, #2 / add w0, w0, #3 …&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M10 360.6 C80.9 354.5, 150.5 354.9, 240.2 362.7 C250 361.9, 247.7 361.9, 250.6 366.9 C254 376.4, 251.5 388.6, 247.1 404.4 C250 407.7, 250 407.2, 238.6 406.8 C157.4 409.6, 75.2 409.7, 10 410.7 C2 413.6, -0.2 410.8, -1.1 400.3 C1 389.1, 1.3 378.1, 2.4 365 C1.2 364.2, 6.2 358.8, 9.4 359.6&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M8.4 360.1 C102 359.9, 193.7 357.4, 242.1 359.9 M7.7 359.9 C90.6 360.4, 171.6 360.4, 241.9 360.8 M241.7 360 C248.8 359.6, 250.7 362.6, 250.2 367.1 M241.2 361.4 C248.5 359.8, 251.6 363.4, 249.9 369.9 M250 369.3 C249.6 377.8, 250.2 388.3, 251.3 403.2 M250 367.9 C251.1 377.8, 250.5 388.2, 250.1 402.6 M250 401.7 C251.3 407.4, 248.1 408.8, 240.1 411.8 M250.8 402.3 C247.7 405.1, 245.2 411.6, 243.3 408 M241.1 408.8 C177.2 408.8, 115.1 409.1, 7.8 409.5 M241.8 410 C158.8 408.9, 76.8 408.3, 8.4 409.8 M8.3 410 C2.2 411.1, -0.2 406, 0.4 403.5 M9.3 410.1 C3.4 411.7, 0 406.7, 0.7 400.3 M0.4 403.5 C-0.5 389.6, -1.2 376, 1.1 369.5 M0.2 401.9 C-0.4 390.4, 0.8 378.4, -0.3 367.7 M0 368.3 C-0.9 361.1, 2.5 361.7, 7.3 359.6 M-1.2 367.3 C-0.9 362.9, 3.5 359.6, 10.3 358.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;125&quot; y=&quot;385.0&quot;&gt;the Mac&#x27;s ARM core&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;290&quot; y=&quot;385.0&quot;&gt;can only run ARM&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M124.8 56.1 C124.8 67, 124 78.2, 126.5 83 M125.9 56.4 C124.8 62, 124.5 67.6, 125 85&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M131 71.4 C128.8 76.6, 126 81.9, 126 83.3 M131.7 71.7 C129.7 74.1, 128.2 76.6, 125 84.7 M124.6 84.5 C122.6 80.5, 121.1 79, 119.7 70.8 M125 84.6 C122.9 80.6, 121.5 76.6, 118.8 71&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M125.4 145.9 C125.3 155.1, 125 164.6, 123.9 175.2 M124.8 145.6 C125.4 154, 124.2 161.6, 124 173.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M131.4 161.4 C129 165.2, 126.6 169.3, 124.2 174.8 M131 161.1 C129.7 165.1, 127.2 168.6, 124.3 173.5 M125.8 174.3 C121.7 168.8, 120.3 164.8, 117.7 160.1 M125.2 173.4 C123.6 171.7, 122.5 168.4, 118.5 161&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M126 235.8 C125.2 247.2, 125.4 255, 125.3 263.3 M125.7 236.8 C124 245.9, 125.8 253.7, 125 263.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M131.8 251.3 C129 256.7, 127 259.6, 125.2 263.5 M131.6 252 C128.4 256, 127.6 259.2, 125 263.7 M124.1 264.2 C122.2 259.6, 122.2 255.6, 118.5 252.2 M125.3 263.5 C123.1 259.1, 121.1 255.3, 118.3 250.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M126.6 325.7 C125 335.2, 125.9 345.3, 126.7 355.5 M124.6 326 C124.6 337.9, 125.5 347.7, 124 354&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M132.2 341.2 C129 345.3, 127.3 349.8, 126.2 355.1 M130.8 341.4 C128.4 347, 126.7 351.1, 124.3 354 M125.3 354 C122.6 350.4, 121.1 346.5, 119.3 341.6 M125.5 353.7 C124.1 350.4, 122.4 347.3, 119.4 340.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;figcaption&gt;My compiler emits x86-64, Rosetta translates it to ARM while the program runs, and only then does the Mac&amp;#x27;s ARM core execute it.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;but-how-does-it-do-anything&quot;&gt;But how does it &lt;em&gt;do&lt;/em&gt; anything?&lt;a class=&quot;anchor&quot; href=&quot;#but-how-does-it-do-anything&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I could now read what my compiler wrote. &lt;code&gt;mov&lt;/code&gt;, &lt;code&gt;add&lt;/code&gt;, &lt;code&gt;cmp&lt;/code&gt;, &lt;code&gt;jl&lt;/code&gt; — the CPU holds numbers in a handful of registers, does tiny arithmetic, and jumps around based on comparisons. Millions of times a second. That&#x27;s the machine.&lt;/p&gt;
&lt;p&gt;Except... reread my guessing game. It prints &lt;code&gt;&quot;бага байна&quot;&lt;/code&gt; to the screen. It reads a number from the keyboard. And I just told you the CPU&#x27;s entire vocabulary is moving numbers between registers and memory. &lt;strong&gt;There is no &lt;code&gt;mov&lt;/code&gt; that puts letters on a screen.&lt;/strong&gt; There&#x27;s no register that is the keyboard. So how does a program — which can &lt;em&gt;only&lt;/em&gt; shuffle numbers — ever touch the outside world at all?&lt;/p&gt;
&lt;p&gt;It can&#x27;t. Not by itself. And the answer to how it cheats is one of the most important ideas in how computers actually work.&lt;/p&gt;
&lt;h2 id=&quot;one-floor-down&quot;&gt;One floor down&lt;a class=&quot;anchor&quot; href=&quot;#one-floor-down&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A program on its own is sealed in a box — it can compute, but it can&#x27;t &lt;em&gt;do&lt;/em&gt; anything you can see. To print a character, read a key, open a file, or send a byte over the network, it has to ask something more powerful for help. It has to call the operating system.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How does a program that can only move numbers ever put a letter on the screen?&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>How a Program Talks to the Outside World</title><link>https://your-moon.github.io/s2-4-syscalls/</link><guid>https://your-moon.github.io/s2-4-syscalls/</guid><pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate><description>&lt;h1 id=&quot;how-a-program-talks-to-the-outside-world&quot;&gt;How a Program Talks to the Outside World&lt;a class=&quot;anchor&quot; href=&quot;#how-a-program-talks-to-the-outside-world&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Building my own programming language — Season 2: To the Metal · Part 4: Syscalls&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;My guessing game prints &lt;code&gt;бага байна&lt;/code&gt; on the screen. I had just spent a whole post proving that should be impossible.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -16 602 312&quot; width=&quot;602&quot; role=&quot;img&quot; aria-label=&quot;The kernel wall&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M53.4 182.6 C63.6 183, 83.5 182, 111.2 176.5 C117 182.1, 121.2 186.6, 117.6 188.9 C120.9 204.9, 117.3 216.7, 121.8 237.8 C117.2 246.9, 117.1 252.7, 107.5 246.9 C93.4 246.7, 66.7 249.7, 48.3 251.5 C44.1 250.7, 37.8 247.8, 40.1 243.4 C42.6 231.1, 40.2 221.1, 42.7 191.2 C39.1 184.9, 40.8 180.4, 53.3 183.1&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M51.9 179.2 C73.9 177.8, 97.5 180.7, 110 178 M50.6 179.6 C74 180.2, 96.6 178.9, 110.5 180.7 M110 180 C117.5 179.2, 120.6 182.3, 118.3 189.6 M108.3 181.5 C117.1 178.3, 119 182, 119.4 188.5 M120.1 191.7 C119.2 200.6, 121.9 211.6, 121.3 238.2 M120.1 190.1 C119.5 201, 119.7 211.9, 120.6 239.8 M120 240 C121.2 246.8, 116.5 251.9, 110 249.3 M118.7 239.7 C122.1 248.2, 118.2 250.6, 109.6 251.2 M108.6 251.7 C90.6 249.3, 71.2 251.4, 51.9 251.7 M110.4 250.3 C94.7 248.6, 78 250.3, 50.4 249.5 M50 250 C43.6 251.2, 38.9 248.1, 41.4 238.2 M51 249 C45.5 247.8, 38.9 244.4, 40.2 237.9 M38.9 238.2 C38.5 219.6, 40.8 200.3, 38.5 191.9 M39.7 239.2 C40.7 221.4, 40.2 204.2, 40.1 189.8 M40 190 C38.9 183.2, 43.6 181.7, 49.9 180.5 M40.2 190.2 C39.8 181.8, 42.9 177.8, 48.9 180.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M73 203.8 C73.8 204.2, 74.6 205.8, 75 206.5 C75.3 207.1, 75.2 207.4, 75.1 207.7 C75 208.1, 74.7 208.4, 74.3 208.7 C73.9 209, 73.5 209.5, 72.6 209.7 C71.7 209.8, 69.8 210.3, 69.1 209.7 C68.4 209.2, 68.4 207.3, 68.4 206.4 C68.3 205.6, 68.3 205.1, 68.7 204.8 C69 204.4, 69.3 204.4, 70.3 204.3 C71.2 204.3, 73.9 204.2, 74.6 204.3 C75.3 204.4, 74.6 204.9, 74.5 204.8 M71.7 203.8 C72.3 203.7, 72.4 203, 73 203.4 C73.6 203.8, 74.9 205.6, 75.2 206.2 C75.4 206.9, 74.9 206.9, 74.4 207.3 C73.8 207.8, 72 208.6, 71.7 209.1 C71.3 209.6, 72.7 210.6, 72.2 210.6 C71.6 210.5, 68.9 209.6, 68.4 208.7 C67.9 207.9, 68.7 206.1, 69.2 205.6 C69.7 205.1, 71.2 205.8, 71.4 205.6 C71.7 205.3, 70.8 204.6, 70.6 204.2 C70.5 203.8, 70.4 202.9, 70.5 203&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M71.6 205 C72.3 204.8, 73.6 204.2, 74.1 204.4 C74.6 204.7, 74.4 205.8, 74.4 206.3 C74.4 206.8, 74.1 207, 74.2 207.4 C74.2 207.8, 74.8 208.4, 74.5 208.8 C74.3 209.1, 73.4 209.6, 72.5 209.5 C71.7 209.5, 70.5 208.8, 69.7 208.5 C68.9 208.2, 67.9 208.2, 67.9 207.8 C68 207.3, 69.3 206.3, 69.9 205.8 C70.6 205.2, 71.7 204.7, 71.9 204.3 C72.1 203.8, 71.3 203.4, 71.2 203.3 M72.3 204.2 C72.9 203.8, 72.3 203, 73 203.4 C73.6 203.9, 76.1 206.3, 76.2 206.9 C76.2 207.5, 74 206.5, 73.4 207.1 C72.8 207.8, 72.7 210.3, 72.5 210.7 C72.3 211.1, 72.6 209.7, 72.3 209.5 C71.9 209.3, 71.1 209.8, 70.5 209.3 C69.9 208.7, 68.7 207.3, 68.7 206.3 C68.6 205.4, 69.8 203.8, 70.1 203.4 C70.3 203, 69.9 203.9, 70.3 203.9 C70.7 203.9, 72.1 203, 72.4 203.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M87.2 203.7 C87.7 203.5, 88.8 203.5, 89.3 203.6 C89.8 203.7, 89.7 203.6, 90.1 204.2 C90.5 204.8, 91.5 206.5, 91.4 207.2 C91.4 207.9, 90 207.7, 89.6 208.2 C89.2 208.8, 89.9 210.4, 89.2 210.5 C88.6 210.7, 86.6 209.6, 85.9 209 C85.1 208.5, 85.2 207.9, 85 207.3 C84.7 206.8, 83.9 206, 84.4 205.6 C84.9 205.2, 87.6 204.9, 88 204.7 C88.4 204.6, 87.1 204.7, 86.9 204.6 M85.9 205.3 C86.7 205.5, 89.2 205.1, 89.9 205.3 C90.6 205.6, 90 206.3, 90 206.7 C90 207.2, 89.9 207.3, 90 207.9 C90.1 208.5, 91.3 210.1, 90.6 210.3 C90 210.5, 86.8 209.8, 86.2 209.4 C85.5 209, 87 208.4, 86.7 207.9 C86.3 207.5, 84.2 207.1, 84.1 206.7 C84.1 206.2, 85.9 205.7, 86.3 205.1 C86.6 204.6, 86.3 203.8, 86.2 203.4 C86.2 203, 85.6 202.5, 85.9 202.7&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M87.8 203 C88.3 202.8, 88.2 202.8, 88.7 203.3 C89.2 203.8, 90.7 205.2, 91 206 C91.3 206.9, 90.8 207.6, 90.6 208.2 C90.4 208.8, 90.4 209.3, 89.8 209.5 C89.2 209.7, 87.4 209.4, 86.9 209.4 C86.3 209.4, 86.7 210.1, 86.3 209.7 C85.9 209.4, 84.5 208, 84.3 207.3 C84 206.6, 84.2 206.3, 84.6 205.8 C85 205.2, 86.2 204.4, 86.6 204 C87.1 203.5, 87 203, 87.2 203.2 M87.3 205.1 C88 205.1, 89.5 203.7, 89.9 204.2 C90.4 204.7, 90.1 207.6, 90 208.2 C89.9 208.8, 89.8 207.3, 89.3 207.7 C88.8 208.2, 87.7 210.4, 87.1 211 C86.5 211.5, 86 211.5, 85.8 211 C85.5 210.4, 85.9 208.2, 85.7 207.6 C85.5 206.9, 84.2 207.5, 84.4 206.9 C84.6 206.4, 85.9 204.8, 86.8 204.1 C87.6 203.4, 89.5 203, 89.6 203 C89.7 202.9, 87.6 203.4, 87.4 203.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M72 224 C77 220.3, 76.8 220.5, 81.9 222.5 M72.6 226 C75.9 222.4, 78.7 219.8, 78.2 222.3 M80 222 C83.1 222.7, 86.5 221.8, 86.6 219.4 M79 221.4 C83.5 224.1, 84.5 222.7, 86.7 220.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M62.2 248.7 C62.4 260.5, 60.5 272.5, 63.6 278.7 M62.2 250.4 C61.2 256.7, 62.7 263.8, 62.5 280.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M98.8 248.6 C98.9 262.6, 97.5 272.9, 97 280.8 M97.1 249.6 C97.8 258.7, 98.3 268.1, 97.5 280.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M120.8 222.8 C127.1 221.6, 142.3 217.6, 159.1 214.4 C175.8 211.3, 210.8 205.6, 221.3 203.9 M119.8 222.2 C126.3 220.6, 144 215.4, 161.3 212.6 C178.6 209.7, 213.7 206.4, 223.8 205.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M230.9 2 C254.6 -1.3, 286.5 2.1, 309.3 -1.7 C315.8 2.9, 321.4 1.9, 320.1 7.6 C323.2 107.6, 320.1 199.9, 317.3 272 C319.6 275.1, 319.9 276.6, 312.1 282.6 C289.6 278.7, 261.8 281.9, 228.1 283.1 C226.4 279.5, 216.7 279.5, 222.2 271.9 C224.1 204.9, 220.3 137.2, 219.3 8 C220.4 5.7, 222.7 -1.2, 227.5 -3.2&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M232 -1.7 C262.5 0.9, 293.9 -0.1, 311.8 1.2 M230.9 0 C246.8 0.7, 265.2 -0.2, 309.5 -0.9 M310 0 C318.5 -1.3, 318.9 2.8, 318.3 11.2 M309.2 0 C318.6 -0.7, 322 3.8, 321.7 8.2 M320.7 10.8 C321.6 106.7, 321.3 205.9, 320.5 271.3 M320.2 10.4 C320.4 97.3, 320.7 184, 320.1 269.7 M320 270 C321 277.3, 315.9 280.6, 310.5 278.9 M320.2 269.9 C320.8 275.4, 314.6 280.2, 310.5 277.8 M311 282 C289.2 279.3, 269.1 280.9, 231.1 279.1 M309 279.7 C279.8 280, 248.1 280.9, 230.9 280.9 M230 280 C222.3 278.7, 221.5 278.1, 220.2 270.7 M231.3 280.9 C223.2 278.8, 219.8 275.7, 218.2 271.2 M220.4 269.9 C221.9 194.2, 221 117.6, 220.8 10.5 M220.4 269.5 C219.4 211.3, 220.5 151.6, 219.8 9.3 M220 10 C220.8 4.9, 225.1 2, 228.3 1.1 M220.9 9.6 C219 2.9, 224.9 0.9, 229 1.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:22px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;270&quot; y=&quot;40.0&quot;&gt;kernel&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M256.6 149.8 C259.9 146.7, 270.1 149.2, 284.4 150.9 C292.1 152.1, 293.4 151.1, 292.7 156.7 C296.5 175.1, 297.8 196.7, 298.4 213.5 C293.3 217.2, 293.1 220, 284.9 221.2 C275.6 222.4, 263.9 221.5, 251.4 218.4 C248.4 223.3, 247.6 218.5, 242.6 210.1 C242.6 190, 245.4 173.6, 242.1 159.9 C241.7 152.2, 249.7 151.4, 254.3 148&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M252.5 148.1 C267.6 150.8, 281.6 150.4, 287.3 151.5 M254 150.4 C265.1 150.6, 275.4 150.4, 286.2 149.7 M286.7 150 C290.4 151.9, 293.5 152.3, 295 158.3 M286.2 149 C292 150.2, 295.9 151.8, 294.7 159 M293.2 160.2 C295.5 171, 295.5 181.3, 296.1 211.9 M295.2 158.6 C294.4 179.1, 295 200.4, 294.4 212.4 M295 211.7 C293.1 218.6, 294.2 219.7, 286.2 221.1 M295.6 212.7 C296.1 215.2, 293.1 218.1, 286.7 220 M288.4 219.2 C274.9 220.4, 266.1 220.8, 254.2 218.9 M287 219 C276.5 219.7, 264.4 220.7, 254.1 220.1 M253.3 220 C249.2 221.4, 244.9 218.1, 246.6 211.4 M251.8 220.9 C249 220.4, 247 218.5, 244.6 213.1 M244.9 210.3 C246.4 192.8, 244.8 178.1, 243.3 159.2 M245.8 212.5 C244.8 197.8, 245.2 185.1, 244.6 158.5 M245 158.3 C245.2 153.7, 247.1 148, 254.6 150.6 M246 157.8 C245.1 154.6, 246 148.5, 255 151.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M284.9 182.5 C285.6 182.6, 287 183.4, 287.6 183.8 C288.1 184.3, 288.3 184.7, 288.1 185.3 C287.9 185.9, 287 186.9, 286.5 187.5 C286.1 188, 286 188.1, 285.4 188.4 C284.9 188.6, 284 189.4, 283.2 189 C282.3 188.5, 280.8 186.6, 280.6 185.8 C280.3 185, 281.3 184.4, 281.6 184 C282 183.5, 281.9 183.4, 282.6 183.1 C283.2 182.8, 284.8 182, 285.4 182 C286.1 182, 286.5 183, 286.7 183 M284.9 182.6 C285.2 182.6, 285 183.5, 285.6 184 C286.3 184.4, 288.7 184.9, 288.9 185.3 C289.2 185.7, 288 185.8, 287.3 186.5 C286.6 187.2, 285.4 189.1, 284.7 189.4 C284 189.7, 283.4 188.7, 283 188.4 C282.5 188, 282.4 188.1, 282.1 187.3 C281.7 186.4, 281.1 184.4, 280.9 183.4 C280.8 182.4, 280.5 181.6, 281.2 181.2 C282 180.8, 285 181.2, 285.4 181.2 C285.7 181.1, 283.7 181, 283.6 181&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M283.8 182.1 C284.4 181.7, 285.6 181.6, 286.4 182 C287.2 182.5, 288.3 184, 288.7 184.7 C289 185.3, 289.1 185.4, 288.5 185.9 C288 186.5, 286.3 187.5, 285.6 187.9 C284.9 188.3, 285.1 188.4, 284.3 188.3 C283.5 188.3, 281.3 188, 280.9 187.5 C280.4 186.9, 281.8 185.9, 281.8 185.1 C281.9 184.4, 281 183.8, 281.3 183.2 C281.6 182.6, 283.1 181.7, 283.7 181.6 C284.3 181.4, 284.9 182.2, 284.9 182.3 M283.8 182.4 C284.5 182.1, 285.5 182.2, 286 182.6 C286.6 182.9, 286.7 184, 287.1 184.7 C287.5 185.4, 288.6 185.9, 288.5 186.7 C288.3 187.5, 286.9 188.9, 286.3 189.5 C285.8 190.2, 285.7 190.6, 285.3 190.6 C284.9 190.6, 284.5 190.1, 283.9 189.3 C283.3 188.6, 282 186.9, 281.7 186.1 C281.5 185.2, 282.2 184.8, 282.5 184 C282.8 183.2, 283.4 181.6, 283.4 181.4 C283.4 181.1, 282.7 182.5, 282.5 182.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;270&quot; y=&quot;245.0&quot;&gt;syscall&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M392.4 89.9 C425.1 95.3, 457.4 90, 558 93.3 C563.4 91.4, 570.6 91.1, 573.3 102 C569.6 142.9, 572 182.1, 570.9 199.9 C571.2 207.4, 568.4 212.2, 559.6 210.3 C523.4 209.7, 485.3 205.3, 391.1 208.1 C384.6 212.5, 379.2 209.2, 376.6 198.9 C383.1 173, 380 143.7, 378.8 97.2 C381.2 92.1, 379.9 91.5, 389.1 92.6&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M389.4 89.2 C431.4 93.1, 477.3 92.2, 559 89.5 M390.9 89.9 C444.1 89.6, 497.9 90.8, 559.8 89.4 M560 90 C567.2 88.3, 568.9 94.4, 571.3 101.4 M561 91.2 C564.6 91.8, 570.1 92.2, 572.1 100.5 M569.1 101.7 C571.5 140.7, 572.5 178.1, 568.4 200.5 M570.8 99.8 C569.1 122.3, 568.9 143, 570.6 200.2 M570 200 C568.2 207.7, 567.1 212, 558.5 208.3 M571.5 201.7 C569.1 205, 568.2 209.3, 560.5 208.2 M559.4 210 C510.3 210.4, 461.1 210.9, 389 209.5 M560.8 209.3 C509.6 211.9, 461.7 211.7, 389.1 210.1 M390 210 C381.6 211.5, 381.3 206.8, 378.8 199.5 M390.9 209.3 C384.3 209.5, 380.5 206.7, 382.3 200.3 M378 198.5 C379 162.6, 379 123.6, 379 100.9 M380.3 200.1 C379 166.9, 378.8 132.6, 379.1 99.7 M380 100 C380.3 91.9, 384.6 90.2, 390.1 88.5 M378.4 101.9 C378.1 95.5, 384.3 90.1, 390.1 87.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:22px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;475&quot; y=&quot;150.0&quot;&gt;бага байна&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M475.5 209 C473.2 225.3, 473 246.4, 476.8 277.8 M475.6 210.3 C474.7 225.7, 475 241.9, 474.8 278.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M441.1 276.9 C456.3 278.7, 474.4 276.7, 509.2 280 M439.5 277.5 C461.4 277.1, 481.9 277.3, 510.8 278.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M1.4 278.9 C54.8 277.6, 111.6 277.9, 220.5 280.1 M0.4 280.6 C80.7 281.5, 159.2 282, 219.8 280.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;Because here&#x27;s what I&#x27;d learned: the CPU&#x27;s entire vocabulary is holding numbers in a few registers, doing arithmetic, comparing, and jumping. That&#x27;s it. There is no instruction that puts a letter on a screen. No register is wired to the keyboard. A program, by itself, can &lt;em&gt;only&lt;/em&gt; move numbers around inside its own box — and yet my program clearly reaches out and touches the world.&lt;/p&gt;
&lt;p&gt;So how does it ever escape the box? The answer is that it doesn&#x27;t — it &lt;strong&gt;asks something that can&lt;/strong&gt;. That something is the operating system, and the way you ask is a &lt;strong&gt;syscall&lt;/strong&gt;. This is the exact seam where &quot;a program&quot; meets &quot;a computer,&quot; and once you see it, a dozen mysterious things click into place at once.&lt;/p&gt;
&lt;h2 id=&quot;your-program-lives-in-a-padded-cell&quot;&gt;Your program lives in a padded cell&lt;a class=&quot;anchor&quot; href=&quot;#your-program-lives-in-a-padded-cell&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Here&#x27;s the setup nobody told me, stated plainly: &lt;strong&gt;your program is not allowed to touch the hardware.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Not the screen, not the disk, not the network card, not another program&#x27;s memory. The CPU literally runs in two modes — a locked-down &lt;strong&gt;user mode&lt;/strong&gt; for normal programs, and a privileged &lt;strong&gt;kernel mode&lt;/strong&gt; for the operating system — and your code runs in user mode, where the dangerous instructions simply aren&#x27;t available to it.&lt;/p&gt;
&lt;p&gt;This sounds like a restriction. It&#x27;s actually the only reason computers are usable. Because your program can&#x27;t touch the hardware directly, a crashing app can&#x27;t take down the whole machine, and one program can&#x27;t secretly read another&#x27;s memory. The operating system is the one adult in the room with the keys, and everybody else has to ask.&lt;/p&gt;
&lt;p&gt;So printing to the screen isn&#x27;t something your program &lt;em&gt;does&lt;/em&gt;. It&#x27;s a favor it &lt;em&gt;requests&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id=&quot;a-syscall-is-asking-the-kernel-for-a-favor&quot;&gt;A syscall is asking the kernel for a favor&lt;a class=&quot;anchor&quot; href=&quot;#a-syscall-is-asking-the-kernel-for-a-favor&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A &lt;strong&gt;syscall&lt;/strong&gt; (system call) is how a user-mode program asks the kernel to do something it&#x27;s not allowed to do itself. &quot;Please write these bytes to the screen.&quot; &quot;Please read a key from the keyboard.&quot; &quot;Please open this file.&quot; The program hands over the request; the kernel, with its privileges, carries it out and hands back the result.&lt;/p&gt;
&lt;p&gt;The mechanism is beautifully blunt. To ask Linux to write to the screen, you put some numbers in specific registers and run one special instruction:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;rax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; syscall #1 = &quot;write&quot;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;rdi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; arg 1: where to write — 1 means &quot;the screen&quot; (stdout)&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;rsi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; arg 2: the address of the bytes to write&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;mov&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;rdx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;       &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; arg 3: how many bytes&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;syscall&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;             &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; hand control to the kernel — &quot;do it&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Read it like a form you&#x27;re filling out. &lt;code&gt;rax&lt;/code&gt; says &lt;em&gt;which&lt;/em&gt; favor (number 1 is &quot;write&quot;). The other registers are the arguments: write &lt;em&gt;what&lt;/em&gt;, to &lt;em&gt;where&lt;/em&gt;, &lt;em&gt;how many&lt;/em&gt; bytes. Then the &lt;code&gt;syscall&lt;/code&gt; instruction is the doorbell — it hands control across the boundary into kernel mode. The kernel reads your form, actually pushes the bytes to the screen using powers your program doesn&#x27;t have, and returns.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:522px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-36 14 522 498&quot; width=&quot;522&quot; role=&quot;img&quot; aria-label=&quot;A syscall crosses from user mode into the kernel&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M8.9 32.3 C56.3 30.5, 105.3 28.6, 167.2 31.1 C169.3 30.3, 170.8 29, 171.2 32.4 C172.7 40.2, 169.2 47.3, 172.5 60.2 C172.1 62.6, 165.8 67.1, 161.5 60.4 C113.7 66.6, 61 62.6, 3 65.6 C-1.2 61, 0.8 60.8, 1 55.3 C-1.6 54.8, 2.6 44.3, 1.5 36.7 C-2.9 34.5, 1.2 28, 5.4 33.1&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M7.5 29 C41.8 29.9, 80.8 27.8, 163.1 31.2 M5.3 29 C48.9 29.7, 90.4 29.1, 165.2 29.3 M164.3 30 C167.1 29.1, 171.5 31.4, 170.2 34.4 M165.8 29.2 C167.1 30.5, 168.8 32.3, 170.5 33.4 M168.6 33.9 C170.9 43, 171.4 52, 171.1 58.2 M169.1 36.6 C170.4 41.2, 169.7 46.2, 170.7 57.3 M170 58.3 C168.8 64, 169.9 63.2, 164.8 65.8 M170.8 57.9 C168.7 61.4, 166.8 65.8, 163.3 63.8 M162.8 65.4 C101.1 61.9, 40.8 62.8, 3.7 64 M164.5 63.5 C120.5 63.2, 75.7 63.2, 5.1 64.8 M5.7 64 C3.3 62.9, -0.9 60.4, 1.6 59.5 M7.3 62.6 C0.2 62.2, 0.3 63.6, -0.4 58.1 M1.1 59.2 C0.2 51.8, 1.3 48.7, -0.5 36.9 M-0.9 57.4 C-0.5 53.1, 0.7 46.4, -0.7 36 M0 35.7 C-0.7 33.5, 3.1 29.6, 6.2 28.2 M-1.4 34.3 C1 32.2, 0.9 29.4, 4.5 30.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;85&quot; y=&quot;47.0&quot;&gt;rax = 1&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;185&quot; y=&quot;47.0&quot;&gt;which favor: write&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M7.1 67.3 C35.8 68.2, 73 74.2, 161.3 72.9 C171.5 70.8, 167.9 72.8, 168.8 74.1 C168.2 78.5, 167.8 88.8, 167.9 96.5 C167.7 101.5, 169.3 104.7, 167.3 104.1 C114.8 104.7, 70.6 105.9, 7.6 105.1 C-0.5 101.7, -0.6 99.6, -3.3 99.2 C2 95, 1.9 84.4, 0.3 73.9 C-1.9 70, 0.3 68.7, 5.7 71.1&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M3.8 70.2 C54.7 69.3, 102.5 69.5, 164.4 69.7 M4.8 69.6 C49.4 69.4, 94 70.1, 163.8 69.3 M164.3 70 C167.2 68.5, 169 73.4, 171 74.9 M166.3 71 C166.2 71, 171.9 69.9, 169.1 76.9 M169.9 76.1 C171.6 81.9, 168.8 90.1, 170.9 98.3 M169.5 74.8 C170.4 84.5, 169.2 93.1, 170 98.2 M170 98.3 C171.3 100.3, 166.8 102.1, 162.4 103.8 M171.7 98.3 C169.5 104, 166 103.8, 162.4 104.8 M166 105.5 C130.7 104.3, 96.6 100.8, 3.9 105.9 M164.1 104.3 C129.7 105.2, 97 105.3, 6.1 104.2 M5.7 104 C1.4 104.9, 0 102, -0.9 99.4 M5.2 104.6 C0.6 106, -1.1 101, 0.5 97.5 M1.3 100.1 C-1.3 90.5, -1.6 85.9, -0.4 74.7 M-0.1 98.4 C-1 90.2, 0.7 84.1, 0.6 74.7 M0 75.7 C1.7 72.6, 3.4 70.8, 6 68.3 M-0.1 77.3 C0.8 72.8, 1.4 69.3, 4.2 71.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;85&quot; y=&quot;87.0&quot;&gt;rdi = 1&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;185&quot; y=&quot;87.0&quot;&gt;where: stdout, the screen&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M5.3 109.6 C54.2 113.1, 104.2 112.7, 162.7 107.5 C166.4 111.4, 172.3 109.3, 173.5 115.7 C170.9 121.3, 166.4 132.1, 170.4 139.9 C170.5 140.5, 165.5 142.2, 166 140.5 C123.2 150, 80.2 149.3, 5.1 144.6 C0.2 142.4, -2 145.6, -0.5 136 C-1.6 135.2, 1.2 124.4, -0.9 118.3 C-1 112.6, -0.6 109.5, 6 109.2&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M4.1 111.3 C63.6 108.7, 124.1 111.3, 165.6 108.2 M6.4 110.2 C51.8 111.2, 97.6 111.1, 164.4 109.3 M164.3 110 C167.4 112, 170.5 111.5, 171.8 115.4 M162.7 108.8 C169.9 111.6, 170.4 112.1, 172.3 115.8 M171.1 114.3 C168.3 120.7, 170.3 128.3, 170.6 138.3 M169.8 115.1 C170 123.2, 170.3 131, 169.3 139 M170 138.3 C169.8 140.5, 167.7 145, 164 145.8 M168.6 138.7 C170.4 141.9, 169.8 141.8, 166 145.9 M165.3 145.6 C128.6 145.9, 88.9 146, 4.2 143.8 M163.8 143.1 C109.2 144, 52.8 144.2, 5.2 143.6 M5.7 144 C3.4 142.9, 0.9 143.6, 0.5 139.4 M7.1 142.6 C0.9 145.3, 2 143, 1.5 136.9 M1.5 137 C0.7 129.1, -0.9 123, -0.3 116.6 M0.8 137.5 C0.5 129.3, 0.7 119.9, -0.1 115.5 M0 115.7 C0 111.7, 3.8 108, 5.7 108.5 M1.2 116.3 C0.6 113.5, 1.9 109.2, 3.9 108.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;85&quot; y=&quot;127.0&quot;&gt;rsi = msg&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;185&quot; y=&quot;127.0&quot;&gt;the address of the bytes&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M3.5 151.8 C40.9 145.1, 72 145.5, 164.1 149.3 C168.5 151.9, 169.5 153.1, 171.1 157.4 C166.4 159.7, 172.2 173.5, 173 176.2 C173.4 179.4, 169 187, 164.6 184.1 C131.5 182.4, 96.9 179.7, 2.5 184.2 C0.9 183.2, -3.4 184.4, 2.4 180 C2 175.5, 0.5 164.5, -2 155.5 C0 155.3, -1.5 150.2, 6.3 147.2&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M4.4 148.5 C44.7 148.2, 82.4 149.1, 162.9 150.8 M5.9 150.8 C52.3 151, 99.2 150, 164.9 149.4 M164.3 150 C167.5 151.4, 172 153.5, 168.6 155.8 M163.2 150.7 C169 152.2, 168.9 149.7, 170.8 154.6 M168.3 156.4 C169 159.5, 171.7 166.4, 170.4 178.4 M170.2 155.3 C170.1 162, 169.8 168.9, 170.6 177.8 M170 178.3 C168.2 180.7, 168.7 183.9, 165.7 183.9 M169.4 179.1 C171.2 179.9, 168.9 184.4, 165.1 182.3 M164.5 185.6 C122.4 184.3, 81.2 184, 4.4 185.8 M163.4 183.9 C118.5 185.9, 72.2 184.2, 6.2 184.9 M5.7 184 C1.5 184.9, 1.9 181.1, 1.9 179.3 M5.1 184.5 C1.2 184.6, 0.6 180.4, -2.2 176.3 M1.8 177.9 C-0.8 172.3, 0.1 169.3, -0.2 154.4 M-0.4 178.5 C0.4 172.9, 1.1 166.7, -0.8 156.2 M0 155.7 C-1.6 150.9, 0.1 149.2, 5.4 148.6 M-1.6 155.3 C0.4 154.2, 2.4 149.2, 3.5 149.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;85&quot; y=&quot;167.0&quot;&gt;rdx = 12&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;185&quot; y=&quot;167.0&quot;&gt;how many bytes&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M-20.7 250.4 C108 250.8, 236.7 250.4, 469.6 250.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;end&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;470&quot; y=&quot;232.0&quot;&gt;user mode&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;end&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;470&quot; y=&quot;270.0&quot;&gt;kernel mode&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M59.1 182.9 C60.2 218.6, 60.1 251, 60.8 309 M60.4 184 C58.6 219.7, 58.7 257.1, 60 310.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M65.5 296.6 C64.6 301.8, 63 304.7, 60.6 309.3 M66.4 297.4 C63.8 300.4, 62.2 304.6, 60 310.2 M58.7 310 C57 307.2, 55.4 301.7, 53.3 297.3 M60.5 309.8 C58.8 306.3, 57.3 302.7, 54.5 296.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;78&quot; y=&quot;205.0&quot;&gt;syscall&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M250.3 308.7 C249.6 278.7, 250.6 245.6, 249.6 183.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;path d=&quot;M244.1 195.7 C245.7 194.5, 248 191.2, 249.7 183.5 M250.3 184.5 C252.1 186.1, 253.8 188.1, 256.1 197.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;268&quot; y=&quot;205.0&quot;&gt;result comes back&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M7.4 311 C83.7 306.2, 157.9 309.1, 290.2 311.1 C297 309.4, 302.8 316.9, 301.1 323.4 C300.6 330.8, 296.4 339.7, 300.1 361.7 C298.5 367.5, 298.3 372.7, 288.9 372.8 C235.3 373.1, 177.7 373.1, 8.3 376.1 C0.2 375.3, 2.2 372.1, 3.3 361.5 C2.4 357.8, 0.1 342.1, 1.7 321.8 C3.5 310, 2.3 313.1, 7.7 308&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M11.3 310.2 C104.8 311, 198.9 311.9, 289.1 310.1 M10.7 309.7 C111.3 309.7, 211.5 310.4, 290 309.7 M290 310 C295.4 310.1, 301.9 313.2, 299.5 320.2 M289.5 308.6 C298.2 311.3, 300 312.7, 301.4 320.4 M299.7 318.3 C299.8 335, 299.9 346.2, 300.4 363.2 M300.4 320.5 C299.1 334.3, 299.8 347.6, 299.7 363.9 M300 364 C300.3 369.3, 296.7 374.8, 291.8 373.3 M298.7 364.2 C302.3 371.6, 296.8 372.5, 289.8 371.8 M289 373.1 C223.2 375.7, 157.7 376.6, 9.4 375.3 M290.3 374.4 C202.9 376.2, 115.1 375.7, 9.3 374.6 M10 374 C5.3 373.6, -1.1 371.4, 1.4 363.8 M8.1 374.2 C1.2 375.4, 2 370.7, 2.1 363 M1.2 363.9 C-1.4 352.5, 0.7 340.2, 2 320.2 M0.1 364.3 C-0.7 353.9, -0.8 345.6, 0 319.1 M0 320 C1.6 313.6, 3.7 309.8, 8 308.3 M1.7 319.4 C0.6 312.2, 2.9 308.5, 9.6 308.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;150&quot; y=&quot;342.0&quot;&gt;kernel does the write&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M10.8 438.7 C67.2 441.3, 128.8 445.5, 289.4 439.9 C298.1 436.6, 302.2 443, 303.4 446.9 C301 456.1, 299.5 465.1, 303.4 486.4 C296.7 491.4, 300 497.4, 291.5 499 C226.6 495.1, 160.2 495.8, 7.3 495.4 C0.3 498.8, -3.2 491.2, 3.4 484.4 C-0.3 474.1, 0.2 465, -0.3 449.1 C2.4 442, 0.3 439.3, 6.8 437.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M8.1 440.2 C105.9 438.9, 201 440, 290.6 438.7 M8.8 440.7 C79.3 442.3, 148.9 441.5, 291.1 440.1 M290.7 440 C295.6 439.2, 300.7 441.8, 298.7 448.7 M292.3 439.5 C298 438.5, 300.1 443.4, 301.5 451.4 M298.8 450.3 C298.9 458.7, 300.8 470.9, 300.5 485 M299.9 449.1 C299.1 458.9, 299.1 466.4, 301 486.5 M300 486.7 C300 492.8, 297.5 496, 290.1 494.7 M300.4 486 C298.5 493.5, 298.5 494.2, 288.6 494.4 M289.3 496.1 C210.9 496.8, 131.7 496.3, 9.1 496.2 M291 496.7 C221.6 493.8, 152.1 494.6, 8.6 496.2 M9.3 496 C1.7 495.7, -1.2 491, 0.3 485.4 M10.9 494.3 C4.1 493.8, -0.2 492.9, -0.2 488.8 M-0.6 486.1 C0 470.7, 2.1 457.5, -1.4 450.5 M0.9 487.4 C-0.4 480.1, -0.2 471.2, -0.7 449.6 M0 449.3 C-0.6 441.2, 2.9 441.9, 10.2 439.6 M-0.2 449 C-2.1 443.4, 2.6 441.2, 11.1 438.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;150&quot; y=&quot;468.0&quot;&gt;screen&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M148.6 378.2 C150.5 396.1, 149.7 407.5, 151.2 433.9 M149.8 379.2 C149.6 394.6, 150.1 407.6, 150.1 434.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M155.1 420.1 C154.9 426.1, 152.8 427.5, 150.8 434 M155.9 420.8 C154 425, 152.7 427.5, 150 434.2 M150 433 C147 428.3, 145.4 423.5, 145.1 420.1 M150.1 433.3 C147.3 428.8, 145.4 424.4, 144.2 421.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;figcaption&gt;The program fills in registers in user mode, the syscall instruction crosses into kernel mode, and the kernel does the write and hands the result back.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;That&#x27;s it. That&#x27;s how &lt;code&gt;мөр_хэвлэх(&quot;Өдрийн мэнд&quot;)&lt;/code&gt; ultimately reaches your eyes. Somewhere at the bottom, after all the layers, it becomes exactly this: fill in some registers, ring the bell, let the kernel do the thing you&#x27;re not allowed to.&lt;/p&gt;
&lt;h2 id=&quot;this-is-the-real-bottom-of-hello-world&quot;&gt;This is the &lt;em&gt;real&lt;/em&gt; bottom of &quot;hello world&quot;&lt;a class=&quot;anchor&quot; href=&quot;#this-is-the-real-bottom-of-hello-world&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Let me connect the whole descent, because this is the floor I&#x27;d been chasing since Season 1.&lt;/p&gt;
&lt;p&gt;When my guessing game prints a line, here&#x27;s the full fall:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;мөр_хэвлэх(&quot;бага байна&quot;)&lt;/code&gt; — my language.&lt;/li&gt;
&lt;li&gt;→ compiles to assembly: load the address of the bytes, set up registers.&lt;/li&gt;
&lt;li&gt;→ which sets up a &lt;strong&gt;&lt;code&gt;write&lt;/code&gt; syscall&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;→ the &lt;code&gt;syscall&lt;/code&gt; instruction crosses into the &lt;strong&gt;kernel&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;→ the kernel talks to the actual screen hardware.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-36 4 572 442&quot; width=&quot;572&quot; role=&quot;img&quot; aria-label=&quot;From мөр_хэвлэх to the screen&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M8.2 22.5 C133.7 24.6, 258.9 24.3, 322 21.4 C326.5 21.1, 332.6 21.5, 333.2 30.1 C329.7 36, 327.8 47.3, 326.9 59.7 C329.7 67.2, 327.9 67.9, 323 73.2 C201.2 65.1, 82.6 66.2, 7.3 72.3 C1.1 66.9, 1.6 67.8, 3 60.2 C2.6 57, 3.7 43.9, -1.4 29.8 C-3.4 25.9, 0.2 16.7, 9.6 22&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M9.4 20.6 C90.6 19.8, 172.7 18.3, 321.3 19 M8 20.5 C86.3 19.2, 163.7 20, 322.3 19.3 M321.7 20 C326.9 20.7, 331.7 23.8, 328.3 28.3 M320.7 21.1 C328.1 20, 332.1 22.6, 330.3 26.6 M330.5 29.2 C329.1 39.4, 327.9 49.8, 328.2 61.1 M329.6 28.3 C329.5 41.9, 330.7 54.7, 329.5 61 M330 61.7 C330.6 68.4, 325.8 68.2, 322 68.4 M330.4 62.5 C331.7 66.8, 325.5 69.5, 321.2 68.5 M320.7 70.1 C237.6 69.5, 155.1 68.5, 8.4 69.5 M321.6 69.6 C219.7 71.4, 118.5 71.8, 7.9 69.7 M8.3 70 C1.4 71.9, -1.9 69.1, 0.6 60.4 M9.7 70.8 C0.9 71.2, -0.5 67.7, -1.2 62.1 M0 60.3 C1.6 52.8, -0.9 44.5, 1.9 26.5 M-0.1 61.2 C0.8 54.1, -0.6 47.7, -0.3 27.9 M0 28.3 C0 21.4, 2.2 18.8, 9.9 21.1 M-1.8 27 C-0.5 24.8, 2.2 21, 8.6 19.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;165&quot; y=&quot;45.0&quot;&gt;мөр_хэвлэх(&quot;бага байна&quot;)&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M6.2 111.4 C88.8 105.9, 170.6 106.9, 323 107.9 C325.8 107.8, 329.5 110.9, 331.5 115.5 C326.7 129.2, 327 139.5, 331.7 148.3 C329 155.2, 326.9 159.9, 323.2 161.7 C233.6 157.7, 143.6 158.2, 7.4 160.6 C1.8 158, 0.2 154.9, 1.9 150 C3.1 141.5, -1.1 137.1, 0.6 114.8 C2.3 115.4, 0.9 112.5, 11.3 107.9&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M7.1 110.1 C92.2 111.4, 176.3 110.3, 321.7 110 M7.9 109.4 C129.5 111.3, 252.5 110.6, 322 109.5 M321.7 110 C325.8 109, 328.7 111, 329 117.9 M320.2 109.5 C327.7 110, 329.5 111.5, 332.1 118.6 M331.6 118.1 C330.1 129.4, 330 139.8, 330.6 150.5 M330.7 118.5 C329 125.9, 330.3 134.3, 329.5 151.1 M330 151.7 C329.6 158, 329.1 159.5, 322.8 161.8 M329 153 C331.2 155.4, 326.9 160.5, 323.8 158.8 M321.6 159.9 C210.2 160.6, 100.6 162.2, 8.8 159.1 M321.6 160 C254 162.1, 187.4 162, 7.9 160.1 M8.3 160 C2.5 158.4, -1.9 158.9, -1.1 152.7 M9.9 158.5 C1.3 158, 0.5 159, 1.3 151.9 M0.6 150.4 C-1.3 141.1, 0.5 135.6, 0.2 118.3 M0.1 151.6 C0.3 144.8, 0.7 136.5, -0.3 117.5 M0 118.3 C-0.8 113.7, 3.1 110.4, 9.5 108.3 M1.6 117.8 C-2.2 114.5, 3.8 110.7, 7 109.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;165&quot; y=&quot;135.0&quot;&gt;assembly: address + registers&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M9.2 200.3 C111.8 200.3, 212.7 202.7, 324 199.5 C325 201.6, 326.4 200.4, 329.7 208 C330.9 222.5, 333.5 231.8, 329.2 244.1 C328.4 250.4, 326 251.8, 323.3 250.1 C198.1 250.3, 79.3 250.2, 7.5 248.8 C2.5 249.2, -1.1 249.1, 0.8 239.8 C-2.4 226.4, 2.5 217.1, 2.6 207 C0.9 205, 1.7 201.1, 5.7 201&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M7.6 199.6 C93.9 198.5, 179.8 200.8, 322.1 201 M7.9 199.8 C111.4 197.5, 214.6 198.2, 321.8 199.6 M321.7 200 C328.6 201.3, 329.8 202.1, 329.8 207.6 M319.7 201.9 C327.3 199.9, 331.4 200.5, 329.3 210.5 M328.8 207 C330.3 219.5, 331.4 233.8, 329 239.8 M329.9 208.7 C331.2 218.5, 330.7 227.2, 329.4 241.3 M330 241.7 C328.5 247.6, 328.5 250.8, 323.7 251.3 M331.5 243.5 C330.6 248.5, 328.3 251.4, 321.7 249.2 M322.5 249.7 C248.3 247.2, 174.3 248.6, 9.2 248.7 M321.6 250.3 C225.7 251.4, 129.5 250.7, 7.9 250.5 M8.3 250 C3.7 248.8, -1.8 248.8, 1.3 240.9 M10 250.1 C1.7 249.4, 1.5 245.6, -0.9 241.7 M1.2 240.4 C-0.2 233.3, 1.9 222.7, -1.5 210 M0.3 242.1 C-0.2 233.5, 0.1 225.3, -0.2 209.1 M0 208.3 C-1.7 202, 4 201.9, 9.2 199.5 M1 208.7 C0.7 204.2, 0.7 200.3, 9.9 200.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;165&quot; y=&quot;225.0&quot;&gt;a write syscall is set up&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M7.2 289.2 C129.6 294.8, 249.7 293.3, 319.8 291.2 C324.3 288.3, 330.6 289.8, 328 300.5 C326.7 308.6, 331.5 324, 326.8 332.8 C327.7 338.4, 325 336.5, 323.5 338.6 C230.5 337.8, 135.2 337.1, 7.7 342.2 C3.2 340.3, -2.5 336.2, -0.3 329.5 C-1.9 318.1, -2.3 310.4, -2.6 299.2 C-0.5 294.6, 2.5 289.7, 7.4 286.9&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M8.1 289 C95.5 293, 180.5 292.8, 322.5 289.2 M7.9 290.2 C93.3 289.6, 176.7 288.9, 321.6 289.8 M321.7 290 C327.5 289.6, 330.8 293.3, 330.5 297.2 M323.3 290.3 C327 289.8, 328.7 294, 331.1 297.9 M329.9 300 C331.2 306.8, 329.5 314.4, 331.4 333.1 M329 298.9 C330.7 309.2, 330.4 320.1, 329.3 331.4 M330 331.7 C331.4 337.2, 327.9 338.1, 320.5 340.8 M330 330 C330.1 337.1, 325.2 337.8, 319.6 339.5 M320.6 339.5 C220.9 338.3, 119.7 339.4, 9.6 341.1 M321.6 340.7 C197.3 340.6, 73.1 340.9, 7.9 339.5 M8.3 340 C0.8 339.2, -1.8 338.6, -0.3 333.2 M10.2 341.8 C2.1 340.7, -2 336.9, 1.6 331.5 M1.8 330.4 C0.9 321.6, -0.7 313.8, 0.8 297.8 M0.6 332.5 C-0.1 322.2, 0.1 314, -0.2 298.7 M0 298.3 C1.4 294.3, 1 289.5, 8.9 290.7 M0.4 299.5 C-1 293.9, 2.2 289.9, 8.3 291.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;165&quot; y=&quot;315.0&quot;&gt;kernel, entered by syscall&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M10.2 378.1 C84.8 376.1, 166.5 375.9, 320.8 377.7 C330.7 382.1, 327.5 379.3, 333.4 385.9 C330.8 401.8, 330.7 416.3, 331.6 421.4 C327.1 426.4, 324.1 428.5, 323.7 427.1 C257.7 430.5, 196.2 429.1, 7.8 430.5 C3.8 431.4, 3.4 430.4, -1.3 419.3 C-0.2 409.7, 1.3 403.6, -0.6 391.5 C-1.9 384.2, 3.3 378.3, 9.1 380&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M8.6 381.4 C97.1 380.1, 184 380.4, 322.9 380.2 M7.9 380.6 C73.7 381.6, 140.2 381, 321.4 379.9 M321.7 380 C326.4 381.9, 331.9 384.4, 331.3 386.9 M322.8 378.7 C326.6 379.7, 330.6 383, 328.3 389.9 M331 388.9 C331.5 396.9, 330.9 404.4, 329.8 422.5 M330.2 389.1 C330.2 399.9, 330.1 413.1, 329.3 421.5 M330 421.7 C330.4 426.8, 327.2 429.4, 321.4 430.2 M328.6 420.5 C329.6 425.7, 326.6 428.8, 322.2 429.9 M321.6 429.4 C256.2 429.3, 190.6 430.2, 7.2 430.7 M321.6 429.6 C231.6 429.9, 140.5 429.7, 7.9 429.9 M8.3 430 C2 429.6, -1.7 428.5, -1.9 421.4 M6.4 429.4 C2.5 432.1, -1 428.2, -0.5 421.4 M-1.6 420.5 C1.9 413.9, 0.7 404.9, -1 389.6 M0.8 421 C-0.6 412.9, -0.5 402.8, -0.2 388.3 M0 388.3 C0.5 382.6, 1.9 381, 8.6 381.9 M-0.3 390.3 C1.9 383.6, 3.8 379.5, 6.6 381.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;165&quot; y=&quot;405.0&quot;&gt;screen hardware&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M164.9 75.8 C164.5 86.1, 166.6 92.4, 163.3 105.9 M165.2 75.4 C165.9 84.2, 165.2 90.4, 166 103.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M171 91.3 C168.8 96.4, 168.4 98.6, 163.8 105.3 M171.3 91 C170 95.2, 167.9 97.7, 165.7 103.5 M163.7 104.7 C162.8 100.9, 160.9 96, 159.8 90.5 M165.5 104.6 C163.6 100.4, 160.8 96.6, 158.4 92&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M165.5 165.7 C164.4 174.2, 163 182.8, 164.7 194 M164.1 166.6 C164.5 174.1, 164.8 184.4, 165 193.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M171.4 181.2 C168.8 185, 166 188.9, 164.8 194 M170.5 181.8 C168.7 184.8, 166.9 189.7, 165 193.7 M164.9 194.5 C163.1 191.7, 162.6 186.9, 157.7 182.6 M165.6 193.4 C163.2 191.7, 162.1 188.5, 159.5 181.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M166.1 255.6 C164.3 266.3, 163.5 273.1, 166.1 282.2 M165 255.8 C165.1 266.1, 164.5 278.4, 166 283.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M171.8 271.1 C168.8 276.4, 166.3 279.1, 165.8 282.7 M171.1 271.3 C168.7 275.8, 165.9 281.7, 165.7 284 M166 284.3 C163.4 282.5, 161.5 277.7, 158.5 272 M164.4 283.6 C162.7 279.1, 160.7 275.4, 159.2 271.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M166.6 345.5 C164.8 354.3, 164.5 363.5, 163.5 374.3 M165.9 345 C165.7 352.5, 166.1 359.3, 165 374.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M172.2 361 C169 365.1, 166.9 369.4, 163.9 374.2 M171.7 360.7 C170 364.2, 168.8 367.2, 165 374.2 M164.4 374.2 C162.8 368, 160.9 363.5, 159.3 361.3 M164.6 373.7 C163.5 370.2, 161.7 367.2, 159 361.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-20.7 269.7 C145.4 270.5, 311 270, 520 269.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;370&quot; y=&quot;250.0&quot;&gt;user mode&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;370&quot; y=&quot;292.0&quot;&gt;kernel mode&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;370&quot; y=&quot;45.0&quot;&gt;my language&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;The full fall from my language down to the screen: three steps in user mode, then the syscall instruction crosses into the kernel.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Every &lt;code&gt;print&lt;/code&gt; in every language you&#x27;ve ever used bottoms out here. Python&#x27;s &lt;code&gt;print&lt;/code&gt;, JavaScript&#x27;s &lt;code&gt;console.log&lt;/code&gt;, C&#x27;s &lt;code&gt;printf&lt;/code&gt; — follow any of them down far enough and you hit a &lt;code&gt;write&lt;/code&gt; syscall crossing from user mode into the kernel. There is no other way out of the box. This one narrow doorway is how &lt;em&gt;all&lt;/em&gt; software touches the world.&lt;/p&gt;
&lt;p&gt;That realization was the quiet climax of the whole project for me. &quot;How does a few letters become something real?&quot; The honest answer: the letters become numbers, the numbers become instructions, the instructions fill in a form, and a syscall rings the kernel&#x27;s doorbell.&lt;/p&gt;
&lt;h2 id=&quot;how-do-i-actually-see-this-happening&quot;&gt;How do I actually &lt;em&gt;see&lt;/em&gt; this happening?&lt;a class=&quot;anchor&quot; href=&quot;#how-do-i-actually-see-this-happening&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;At this point I didn&#x27;t want to take the book&#x27;s word for it. I wanted to &lt;em&gt;watch&lt;/em&gt; my program make these calls. And Linux has a wonderful tool for exactly that: &lt;strong&gt;&lt;code&gt;strace&lt;/code&gt;&lt;/strong&gt;, which prints every syscall a program makes, live.&lt;/p&gt;
&lt;p&gt;Run any program under it and the box goes transparent:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$ strace ./guess
...
read(0, &quot;42\n&quot;, 1024)              = 3
write(1, &quot;\321\201\320\260...&quot;, 20) = 20
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;There it is, in the open: my program called &lt;code&gt;read&lt;/code&gt; to get the guess from the keyboard (&lt;code&gt;0&lt;/code&gt; is stdin), and &lt;code&gt;write&lt;/code&gt; to print the result (&lt;code&gt;1&lt;/code&gt; is stdout). Every door my program opens to the outside world, &lt;code&gt;strace&lt;/code&gt; shows you, one line each. The first time I ran my own compiled program under &lt;code&gt;strace&lt;/code&gt; and watched the &lt;code&gt;write&lt;/code&gt; calls scroll by — the exact calls I&#x27;d set up in assembly — the abstraction was completely gone. I could &lt;em&gt;see&lt;/em&gt; my language talking to the kernel.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;88 4 560 208&quot; width=&quot;560&quot; role=&quot;img&quot; aria-label=&quot;Watching the write calls&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M160 18.7 C243.2 16.5, 332.5 15.8, 470.6 20.1 C473.7 22.6, 478 20.2, 477.6 31.2 C478.7 67.6, 481.1 108.3, 477.6 148 C483.4 155.4, 473.5 160.3, 470.2 159.4 C382.9 156.4, 293.4 154.8, 157.7 162.5 C155.3 157.6, 148.9 157.1, 151.7 148.2 C152.4 127.8, 147.8 103.4, 148.7 28.9 C147.5 25.9, 154.1 23.6, 161.8 17.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M158.9 18.7 C229.6 21.4, 300.2 20.9, 470.1 20.4 M159.8 20.7 C252 20.5, 344.2 20.4, 469.8 20.5 M470 20 C478.4 21.7, 479.5 23.7, 481.4 28.2 M469.7 18.1 C474.8 22.3, 479.3 25.1, 480.6 29.3 M479.1 28.6 C480 71, 480.8 113.1, 480.7 151 M480 29.8 C480.3 73.9, 481 118, 480.1 149.1 M480 150 C481 157.2, 477.5 161.8, 471.4 161.5 M478.2 149.5 C481.7 155.5, 475.4 160.8, 471.2 161.1 M469.1 159 C354.6 161.2, 240.4 162.3, 160.4 160.3 M469.7 159.3 C405.2 162.3, 339.5 162.6, 159.8 160.3 M160 160 C152.6 161.2, 150.3 156.3, 149.6 150 M161.6 158.5 C153 158.8, 149.1 157.4, 148.3 148.6 M148.4 151.2 C150.4 107, 151.4 64.5, 151.8 30.7 M149.2 150.9 C150.6 106.7, 149.5 61.8, 149.4 31 M150 30 C148.5 24.7, 151.4 20.1, 158.4 20.1 M148.9 29.6 C148.2 22.8, 155.1 21.7, 160.8 21.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M170.2 29.8 C260.1 27.2, 353 31.6, 455.3 33.1 C465.6 30.6, 468.1 35.6, 468 39.9 C466 68.4, 467.3 96.4, 469 135.7 C470.7 144.2, 463.9 146.4, 459.9 150.3 C370.8 151.2, 283.7 147.8, 169.5 146.1 C162.5 147.5, 163.9 144.3, 165 138.1 C159.7 101.1, 159 69.8, 163.3 39.3 C164.9 32.9, 167.4 33.3, 172 33.7&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M171.3 30.6 C236.2 32, 301.9 30.3, 459.2 31 M172.4 32.1 C275.1 31.8, 377.2 32, 458.5 31.3 M458 32 C466.5 31.3, 467.2 35.8, 468.2 41.6 M457.9 31.6 C466.3 32.4, 469 34.1, 467.6 42.6 M467.8 41.1 C467.9 76.3, 468.9 110.9, 466.9 138.3 M468 42.7 C467.5 70, 467.4 99.9, 467.7 137.7 M468 138 C469.6 143.5, 464.9 147.3, 459 146.6 M466.4 138 C467.6 143.1, 464.9 150, 456.7 148 M457.3 147.4 C372.3 148.8, 285.8 149.6, 172.4 146.7 M458.2 148.5 C377.6 148.3, 295.4 147.8, 172.5 148.1 M172 148 C163.8 146.5, 161.5 146, 160.3 139.5 M170.3 148.5 C163.4 147.6, 159.9 144.3, 163.3 139 M160.1 136.5 C161.4 102.8, 164.2 66.7, 162.5 40.8 M161.4 138.7 C162.9 100.8, 162.3 64.3, 161.4 41.4 M162 42 C160.2 36.3, 164.2 32.2, 171.9 33.9 M161 41.6 C160.7 33.6, 165.4 30.2, 174.2 33.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M127.5 165.1 C207 163.9, 288.2 164.8, 503.9 164.7 C510.9 172.6, 516.9 175, 528.8 184.8 C425 186.5, 326.7 188.7, 105.7 189.4 C111.2 179.5, 116.2 173.1, 128.5 165.5&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M125.8 167.2 C211.4 166.3, 298.2 166.3, 503.3 166.5 M125.7 165.6 C208.9 165.1, 292.6 165.4, 503.8 165.6 M505 165 C510.2 171.4, 516.3 175.7, 527.6 188.4 M504.8 166.5 C509.2 171.5, 514.1 176.2, 525.4 188.2 M525.2 187.7 C372 187.6, 219.3 186.6, 105 188.1 M526.1 187.9 C427.4 188.9, 329.6 188.8, 103.6 188.2 M102.3 189.5 C110.3 179.1, 117.6 173.1, 125.5 165.8 M104.5 188.2 C112.7 179.9, 122 169.9, 127 166.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:12.299999999999999px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;176&quot; y=&quot;54.0&quot;&gt;$ strace ./guess&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:12.299999999999999px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;176&quot; y=&quot;77.0&quot;&gt;read(0, &quot;42\n&quot;, 1024) = 3&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M601.7 40.4 C605.8 39.6, 610.5 41.3, 614 44.1 C617.5 46.9, 621.4 52.6, 622.6 57.3 C623.9 62, 623.7 68.4, 621.5 72.4 C619.3 76.3, 613.5 79.3, 609.3 80.9 C605.1 82.4, 600.3 82.8, 596.2 81.7 C592.1 80.6, 587.1 78, 584.5 74.4 C581.8 70.7, 579.6 64.6, 580.2 59.9 C580.8 55.2, 584.2 49.2, 588 46.2 C591.7 43.1, 599.7 42.4, 602.5 41.7 C605.3 41, 604.6 41.6, 604.7 41.9 M593.8 42.4 C597.8 40.4, 603.9 41.2, 608.3 42.4 C612.7 43.6, 617.9 46, 620.3 49.6 C622.7 53.2, 623.2 59.4, 622.7 64 C622.2 68.7, 620.3 74.1, 617.2 77.3 C614.1 80.6, 608.8 83, 604.2 83.5 C599.6 84, 593.1 83.3, 589.4 80.4 C585.6 77.5, 583.3 70.8, 582 66.2 C580.6 61.6, 579.7 56.6, 581.4 52.6 C583.1 48.6, 590.2 43.7, 592 42.2 C593.8 40.7, 592 43, 592.3 43.5&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M609.6 42.4 C613.7 43.8, 618.5 48, 620.5 52.1 C622.5 56.3, 622.8 62.8, 621.7 67.3 C620.6 71.8, 617.5 76.7, 614.2 79.2 C610.9 81.7, 606.1 82.5, 601.7 82.4 C597.4 82.2, 591.5 81.1, 588.1 78.3 C584.6 75.4, 581.6 69.9, 581.1 65.2 C580.5 60.5, 582.1 54.2, 584.7 50.1 C587.2 46.1, 591.5 42, 596.4 40.8 C601.4 39.7, 611 42.2, 614.3 43.2 C617.6 44.2, 616.4 46.2, 616.2 46.6 M606.3 41.6 C610.2 41.9, 615.7 44.7, 618.4 48.1 C621.1 51.6, 622.6 57.7, 622.5 62.3 C622.5 66.9, 621 72.1, 618 75.6 C615 79.1, 609.5 82.5, 604.7 83.2 C599.8 83.8, 592.6 82.2, 589 79.4 C585.4 76.7, 583.7 71.1, 582.9 66.8 C582 62.5, 582.1 57.4, 583.8 53.4 C585.4 49.5, 588.9 45.5, 592.8 43.3 C596.6 41.1, 604.3 40.4, 606.8 40.4 C609.2 40.3, 607.5 42.6, 607.5 43.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M593.7 52.6 C594.4 52.6, 595.1 53.4, 595.6 53.8 C596 54.2, 596.1 54.3, 596.4 54.8 C596.6 55.4, 597.2 56.3, 596.8 57.1 C596.5 57.9, 595 59.4, 594.3 59.5 C593.7 59.7, 593.3 58.5, 592.9 58 C592.5 57.4, 592.1 56.8, 591.8 56.4 C591.5 56, 591 56.4, 591.2 55.8 C591.4 55.2, 592.3 53.5, 592.9 53 C593.4 52.5, 594.3 53, 594.5 52.9 C594.8 52.8, 594.4 52.5, 594.3 52.5 M594.5 54.6 C594.9 54.7, 595.2 54.4, 595.5 54.9 C595.9 55.3, 596.8 56.7, 596.6 57.4 C596.5 58.2, 595.3 58.9, 594.8 59.5 C594.3 60, 593.9 60.9, 593.6 60.5 C593.4 60.1, 593.7 57.8, 593.1 57.1 C592.4 56.3, 590.1 56.6, 589.8 56 C589.4 55.5, 590.3 54.4, 591 53.8 C591.7 53.1, 593.4 52.4, 593.9 52.1 C594.4 51.8, 594.1 51.7, 594.1 52 C594.1 52.2, 593.6 53.3, 594 53.5&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M594.6 53.3 C595.3 53.7, 596.5 54.7, 596.8 55.3 C597.1 55.9, 596.7 56.6, 596.5 57 C596.3 57.3, 596.1 57.2, 595.7 57.5 C595.3 57.8, 594.5 58.6, 594 58.8 C593.6 59.1, 593.3 59.2, 592.9 58.7 C592.5 58.3, 592 57, 591.8 56.2 C591.7 55.3, 592.2 54.3, 592.3 53.6 C592.3 53, 591.7 52.5, 592.3 52.3 C592.8 52.2, 594.9 52.3, 595.6 52.7 C596.4 53, 596.9 54.5, 596.8 54.7 M593 54.5 C593.4 54, 593.7 52.2, 594.2 52 C594.8 51.8, 595.8 53, 596.4 53.5 C597 53.9, 598 54, 597.9 54.7 C597.9 55.5, 596.5 57, 595.9 58 C595.4 58.9, 594.9 60.2, 594.5 60.5 C594 60.7, 593.6 60.3, 593.2 59.5 C592.8 58.6, 592.3 56.4, 592 55.4 C591.7 54.5, 591.5 53.8, 591.4 53.6 C591.4 53.4, 591.8 54.7, 591.7 54.5 C591.7 54.3, 591.2 52.6, 591.3 52.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M610.9 52.9 C611.4 53.1, 611.6 54.5, 612.1 55.1 C612.6 55.7, 613.8 55.8, 613.9 56.3 C613.9 56.8, 613 57.5, 612.4 58 C611.8 58.4, 611.2 58.6, 610.5 58.8 C609.8 59.1, 608.7 59.9, 608.3 59.5 C607.8 59, 607.9 56.9, 607.8 56.3 C607.8 55.6, 607.8 56.1, 608.1 55.5 C608.4 54.9, 608.8 52.8, 609.4 52.6 C609.9 52.4, 610.8 54, 611.3 54.2 C611.8 54.5, 612.1 54, 612.2 53.9 M611.8 53.1 C612.4 53, 612.7 53.6, 612.7 53.9 C612.6 54.2, 611.6 54.5, 611.7 55 C611.9 55.5, 614 56.4, 613.7 57 C613.3 57.6, 610.2 58.4, 609.6 58.7 C609 59, 610.2 58.9, 610 58.8 C609.7 58.7, 608.1 58.8, 607.9 58.2 C607.6 57.5, 608.5 55.4, 608.7 54.8 C608.8 54.2, 608.4 54.7, 608.6 54.6 C608.8 54.5, 609.7 54.4, 609.8 54.2 C609.9 54, 609.5 53.5, 609.5 53.2&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M610.9 53.6 C611.6 53.6, 613.1 53.8, 613.5 54.4 C613.8 54.9, 613.4 56.1, 613.2 56.8 C612.9 57.4, 612.8 57.8, 612.1 58.2 C611.5 58.6, 610.2 59.3, 609.3 59.4 C608.5 59.4, 607.7 58.8, 607.2 58.4 C606.7 58, 606.5 57.8, 606.4 57.2 C606.3 56.7, 606.2 56, 606.6 55.2 C607 54.4, 608 52.7, 608.9 52.5 C609.8 52.4, 611.3 54, 611.7 54.2 C612.2 54.4, 611.8 54, 611.7 53.7 M610.9 52.4 C611.5 52.3, 610.9 52.3, 611.3 52.7 C611.8 53.1, 613.1 53.8, 613.6 54.8 C614 55.7, 614.6 57.7, 614.2 58.3 C613.7 58.9, 611.3 58.2, 610.7 58.3 C610.2 58.4, 611.4 59.1, 611 59 C610.5 58.9, 608.7 58.3, 608.1 57.8 C607.5 57.3, 607.4 56.6, 607.4 56.1 C607.3 55.5, 607.3 54.7, 607.9 54.3 C608.4 53.9, 610.7 53.7, 610.9 53.5 C611.1 53.3, 609.5 52.9, 609.2 53.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M602.7 66.5 C603.7 66.8, 605.6 67.9, 606.3 68.7 C607.1 69.6, 607.4 70.5, 607.2 71.7 C607 72.9, 605.9 75.4, 605.2 76.2 C604.4 76.9, 603.7 75.9, 602.6 75.9 C601.5 76, 599.1 76.9, 598.4 76.2 C597.6 75.6, 598.2 73.2, 598 72.1 C597.9 70.9, 596.9 70.6, 597.4 69.5 C597.9 68.5, 600.2 66.1, 601.3 65.6 C602.3 65, 603.2 66.1, 603.8 66.5 C604.4 66.8, 605.1 67.2, 605 67.5 M602.1 64.9 C602.8 64.6, 603 65.7, 603.9 66.7 C604.9 67.7, 607.1 69.5, 607.6 70.7 C608.1 72, 608 73.1, 607.1 74.3 C606.2 75.4, 603.5 77.4, 602.2 77.5 C600.9 77.7, 600 75.8, 599.2 75.2 C598.4 74.6, 597.6 74.6, 597.3 73.9 C597.1 73.2, 597.4 71.9, 597.6 71 C597.7 70, 597.5 68.7, 598.2 67.9 C598.9 67.2, 601 66.9, 601.5 66.6 C602 66.3, 600.8 66, 600.9 66.1&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M603.7 67 C604.6 67.5, 605.1 68.8, 605.7 69.7 C606.4 70.6, 607.7 71.3, 607.7 72.4 C607.7 73.5, 606.7 75.4, 605.9 76.3 C605 77.1, 604 77.9, 602.7 77.8 C601.4 77.6, 599.2 76.3, 598.3 75.4 C597.4 74.5, 597.3 73.4, 597.1 72.3 C596.9 71.2, 596.5 70.2, 597.2 69.1 C597.8 68.1, 599.8 66.3, 600.8 66 C601.8 65.7, 602.6 67.2, 603.2 67.4 C603.9 67.6, 604.7 67.2, 604.6 67.3 M602 66.6 C603.2 66.4, 605.1 66.6, 605.7 67.4 C606.2 68.2, 605.6 70, 605.4 71.3 C605.3 72.7, 605.3 74.8, 604.7 75.6 C604.2 76.4, 602.8 76.3, 602 76.2 C601.1 76.1, 600.5 75.6, 599.7 75 C598.9 74.4, 597.8 73.2, 597.4 72.6 C597 72, 596.8 72.3, 597.1 71.6 C597.4 71, 598.3 69.7, 599.3 68.7 C600.3 67.8, 602.5 66.1, 603.2 65.9 C603.8 65.6, 603.6 67.1, 603.2 67.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M601.7 85.1 C602 100.4, 603.3 115.6, 602.7 150 M601.7 83.7 C601.7 100.3, 601.5 117.9, 602.7 149.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M601.5 148.3 C595.5 159.4, 592.2 170.9, 581.1 194.2 M601.7 150.9 C596 165.5, 587.9 182.1, 582.7 196.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M602.1 148.2 C605.7 161.5, 612.5 171.4, 622.5 196.3 M602.6 150.1 C609.3 168.3, 617.1 186, 621.7 195.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M602.6 100.1 C595.5 107.8, 592.7 116.1, 581.9 130.5 M601.5 101.3 C596.2 110, 591.2 117.6, 580.7 131.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M603.2 104 C608.3 93, 618.5 82.9, 631.3 62.6 M602.4 102.5 C612.5 89.7, 622 76.8, 631.7 61.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;If you learn one tool from this whole series, make it &lt;code&gt;strace&lt;/code&gt;. It turns &quot;the program does something&quot; into a literal, readable list of every favor it asks the system for.&lt;/p&gt;
&lt;h2 id=&quot;but-when-it-breaks-strace-isnt-enough&quot;&gt;But when it breaks, &lt;code&gt;strace&lt;/code&gt; isn&#x27;t enough&lt;a class=&quot;anchor&quot; href=&quot;#but-when-it-breaks-strace-isnt-enough&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;strace&lt;/code&gt; shows you the &lt;em&gt;doors&lt;/em&gt; a program opens. It doesn&#x27;t show you what&#x27;s happening &lt;em&gt;inside&lt;/em&gt; — the registers, the values, the exact line where things go wrong. And plenty went wrong. My compiler would emit assembly that crashed with no explanation, or computed the wrong number, and &lt;code&gt;strace&lt;/code&gt; just showed me a program calling &lt;code&gt;write&lt;/code&gt; with garbage. It told me &lt;em&gt;that&lt;/em&gt; something was wrong, never &lt;em&gt;where&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;To see inside a running program — to freeze it mid-instruction, peek at the registers, and step forward one line at a time — I needed a different, almost magical kind of tool. A debugger. And I had no idea how something could reach &lt;em&gt;inside&lt;/em&gt; another running program and stop it in its tracks.&lt;/p&gt;
&lt;h2 id=&quot;one-floor-down&quot;&gt;One floor down&lt;a class=&quot;anchor&quot; href=&quot;#one-floor-down&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Next we pick up the single most useful skill I gained from this whole project: driving a debugger, and understanding the genuinely surprising trick that lets one program freeze, inspect, and puppeteer another.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How can one program freeze another one mid-instruction?&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>How Does gdb Work?</title><link>https://your-moon.github.io/s2-5-gdb/</link><guid>https://your-moon.github.io/s2-5-gdb/</guid><pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate><description>&lt;h1 id=&quot;how-does-gdb-work&quot;&gt;How Does gdb Work?&lt;a class=&quot;anchor&quot; href=&quot;#how-does-gdb-work&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Building my own programming language — Season 2: To the Metal · Part 5: The Debugger&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;My compiler kept producing programs that crashed for no reason I could see.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;strace&lt;/code&gt; from last post showed me the &lt;em&gt;doors&lt;/em&gt; my program opened — every syscall it made — but not what was happening inside: the registers, the variables, the exact instruction where everything fell apart. I&#x27;d stare at a page of assembly my own compiler had written and have no idea which line was lying to me.&lt;/p&gt;
&lt;p&gt;So I learned to use a debugger, &lt;strong&gt;gdb&lt;/strong&gt;, and it changed everything about how I work. But the thing that really got me — the thing I want to show you — is a question I couldn&#x27;t stop asking once I started relying on it: &lt;em&gt;how does gdb do this at all?&lt;/em&gt; How can one program reach inside another program that&#x27;s already running, freeze it, and read its private registers? That sounds like it should be impossible. It turns out the answer is one of the best tricks in the whole system.&lt;/p&gt;
&lt;h2 id=&quot;first-what-it-feels-like-to-use&quot;&gt;First, what it feels like to use&lt;a class=&quot;anchor&quot; href=&quot;#first-what-it-feels-like-to-use&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Let me show you the magic before the mechanism, because the magic is the point.&lt;/p&gt;
&lt;p&gt;You run your program under gdb, and suddenly you&#x27;re in control of time. You set a &lt;strong&gt;breakpoint&lt;/strong&gt; — &quot;stop when you reach this line&quot; — and the program runs full speed until that exact spot, then &lt;em&gt;freezes&lt;/em&gt;, mid-flight, waiting for you.&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$ gdb ./guess
(gdb) break guessGame
(gdb) run
Breakpoint 1, guessGame () at guess.mylang:4
(gdb) print target
$1 = 42
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;There it is. My program stopped dead inside &lt;code&gt;guessGame&lt;/code&gt;, and I asked it: what&#x27;s &lt;code&gt;target&lt;/code&gt; right now? &lt;code&gt;42&lt;/code&gt;. The secret number, plucked straight out of the frozen program&#x27;s memory. I can step forward one line at a time, watch variables change, read the CPU&#x27;s actual registers, and find the precise instruction where my compiler&#x27;s output goes wrong.&lt;/p&gt;
&lt;p&gt;The first time I caught a compiler bug this way — froze the program, saw a register holding a number that made no sense, traced it back to one wrong line of assembly I&#x27;d emitted — I understood why every serious programmer lives in a debugger. You stop &lt;em&gt;guessing&lt;/em&gt; what your program does. You &lt;em&gt;watch&lt;/em&gt; it.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-44 4 576 218&quot; width=&quot;576&quot; role=&quot;img&quot; aria-label=&quot;Caught a bug&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M159.9 19.5 C262.7 21.2, 366.6 23.9, 458.3 18.9 C469.4 21.1, 469.4 24, 466.7 31.6 C471.4 56.7, 468.2 81.7, 470.7 148.5 C467.7 154.8, 464.1 159.2, 457.5 162.2 C397.1 164.3, 329.1 162, 158.6 160.4 C154.1 159.6, 147.7 153.8, 151 151.9 C147.2 122.8, 153.1 98.9, 146.9 32.3 C150.8 26.3, 151.9 18.3, 160.1 22.9&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M159.2 21.1 C250 17.2, 339.7 17.4, 461.4 19.7 M159.8 19.6 C262.1 20.9, 363.4 21.3, 459.8 20.5 M460 20 C467.6 21.5, 468.2 21.5, 469.6 28.9 M460.6 18.5 C466.5 18.8, 470.1 21.1, 470 30 M468.5 28.3 C472.7 75.1, 470.6 121, 469.1 151.6 M469.3 30.1 C469.8 70, 470.4 107.4, 469.8 150.1 M470 150 C470.7 155, 467 158.2, 460.2 158.9 M468.4 151.4 C470.8 156, 466.5 160.3, 458.1 161.1 M461.1 158.9 C356.7 161, 249.8 159.1, 159.9 159.9 M460.6 160.6 C341.5 159.8, 223.9 160.7, 159.3 159.8 M160 160 C152 158.8, 149.5 157.3, 149.3 149.6 M161.9 161.9 C151.2 162.2, 150.8 156, 149.8 150.5 M148.5 150.4 C149.4 117.3, 148.5 81, 151.9 28.5 M150.9 151 C150.8 101.7, 150.7 55.1, 149.8 30.1 M150 30 C150.2 25.2, 151.5 20, 158.6 18 M150.8 30.3 C148.6 23.3, 151.5 21, 159.7 18&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M170.1 30.6 C277.6 31.8, 383 34.3, 448.4 31.8 C454.2 29.1, 459.5 32.3, 457.1 40.3 C459.1 59.8, 454.8 81.7, 454.9 136.2 C455 143.6, 454.5 145.3, 447.2 145.8 C383.5 145.7, 316.3 147.3, 170.5 149.4 C168.4 149.5, 162.6 148.2, 164.3 134.6 C165.4 103.4, 160.7 72.8, 161.5 42.7 C160.9 33.3, 165.2 35.2, 170.3 32&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M171.6 33.1 C254.8 32.3, 337.7 31.2, 447.5 33.4 M172.4 32.5 C228.3 32.2, 284.1 32.9, 448.5 32.8 M448 32 C455.7 31.1, 456 33.6, 456.4 42.3 M448.8 32 C453.4 33.5, 459.8 34.7, 457 43.3 M457.1 40.7 C458.5 60.2, 456.5 82.5, 459.3 138.9 M457.3 41 C457.1 67.1, 456.9 91.2, 457.4 138.7 M458 138 C459.2 145.3, 454.4 147.7, 447.8 148 M456.7 140 C456.6 143.6, 456 149.5, 448.2 147.9 M449.5 147.3 C370.3 148.7, 292.8 149.2, 171.9 149.4 M447.7 148.4 C374.2 145.9, 300.4 146.1, 172 147.5 M172 148 C167.3 148.2, 160.7 143, 164 139.1 M170.5 147.9 C166.2 146.4, 161.7 142.9, 160.2 136.3 M160.1 139.8 C160.4 107.6, 161.3 80.2, 162.5 42.6 M163 138.7 C161 117.7, 161.5 97.4, 161.8 42.6 M162 42 C161.9 36.9, 164.2 32, 172.1 31.8 M162.9 42.2 C161.1 34.1, 166.4 34.1, 173 30.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M127.6 168 C235.7 164.2, 339.5 164.8, 495.7 168.2 C499.2 171, 504.7 181.5, 516.5 185.5 C391.4 186.3, 267.2 185.1, 102.4 188.9 C113.2 181.1, 115.5 172.3, 128.8 168.9&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M126 166.8 C236.8 166.6, 347.9 167.2, 494.5 166 M125.7 165.9 C222.7 165.5, 320.5 165, 493.8 165.6 M494.8 167.8 C500.5 174.8, 511.8 180.2, 514.2 190 M493.2 165.2 C500.8 172.1, 506.1 179.1, 515.1 187.7 M517 189 C401 187.5, 284.3 187.7, 103.8 188.4 M515.8 188.3 C382.7 186, 248.2 186.6, 103.7 187.6 M102.8 186.4 C111.3 177.3, 123.2 169.9, 124.2 165.8 M104.6 187.9 C111.4 180.8, 119.6 173.1, 126.2 166.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:12.299999999999999px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;176&quot; y=&quot;54.0&quot;&gt;Breakpoint 1, guessGame ()&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M30.2 50.2 C34.4 48.7, 40.6 50.4, 44.9 52.5 C49.3 54.6, 54.4 58.6, 56.3 62.9 C58.2 67.1, 57.6 73.5, 56.4 78 C55.2 82.5, 52.8 87.2, 49.2 89.8 C45.5 92.4, 39.3 93.8, 34.5 93.6 C29.6 93.4, 23.5 91.6, 20.1 88.5 C16.7 85.4, 14.5 79.7, 14.1 74.9 C13.7 70.1, 14.9 63.7, 17.7 59.5 C20.6 55.4, 28.8 51.5, 31.3 49.9 C33.9 48.3, 32.9 49.7, 33.1 50 M27.7 52.1 C32 50.6, 41.1 49.9, 45.4 51.6 C49.8 53.4, 52 58.5, 54 62.7 C56 66.9, 58 72.4, 57.3 76.9 C56.6 81.3, 53.5 86.1, 49.9 89.2 C46.2 92.4, 40.4 95.7, 35.5 95.7 C30.5 95.7, 23.5 92.6, 20 89.2 C16.5 85.9, 14.9 80.5, 14.5 75.6 C14.2 70.7, 15.2 63.8, 17.8 59.7 C20.3 55.7, 27.9 52.6, 29.8 51.3 C31.8 50, 29 51.5, 29.3 52&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M42.1 50.7 C46.5 51.8, 51.1 55.5, 53.9 59.4 C56.7 63.4, 59.4 70, 58.8 74.6 C58.3 79.2, 54 83.7, 50.6 87.1 C47.1 90.5, 42.5 94.4, 38.1 94.9 C33.7 95.4, 27.8 93.1, 24 90.2 C20.2 87.3, 16.7 82.1, 15.4 77.4 C14 72.6, 14.1 66.1, 16.1 62 C18 57.8, 22 54, 27 52.5 C32 50.9, 42.4 52.3, 46 52.8 C49.6 53.3, 48.8 55.2, 48.6 55.5 M36.9 49.4 C41.3 49.5, 47.9 52.3, 51.4 56 C54.8 59.6, 56.9 66.3, 57.4 71.3 C57.8 76.2, 56.5 81.8, 53.9 85.5 C51.4 89.1, 46.5 91.8, 41.8 92.9 C37.1 94, 30.1 94, 25.7 91.9 C21.2 89.9, 16.8 84.6, 15.1 80.4 C13.4 76.2, 14.1 71.5, 15.3 66.9 C16.6 62.4, 18.6 55.8, 22.6 53.1 C26.6 50.4, 36.6 51.6, 39.2 50.9 C41.7 50.3, 38.1 49, 38 49.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M28.5 62.8 C29.3 62.6, 29.4 62.9, 29.8 63.2 C30.2 63.6, 30.5 64.2, 30.8 64.7 C31.1 65.2, 31.8 65.7, 31.7 66.2 C31.6 66.7, 31 67.3, 30.2 67.6 C29.5 67.9, 28 67.8, 27.2 68 C26.3 68.2, 25.5 68.8, 25.3 68.6 C25 68.4, 25.7 67.4, 25.8 66.7 C25.9 65.9, 25.5 64.4, 25.9 63.9 C26.2 63.4, 27.3 63.8, 27.9 63.8 C28.5 63.7, 29.4 63.6, 29.4 63.6 M26.9 63.3 C27.2 63.1, 27.5 62.9, 28.2 62.9 C28.8 62.9, 30.6 62.8, 30.9 63.5 C31.2 64.2, 30.4 66.4, 30.2 67.3 C30.1 68.2, 30.2 68.6, 30 68.9 C29.8 69.1, 29.6 69, 29.2 68.8 C28.7 68.6, 27.9 67.9, 27.1 67.8 C26.3 67.6, 24.8 68.7, 24.4 68 C24.1 67.3, 24.4 64.6, 24.9 63.8 C25.4 63, 27.1 63.2, 27.4 63.2 C27.7 63.3, 26.7 63.9, 26.5 64.1&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M29.3 63.6 C30 63.5, 30.7 63, 30.9 63.5 C31.1 64, 30.7 65.9, 30.5 66.6 C30.3 67.4, 30.1 67.9, 29.6 68.2 C29.2 68.4, 28.2 68.2, 27.8 68.2 C27.5 68.2, 27.9 68.2, 27.3 68.1 C26.7 68, 24.6 67.9, 24.4 67.5 C24.1 67.2, 25 66.3, 25.6 65.8 C26.1 65.2, 26.8 64.5, 27.5 64.2 C28.3 63.9, 29.8 63.8, 30 63.8 C30.2 63.8, 29.1 64.3, 28.8 64.2 M28.9 63.9 C29.5 64.2, 30.2 63.8, 30.5 64.5 C30.9 65.1, 31.1 67.3, 31.1 68 C31 68.6, 30.9 68.4, 30.3 68.4 C29.8 68.5, 28.4 68.4, 27.8 68.1 C27.1 67.8, 27.3 66.8, 26.6 66.7 C25.9 66.6, 23.9 68.2, 23.7 67.7 C23.5 67.2, 25.1 64.5, 25.5 63.9 C25.9 63.4, 25.4 64.2, 26 64.2 C26.7 64.1, 28.7 63.7, 29.4 63.6 C30.1 63.4, 30.1 62.9, 30 63.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M43.7 62.7 C44.3 62.8, 46 63.7, 46.4 64.2 C46.9 64.8, 46.3 65.6, 46.4 66.2 C46.6 66.7, 47.6 66.8, 47.3 67.3 C47 67.8, 45.2 68.9, 44.4 69.3 C43.6 69.7, 43 70.3, 42.5 69.9 C41.9 69.4, 41.5 67.3, 41.2 66.7 C40.9 66.1, 40.4 66.9, 40.6 66.3 C40.8 65.7, 41.7 63.8, 42.3 63.2 C43 62.6, 44 62.4, 44.4 62.6 C44.9 62.8, 44.7 64.1, 44.8 64.4 M44.1 61.5 C44.7 61.7, 47.1 62.7, 47.5 63.5 C47.9 64.4, 47 66.2, 46.5 66.9 C46.1 67.6, 45.2 67.3, 44.6 67.6 C44.1 67.8, 43.5 67.9, 43.3 68.3 C43 68.7, 43.7 70, 43.3 69.8 C42.9 69.7, 40.8 68.6, 40.7 67.5 C40.6 66.4, 42.4 63.7, 42.6 63.1 C42.7 62.6, 41.2 64.4, 41.8 64.2 C42.4 64, 45.5 62.3, 46 62.1 C46.5 62, 44.9 63.4, 44.8 63.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M45.6 63.6 C46 63.8, 45.3 63.9, 45.5 64.4 C45.8 64.8, 47 66, 47.1 66.5 C47.2 66.9, 46.4 66.7, 46.1 67.1 C45.7 67.5, 45.9 68.8, 45.1 69 C44.4 69.1, 42.3 68.4, 41.6 68 C40.9 67.6, 40.9 67.2, 40.9 66.7 C41 66.2, 41.7 65.6, 41.9 65.2 C42.1 64.8, 41.7 64.4, 42.2 64.1 C42.6 63.8, 44.1 63.5, 44.5 63.4 C44.8 63.4, 44.2 64, 44.2 63.8 M43.9 61.7 C44.7 61.3, 44.7 63, 45.3 63.2 C45.9 63.5, 47.1 62.8, 47.5 63.3 C47.9 63.9, 48.1 65.8, 47.8 66.5 C47.4 67.2, 46 67, 45.2 67.4 C44.4 67.9, 43.2 69.1, 42.9 69.3 C42.5 69.5, 43.6 68.9, 43.2 68.6 C42.9 68.3, 41.1 68.3, 40.6 67.5 C40.1 66.7, 40 64.5, 40.4 63.7 C40.7 62.9, 42.4 62.6, 42.6 62.6 C42.9 62.5, 42.1 63.7, 42.1 63.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M26 78 C29.4 84.5, 42.1 85.2, 47.4 79.2 C39.9 75.9, 36.1 75.6, 27.6 75.7&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M26 78 C32.3 84.9, 40 85.9, 46.1 78.2 M27.1 76.5 C31.2 87.7, 40 86.5, 47.8 77.7 M44.9 76.1 C40.9 79.6, 36.3 77.7, 26.5 79.9 M46.8 78.5 C40 77.7, 32.7 77.7, 25.3 77.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M35.5 94.6 C35.5 113.2, 34.7 135.9, 37.1 160.9 M36.8 93.1 C35.3 109.2, 36.9 126, 35.7 159.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M36.1 160.5 C30.3 175.3, 23.9 186.3, 14.5 205.1 M35.7 160.3 C29.9 173.7, 24.6 187, 16.8 205.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M35.8 161.4 C43.1 175.9, 50.7 194.6, 55.2 205.9 M35 160.8 C40.4 172.2, 47.1 185.8, 55.6 206.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M36.3 113.3 C25 99, 15.1 85, 6.6 70 M35.9 112 C26.2 98.2, 16.3 84.1, 6.6 72.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M36.9 113.2 C47 97, 59.2 81.3, 68 72.2 M36.8 111.2 C48.9 96.3, 60.1 80.1, 65.6 71.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-22 44.3 C-17.7 44.7, -14.1 42.6, -9.4 42.4 M-23.2 43.9 C-19.9 43.9, -16.1 43.9, -8.6 43.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-17.4 37.3 C-15.6 41.3, -16.6 45.8, -15.5 51 M-15.6 36.3 C-16 41.5, -16.4 46.3, -16.3 50.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M80 39 C86.4 39.5, 90.8 37.8, 93.7 37.5 M80.6 39 C86.7 38.9, 92.4 38, 95.4 38.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M87.4 31.9 C88.3 36.2, 88.1 41.2, 87.7 46 M88.2 31.4 C87.4 34.2, 88.5 38.3, 87.8 45.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-28.4 101.2 C-22.7 101.9, -17.5 100.7, -13.5 100.1 M-28.7 100.3 C-24.1 100.4, -19.4 101.3, -13.7 101.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-20.9 94.1 C-20.7 98.6, -20.2 104.1, -22.3 108.6 M-21.1 94.1 C-20.9 98.6, -21.2 103.6, -21.4 107.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M86.9 95.8 C91.9 96.7, 95 95.9, 100 95.1 M85.5 95.4 C90.1 95.4, 92.4 95.4, 100.7 95.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M94.3 89.8 C92.2 93, 93.2 99.2, 92.2 101.8 M93.6 88.7 C93.8 94.6, 93.7 99.8, 93.8 103.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;But how? How does gdb reach into a program that&#x27;s already running and stop it?&lt;/p&gt;
&lt;h2 id=&quot;the-surprising-answer-the-kernel-hands-it-a-leash&quot;&gt;The surprising answer: the kernel hands it a leash&lt;a class=&quot;anchor&quot; href=&quot;#the-surprising-answer-the-kernel-hands-it-a-leash&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I assumed gdb must be doing something wildly low-level — reading the other program&#x27;s memory directly, some deep hardware sorcery. The real answer is both simpler and stranger: &lt;strong&gt;gdb asks the kernel to do it.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Remember the last post — a program can&#x27;t touch another program&#x27;s memory. That&#x27;s a hard rule. So gdb can&#x27;t just reach in. Instead, it uses a special syscall, and its name tells you the whole story: &lt;strong&gt;&lt;code&gt;ptrace&lt;/code&gt;&lt;/strong&gt; — &quot;process trace.&quot;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ptrace&lt;/code&gt; is the kernel saying: &lt;em&gt;&quot;If you have permission, I&#x27;ll let you puppeteer another process. I&#x27;ll be the muscle; you give the orders.&quot;&lt;/em&gt; With it, gdb asks the kernel to attach a leash to your program. Through that leash gdb can tell the kernel: pause it, let it run one instruction, read its registers, read its memory, change its memory. gdb never touches your program directly. It asks the kernel, every time, and the kernel — which &lt;em&gt;is&lt;/em&gt; allowed to touch everything — does it on gdb&#x27;s behalf.&lt;/p&gt;
&lt;p&gt;So the impossible thing isn&#x27;t gdb reaching into your program. It&#x27;s the &lt;strong&gt;kernel&lt;/strong&gt; reaching in, because the kernel can reach into anything, and &lt;em&gt;lending&lt;/em&gt; that power to gdb through one carefully guarded syscall.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -6 632 322&quot; width=&quot;632&quot; role=&quot;img&quot; aria-label=&quot;gdb asks, the kernel reaches in&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M8.3 41.5 C80.8 42.2, 153 44.8, 193.6 37.1 C195.8 42.5, 198.9 45.3, 196.6 47.7 C201.9 61.8, 201.4 69.4, 202.7 88 C199.6 93.3, 196.6 102.2, 192.9 97.6 C123.1 99.3, 64.3 98.2, 11.8 102.8 C2.9 100, 0.9 94.1, -1.5 88 C-2.2 79.3, 0 71.9, 3.4 48.7 C-2.6 46.2, 4.2 42.4, 8.5 42.5&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M11.8 38.3 C63.1 36.3, 112.6 40.2, 189 39.4 M9.6 40.2 C79.4 41, 148.2 41.5, 190.4 39.2 M190 40 C195.1 38.9, 198.4 43.9, 200.1 50.8 M190.7 38.2 C194.4 41.2, 198.3 45.1, 202.2 51.7 M201 48.3 C200.1 63.8, 200.7 80.4, 199.8 88.3 M200.6 50 C200.1 60.1, 200 70.7, 199.5 89.1 M200 90 C200.6 98.1, 197.4 98.2, 191.4 100.4 M200.6 90.9 C199.6 97.9, 194.9 98.3, 189.2 99 M189.5 99.3 C123.1 103.3, 53.3 102.6, 9.6 99 M190.3 99.1 C152.8 98.6, 115.1 99.3, 9.5 101 M10 100 C1.5 99.1, -1.1 96.7, 1.1 91.9 M9 98.6 C1.7 99.1, 1.4 96.8, -1.6 91.6 M0.7 91.9 C-0.7 81, -0.2 71.2, -0.7 50.9 M0.3 89.9 C-0.5 75.9, 1 61.9, 0.7 50.5 M0 50 C-1.7 42.2, 3.1 38.9, 10.1 41.3 M-0.1 50.1 C1.8 43, 2.8 38.1, 8.7 39.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;100&quot; y=&quot;70.0&quot;&gt;gdb&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M406.6 42.5 C451 44.7, 501 41.9, 592.2 41.1 C595.9 37.7, 602.9 42.1, 601.5 52 C602.9 56.4, 596.9 70.3, 599.5 92.6 C596.6 97.6, 593.3 100.8, 593.1 97.5 C549.2 96.1, 505.8 100.2, 412.2 101.2 C402.1 101.6, 397 98.1, 399.9 88.3 C398.6 80.4, 396.5 65.2, 402.9 47 C402.4 45.6, 406.3 43.4, 410.2 43.4&quot; style=&quot;fill:var(--xd-violet)&quot;/&gt;&lt;path d=&quot;M411.4 41.3 C461.7 39.2, 514.8 40.5, 591.3 40 M410.4 40.9 C463.7 38.9, 516 40.8, 589.5 39.4 M590 40 C597.6 41.5, 601.5 41.9, 599.6 51.1 M588.1 39 C595.3 39.9, 601.4 42.4, 598.1 48.1 M600.3 51.5 C600.6 60.1, 599.5 70.4, 598.4 91.5 M601 49.5 C601.1 63.2, 600.5 75.9, 599.5 90.2 M600 90 C598.1 97.9, 597.5 99.3, 589.1 101.5 M598.2 88 C598 94.5, 598.3 101.7, 589.3 99 M591.6 101.4 C542.9 99.6, 498.2 100.2, 410.1 98.1 M589.8 99.5 C522.4 99, 455.8 100.5, 410.5 100.5 M410 100 C402.6 101.4, 398.7 96.6, 398.8 90.4 M409.5 100.7 C405.2 99.3, 400.1 96.6, 402 88 M398 88.5 C398.8 74.3, 400.4 62.3, 400.3 48.3 M399.7 91 C400.3 80, 401 69.2, 399.6 50.4 M400 50 C400.4 44.5, 403.5 41.6, 410.6 40.4 M398.4 49.8 C399.1 43.2, 401.2 38.6, 409.3 41.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;500&quot; y=&quot;70.0&quot;&gt;your program&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M206.6 68.6 C250.8 68.9, 295.9 70.3, 395.7 68&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;path d=&quot;M381.8 63 C384.8 64.3, 388.3 66.7, 395.2 68.6 M394.8 70.5 C388.7 73, 384.5 75.5, 381.8 76.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;300&quot; y=&quot;20.0&quot;&gt;can&#x27;t reach in directly&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M10.4 231 C156.1 225.4, 299.9 226.5, 590.8 229.6 C600 233.6, 601 233.1, 596.8 240.7 C601.7 254.2, 603 276.1, 600.2 289.6 C596.9 299.7, 600 302.7, 586.4 298.7 C369.9 297, 150.6 298, 11 300.1 C5.6 297.3, 2.7 296.7, 1.4 287.1 C2.1 275.9, -2.5 265.2, -2.9 240.3 C-1.1 234.5, 0.1 226.7, 8 230.5&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M10.2 229.7 C185.7 228.9, 362.2 228.2, 590.5 230.5 M9.8 230.2 C209.7 229, 410.1 228.4, 589.7 230 M590 230 C598.6 230.1, 598.6 234.5, 599 239.4 M588.8 229.8 C597.6 230.9, 601.4 235.5, 600.2 240.4 M601.5 238.1 C598.6 258.3, 599.8 274.9, 601.4 289.6 M599.2 240.8 C600.7 249.9, 599.3 260.7, 599.2 289.6 M600 290 C600.3 296.5, 594.8 299.3, 590.7 298.2 M598.8 288.9 C602.1 296.9, 596 302.2, 590.1 300.5 M590.3 299.3 C405.2 298.5, 219.8 297.7, 10.8 300.3 M590.1 299.6 C375.6 300.1, 160.8 300.9, 9.8 299.7 M10 300 C2.1 300.8, -0.9 296.1, -1.4 288.8 M9.6 301.2 C3.2 299.9, 1 297.3, -0.9 290.8 M-0.9 288 C-0.3 279.8, 1.6 267.2, 0.4 240 M-0.8 289.7 C0 277.8, -1 265.2, 0.8 240.8 M0 240 C-1.2 233.3, 2.8 231.1, 8.9 228.1 M1.4 239.5 C-0.3 231.7, 4.3 231.2, 11.3 232&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:19px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;300&quot; y=&quot;265.0&quot;&gt;kernel: allowed to touch everything&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M98.3 98.3 C101.9 131.3, 100.3 162.3, 101.9 230.5 M99.2 99.9 C100.4 148.6, 100.1 199, 99.3 229.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M104.9 216.2 C105.3 220.8, 102.8 224, 101.3 230.4 M105.5 217.4 C103.6 221.6, 101.1 227.2, 99.5 229.6 M99.6 229.3 C98.5 227, 95.2 223.4, 94.7 218.1 M100 230.5 C97.5 225.3, 95.2 220.7, 93.5 217.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;120&quot; y=&quot;135.0&quot;&gt;ptrace: pause it, step it,&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;120&quot; y=&quot;158.0&quot;&gt;read registers and memory,&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;120&quot; y=&quot;181.0&quot;&gt;change memory&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M500.6 231.8 C501.3 200.1, 502 167, 499.5 101.2 M500.8 230.8 C499.7 200.5, 499.6 171.3, 499.4 100.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M494.4 113.9 C496.2 110.2, 498.1 105.5, 499.7 100.8 M494.5 113.1 C495.3 109.8, 496.7 107.2, 499.6 100.5 M501.3 98.6 C502.3 104.8, 503.8 105.8, 507.2 113.4 M500.6 99.7 C501.2 102.5, 503.3 105.4, 506 112.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;end&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;485&quot; y=&quot;150.0&quot;&gt;the kernel does it&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;end&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:15px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;485&quot; y=&quot;173.0&quot;&gt;on gdb&#x27;s behalf&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;gdb cannot reach into your program directly; it asks the kernel through ptrace, and the kernel does the reaching.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;but-how-does-a-breakpoint-actually-stop-the-program&quot;&gt;But how does a breakpoint actually stop the program?&lt;a class=&quot;anchor&quot; href=&quot;#but-how-does-a-breakpoint-actually-stop-the-program&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This is the detail that delighted me most, because it&#x27;s such an audacious hack.&lt;/p&gt;
&lt;p&gt;A breakpoint means &quot;freeze when execution reaches this line.&quot; But the program runs at billions of instructions per second — gdb can&#x27;t sit there checking &quot;are we there yet?&quot; before every one. That&#x27;d be hopeless. So how does it stop at &lt;em&gt;exactly&lt;/em&gt; the right instruction, instantly, without slowing the program down?&lt;/p&gt;
&lt;p&gt;gdb &lt;strong&gt;rewrites your program while it&#x27;s running.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When you set a breakpoint at some instruction, gdb (through &lt;code&gt;ptrace&lt;/code&gt;) reaches into the running program&#x27;s code and &lt;em&gt;overwrites the first byte of that instruction&lt;/em&gt; with a special one-byte instruction called a &lt;strong&gt;trap&lt;/strong&gt; (&lt;code&gt;int3&lt;/code&gt; on x86). It saves the original byte first. Now the program runs full speed — and the instant it hits that spot, it executes the trap instead, which immediately kicks control to the kernel, which freezes the program and taps gdb on the shoulder: &lt;em&gt;&quot;your trap fired.&quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Then gdb quietly puts the original byte back, shows you your frozen program, and when you say &quot;continue,&quot; it sets the trap again and lets go. You never see any of this. You just see your program stop exactly where you asked.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -16 562 510&quot; width=&quot;562&quot; role=&quot;img&quot; aria-label=&quot;A breakpoint is a booby-trapped instruction&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M11.5 -0.7 C131 1, 254.4 3.3, 371.7 0.1 C374.1 -0.8, 381.4 6.6, 379.2 10.6 C381.7 26.6, 377.7 35.9, 376.6 50.5 C379.6 57.6, 373.5 55.5, 368.6 57.3 C259.3 62.8, 150 62.2, 9.1 56.6 C-0.1 56.6, 0.8 56.6, 3.3 50.2 C-1.3 33.4, -3.5 18.1, -1.6 6.4 C-2.4 6.6, 1.3 -2.6, 13 0.9&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M10.9 -1.2 C82.6 -0.3, 157.1 -0.4, 371.4 -0.9 M9.4 0.1 C99.7 0.7, 190.1 0.4, 370.4 0.6 M370.3 0 C375.4 1.6, 378.1 1.4, 378.3 8.7 M369 2 C377.5 1.8, 378.8 3.5, 379.9 9.1 M378.4 9.1 C380.9 20.7, 378.2 27, 381 47.2 M379.6 10.3 C381.1 21.6, 380.7 35.4, 380.5 47.6 M380 48.3 C380.2 56.1, 375.4 59.9, 369 57.1 M379.2 49.1 C380.1 55.9, 376.1 59.5, 369.8 60.2 M370.8 59.2 C245.1 60, 120.6 58.2, 10 58.4 M370.2 58.3 C290 60.3, 209.6 59.6, 9.5 58.6 M9.7 58 C1.3 57.3, -0.9 53.5, -1.4 48.7 M7.9 59.2 C5.3 57.7, -0.4 52.7, -0.1 48.7 M1.6 46.8 C-0.4 34.6, -1.4 23.5, 0.5 8.5 M0.7 49.3 C0.1 33.2, -0.3 17.6, 0.8 10.1 M0 9.7 C1.5 3.8, 2.2 -0.9, 11.3 -1.7 M-1.6 8.5 C-0.4 5, 5.4 2.1, 8.1 -1.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;190&quot; y=&quot;18.4&quot;&gt;Overwrite the first byte of the&lt;/tspan&gt;&lt;tspan x=&quot;190&quot; y=&quot;39.6&quot;&gt;instruction with int3 (original saved)&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;405&quot; y=&quot;29.0&quot;&gt;gdb, via ptrace&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M10.3 84.7 C96.1 88.8, 181 87, 372.6 85.2 C376.2 83.8, 378.6 87.1, 376.7 96.3 C377.1 108.3, 376.2 120.1, 379.1 130.8 C382.4 140.5, 376.9 144.2, 367.3 144.9 C274.2 138.7, 179.8 136.8, 7.5 140.3 C0.6 141.4, -0.6 139.5, -1 130.9 C2.4 117.5, 3 102, -2.7 94.8 C-1.4 86.1, 0.4 82.2, 13.3 83&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M8.6 83.5 C108.4 83.5, 206.1 82.4, 369.6 84.7 M9.1 84.5 C103.8 84.7, 197.4 85.1, 370.7 84.6 M370.3 84 C375.5 85, 379.6 87.5, 379.1 93.1 M369.5 83.8 C376.6 81.7, 381.9 85.1, 378.5 92 M379.6 95.3 C381.6 110.5, 379.6 123.1, 380.7 131.2 M380 94.5 C380.4 105.6, 379.5 115.8, 379.8 132.5 M380 132.3 C378.7 140.3, 376.3 142.8, 370.6 143.1 M380 133.5 C380.9 137.9, 375.3 141.5, 368.9 140.7 M370.3 143.2 C237.4 142.2, 103.1 142.6, 10.2 141.1 M370 141.5 C240 142.3, 110 141.8, 10.2 142.2 M9.7 142 C3.4 143.3, 0 139.1, 0 132.7 M9.8 141.2 C1.1 141, -1.8 138.7, 0.8 132.1 M1.8 131.7 C2.3 123.9, -0.1 118, 0.6 94.4 M-0.5 132.4 C0.3 122.8, 0.5 112.4, 0.1 92.9 M0 93.7 C-0.1 86.9, 2.6 84.3, 11 82.5 M-0.3 95.5 C-0.6 85.1, 1.3 86, 7.8 83.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;190&quot; y=&quot;113.0&quot;&gt;Program runs at full speed&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;405&quot; y=&quot;113.0&quot;&gt;program&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M190.8 63.4 C189.7 67.2, 189.7 70.2, 190.3 79 M190.3 63.8 C190.2 68.4, 189.6 71.3, 190.5 78.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M196.9 64.8 C194.5 68.3, 193.2 71, 190.3 79 M196.4 65.2 C194.6 69.4, 192.4 71.9, 190.5 78.6 M189.7 77.9 C188.6 75.2, 186.9 70.5, 184.7 65.6 M189.3 77.3 C187.8 74.1, 186.5 71, 183.7 65.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M8.6 167.3 C93.6 163.9, 183.3 162.9, 371.4 169.2 C379.8 169.6, 379.3 169.3, 382.6 177.8 C380.6 194, 381.2 204, 382.6 218.8 C380.1 225.3, 377.3 222.9, 369.7 225.7 C264.7 226.8, 162.5 226.2, 9.3 225.5 C5.8 222.8, -3.4 225.3, 2.7 217.3 C-1.1 200.9, 0.1 184.2, -1.6 174.4 C0.5 171.9, 0.8 168.5, 9.2 170.5&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M9.2 168.9 C108 167.9, 207.1 166, 370.4 169.1 M9.2 167.4 C141 168, 273.2 168.5, 370.5 167.5 M370.3 168 C376.5 166.4, 381.7 173, 380.1 177.3 M370.6 166.7 C374.6 165.8, 378.2 169.6, 378.4 179.2 M379.3 176.3 C379.5 185.7, 378.4 198.8, 381.1 215.3 M380.1 177.8 C380 191.5, 379.2 204.1, 379.4 216.1 M380 216.3 C379.5 221.4, 377.9 224.2, 371 227.3 M379.4 217.1 C381.1 222.7, 375.4 225.3, 371.1 224.2 M370 227.1 C262.7 223.4, 156.1 225.1, 9.2 226.8 M370.4 225.6 C280.5 225.4, 190.2 224.6, 9.5 226.2 M9.7 226 C2.2 225.2, -0.6 222.1, 0.7 216.8 M8.2 224.1 C1.3 224.2, -2.1 223.5, 1.6 216.4 M0.6 216.6 C0.1 204.4, 1 190.1, 0.6 176.9 M-0.6 215.6 C0.2 204.6, 0.7 191.6, 0.2 178.6 M0 177.7 C-0.7 169.3, 2.6 169.8, 7.8 169.8 M1.4 176.4 C1.5 170.6, 5.1 166.4, 10.4 166.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;190&quot; y=&quot;186.4&quot;&gt;It executes int3: control jumps&lt;/tspan&gt;&lt;tspan x=&quot;190&quot; y=&quot;207.6&quot;&gt;to the kernel, program frozen&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;405&quot; y=&quot;197.0&quot;&gt;kernel&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M189.2 147.2 C189.9 150, 191 155, 190.5 161.9 M189.4 147.5 C190.3 151.3, 190.6 154.6, 189.8 161.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M195.3 148.6 C194.7 151, 194.5 155.7, 190.5 161.9 M195.5 148.9 C194.8 152.4, 193.6 155.4, 189.8 161.9 M190.3 161.4 C188.5 159.1, 186.9 154.8, 184.2 150.4 M189.8 161.8 C187.9 159.3, 186.3 155.7, 184.3 149.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M11.3 249.9 C95.6 251.9, 181 251.5, 370.3 253.1 C376.2 255.4, 380.1 258.7, 381.3 259.2 C384.1 272.1, 379 279.6, 378.9 299.5 C377.7 310, 377.6 308.8, 372.2 306.5 C259.8 306.7, 145.1 307.4, 11.2 310.7 C3.8 311.5, 1 304, -0.9 303.6 C2.5 284.2, -2.7 273.6, -0.5 261.2 C2.4 257.7, 1.2 254.8, 12.3 250.7&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M9.9 251.8 C110.1 249.6, 208.1 249.7, 371.2 250.9 M9.4 251.5 C106.2 252.7, 203.5 251.9, 370.2 251.6 M370.3 252 C377.5 251.8, 379.8 254.5, 381.1 261.5 M371.7 253.5 C377.2 249.8, 379 254.2, 378.4 261.8 M379 261.2 C381.5 272.6, 381.1 286.1, 381.5 299.4 M380.2 261 C379.7 277.3, 379 292.5, 379 299.8 M380 300.3 C380.3 306.5, 375.6 309.5, 371.4 311.5 M378.8 300.7 C381.3 307.6, 375.5 309, 368.7 307.8 M369.7 310.9 C290.5 311.7, 211.6 312.1, 10.7 310 M370.9 309.8 C247.6 308.4, 125 308.6, 10.1 310.2 M9.7 310 C5.1 311.1, -1.1 305.2, 1.4 301 M10.5 311 C1.6 312.1, 2.2 308.2, -2.3 300.6 M-0.6 301.4 C-1.3 292.6, -1.1 281.8, 0.6 263.4 M-0.7 300.9 C0.1 286.4, 0.9 270.9, 0.3 262.3 M0 261.7 C-1.4 255.8, 2.6 251.3, 8.6 253.2 M-0.8 261.2 C-1.1 256.2, 4.3 251.4, 8.4 253.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;190&quot; y=&quot;270.4&quot;&gt;Kernel taps gdb:&lt;/tspan&gt;&lt;tspan x=&quot;190&quot; y=&quot;291.6&quot;&gt;&quot;your trap fired&quot;&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;405&quot; y=&quot;281.0&quot;&gt;kernel&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M191.2 231.5 C190.9 233.9, 190.5 237.5, 190 246.2 M190.1 231.8 C190 235.6, 190.6 239, 190.7 246.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M197.3 232.9 C195.6 235.1, 193.8 238.3, 190 246.2 M196.2 233.2 C194.5 236.6, 193.6 239.7, 190.7 246.3 M190.9 245.9 C186.4 240.6, 186.4 236.3, 182.7 234.1 M189.5 245.9 C188.3 241.7, 185.5 237.2, 184 233&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M10.1 337.4 C93.8 333.8, 177.7 332.7, 372.6 338.1 C380.2 334.3, 383.1 341.5, 378.5 344.6 C379.9 363.2, 380 377.1, 377.6 385.1 C382.2 389.3, 376.3 392.3, 372.9 390.4 C271.9 389.8, 172.1 389.3, 10.4 395.3 C1.2 393.1, 3.6 389.2, -0.6 382.5 C-3.8 373.3, -0.5 360.5, -3.3 345.5 C-3.2 340.8, 0.1 338.4, 7.6 333.8&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M9.2 336.1 C99.7 336.3, 190.5 336.4, 370.7 335 M9.8 336.3 C122.4 336, 235.1 336.1, 370.4 336.3 M370.3 336 C378.3 335, 381.6 340.3, 381.7 345.8 M372.1 337.2 C375.8 336.4, 382.1 340.2, 380.1 344.3 M379.4 347.4 C380.9 360.4, 380.8 376.7, 379.7 384.8 M380.8 346.2 C380.3 359.5, 379.9 372.8, 379.6 383.4 M380 384.3 C381.8 390.7, 377 396, 371.7 394.5 M381.5 382.5 C377.9 389.9, 377.9 395.9, 370.6 393.5 M369.7 393.8 C268 394.1, 166.6 392.8, 9.7 392.8 M370 394.1 C258.4 394.8, 146.5 394.9, 10.3 394.6 M9.7 394 C1.8 395.1, -0.3 389.8, -0.1 383.3 M11.4 395.1 C2.3 394, 0.5 392.8, -0.3 386.2 M-0.8 383.2 C0.1 373.6, -0.2 357.7, 1.9 347.4 M0.6 385.2 C-1.1 373.6, -0.5 365.1, -0.8 346.1 M0 345.7 C0.7 339, 2.6 335.1, 10.2 335.2 M0.6 347.3 C-0.5 337.4, 5.5 336.6, 9.9 337.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;190&quot; y=&quot;354.4&quot;&gt;Put the original byte back,&lt;/tspan&gt;&lt;tspan x=&quot;190&quot; y=&quot;375.6&quot;&gt;show you the frozen program&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;405&quot; y=&quot;365.0&quot;&gt;gdb&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M189.6 315.2 C191 319.5, 189 322.3, 190.1 329.1 M190.6 315.5 C189.9 319.9, 189.9 322.4, 190 329.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M195.7 316.6 C195.7 320.6, 192.3 323.1, 190.1 329.1 M196.7 316.9 C194.5 320.9, 193 323.1, 190 329.7 M188.8 329.4 C187.5 327.1, 186 325.6, 185 316.1 M190 330.3 C188.1 326.9, 186.4 323.3, 183.2 316.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M8.3 420 C91.4 421.7, 175.4 421.4, 371.4 422.1 C376.7 420.1, 376.6 423.7, 377.1 433.2 C383.4 434, 377.9 445.6, 381.1 465.8 C379.8 474, 376.6 478.3, 368.1 478.4 C262.5 478, 154.8 478.8, 7.7 476 C6.4 474.6, 0.7 475.1, 3.1 468.8 C-0.1 456.6, -3.4 442.7, -2.2 432.3 C-1.3 426.6, 0.5 417.5, 10.7 421.3&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M9.9 419 C101.8 418.1, 191.5 420, 371.5 419.4 M9.9 420.5 C87.5 420.6, 165.4 419.5, 370.2 420.4 M370.3 420 C375.3 420.4, 379.8 421.8, 378.7 429.9 M369.2 420.1 C378.4 420.5, 378.4 424.7, 380 431.5 M379.2 428.4 C379.6 439.6, 380.3 448.5, 380.1 468.9 M381 429.5 C379.9 437.6, 379.6 445.7, 379.2 469.1 M380 468.3 C378.6 475.8, 378.6 477.3, 372.1 478.7 M380.9 470.1 C378.1 474.8, 378 479.6, 368.2 477 M369.5 477.6 C295.9 479.9, 222.1 479.8, 8.6 478.5 M370.5 478.3 C297.6 477.9, 225.5 477.7, 9.6 478.6 M9.7 478 C4.6 477, -0.9 472.9, 0.6 467.5 M9.8 478 C2.6 477.2, 0.2 473, 0.5 470.4 M1.9 468 C-1.3 457.8, 1.7 449.3, 1.8 429.9 M0.5 468.5 C-1.2 455.4, -0.3 444.4, -0.7 429.8 M0 429.7 C0 421.4, 2.6 420.6, 10.9 418.5 M-1.6 428.2 C1.6 423, 4.7 421.6, 7.9 419.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;190&quot; y=&quot;438.4&quot;&gt;On continue: set the trap again,&lt;/tspan&gt;&lt;tspan x=&quot;190&quot; y=&quot;459.6&quot;&gt;let go&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;405&quot; y=&quot;449.0&quot;&gt;gdb&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M190.8 399 C191.2 402.2, 190.3 407.1, 190.2 414.9 M189.6 400.6 C189.7 402.7, 189.2 405.8, 189.3 414.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M196.9 400.4 C195.9 403.3, 193.6 407.8, 190.2 414.9 M195.7 402 C194.4 403.8, 192.5 406.6, 189.3 414.4 M189.4 412.9 C187.5 411.1, 186.1 407.1, 184.5 400.9 M190.5 413.4 C188 410.7, 187.3 408, 183.8 402&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;figcaption&gt;The life of a breakpoint: gdb plants an int3 byte, the program walks into it, the kernel freezes it and notifies gdb, then gdb restores the byte.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;I find that genuinely wonderful. A breakpoint isn&#x27;t gdb watching your program. It&#x27;s gdb &lt;em&gt;booby-trapping&lt;/em&gt; one instruction and letting the program walk into it.&lt;/p&gt;
&lt;h2 id=&quot;why-im-telling-you-this-in-a-series-about-building-a-language&quot;&gt;Why I&#x27;m telling you this in a series about building a language&lt;a class=&quot;anchor&quot; href=&quot;#why-im-telling-you-this-in-a-series-about-building-a-language&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Because this is where all the previous layers suddenly became &lt;em&gt;tools&lt;/em&gt;, not just concepts.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Debugging my crashing compiler output meant reading &lt;strong&gt;assembly&lt;/strong&gt; (Part 3) — I had to know what &lt;code&gt;mov&lt;/code&gt; and &lt;code&gt;cmp&lt;/code&gt; were to make sense of a frozen program.&lt;/li&gt;
&lt;li&gt;gdb works by making a &lt;strong&gt;syscall&lt;/strong&gt;, &lt;code&gt;ptrace&lt;/code&gt; (Part 4) — the exact user/kernel boundary I&#x27;d just learned.&lt;/li&gt;
&lt;li&gt;And it reads the CPU&#x27;s &lt;strong&gt;registers&lt;/strong&gt; directly — the tiny slots from Part 3, now something I could literally print and inspect.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every abstraction I&#x27;d peeled back became something I could now &lt;em&gt;see&lt;/em&gt; in a live program. The debugger is where the whole descent stops being a story I was told and becomes a machine I can operate.&lt;/p&gt;
&lt;h2 id=&quot;one-last-mystery-hiding-in-plain-sight&quot;&gt;One last mystery, hiding in plain sight&lt;a class=&quot;anchor&quot; href=&quot;#one-last-mystery-hiding-in-plain-sight&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;While I was stepping through my compiled program in gdb, I kept noticing something odd. My guessing game calls &lt;code&gt;мөр_хэвлэх&lt;/code&gt;, which deep down calls the system&#x27;s &lt;code&gt;write&lt;/code&gt;. But when I stepped into the printing code, gdb walked me through a function called &lt;code&gt;printf&lt;/code&gt; — from the C standard library — that I had &lt;em&gt;never written&lt;/em&gt; and never included in my project. It was just... there. In my program. Doing real work.&lt;/p&gt;
&lt;p&gt;Where did it come from? I wrote a compiler, not a &lt;code&gt;printf&lt;/code&gt;. And yet my finished program was full of code I didn&#x27;t write, code that was somehow bundled in without my ever asking. Something, at some stage, had reached out and &lt;em&gt;stitched other people&#x27;s code into mine&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;That stitching has a name, and it&#x27;s the next floor down.&lt;/p&gt;
&lt;h2 id=&quot;one-floor-down&quot;&gt;One floor down&lt;a class=&quot;anchor&quot; href=&quot;#one-floor-down&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;My program was full of code I never wrote — &lt;code&gt;printf&lt;/code&gt; and friends, pulled in from somewhere. Someone had to find that code and wire it into my binary. That someone is the linker — and it&#x27;s also behind the single most common build error every programmer eventually hits.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So who put &lt;code&gt;printf&lt;/code&gt; in my program?&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Where Does printf Actually Come From?</title><link>https://your-moon.github.io/s2-6-linking/</link><guid>https://your-moon.github.io/s2-6-linking/</guid><pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate><description>&lt;h1 id=&quot;where-does-printf-actually-come-from&quot;&gt;Where Does &lt;code&gt;printf&lt;/code&gt; Actually Come From?&lt;a class=&quot;anchor&quot; href=&quot;#where-does-printf-actually-come-from&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Building my own programming language — Season 2: To the Metal · Part 6: Linking&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Stepping through my own compiled program in gdb, I hit something I couldn&#x27;t explain.&lt;/p&gt;
&lt;p&gt;My guessing game calls &lt;code&gt;мөр_хэвлэх&lt;/code&gt;, which deep down calls &lt;code&gt;printf&lt;/code&gt; — the standard C printing function. And gdb happily walked me straight into &lt;code&gt;printf&lt;/code&gt;&#x27;s code. Real, working code. Code I had never written, never copied in, never mentioned anywhere in my project. So where did it come from? Who put &lt;code&gt;printf&lt;/code&gt; inside my program?&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -16 552 318&quot; width=&quot;552&quot; role=&quot;img&quot; aria-label=&quot;Who put printf here?&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M194.7 -0.3 C211.8 0.5, 230.1 4.2, 243.9 7.7 C257.8 11.2, 269.4 15.7, 277.9 20.7 C286.5 25.7, 293 32.3, 295.2 37.8 C297.4 43.2, 296.4 48.2, 291.3 53.5 C286.2 58.9, 276.1 65.6, 264.8 69.9 C253.4 74.3, 238.9 77.1, 223.3 79.6 C207.6 82.2, 189 84.7, 170.9 85.3 C152.8 85.9, 132.3 84.7, 114.9 83.2 C97.6 81.6, 80.8 79.5, 66.8 76 C52.7 72.4, 39 67, 30.5 62 C22 57.1, 17.7 51.8, 15.7 46.3 C13.7 40.8, 13.6 34.3, 18.6 28.9 C23.7 23.5, 34.2 18, 45.7 13.9 C57.2 9.8, 72 6.5, 87.7 4.1 C103.3 1.7, 119.9 -0.1, 139.8 -0.5 C159.7 -1, 194.1 0.8, 207 1.5 C219.8 2.1, 218 2.7, 217 3.4 M118.7 -0.1 C134.6 -2, 157.1 -1.1, 175 -0.5 C192.8 0.2, 210.5 1, 225.8 3.7 C241.1 6.4, 255.8 11.3, 266.7 15.8 C277.7 20.2, 286.9 25, 291.5 30.4 C296.1 35.9, 296.5 42.7, 294.2 48.5 C291.9 54.4, 286.6 60.7, 277.5 65.6 C268.5 70.6, 254.2 75.2, 239.7 78.2 C225.1 81.2, 207.4 82.8, 190.1 83.8 C172.8 84.9, 153.4 85, 135.7 84.5 C117.9 84, 99.2 83.4, 83.8 80.6 C68.3 77.9, 54.1 72.7, 42.9 68.1 C31.8 63.5, 21.6 58.2, 16.9 52.8 C12.1 47.4, 11.8 41, 14.4 35.6 C17.1 30.3, 23.3 25.6, 32.6 20.6 C41.8 15.6, 55.3 9.1, 69.7 5.8 C84.1 2.4, 110.2 1.4, 119 0.5 C127.7 -0.5, 121.6 -1, 122.2 -0.2&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M223.2 4.5 C239.3 6.7, 252.9 11, 264 15.3 C275.1 19.6, 284.4 25.3, 289.7 30.5 C295 35.6, 297.5 41, 295.8 46.3 C294.1 51.7, 288.2 57.6, 279.6 62.5 C271 67.4, 258.1 71.9, 244.1 75.6 C230.2 79.2, 213.3 82.7, 195.9 84.2 C178.6 85.8, 157.9 85.5, 140 84.9 C122.1 84.4, 104.3 83.5, 88.6 80.9 C72.9 78.3, 57.6 73.8, 46 69.4 C34.5 65.1, 24.5 60.2, 19.3 54.7 C14.1 49.2, 13 42.1, 14.9 36.6 C16.8 31, 21.9 26, 30.5 21.4 C39.1 16.7, 52.5 12.3, 66.5 8.6 C80.5 5, 97.2 1.3, 114.4 -0.5 C131.6 -2.3, 149.6 -3.1, 169.7 -2.1 C189.9 -1.2, 222.9 3.4, 235.3 5.3 C247.7 7.2, 245.6 8.6, 244.1 9.3 M116.2 0.6 C131.9 -1.4, 153.1 -0.6, 170.9 -0.2 C188.7 0.2, 207.5 0.6, 223.1 3.1 C238.7 5.6, 252.9 10, 264.3 14.7 C275.8 19.4, 286.4 25.8, 291.8 31.3 C297.1 36.8, 298.9 42.3, 296.4 47.6 C293.9 52.8, 285.6 58.2, 276.8 62.7 C268 67.3, 257.9 71.3, 243.8 74.9 C229.7 78.5, 209.4 82.7, 192 84.3 C174.6 85.8, 157 85, 139.3 84.2 C121.5 83.4, 101 82.2, 85.3 79.6 C69.5 77.1, 56 72.9, 44.8 68.7 C33.7 64.6, 23.1 60, 18.3 54.7 C13.5 49.3, 13.6 42.3, 16.1 36.6 C18.5 31, 24.4 25.5, 32.8 20.8 C41.3 16.1, 52.9 11.7, 66.8 8.5 C80.6 5.2, 107.4 2.6, 115.8 1.1 C124.1 -0.5, 115.8 -1.2, 116.6 -0.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M109.7 91 C111.6 90.2, 115.2 90.5, 117.4 91.4 C119.7 92.2, 122.1 94.7, 123 96.1 C123.9 97.6, 123.4 98.4, 122.9 100.1 C122.3 101.8, 121.5 105.1, 119.9 106.4 C118.2 107.7, 115.3 108.1, 113 108 C110.7 108, 107.7 107.7, 106.2 106.3 C104.6 105, 103.9 102.1, 103.7 100.1 C103.5 98.1, 103.3 95.7, 105 94.3 C106.6 92.9, 111.8 92.1, 113.5 91.8 C115.3 91.5, 115.8 92.7, 115.5 92.8 M115.2 90.1 C117.2 90.1, 120 92.3, 121.2 93.7 C122.3 95, 122.2 96.4, 122.2 98.2 C122.1 100, 121.9 103.2, 121 104.6 C120 106, 118.5 106.1, 116.4 106.6 C114.3 107.2, 110.6 108.7, 108.4 108 C106.3 107.3, 104.4 104.4, 103.6 102.5 C102.8 100.5, 103.4 98, 103.8 96.2 C104.1 94.4, 104.3 92.5, 105.8 91.6 C107.3 90.7, 111.4 91.2, 112.7 91 C113.9 90.7, 113.3 89.9, 113.4 90.2&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M117 91.3 C119.1 91.9, 121.8 94.3, 122.8 96.1 C123.9 98, 123.7 100.8, 123.2 102.6 C122.7 104.3, 121.7 105.9, 119.7 106.8 C117.8 107.6, 113.9 108.1, 111.7 107.7 C109.4 107.2, 107.6 105.6, 106 104.2 C104.4 102.7, 102.3 100.6, 102.1 99.1 C101.9 97.7, 103.4 96.6, 104.8 95.4 C106.2 94.3, 108 92.6, 110.4 92.1 C112.7 91.7, 117.2 92.4, 118.9 92.7 C120.5 93.1, 120 94, 120.1 94.3 M112.6 91.7 C114.7 91.8, 117.9 92.5, 119.7 93.8 C121.5 95.1, 123 98, 123.3 99.5 C123.6 100.9, 122.7 101, 121.4 102.5 C120.1 104, 117.4 107.6, 115.6 108.5 C113.8 109.3, 112.4 108.7, 110.4 107.7 C108.5 106.7, 105 104.2, 103.6 102.4 C102.2 100.6, 101.6 98.5, 102 96.8 C102.4 95.2, 104.4 93.3, 106.1 92.7 C107.8 92, 111 92.9, 112.1 92.8 C113.3 92.7, 112.9 92.4, 113.2 92.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M80.1 111.5 C81.4 111.3, 83.3 112.6, 84.4 113.1 C85.5 113.7, 86.4 114, 86.7 114.9 C86.9 115.7, 86.2 117.3, 85.8 118.3 C85.5 119.4, 85.6 120.6, 84.6 121.2 C83.5 121.8, 80.9 122.5, 79.4 122.2 C78 121.9, 76.9 120.3, 76 119.4 C75.1 118.5, 73.9 117.4, 74 116.6 C74.1 115.8, 75.5 115.7, 76.6 114.8 C77.7 114, 79.9 112.1, 80.7 111.6 C81.4 111.1, 81.1 111.6, 81 111.9 M80 112.5 C80.9 112.3, 82 111.9, 83.2 112.5 C84.4 113.2, 86.5 115.6, 87.2 116.5 C88 117.3, 88.5 116.8, 87.9 117.7 C87.2 118.7, 84.6 121.5, 83.1 122.1 C81.6 122.7, 80.5 121.6, 79.1 121.4 C77.6 121.2, 75.2 121.9, 74.3 121 C73.5 120, 73.6 117, 74.1 115.9 C74.5 114.8, 76.3 115.4, 77.1 114.6 C78 113.8, 78.6 111.2, 79 111.1 C79.3 110.9, 79.3 113.6, 79.5 113.7&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M82.8 111.9 C84.2 112.2, 86.3 112.8, 87.1 114 C87.8 115.1, 87.9 117.9, 87.3 119 C86.7 120.1, 84.5 119.9, 83.4 120.5 C82.4 121.1, 82.1 122.6, 81 122.7 C79.9 122.9, 78 122.2, 76.9 121.3 C75.8 120.5, 74.5 118.9, 74.3 117.7 C74.1 116.6, 75 115.3, 75.8 114.5 C76.7 113.7, 77.9 113.2, 79.3 112.9 C80.7 112.6, 83.5 112.4, 84.3 112.6 C85.1 112.7, 84.3 113.6, 84.2 113.7 M82.7 113.8 C84.1 113.9, 85 114.7, 85.8 115.1 C86.5 115.5, 87.6 115.7, 87.4 116.3 C87.2 117, 85.8 118, 84.5 119.2 C83.2 120.3, 80.9 123, 79.5 123.1 C78.1 123.3, 77.2 120.9, 76.3 120.3 C75.3 119.6, 74.1 120.1, 73.7 119.3 C73.3 118.4, 73 116.3, 73.7 115.3 C74.4 114.3, 76 113.9, 77.6 113.5 C79.3 113.1, 82.6 113, 83.5 113 C84.5 113.1, 83.5 114, 83.3 113.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;155&quot; y=&quot;42.0&quot;&gt;who put this here?&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M58.3 129.7 C62.9 130, 68.4 133.5, 71.7 136.8 C75 140.2, 77.4 145.2, 78.1 150 C78.8 154.8, 78.4 161.7, 75.7 165.7 C72.9 169.7, 66.7 172.8, 61.6 173.8 C56.6 174.9, 49.7 173.9, 45.3 171.7 C41 169.6, 37.6 165.2, 35.6 160.9 C33.5 156.6, 31.9 150.3, 33 145.8 C34.1 141.4, 37.2 137, 42.1 134.4 C47.1 131.8, 58.9 130.3, 62.8 130.2 C66.8 130.1, 66 133.1, 65.9 133.6 M67.8 133.2 C72.1 134.8, 75 138.1, 76.5 142.4 C77.9 146.7, 77.9 154.2, 76.6 159 C75.2 163.9, 72.2 169.1, 68.4 171.6 C64.7 174.1, 58.9 175, 54.1 174.1 C49.3 173.2, 43.1 169.6, 39.6 166.2 C36 162.9, 32.8 158.5, 32.6 153.8 C32.5 149.2, 35.5 142.6, 38.5 138.6 C41.6 134.6, 46.3 130.8, 51 129.9 C55.6 129, 63.9 132.5, 66.5 133.2 C69.1 133.8, 66.5 133.7, 66.3 134&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M64.6 131.3 C69.2 132.7, 74.1 136.5, 76.4 140.8 C78.7 145, 79.5 152.4, 78.5 157 C77.4 161.6, 74.2 165.7, 70.3 168.5 C66.3 171.3, 59.8 174, 54.7 174 C49.6 174.1, 43.6 171.7, 39.9 168.7 C36.2 165.6, 33 160.3, 32.3 155.5 C31.6 150.7, 32.8 143.6, 35.5 139.6 C38.2 135.7, 43.4 133.3, 48.4 131.9 C53.5 130.6, 62.7 131.3, 65.8 131.6 C68.8 131.9, 66.8 133.4, 66.5 133.7 M52.4 130.7 C57 130.3, 64.8 132.5, 68.9 134.9 C73 137.3, 75.5 140.6, 77 145.1 C78.5 149.5, 79.3 156.9, 77.7 161.5 C76.1 166, 71.8 170.5, 67.2 172.5 C62.6 174.4, 54.8 174.5, 50.1 173.1 C45.4 171.8, 41.7 168.2, 39 164.6 C36.3 161, 33.8 156, 33.7 151.6 C33.6 147.1, 35.3 141.6, 38.4 137.9 C41.6 134.2, 50.3 130.5, 52.7 129.3 C55.1 128.1, 53.1 130, 53 130.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M49.6 142.8 C50.2 142.9, 49.7 142.7, 50.1 143.4 C50.5 144, 51.6 146.2, 51.8 146.9 C52 147.6, 51.6 147.3, 51.1 147.6 C50.6 147.9, 49.4 148.7, 48.8 148.8 C48.2 148.9, 47.8 148.5, 47.2 148.2 C46.7 147.9, 46 147.6, 45.7 147 C45.3 146.4, 45 145.2, 45.1 144.7 C45.1 144.1, 45.2 143.8, 45.9 143.6 C46.6 143.4, 48.7 143.6, 49.3 143.5 C50 143.3, 49.8 142.7, 49.6 142.9 M48.7 142.4 C49.5 142.7, 50.6 144.5, 51.1 145.4 C51.7 146.3, 52 147.4, 51.8 147.7 C51.6 148, 50.3 147.1, 49.9 147.1 C49.4 147.1, 49.4 147.2, 49 147.6 C48.5 148, 48.2 149.6, 47.3 149.4 C46.4 149.2, 43.9 147, 43.5 146.4 C43.1 145.7, 44.4 146.1, 44.8 145.3 C45.1 144.6, 45 142.3, 45.7 142 C46.4 141.6, 48.3 142.7, 48.8 143 C49.3 143.3, 48.4 144, 48.6 144&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M49.5 143.1 C50.4 143.3, 51.2 144.2, 51.6 144.8 C51.9 145.5, 51.8 146.4, 51.6 147 C51.4 147.6, 50.9 148, 50.4 148.4 C49.9 148.9, 49.4 149.7, 48.6 149.6 C47.7 149.6, 46.1 148.8, 45.4 148.2 C44.7 147.5, 44.7 146.3, 44.5 145.8 C44.4 145.3, 44.2 145.4, 44.7 145.1 C45.1 144.8, 46.3 144.5, 47.3 144.1 C48.2 143.7, 49.9 142.7, 50.2 142.8 C50.6 142.8, 49.6 144, 49.5 144.3 M49 144.6 C49.9 144.3, 50.9 142.5, 51.2 142.8 C51.5 143, 50.9 145.1, 51 146.1 C51 147.1, 51.6 148, 51.2 148.7 C50.9 149.3, 49.3 149.6, 48.6 149.8 C47.9 150, 47.4 150.2, 46.9 149.9 C46.4 149.7, 46.1 149.2, 45.8 148.3 C45.6 147.3, 45.3 145, 45.3 144 C45.3 143.1, 45.4 142.5, 45.8 142.6 C46.1 142.7, 46.9 144.1, 47.5 144.4 C48.2 144.6, 49.2 144.3, 49.6 144&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M64.8 142.9 C65.3 142.9, 66.2 143.9, 66.6 144.5 C67.1 145.1, 67.3 145.7, 67.2 146.4 C67.2 147.1, 67 148.3, 66.6 148.6 C66.2 148.9, 65.6 148.4, 64.9 148.3 C64.2 148.2, 63.1 148.1, 62.6 147.9 C62.1 147.6, 61.8 147.5, 61.8 146.9 C61.7 146.3, 61.9 144.9, 62 144.3 C62.2 143.6, 61.8 143.4, 62.4 143 C63.1 142.7, 65.4 142.3, 65.8 142.4 C66.2 142.5, 65 143.5, 64.9 143.6 M62.9 143.7 C63.4 143.8, 64.5 144, 65.2 144.3 C65.8 144.6, 66.8 144.7, 66.9 145.3 C67 145.9, 66 147.2, 65.7 147.8 C65.4 148.4, 65.7 148.9, 65 149 C64.2 149.1, 61.8 148.4, 61.2 148.3 C60.7 148.3, 61.4 148.9, 61.7 148.5 C61.9 148.2, 62.2 147, 62.5 146.3 C62.8 145.6, 63.1 145, 63.4 144.3 C63.7 143.6, 64.3 142.1, 64.4 142 C64.5 141.8, 64.2 143, 64 143.4&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M65.7 143.1 C66.4 143.3, 66.2 143.1, 66.2 143.7 C66.3 144.3, 66.2 146.3, 66.3 146.9 C66.4 147.5, 67.3 147.1, 66.9 147.4 C66.5 147.7, 64.7 148.3, 63.9 148.5 C63 148.6, 62.1 148.3, 61.7 148 C61.2 147.8, 61.2 147.6, 61.1 147 C61 146.4, 60.8 145, 61 144.5 C61.1 144, 61.2 144.4, 61.9 144 C62.5 143.7, 64.4 142.4, 65 142.4 C65.6 142.5, 65.3 143.9, 65.5 144.2 M64 142.6 C65 142.8, 67.4 142.9, 68 143.7 C68.6 144.5, 67.8 146.5, 67.6 147.4 C67.4 148.3, 67.7 148.7, 67 149.1 C66.2 149.5, 64.2 150, 63.1 149.9 C62.1 149.7, 60.8 148.8, 60.5 148.2 C60.2 147.7, 61 147.1, 61.1 146.5 C61.2 145.9, 61 145.2, 61.2 144.7 C61.4 144.2, 61.6 143.6, 62.6 143.5 C63.5 143.3, 66.4 143.9, 66.8 143.6 C67.1 143.4, 64.6 141.9, 64.5 141.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M48 163 C50.2 160, 55.2 157.9, 57.8 160.5 M48.7 161.2 C52.3 159.2, 54.9 157.1, 56.5 161.6 M56 161 C58 162.7, 59.3 164.2, 64 161.9 M54.7 161.1 C60.2 164, 58.6 162.2, 62.6 159.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M56.9 175 C54.3 198.6, 54.2 226.5, 58 239 M56.9 174.2 C56.8 196.5, 57.2 218.2, 56.4 240.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M57.5 240.9 C47.3 258.8, 39.9 277.2, 35.4 287.1 M55.8 239.4 C51.3 249.6, 48.7 258.4, 35.4 286.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M56.4 239 C63.2 255.6, 66.8 269.2, 77.2 286.1 M55.6 239.5 C61.7 255.1, 69.2 268.1, 76.5 285.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M57 190.9 C49.8 200.9, 40.8 211.8, 32.6 220.3 M56.5 192.7 C47.8 204.1, 39.8 214.3, 33.5 221.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M57.6 190.8 C74.4 191.3, 90.5 188.5, 112 184.5 M55.4 191.9 C70.3 190.7, 83.1 188, 112.5 184.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M110.1 182.7 C150.7 178.3, 187.4 175.9, 233.4 168.6 M112.2 183.1 C147.8 177.8, 184.3 175.1, 231.5 170.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M312.4 120.2 C358.2 117.6, 407.9 118.6, 480.5 118.7 C490.1 126.4, 495.6 133.6, 509.3 147.7 C510.9 171.3, 513.1 189.6, 512.2 242.2 C467.6 239.1, 430.9 235.1, 311.2 238.6 C307.1 207.9, 310.4 183, 308.6 116.7&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M308.7 118.6 C365.8 121.6, 420.1 122, 482.8 120.8 M309.1 120.3 C373.3 120.5, 436 120.4, 484.5 120.9 M485.3 118.7 C489.8 125.6, 498 134.2, 508.8 146.6 M483.6 119.4 C492.2 127.2, 498.2 134.2, 510.8 146.4 M509.4 144.1 C509.4 169.6, 509.3 196.2, 510.6 240.8 M509.7 146.3 C509.6 172.4, 510.7 198, 511 239 M509.7 240.6 C464.3 237.8, 420 237.5, 309.8 241.4 M510.5 240.3 C458.8 238.5, 405.4 238.9, 310.5 240.5 M310 240.9 C311.6 204.1, 309.7 165.5, 308.2 121.4 M309.1 240.9 C309.8 203.7, 308.4 166.9, 310.3 119.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M483.2 119.6 C483 123.9, 478.6 142.2, 483.1 146.7 C487.5 151.2, 505.5 146.9, 509.8 146.8 M484.9 118.3 C485.1 122.2, 481.3 140.5, 485.3 144.9 C489.3 149.4, 505 144.5, 508.9 144.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;326&quot; y=&quot;168.0&quot;&gt;call printf&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.12px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;326&quot; y=&quot;192.0&quot;&gt;...&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M247.8 134.7 C253.2 131.3, 262.8 131, 269.3 132.2 C275.9 133.4, 282.3 137.1, 287.2 141.9 C292.1 146.7, 297.6 154.3, 298.7 161 C299.8 167.7, 296.8 176.2, 293.7 182.3 C290.6 188.3, 286 194.2, 280.1 197.3 C274.2 200.4, 265.1 202.2, 258.4 201 C251.8 199.9, 245 195.2, 240.2 190.2 C235.4 185.2, 230.8 177.7, 229.6 171.2 C228.5 164.7, 229.7 157.6, 233.3 151.3 C236.9 144.9, 247.7 136, 251.3 133 C254.9 130, 254.4 132.6, 254.7 133.3 M275.9 133.4 C282.1 135.1, 289.5 139.1, 293.3 144.9 C297.1 150.6, 299.3 160.9, 298.8 168 C298.2 175, 294.6 181.9, 290.3 187 C285.9 192.2, 278.7 196.9, 272.7 199.1 C266.6 201.4, 260.1 202.7, 253.9 200.5 C247.8 198.3, 239.9 191.8, 235.7 185.8 C231.5 179.8, 228.4 171.5, 228.7 164.7 C228.9 157.9, 233.2 150.6, 237.3 145.2 C241.3 139.9, 246.6 134.7, 253.1 132.5 C259.5 130.3, 272.1 131.8, 276 132.1 C279.8 132.4, 276.2 133.4, 276.1 134.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M0.6 286.8 C164.4 285.1, 327.6 285, 520.7 285.8 M-0.2 286.1 C141.5 287.7, 283.6 287.5, 519.8 286.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;The answer is a step in building software that I&#x27;d been benefiting from for years without noticing: &lt;strong&gt;linking&lt;/strong&gt;. It&#x27;s the stage that takes your code — full of references to functions you never wrote — and stitches in the actual code those references point to. Understanding it finally explained a pile of things I&#x27;d always found mysterious, including the single most common category of build error every programmer eventually hits.&lt;/p&gt;
&lt;h2 id=&quot;your-code-is-full-of-promises&quot;&gt;Your code is full of promises&lt;a class=&quot;anchor&quot; href=&quot;#your-code-is-full-of-promises&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Here&#x27;s the thing I never appreciated. When my compiler translates &lt;code&gt;printf(&quot;hi&quot;)&lt;/code&gt;, it does &lt;em&gt;not&lt;/em&gt; produce the code for &lt;code&gt;printf&lt;/code&gt;. It has no idea how &lt;code&gt;printf&lt;/code&gt; works. Instead it emits something more like an IOU:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;call&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;; &quot;call the function named printf&quot; — wherever it is&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;That &lt;code&gt;call printf&lt;/code&gt; is a &lt;strong&gt;promise&lt;/strong&gt;, not an answer. My program is saying: &quot;at this point, jump to a function called &lt;code&gt;printf&lt;/code&gt;. I don&#x27;t have it. Somebody find it and fill in the address later.&quot; My compiler produces a file full of these IOUs — its own code, plus a list of unresolved names it&#x27;s counting on someone else to provide.&lt;/p&gt;
&lt;p&gt;That &quot;somebody&quot; is the &lt;strong&gt;linker&lt;/strong&gt;. Its whole job is to collect all the pieces of code — mine, plus libraries — and &lt;strong&gt;resolve every promise&lt;/strong&gt;: find the real &lt;code&gt;printf&lt;/code&gt;, figure out where it lives, and patch every &lt;code&gt;call printf&lt;/code&gt; to point at it. Compiling turns your source into a piece with holes in it. Linking fills the holes.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -16 692 426&quot; width=&quot;692&quot; role=&quot;img&quot; aria-label=&quot;What the linker does&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M11.4 2 C72.2 1.1, 140.8 -0.3, 223 1.3 C228.7 2.8, 231.4 6.6, 233.2 12.1 C232.8 28, 234.1 48.7, 232.3 71.4 C232 83.5, 229.5 81.8, 222.9 81.2 C140.6 80.3, 64.9 81.6, 12 85.6 C6.8 83.3, -3.1 83.9, -2.8 71 C-1.4 54.4, -1.5 37.9, 2.5 9.3 C-0.2 1.2, 6.6 -1.2, 6.7 2.3&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M8.3 1.2 C58.6 2.3, 106.2 0.3, 218.3 0.4 M10.7 0.5 C71.6 1.6, 132.2 1.8, 220.7 -0.4 M220 0 C227.9 -1.8, 228.1 4.5, 230.4 9.5 M220.3 -1.1 C225.8 -0.2, 230.1 2.5, 230.7 7.8 M230.7 9 C229.3 22.4, 229.3 35.8, 229.6 74.2 M229.8 10.9 C230.4 27.7, 229.4 43.7, 229.8 73.1 M230 74 C228.8 80, 227.7 84.4, 221 83.7 M229.7 73.5 C227.8 82.6, 228 85.8, 219.6 82 M219.7 84.2 C164.3 84.6, 108.5 83.3, 10.8 83.2 M219.4 84.2 C175.7 83.1, 132.9 84.2, 10.1 84.6 M10 84 C3.4 84.2, 1 79.5, -0.8 73.7 M10.9 82.2 C3.1 84.6, 2.1 81.2, 1.2 72.4 M1 73.3 C1.4 51.1, 1.7 27, -1 11.4 M-0.9 74.1 C0.3 55.9, -0.6 37.2, 0.3 10.9 M0 10 C-1.1 4.3, 4.2 -0.7, 10.2 0.7 M0.5 9.9 C1.9 3.3, 1.7 0.1, 9.3 1.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;115&quot; y=&quot;30.8&quot;&gt;my compiled code&lt;/tspan&gt;&lt;tspan x=&quot;115&quot; y=&quot;53.3&quot;&gt;call printf → ?&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M312.4 1.1 C353.3 1.1, 399.5 -3.3, 517.8 -2.8 C525.3 -1, 532.7 3.3, 530.3 12.9 C531.9 29.2, 528.2 53.5, 530.1 71.6 C531.9 81.4, 527.1 87.1, 521.2 80.7 C461.9 87.7, 401 89.3, 311.3 86.2 C303.7 86.7, 299.5 82.4, 300.4 70.9 C301.5 52.8, 302.2 25.8, 300.7 6.9 C297.3 6.4, 303.4 1.6, 311.1 1.5&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M309.8 1.1 C358.6 -2.9, 404.9 -1.7, 518.5 -0.8 M309.3 -0.9 C365.3 -1.4, 421.8 -2, 520 -0.5 M520 0 C528.6 -0.7, 529.8 2.1, 532 11.1 M518.6 1.5 C528.8 -2, 530.9 1.2, 529.7 11 M530.7 11.7 C530.8 27.7, 530.9 47.7, 530.5 72.2 M529.7 10 C530.1 33.2, 530.3 58, 530.7 74.6 M530 74 C531.4 80, 526.1 83.6, 518.1 83 M530.1 72.4 C530.7 78.9, 526.7 81.8, 519.6 82 M519.7 83 C457.4 83.9, 396.3 83.2, 308.3 84.8 M519.6 83.8 C470 84.4, 421 84.4, 309.3 84 M310 84 C301.4 85.3, 298.7 80.1, 300.8 74.4 M310.8 85.1 C302.1 84.6, 301.7 80.1, 299.8 75.5 M298.9 73.9 C299.2 53.6, 298.2 30.3, 301.9 10 M299.3 73.2 C298.8 56.1, 300 38.6, 300.2 9.2 M300 10 C301.1 3, 304.5 1.8, 308.8 0.9 M299.7 10.8 C299.6 1.5, 303.1 -0.5, 310.3 -0.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;415&quot; y=&quot;30.8&quot;&gt;libc&lt;/tspan&gt;&lt;tspan x=&quot;415&quot; y=&quot;53.3&quot;&gt;the real printf&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M109.3 171.3 C175.7 167.7, 238.3 168, 319.9 168.8 C326.1 170.2, 327.3 175.7, 328.7 180.3 C326.7 190.6, 328.3 199.3, 331.7 215.7 C333.4 220.5, 325.9 223.8, 319.2 224.6 C248.1 222.4, 173.3 222.3, 108.5 224.8 C102.4 226.9, 100.3 224, 100.8 217.9 C99.3 201.3, 100.1 188.4, 98.5 177.2 C98.3 170.7, 100.3 168.5, 107.3 171.7&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M109.1 171.3 C175.4 170.8, 240.2 170.6, 320.2 169.4 M108.8 170.5 C182.3 170.8, 256.3 171.9, 320.9 169.5 M320.7 170 C327.7 169.3, 330 174.7, 330.7 180.8 M320.8 169.5 C326 171.1, 331 171.9, 327.9 181 M328 180.9 C328.2 187.2, 331.4 195.9, 331.2 217.9 M330.8 178.9 C330.4 186.6, 329.8 193.9, 330.6 216.5 M330 216.7 C329.1 222.3, 325.1 224.4, 321.6 226.2 M331 215.5 C330.4 224.2, 327.8 224.5, 319.3 223.9 M321.8 224.8 C279.6 227.5, 233.6 226.4, 107.7 225.2 M321 226.9 C262 227.5, 205.1 227.2, 110 226 M109.3 226 C103.8 227.2, 100.8 221.6, 99.9 217.6 M107.9 224.5 C104.4 226.5, 101 224.8, 98.6 216.7 M98.3 214.8 C99.2 200.1, 99.1 185.9, 101.2 180.5 M99.8 216.7 C99.1 203.5, 99.1 192.9, 100.6 179.7 M100 179.3 C100 174, 101.4 169.3, 111.1 171.3 M101.8 181.3 C101.2 175.3, 104.3 169.4, 108.8 169.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;215&quot; y=&quot;198.0&quot;&gt;Linker&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M146 90.8 C163.2 118, 185.1 147.8, 194.4 163.7 M145 89.3 C161 113.6, 176.8 136.2, 193.6 165.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M192.7 152.2 C191.7 155.8, 194.2 161.1, 194.2 164.1 M192 151.2 C192.7 155.9, 193.6 159.3, 193.7 165.3 M193.7 164 C192.1 163.9, 188.7 163.1, 181.7 157 M194.3 164.7 C191.5 163.6, 189.6 161.8, 182.3 157.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M357.9 89.3 C314.9 119.1, 278.1 148.3, 257.6 167.2 M357.2 87.1 C319.8 118.2, 281.5 146.8, 256.4 167.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M270.3 164.5 C262.8 165.1, 259.6 164.9, 257 166.9 M269.8 163 C264.6 165.1, 259.2 165.6, 256.2 166.9 M256.7 165.2 C258.7 162.4, 261.1 158, 262.4 152.5 M256.2 166.2 C258 162.6, 260.3 157.9, 262 153.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M108.3 310.2 C173.4 309, 240.6 312.3, 318.4 310.2 C330.1 308.5, 332.7 316.5, 331.5 320.3 C326.4 341.3, 327.6 358.6, 328.6 386.4 C327.1 388.4, 324 391.1, 322.3 390.6 C259.1 394.3, 193.3 395.3, 111.2 391.2 C102 393.2, 103.4 392.6, 98.8 385.3 C101.6 366.4, 101.3 350.3, 96.5 318.3 C103.6 310.7, 106.2 309.6, 110.4 312.7&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M110.1 311.7 C183.1 309.3, 257.5 309.4, 320.6 308.3 M109.9 310.7 C184.2 310.9, 259.9 310.9, 320 310.9 M320 310 C325.3 310, 331.2 314, 330.2 319.1 M320.5 310.5 C326.1 309.8, 328.2 313.7, 328.1 320.7 M331.3 319.3 C331.1 338.2, 328.8 359.7, 331.4 385.7 M329.1 320 C330.3 340.9, 329.8 362, 329.3 383.7 M330 384 C329.6 390.3, 326.5 394.2, 321.8 394.3 M328.2 385.1 C328.4 392.6, 326.4 391.7, 321.3 394.3 M321.1 395.3 C243.5 392.4, 167.3 392.2, 108.3 393.3 M320 394.6 C244.8 395, 168.4 393.8, 110.5 394.8 M110 394 C104.7 393.8, 100.5 390.2, 101 383.7 M111.5 395.4 C105.5 393.5, 101 390.6, 99.2 383.5 M100.6 383.1 C101.7 361.6, 99.4 338.5, 101.6 319.6 M100.5 383.3 C100.1 367.8, 98.5 352.3, 100.6 319.9 M100 320 C101 312, 102.2 311.8, 110.8 311.9 M101.1 321 C99.8 314.7, 104.6 311.2, 109.3 308.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;215&quot; y=&quot;341.4&quot;&gt;my program&lt;/tspan&gt;&lt;tspan x=&quot;215&quot; y=&quot;362.6&quot;&gt;call printf → real address&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M213.6 233.3 C213.9 261.6, 214.2 288.8, 215.8 305.2 M215.5 231.8 C215.3 252.9, 215 274.2, 215.8 303.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M220.1 292.3 C217.8 297.1, 215.5 301.2, 215.5 304.8 M221.5 291.3 C219.2 294.7, 217.2 298.3, 215.6 303.6 M215.5 302.6 C214.6 301.7, 212.5 297.4, 208.2 291.6 M214.5 304.2 C212.6 298.8, 210.2 294.3, 208.5 291.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;290&quot; y=&quot;270.0&quot;&gt;promise kept&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M437.1 158.1 C516.4 162.1, 595.6 157.4, 649.3 158.7 C659.5 163.4, 662.3 165.8, 661.5 167.9 C661.6 183.7, 659.5 198.3, 661 227.9 C662.5 232.9, 659.8 233.2, 646.9 232.7 C563.6 237.7, 481.7 234.3, 439.4 233.8 C430.4 238.3, 432.5 232.2, 430.4 223 C433.6 202.9, 432.5 182.6, 427.6 170 C427.5 164.6, 433.9 160.3, 442.5 156.9&quot; style=&quot;fill:var(--xd-red)&quot;/&gt;&lt;path d=&quot;M439.5 160.7 C491.4 156.8, 545.7 159.5, 651.1 160.3 M440.5 160.7 C503.4 161.3, 566.2 162.4, 649.8 160.2 M650 160 C658.7 161.5, 660.9 163.1, 661.5 171.8 M650.1 159.7 C657.6 159.8, 657.7 163.8, 658.6 167.9 M658.4 168.2 C661 192.3, 661.2 213.3, 659.9 225.6 M660.8 170.8 C661.2 190.5, 659.9 211.3, 660.3 225.7 M660 226 C660.3 231.8, 657 237.3, 651.3 237.9 M658.5 227.2 C658.9 230.6, 655.9 234.9, 652.1 235.9 M650.8 234.5 C586.8 236.2, 521.5 235.1, 438.6 235.4 M649.2 235.9 C572.2 235.9, 495.8 236.1, 440.5 235.8 M440 236 C434.8 237.9, 428.8 233.1, 430.4 227.2 M438.4 237.3 C434.3 234.4, 428.5 231.1, 430.9 227.2 M431.8 226.2 C429.4 211.3, 429 192.7, 428.8 169.7 M429.5 227 C430.3 205.3, 430.4 185.4, 429.6 170.3 M430 170 C431.3 163.9, 433 158.8, 438.5 160.5 M431.6 168.1 C432 161.2, 432.3 159.4, 438.7 160.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:13.94px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;545&quot; y=&quot;187.4&quot;&gt;undefined reference&lt;/tspan&gt;&lt;tspan x=&quot;545&quot; y=&quot;208.6&quot;&gt;to `printf&#x27;&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M335.8 199.1 C369.7 198.8, 406 198.1, 423.6 199.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;path d=&quot;M411.2 192.7 C415.6 195.1, 421.6 197, 423.7 199.1 M424.4 198.3 C419.9 199, 419.6 201, 412.6 204.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;545&quot; y=&quot;262.0&quot;&gt;no library had printf&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;The compiler leaves a hole where printf goes; the linker finds the real printf in libc and fills it, or fails with undefined reference.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;where-the-real-code-lives-my-stdlib-and-libc-underneath&quot;&gt;Where the real code lives: my stdlib, and libc underneath&lt;a class=&quot;anchor&quot; href=&quot;#where-the-real-code-lives-my-stdlib-and-libc-underneath&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;My language actually makes this promise &lt;em&gt;explicit&lt;/em&gt;, in the source, with a keyword. To use the print function, a Mon program declares it up front:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;extern функц мөр_хэвлэх(м мөр) -&amp;gt; хоосон {}   // extern fn print_line(m: string) -&amp;gt; void
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;That &lt;code&gt;extern&lt;/code&gt; — &quot;external&quot; — is me writing the IOU by hand. It tells the compiler: &lt;em&gt;this function exists somewhere else; I promise to provide it at link time; just emit a &lt;code&gt;call&lt;/code&gt; to it.&lt;/em&gt; The real body of &lt;code&gt;мөр_хэвлэх&lt;/code&gt; lives in my own little &lt;strong&gt;standard library&lt;/strong&gt; (a &lt;code&gt;stdlib/&lt;/code&gt; folder that ships with the compiler), and underneath &lt;em&gt;that&lt;/em&gt;, when it actually needs to push bytes to the screen, it leans on the &lt;strong&gt;C standard library&lt;/strong&gt; — &lt;strong&gt;libc&lt;/strong&gt; — the collection of pre-compiled functions on every system that includes the code making the real &lt;code&gt;write&lt;/code&gt; syscall from Part 4.&lt;/p&gt;
&lt;p&gt;And the neat part: my compiler doesn&#x27;t do the stitching itself. After it emits assembly, the final &lt;code&gt;gen&lt;/code&gt; step &lt;em&gt;shells out to the system&#x27;s C compiler&lt;/em&gt; (&lt;code&gt;cc&lt;/code&gt;) to assemble and link the program — which means my little language gets to borrow the exact same battle-tested linker and libc that C programs use. I wrote &lt;code&gt;extern функц мөр_хэвлэх&lt;/code&gt;; &lt;code&gt;cc&lt;/code&gt; found the real code and wired it in. Decades of working code, for free, in exchange for one honest promise.&lt;/p&gt;
&lt;p&gt;And &lt;em&gt;how&lt;/em&gt; the linker fulfills that promise turns out to be a real fork in the road, with consequences you can measure.&lt;/p&gt;
&lt;h2 id=&quot;two-ways-to-stitch-static-vs-dynamic&quot;&gt;Two ways to stitch: static vs dynamic&lt;a class=&quot;anchor&quot; href=&quot;#two-ways-to-stitch-static-vs-dynamic&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There are two ways the linker can fulfill your program&#x27;s promises, and the difference matters enough that every programmer should be able to explain it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Static linking — bring your own copy.&lt;/strong&gt; The linker takes the actual &lt;code&gt;printf&lt;/code&gt; code out of libc and &lt;em&gt;copies it into your program&#x27;s file&lt;/em&gt;. Your binary now physically contains &lt;code&gt;printf&lt;/code&gt;, and every other library function it uses. The upside: your program is self-contained. Hand that one file to any compatible machine and it just runs — nothing else needed. The downside: it&#x27;s fat. If &lt;code&gt;printf&lt;/code&gt; is 50 KB and a hundred programs each statically link it, that&#x27;s a hundred copies of the same 50 KB sitting on your disk and, worse, a hundred copies loaded into memory when they all run.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Dynamic linking — share one copy.&lt;/strong&gt; The linker does &lt;em&gt;not&lt;/em&gt; copy &lt;code&gt;printf&lt;/code&gt; in. Instead it leaves a note: &quot;at runtime, go find &lt;code&gt;printf&lt;/code&gt; in the shared system copy of libc.&quot; That shared copy — one &lt;code&gt;libc.so&lt;/code&gt; file — lives on the machine, and &lt;em&gt;every&lt;/em&gt; dynamically-linked program borrows the same one. The upside: your program is small, and the whole system shares a single &lt;code&gt;printf&lt;/code&gt; in memory instead of a thousand copies. The downside: your program is no longer self-contained. It &lt;em&gt;depends&lt;/em&gt; on that shared libc being present and compatible on whatever machine it runs on.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -31 692 417&quot; width=&quot;692&quot; role=&quot;img&quot; aria-label=&quot;Static vs dynamic linking&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:24px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;0.0&quot;&gt;Static&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;0&quot; y=&quot;30.0&quot;&gt;bring your own copy&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M320.3 -8.9 C318.7 75.2, 319.3 160.3, 320.4 370.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6;stroke-dasharray:8 6&quot;/&gt;&lt;path d=&quot;M12.7 79.8 C108.6 80.6, 209.9 78.7, 272.3 78.3 C276.8 77.3, 278.4 86.3, 278 87.5 C283 99.3, 280.7 110.4, 283.2 128.7 C280.4 136.7, 276.2 143.6, 272.1 143.6 C192.8 135.4, 114.3 136.4, 12.6 139.4 C5.7 141, -3 139, 0.3 128.5 C-3.1 120.2, 1.3 112.6, 0.4 89.4 C0.8 83.3, 4 78.2, 7.6 78.2&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M9.3 80.1 C83 79, 155.4 77.7, 270.5 80.6 M9.6 80.5 C65.3 78.3, 120 78.1, 269.5 80.8 M270 80 C276.1 81.6, 278.9 82.5, 281 88 M268.2 79.5 C276.9 78.1, 280.9 81.7, 278 90.6 M279.2 91.4 C281.2 97.9, 280.2 108.5, 280.3 129.6 M280.2 90.5 C279.7 100.9, 281.1 112.8, 280.5 131 M280 130 C280.4 137.7, 274.9 139.1, 270.5 138.6 M278.5 128 C280.9 136.4, 276.9 138.7, 270.7 141.5 M270.9 140.1 C207.3 140.5, 145.4 137.8, 11.6 139 M269.4 140.6 C172.1 141.9, 74.6 142.2, 10.3 139.5 M10 140 C1.7 138, 0.4 136.3, 1.8 128.2 M11.7 140.9 C1.7 140.4, -1.6 138.8, -0.1 129.1 M-1.9 128.5 C0.9 115.2, 1.3 103.9, -1.1 89.9 M-0.6 130.1 C-0.9 118.2, 0 104.5, -0.3 89.3 M0 90 C1.4 83.9, 5.3 80.3, 9.9 81.8 M0.6 89.8 C1.5 85, 1.6 78.2, 11.1 78.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;140&quot; y=&quot;110.0&quot;&gt;my code&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M8.9 140.2 C96.8 144.4, 178 141.6, 268.6 139.2 C275.1 139.4, 282.7 143.1, 280.4 152.2 C276.9 160.2, 276.4 168.3, 278 193.6 C276.8 197, 275.8 201.6, 273.3 202.7 C209.9 198.8, 153.7 197.4, 11.5 201.4 C6 198.4, 2 198.4, -3.2 193.2 C-3 179.5, -2.7 169.3, -2.8 147.2 C-2.6 144.5, 5.5 139.1, 10 141&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M9.8 139.9 C64.3 141.1, 119.5 142.2, 269.2 141 M9.4 140.7 C65.1 140.5, 120.3 140.5, 270.3 140.6 M270 140 C275.2 140.9, 281.5 142.8, 278.4 151.6 M269.6 138.5 C274.7 141.1, 280.5 142.2, 278.2 150.2 M281.1 150.8 C279.5 160.2, 281.2 174.5, 280.8 188.9 M280.7 150.7 C280.4 163.9, 279.2 176.6, 280.4 190.2 M280 190 C278.3 196.6, 278.5 198.2, 271.8 199.1 M281.2 190.9 C280.6 197.6, 278 202.3, 269.6 199.1 M269.9 199.6 C216.1 202.3, 160.5 202.2, 9.2 200.9 M270.2 200.7 C196.5 199.3, 122 198.4, 10.2 200.6 M10 200 C4.8 200.2, -0.4 198.6, -1.8 191.4 M10.3 200.9 C3.9 199, 1.1 195.6, -1.2 188.3 M1.4 189.1 C1.9 177.3, 1.5 163.1, -0.1 148.1 M0.2 190 C0.1 179.3, 0.8 167.4, 0.8 150.2 M0 150 C1.7 144.4, 3.2 140.1, 8.8 140.5 M-1.7 151 C-0.7 145.6, 3.5 138, 9.1 140.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;140&quot; y=&quot;170.0&quot;&gt;printf (copied in)&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;140&quot; y=&quot;236.0&quot;&gt;one file, self-contained&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;140&quot; y=&quot;336.0&quot;&gt;fat, but runs anywhere&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:24px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;360&quot; y=&quot;0.0&quot;&gt;Dynamic&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;360&quot; y=&quot;30.0&quot;&gt;share one copy&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M369.7 82.3 C400.2 81.2, 422.6 78.4, 478.6 79.2 C483.5 83.5, 489.2 82.7, 492.6 93.3 C489.3 104.4, 490.9 120, 487.4 132.9 C488.6 140.2, 486.2 141.1, 478.7 142.3 C448.4 142, 412.4 141.1, 370.4 138.1 C364 139.9, 357.3 136.6, 363.2 130.7 C362.2 119.2, 359.6 110.1, 359.5 87.3 C362.3 81.4, 365 82.3, 372.4 80.8&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M369.2 81.1 C412.1 81.1, 452.7 80.7, 482 81.2 M370.4 80.6 C413.6 79.3, 455.8 80.4, 479.5 79.2 M480 80 C486.8 79.1, 488.3 84.7, 491.2 88.4 M478.2 80.9 C488.7 78.5, 490.1 83.7, 489.6 92.3 M488.5 91.9 C490.9 106, 488.6 118.2, 489.6 130 M489.1 89.3 C488.8 101.1, 489.1 113.5, 489.9 130 M490 130 C491.3 135.2, 488.1 140.6, 478 140.6 M490.7 130 C491.5 135.6, 487.5 139.2, 480.9 138.4 M479.6 140.9 C455.7 140.1, 432.2 141.4, 368.4 141.5 M480.3 139.6 C445.1 140.9, 410.7 139.9, 370.9 139.9 M370 140 C364.1 138.6, 358.3 135.8, 359.2 130.9 M370.7 138.5 C365.6 139.8, 359.5 134.7, 358.1 131.3 M359.9 130.4 C361.7 121.8, 359.1 110.1, 358.8 91.6 M360 130.7 C359.1 121.9, 359.8 111.9, 360.4 89.9 M360 90 C361.9 83.5, 361.7 81.2, 369.6 79.3 M359.1 88.4 C359.8 81.1, 364.2 79.4, 372.3 79.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;425&quot; y=&quot;99.4&quot;&gt;my&lt;/tspan&gt;&lt;tspan x=&quot;425&quot; y=&quot;120.6&quot;&gt;program&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M528.2 77.5 C564.6 82, 593.2 81.5, 641.5 80 C643.1 78, 651 80.2, 652.8 88.6 C647.9 99.2, 648.6 108.4, 652.9 130.7 C648.6 139.7, 643.6 136.8, 640.1 139.4 C619.3 139.5, 592.2 136.1, 530.2 137.9 C521.7 140.1, 522.7 137.9, 516.5 126.9 C520.5 118.6, 519.8 105, 522.7 87.4 C519 83.6, 521.2 80.6, 528.3 82.5&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M531.5 80.6 C565.5 81.7, 603.1 79.9, 638.8 79.6 M530.9 80.2 C561.4 79.5, 595 79.7, 639.9 79.6 M640 80 C646.9 79.3, 649.6 83.6, 648.2 89.4 M641.9 81.3 C648.7 80.1, 649.6 84.5, 648.8 88.4 M648.9 89.7 C650.7 102.3, 648.6 116.5, 650.7 130.2 M650.2 89 C649.2 102.1, 649.6 115.5, 649.1 129.7 M650 130 C650.6 137.2, 647.1 138.3, 640.1 138.1 M648.8 129.9 C648.2 137.1, 648.7 140.9, 639.9 137.8 M640.6 139.1 C607.2 137.8, 578.7 139.4, 528.7 139.5 M639.3 140.1 C609 139.5, 577.3 139.4, 529.9 139.8 M530 140 C522.7 140.2, 520 137.8, 521.7 130.4 M530.3 141.2 C522.3 138.9, 521 138.1, 520.9 127.8 M521.6 130.4 C519.4 115.2, 520.8 101.9, 519.1 89.3 M519.3 130.3 C519.5 119.6, 519.1 111.1, 519.6 90.5 M520 90 C518.5 84.6, 524.6 79, 529.7 78.3 M521.8 89.4 C518.1 82.8, 521.5 79, 530.7 81.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;585&quot; y=&quot;99.4&quot;&gt;other&lt;/tspan&gt;&lt;tspan x=&quot;585&quot; y=&quot;120.6&quot;&gt;program&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M370.1 221.1 C433.7 215.5, 492 219, 641.2 219.3 C645.2 218.8, 648.7 226, 649.6 233.3 C652.2 244.5, 649.1 254.7, 650.5 269.2 C646.8 279.4, 646 278.7, 640.7 277.6 C558.8 278.3, 474.8 282.8, 369.8 281.4 C365.7 280.6, 360.6 276.4, 361 272.1 C360.3 252.7, 360 241.7, 361.6 231.6 C358.1 226.3, 366.6 216.6, 367 223.3&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M371.3 219.4 C428.9 219.5, 486 219.7, 639.9 220.6 M370.4 220 C477.3 220.2, 585.9 220.5, 639.4 220.4 M640 220 C646.5 219, 649.3 224.5, 649.8 231.9 M639.7 220.7 C646.7 219.2, 652 224.9, 651.9 228.2 M651.9 229.6 C648.7 245, 648.4 260.1, 649.1 271.2 M650.8 230.6 C649.8 245.6, 649.6 262.4, 650.2 270.7 M650 270 C651 275.2, 648.6 281.6, 641.2 279.1 M649.6 269.1 C648.5 274.7, 646.3 280.2, 640.8 279.7 M640.1 279.9 C533.5 280, 428.8 281.8, 368.8 279.2 M639.5 280.3 C580.3 279.1, 521.4 278.6, 370.2 280.6 M370 280 C363.2 279, 361.2 274.8, 360.4 268.7 M370.5 278.6 C362.7 279.7, 361.9 276.6, 361.9 268.4 M358.3 271.1 C358.7 256.1, 360.1 244.7, 360.7 229.2 M359.3 270.6 C361 255.7, 360.3 242.2, 359.8 230.2 M360 230 C358.2 224.8, 364.8 218.5, 368 221.8 M359.2 230.1 C359.9 225.4, 361 219.3, 368.9 219.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;505&quot; y=&quot;250.0&quot;&gt;libc.so (one shared copy)&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M444.5 143.5 C457.4 169, 473 191.5, 486.5 214.8 M445.5 145 C460.4 171.9, 474.7 197.9, 485.3 214.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M483.5 199.7 C483.7 206, 485.7 210.1, 486 214.8 M484.2 200.7 C484.6 206.1, 484.4 211.2, 485.2 214.7 M485.3 213.7 C482.5 213.8, 479.6 211.1, 472 205.5 M484.7 214.9 C481.1 212.4, 476 208.5, 473.8 207.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M564.8 143.4 C551.6 167.1, 537.2 191.9, 524.2 213 M564.1 144.2 C554.1 162.1, 544.7 178.9, 524.6 215.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M536.6 205.6 C532.5 208.6, 527.9 212.4, 524.5 213.5 M536.1 206.2 C533.3 208.9, 530.6 210.8, 524.7 215 M523.9 213.6 C526.1 212.9, 524.8 208.7, 525.5 201.6 M525.1 215.1 C525 210.2, 525.6 206.3, 526.3 201.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:17px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;505&quot; y=&quot;336.0&quot;&gt;thin, but needs libc on the machine&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;figcaption&gt;Static linking copies printf into the program file; dynamic linking leaves a note and every program shares one libc.so.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The trade-off in one line: &lt;strong&gt;static is a fat, portable program; dynamic is a thin program that depends on its surroundings.&lt;/strong&gt; Most software on your machine is dynamically linked, because sharing one libc across everything is a huge memory and disk win. But when you want a binary that runs &lt;em&gt;anywhere&lt;/em&gt; with zero dependencies, you reach for static.&lt;/p&gt;
&lt;h2 id=&quot;the-error-this-finally-explained&quot;&gt;The error this finally explained&lt;a class=&quot;anchor&quot; href=&quot;#the-error-this-finally-explained&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This is the payoff that made linking click for me forever. Every programmer, sooner or later, hits an error like this:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;undefined reference to `printf&#x27;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For years I found that message baffling. Now it&#x27;s completely transparent: &lt;strong&gt;it&#x27;s the linker telling you it couldn&#x27;t keep one of your promises.&lt;/strong&gt; Your code has a &lt;code&gt;call printf&lt;/code&gt; IOU, and the linker looked through every library you gave it and &lt;em&gt;never found the real &lt;code&gt;printf&lt;/code&gt;&lt;/em&gt; to fill in. An &quot;undefined reference&quot; is a promise with nobody to fulfill it — you forgot to link the library that contains it.&lt;/p&gt;
&lt;p&gt;The moment you understand that compiling makes promises and linking keeps them, that entire class of error stops being mysterious and starts being obvious: &lt;em&gt;you asked for a function and didn&#x27;t tell the linker where to find it.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;but-dynamic-linking-left-a-loose-thread&quot;&gt;But dynamic linking left a loose thread&lt;a class=&quot;anchor&quot; href=&quot;#but-dynamic-linking-left-a-loose-thread&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Static linking I fully understood — the code is right there in my file, end of story. But go back and reread dynamic linking, because something doesn&#x27;t add up.&lt;/p&gt;
&lt;p&gt;If my program is dynamically linked, then &lt;code&gt;printf&lt;/code&gt; is &lt;strong&gt;not in my binary&lt;/strong&gt;. My file just contains a note that says &quot;find &lt;code&gt;printf&lt;/code&gt; in the shared libc, later.&quot; But &lt;em&gt;later when?&lt;/em&gt; My program is just a file on disk full of these notes. At some point, between me double-clicking it and it actually running, &lt;em&gt;someone&lt;/em&gt; has to read those notes, hunt down the shared libc, load it into memory, and finally fill in all those addresses my linker left blank.&lt;/p&gt;
&lt;p&gt;Who does that? And when, exactly? That last handoff — from a file full of unfilled promises to a living, running process with every address resolved — is the very last step of the whole descent. It&#x27;s where a program is finally, truly &lt;em&gt;born&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id=&quot;one-last-floor&quot;&gt;One last floor&lt;a class=&quot;anchor&quot; href=&quot;#one-last-floor&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;We&#x27;ve come all the way down: language → compiler → IR → assembly → syscalls → the code that gets stitched in. One step remains, the one that happens at the last possible moment — the instant a file on disk becomes a running process, with the dynamic linker sprinting to fill in every borrowed address before your first instruction runs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What happens between pressing Enter and my program&#x27;s first instruction?&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>The Last Mile: From a File on Disk to a Living Process</title><link>https://your-moon.github.io/s2-7-loading/</link><guid>https://your-moon.github.io/s2-7-loading/</guid><pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate><description>&lt;h1 id=&quot;the-last-mile-from-a-file-on-disk-to-a-living-process&quot;&gt;The Last Mile: From a File on Disk to a Living Process&lt;a class=&quot;anchor&quot; href=&quot;#the-last-mile-from-a-file-on-disk-to-a-living-process&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Building my own programming language — Season 2: To the Metal · Part 7 (Finale)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I typed &lt;code&gt;./guess&lt;/code&gt;, pressed Enter, and my program printed a line — and a question I&#x27;d been dodging finally had nowhere to hide.&lt;/p&gt;
&lt;p&gt;Because if my program is dynamically linked, then &lt;code&gt;printf&lt;/code&gt; is &lt;em&gt;not inside it&lt;/em&gt;. My compiled file just carries a note — &quot;find &lt;code&gt;printf&lt;/code&gt; in the shared libc, later.&quot; But a file on disk is inert. It doesn&#x27;t do anything. So in the sliver of time between that Enter key and the first instruction actually running, someone has to read those notes, track down the shared libc, load it into memory, and fill in every address my linker left blank.&lt;/p&gt;
&lt;p&gt;This post is about that someone, and that &lt;em&gt;when&lt;/em&gt;. It&#x27;s the final floor of the whole descent — the instant a dead file becomes a live process. And once we hit the bottom, we&#x27;re going to climb all the way back up, and I&#x27;ll show you the entire fall in one piece.&lt;/p&gt;
&lt;h2 id=&quot;a-program-on-disk-is-not-running-yet&quot;&gt;A program on disk is not running yet&lt;a class=&quot;anchor&quot; href=&quot;#a-program-on-disk-is-not-running-yet&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Start with the thing I&#x27;d always blurred together: a &lt;strong&gt;program&lt;/strong&gt; and a &lt;strong&gt;process&lt;/strong&gt; are not the same thing.&lt;/p&gt;
&lt;p&gt;A program is a file — bytes on your disk, patient and dead. A process is that program &lt;em&gt;alive&lt;/em&gt; in memory, with a slice of the CPU, actually executing. Running a program means turning the first into the second, and that transformation is a real, active job that something has to perform. It doesn&#x27;t just happen.&lt;/p&gt;
&lt;p&gt;When you run &lt;code&gt;./guess&lt;/code&gt;, you&#x27;re really asking the operating system: &lt;em&gt;take this dead file and bring it to life.&lt;/em&gt; The kernel obliges. It carves out memory for the new process, copies the program&#x27;s instructions in, sets up the stack — and then, for a dynamically-linked program, it does &lt;em&gt;not&lt;/em&gt; jump straight into your code. It jumps somewhere else first.&lt;/p&gt;
&lt;h2 id=&quot;the-dynamic-linker-a-program-whose-job-is-to-finish-your-program&quot;&gt;The dynamic linker: a program whose job is to finish your program&lt;a class=&quot;anchor&quot; href=&quot;#the-dynamic-linker-a-program-whose-job-is-to-finish-your-program&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Here&#x27;s the surprise that tied the whole series together for me. Before your first line runs, the kernel hands control to a small, special program called the &lt;strong&gt;dynamic linker&lt;/strong&gt; (on Linux, &lt;code&gt;ld.so&lt;/code&gt;). Its entire purpose is to finish the job the regular linker deliberately left half-done.&lt;/p&gt;
&lt;p&gt;Remember the trade from Part 6: dynamic linking kept your binary thin by &lt;em&gt;not&lt;/em&gt; copying &lt;code&gt;printf&lt;/code&gt; in, leaving a promise to resolve &quot;later.&quot; The dynamic linker is &lt;em&gt;later&lt;/em&gt;, arriving. It runs &lt;em&gt;inside&lt;/em&gt; your process, at startup, before &lt;code&gt;main&lt;/code&gt;, and it sprints through a checklist:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Read the notes: which shared libraries does this program need? (libc, and maybe others.)&lt;/li&gt;
&lt;li&gt;Find each one on the system and load it into the process&#x27;s memory.&lt;/li&gt;
&lt;li&gt;Walk every unresolved promise — every &lt;code&gt;call printf&lt;/code&gt; my compiler left blank — and patch in the real address, now that libc is loaded and it knows where &lt;code&gt;printf&lt;/code&gt; actually sits.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Only when every promise is kept does the dynamic linker step aside and let &lt;em&gt;your&lt;/em&gt; code run. By the time &lt;code&gt;main&lt;/code&gt; starts, the holes are filled. &lt;code&gt;printf&lt;/code&gt; has a real address. The program is whole.&lt;/p&gt;
&lt;figure class=&quot;diagram&quot; style=&quot;--w:560px&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -16 623 502&quot; width=&quot;623&quot; role=&quot;img&quot; aria-label=&quot;From Enter to main&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M8.8 -1.8 C52.1 2.6, 105.1 5, 214.5 2.9 C215.1 -1.4, 217.5 3.4, 220.2 10 C217.4 19.8, 216.3 34.8, 221.1 43.4 C221.4 50.7, 215.8 53.4, 214.8 48.8 C154.2 51.6, 98.7 48.5, 7.6 52.4 C4 49.4, -2 49.7, -0.9 40.8 C0.8 32.4, 3.5 19.8, 1.3 11.9 C-3.3 1.6, 6.1 0.2, 11.7 -1&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M8.2 0.5 C54.4 -2.3, 103.7 -1.2, 212.9 -0.2 M7.9 0.4 C62.9 1, 115.3 1.5, 212.5 0.6 M211.7 0 C217.5 1.2, 220.8 4.3, 218.1 8.4 M212.9 1.2 C219.5 -0.5, 219 3.4, 219.8 7.2 M220.7 10.1 C219.5 17.4, 220.4 30.6, 220.2 41.6 M219.1 7.8 C219.7 16.8, 219.4 26, 220.6 41.2 M220 41.7 C218.2 45.7, 218.8 48.6, 212.3 50.7 M219.9 40.8 C220.7 46.6, 218.6 48.1, 209.6 51.2 M210.5 48.5 C159.9 49.7, 112.1 48.9, 8.3 51.1 M211.2 50.2 C158 48.7, 105 48.5, 7.8 49.5 M8.3 50 C2.7 48.3, 2 45.3, -0.2 41.7 M10 49.8 C1.7 51.7, -0.7 45.6, -1.7 40.5 M-0.6 42.5 C1 30.4, -1.5 20.1, 0.9 6.6 M-0.2 42.4 C-0.5 33.9, 1.2 27.2, 0.8 9.2 M0 8.3 C-1.3 3.6, 3.4 -0.9, 6.5 0.1 M1.7 6.4 C-1.5 2.2, 3.2 -2.2, 7.9 0.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:14.76px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;110&quot; y=&quot;25.0&quot;&gt;./guess  + Enter&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M8.4 100.6 C74.3 97.9, 139.8 98.6, 208 103.2 C220.1 102.1, 217.5 104.2, 221.6 112.6 C220.2 124.8, 219.2 138, 223.4 151.1 C223.4 153.1, 218.4 161, 210.4 159.5 C161.5 161.2, 117.3 159.5, 11.3 162.9 C0.9 161.1, -1.9 157.6, -1 149.1 C1.7 136.9, -0.5 123.1, -2.5 110.3 C3.3 104.8, 2.2 99.9, 9.1 97.5&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M8.7 99 C80.1 101.3, 145.3 100.2, 209.4 101 M10.2 100.6 C76.4 99.9, 140.5 99.8, 209.4 99.3 M210 100 C217.1 99.5, 218.2 104.6, 221.3 108.8 M208.6 101.3 C218 101.4, 221.5 103.3, 219 110.9 M220.6 108.9 C219.2 126.7, 217.9 141.8, 220.8 151.6 M219.2 110.2 C220.7 120.1, 221.1 131.9, 220.3 149.9 M220 150 C220.6 158.6, 217.9 158.8, 210.5 159.2 M221.1 148.5 C220.1 158, 216 159, 211.6 158 M210.6 160.6 C150.9 160, 93.4 159.3, 11.3 161.4 M210.7 160 C136.9 160, 64.8 159.7, 10.3 160.6 M10 160 C3.8 160.6, -1.5 158.3, 1.8 151 M11.2 160.1 C4.7 159.7, 0.2 157.1, 1.6 152.1 M-0.3 151.1 C0.8 135.5, -1 121.9, -1 110.5 M-0.7 149.4 C-0.9 140.3, 0.2 130.3, -0.5 110 M0 110 C0.9 103.6, 3.8 101, 10.2 98.5 M-1.4 110.6 C1.1 102.2, 3.2 98.2, 9.3 101.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;110&quot; y=&quot;130.0&quot;&gt;Kernel&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;250&quot; y=&quot;118.0&quot;&gt;carves out memory, copies the&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;250&quot; y=&quot;142.0&quot;&gt;instructions in, sets up the stack&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M8.7 222 C51.2 219.9, 90 222.2, 212.2 218.5 C214.6 222.5, 223 220.9, 221.7 233.5 C224.8 266.3, 222.5 305, 218.6 340.8 C219.3 349.6, 215.3 350.8, 207.2 351.9 C137.8 344.7, 68 348.2, 12.6 353 C2.4 352.4, 1.8 344.8, -0.1 336.6 C3.3 318.8, 0 294.3, -0.6 230.9 C-2.7 226.3, 3.4 223.1, 9 222.1&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M11.3 221.5 C54.4 217.7, 102.1 218.9, 208.4 219.6 M9.4 220.2 C60.7 219.5, 110.7 218.8, 210.9 220.5 M210 220 C218.1 218.5, 219.3 222, 219.6 230.4 M211.4 221.1 C217 219.9, 218.5 225.1, 220.6 230.4 M219.1 231.1 C220.7 255.4, 220 279.5, 220.8 339.9 M220 231 C219.6 264.7, 219 299.4, 220.1 340 M220 340 C221.4 348.1, 216 348.4, 211.1 349.5 M220.9 339.2 C219 344.7, 217.1 351, 209.7 351.4 M210.6 348.9 C146.1 351.3, 82.8 350.8, 11.7 348.5 M210.7 349.9 C156.2 350.7, 103.9 349.9, 10.9 350.6 M10 350 C4 349.9, 0.4 346.9, 0.2 340.9 M9.3 348.3 C5.5 351.3, 1.7 347.1, -0.1 338.6 M1.1 338.6 C1.1 314.9, 0.6 291.3, 1.8 228.3 M0.4 339.4 C0.7 308.4, 0.7 275.9, -0.1 229 M0 230 C-0.6 222.9, 2.3 220.8, 11 218.2 M1.8 228.2 C0.9 223.7, 4.3 221.8, 9.7 218.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:20px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;110&quot; y=&quot;272.5&quot;&gt;Dynamic linker&lt;/tspan&gt;&lt;tspan x=&quot;110&quot; y=&quot;297.5&quot;&gt;ld.so&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;250&quot; y=&quot;242.0&quot;&gt;1. which shared libraries are needed?&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;250&quot; y=&quot;276.0&quot;&gt;2. find each one, load it into memory&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;250&quot; y=&quot;310.0&quot;&gt;3. patch every call printf&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;250&quot; y=&quot;336.0&quot;&gt;    with its real address&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M12.6 410.6 C58.2 410.5, 109 411.7, 208.5 412.4 C218.9 411.7, 216.5 413.6, 220.6 418.3 C220.1 435, 221.2 442, 220.9 463.5 C218.1 467.6, 218 467.3, 208.3 468.8 C167.3 466.1, 127.9 467, 7.6 471 C5.7 472.4, 0 465.8, -2.5 456.9 C2.5 442.9, 0.4 426.5, -2.5 421.2 C-2.1 413.3, 0.3 412.9, 11.5 408.7&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M9.1 409.3 C84.4 411.3, 159.7 412.2, 210.6 408.4 M9.9 409.5 C75.1 409.5, 139.3 410.5, 210.3 410.3 M210 410 C217.3 410.8, 221.1 413.1, 221.2 421.6 M209.3 411.8 C216.4 410.6, 218.6 413.1, 221.7 417.8 M220 419.3 C219.1 431, 219.3 443.4, 221 460.4 M219 420.8 C220.4 431.4, 219.3 441.7, 219.2 460.1 M220 460 C221.1 466.1, 215.2 471.2, 208.6 470.6 M218.1 458 C221.3 466.3, 215.4 468.2, 210.8 470 M209.6 471.7 C162.7 472.1, 115.8 469.6, 8.3 468.6 M210 469.9 C153.4 468.7, 96.4 469.6, 9.8 470.6 M10 470 C2.1 468.6, -0.9 468, -0.7 461.7 M10.2 470.9 C5.5 471, -1.2 464.5, -0.2 459.7 M1.8 459 C-0.7 444.5, 1.7 432.8, -0.9 419.9 M-0.7 459.6 C0.7 447.3, -0.7 433.8, 0 420 M0 420 C-0.4 412.9, 1.6 411.6, 10.1 411.6 M-0.7 419.1 C2.2 411.6, 1.7 409.2, 9.4 411.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;font-size:16.4px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;110&quot; y=&quot;440.0&quot;&gt;main&lt;/tspan&gt;&lt;/text&gt;&lt;text text-anchor=&quot;start&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:16px;fill:var(--xd-muted)&quot;&gt;&lt;tspan x=&quot;250&quot; y=&quot;440.0&quot;&gt;every promise kept, printf has an address&lt;/tspan&gt;&lt;/text&gt;&lt;path d=&quot;M111.4 54.8 C108.8 67.3, 112 80, 109.7 94.5 M110.9 55.8 C111 67.9, 111.1 81, 109.7 94.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M117.1 80.5 C113.1 84.5, 113.2 88.7, 109.8 94.3 M116.7 81.3 C114.7 85.2, 112.8 89.8, 109.8 94.2 M109.6 94 C109.1 90.5, 105.8 89.2, 104.4 80.2 M109.5 93.8 C108.1 90.2, 106.3 86.2, 104.6 81.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M108 164.6 C108.6 182.7, 108.3 197.2, 111.1 212.6 M109.8 165 C109.7 184.3, 110.8 204, 110.8 214.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M114.7 200.4 C113.1 205.9, 110.8 208.9, 110.7 213 M116 200.7 C113.4 206, 111.8 211.7, 110.5 214.4 M110.8 213.9 C108.4 208.8, 105.3 205, 105.2 202.3 M109.7 214 C108.8 211.4, 107.4 208.2, 104.3 201&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M108.6 354.5 C108.4 370.8, 108.6 387.6, 108.5 404.8 M110.7 356.2 C110.2 367.9, 110.5 379.3, 109.8 404.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M115.1 390.4 C113.1 394.5, 111.1 399.1, 108.9 404.6 M116.6 391.6 C114.6 394.5, 113.3 397.2, 109.8 404.7 M109.1 403.7 C108.7 399.6, 106.9 395.9, 103.1 391.7 M109.8 404.1 C107 398.7, 106 395, 104 390.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;/svg&gt;&lt;figcaption&gt;After Enter, the kernel sets up the process, then the dynamic linker loads libc and patches every call printf before main runs.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id=&quot;you-can-watch-it-decide&quot;&gt;You can watch it decide&lt;a class=&quot;anchor&quot; href=&quot;#you-can-watch-it-decide&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;And you can see the whole guest list before the program even starts. The &lt;code&gt;ldd&lt;/code&gt; command shows you exactly which shared libraries a program will demand at load time:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$ ldd ./guess
    linux-vdso.so.1
    libc.so.6 =&amp;gt; /lib/x86_64-linux-gnu/libc.so.6
    /lib64/ld-linux-x86-64.so.2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Read it straight: my little guessing game depends on &lt;code&gt;libc.so.6&lt;/code&gt; (there&#x27;s the source of &lt;code&gt;printf&lt;/code&gt;), and on &lt;code&gt;ld-linux-x86-64.so.2&lt;/code&gt; — &lt;em&gt;the dynamic linker itself&lt;/em&gt;, listed as a dependency because it&#x27;s the thing that will load everything else. Running &lt;code&gt;ldd&lt;/code&gt; on my own compiled program and seeing it name libc as a runtime dependency was the last click. My program truly did not contain &lt;code&gt;printf&lt;/code&gt;. It contained a &lt;em&gt;promise&lt;/em&gt; to go find it, and &lt;code&gt;ld.so&lt;/code&gt; is who keeps that promise, at the last possible second, every time you run it.&lt;/p&gt;
&lt;h2 id=&quot;the-whole-fall-in-one-piece&quot;&gt;The whole fall, in one piece&lt;a class=&quot;anchor&quot; href=&quot;#the-whole-fall-in-one-piece&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;We&#x27;ve reached the bottom. So let me do the thing I&#x27;ve wanted to do since Season 1: trace &lt;code&gt;мөр_хэвлэх(&quot;Өдрийн мэнд&quot;)&lt;/code&gt; — one line, one greeting — all the way down, with no black boxes left.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;The language.&lt;/strong&gt; &lt;code&gt;мөр_хэвлэх(&quot;Өдрийн мэнд&quot;)&lt;/code&gt; — my own keywords, in my own alphabet.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lexer → parser.&lt;/strong&gt; The text becomes tokens, then an AST — a tree that knows what it means. &lt;em&gt;(&lt;a href=&quot;/s1-1-interpreter/&quot;&gt;S1·1&lt;/a&gt;)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The compiler.&lt;/strong&gt; Instead of running the tree, my compiler writes it down as instructions for a real CPU. &lt;em&gt;(&lt;a href=&quot;/s2-1-compiler/&quot;&gt;S2·1&lt;/a&gt;)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tacky, my own IR.&lt;/strong&gt; The tree first becomes a flat middle language I built by hand — where an optimizer folds constants and trims waste — before it&#x27;s lowered toward real hardware. (No LLVM; I chose to do this part myself.) &lt;em&gt;(&lt;a href=&quot;/s2-2-llvm/&quot;&gt;S2·2&lt;/a&gt;)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Assembly.&lt;/strong&gt; They become &lt;code&gt;mov&lt;/code&gt;, &lt;code&gt;add&lt;/code&gt;, &lt;code&gt;cmp&lt;/code&gt; — the CPU&#x27;s tiny real vocabulary, shuffling numbers between sixteen registers. &lt;em&gt;(&lt;a href=&quot;/s2-3-assembly/&quot;&gt;S2·3&lt;/a&gt;)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The syscall.&lt;/strong&gt; Printing isn&#x27;t something the program can do, so it fills in registers and makes a &lt;code&gt;write&lt;/code&gt; syscall, ringing the kernel&#x27;s doorbell. &lt;em&gt;(&lt;a href=&quot;/s2-4-syscalls/&quot;&gt;S2·4&lt;/a&gt;)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;libc + the linker.&lt;/strong&gt; That &lt;code&gt;write&lt;/code&gt; lives in code I never wrote — libc — stitched into my program by the linker&#x27;s kept promises. &lt;em&gt;(&lt;a href=&quot;/s2-5-gdb/&quot;&gt;S2·5&lt;/a&gt;, &lt;a href=&quot;/s2-6-linking/&quot;&gt;S2·6&lt;/a&gt;)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The dynamic linker.&lt;/strong&gt; At the instant I run it, &lt;code&gt;ld.so&lt;/code&gt; loads libc and fills in the last blank addresses, turning my dead file into a living process. &lt;em&gt;(this post)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The kernel → the screen.&lt;/strong&gt; The kernel takes the &lt;code&gt;write&lt;/code&gt;, uses powers my program isn&#x27;t allowed, and pushes the bytes to actual hardware.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;Өдрийн мэнд&lt;/code&gt;&lt;/strong&gt; appears on the screen.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Ten steps. That&#x27;s the whole distance from a greeting in my language to letters made of light. When I started, every one of those arrows was a mystery I&#x27;d have waved away with &quot;and then, somehow, it runs.&quot; Now there&#x27;s no &lt;em&gt;somehow&lt;/em&gt; left in the chain. That was the entire point.&lt;/p&gt;
&lt;h2 id=&quot;what-three-years-actually-bought&quot;&gt;What three years actually bought&lt;a class=&quot;anchor&quot; href=&quot;#what-three-years-actually-bought&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Go back to the six lines at the very top of Part 1:&lt;/p&gt;
&lt;div class=&quot;codehilite&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;extern функц мөр_хэвлэх(м мөр) -&amp;gt; хоосон {}

функц үндсэн() -&amp;gt; тоо {
    мөр_хэвлэх(&quot;Өдрийн мэнд&quot;);
    буц 0;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Six lines. One greeting. When I first wrote something like it, I could make it print but I couldn&#x27;t tell you a single true thing about &lt;em&gt;how&lt;/em&gt;. Now I can follow it from my own keywords, through two languages I built, down through a compiler, an optimizer, a CPU&#x27;s bare instructions, the kernel boundary, other people&#x27;s code stitched into mine, and a linker that finishes the job as the program draws its first breath.&lt;/p&gt;
&lt;p&gt;That&#x27;s what the three years bought. Not a job-interview trophy, though I got that too. It bought the disappearance of the word &lt;em&gt;somehow&lt;/em&gt;. The machine I use every day became a stack of understandable floors, each one a program doing an almost embarrassingly simple job, very fast, handing off to the next.&lt;/p&gt;
&lt;h2 id=&quot;thank-you-for-coming-down-here-with-me&quot;&gt;Thank you for coming down here with me&lt;a class=&quot;anchor&quot; href=&quot;#thank-you-for-coming-down-here-with-me&quot; title=&quot;Permanent link&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I have to tell you: I loved every part of this.&lt;/p&gt;
&lt;p&gt;I started as a second-year student who just wanted something to put on a résumé, and somewhere along the way that stopped being the point. Every floor I opened was more fun than the last. The night the bytecode stack first printed itself. The first &lt;code&gt;mov&lt;/code&gt; my own compiler wrote. Watching my program ring the kernel&#x27;s doorbell under &lt;code&gt;strace&lt;/code&gt;. Booby-trapping an instruction with gdb and catching a bug I&#x27;d chased for days. Reading &lt;code&gt;ldd&lt;/code&gt; and finally understanding where &lt;code&gt;printf&lt;/code&gt; had been hiding the whole time. Three years, two languages — Cecile and Mon — and a machine that used to be magic and now feels like an old friend I&#x27;ve taken apart and put back together.&lt;/p&gt;
&lt;p&gt;And neither language is finished, which is the best part. There&#x27;s a real type checker to sharpen, better error messages to write, more of the standard library to build. Maybe someday an LLVM backend — not because I have to, but because now I actually understand what I&#x27;d be trading away, and that&#x27;s a choice I&#x27;m finally qualified to make.&lt;/p&gt;
&lt;p&gt;But mostly I want to say this to &lt;em&gt;you&lt;/em&gt;. If you read this far — through interpreters and stacks and IR and registers and syscalls and linkers — thank you. Genuinely. Writing this was me getting to relive the whole descent, and it was so much better having someone along for it.&lt;/p&gt;
&lt;p&gt;So here&#x27;s the only thing I really want you to take with you: &lt;strong&gt;the magic isn&#x27;t real. It&#x27;s just floors.&lt;/strong&gt; Every layer of the machine you use every day is a program doing a small, honest job, and every single one is something you&#x27;re allowed to open up and read. Pick one that scares you a little. Open it. I promise there&#x27;s just another understandable floor underneath — and it&#x27;s a wonderful way to spend three years.&lt;/p&gt;
&lt;p&gt;See you at the bottom of your own rabbit hole. 🙏&lt;/p&gt;
&lt;figure class=&quot;diagram&quot;&gt;&lt;svg class=&quot;xd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;-16 -82 572 388&quot; width=&quot;572&quot; role=&quot;img&quot; aria-label=&quot;It&#x27;s just floors&quot; data-fit=&quot;1&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;path d=&quot;M49.6 132.8 C92.7 128.4, 138.5 130.5, 234.2 126.4 C238.2 132, 241.8 135.1, 241.1 135.8 C242.7 144.4, 236.7 152.3, 239.2 162.5 C238.4 167.4, 236.6 168.5, 229.8 171.7 C191.4 168.5, 154.7 173.4, 46.2 170.3 C45.1 171, 43.1 167.5, 42 163.8 C37.5 150, 43.4 144.6, 40.3 136.4 C42.6 134.9, 40.2 127.8, 46.6 131.2&quot; style=&quot;fill:var(--xd-blue)&quot;/&gt;&lt;path d=&quot;M47.6 130.9 C98.2 130.3, 147.7 128.6, 235.1 130.8 M45.7 130.5 C109 128.5, 173.6 128.5, 234.1 129.9 M233.3 130 C238.6 130.6, 241.5 131.7, 241.6 136.3 M231.7 130.3 C238.5 131.1, 239.9 132.6, 237.7 138.3 M240.7 134.7 C241.5 143.8, 238.2 154.2, 238.9 162.3 M239.7 136.3 C239.8 146.6, 239.1 157.3, 239.4 164 M240 163.3 C239.9 167.6, 238.2 169.4, 235.1 170.6 M239.2 163.5 C238 167.4, 238.7 169.9, 233.8 169.4 M232.6 168.3 C182.4 171.7, 136.6 169.8, 45.8 170.2 M233.1 169.3 C169.9 169, 105.8 168.4, 45.7 170.4 M46.7 170 C43.9 169, 40.2 167.3, 41.9 164.5 M48.2 172 C43.6 169.8, 39.4 169.8, 38 162.6 M41.3 164.6 C41.3 154.7, 39.9 141.4, 38.9 136.6 M39.6 164.3 C40 155, 40.7 146, 39.4 136 M40 136.7 C41 133.5, 42.4 130.1, 44.9 131.8 M38.5 137.9 C37.9 132, 41 129, 46.3 128.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M47.2 171.7 C100.8 174.3, 152.8 168.8, 229.8 167.7 C234.9 168, 236.7 171.3, 243.5 179.7 C241.9 182.3, 242.1 193.6, 242.6 202.2 C237.7 208.2, 239.1 206.6, 231.5 207.3 C186.2 207.9, 140.6 210.8, 46.2 211.5 C40.3 212.9, 38.8 206.7, 43.3 205.7 C41.9 193.2, 37.2 184.6, 42.9 174.9 C40.8 169.8, 41.5 172.7, 44.7 168.2&quot; style=&quot;fill:var(--xd-green)&quot;/&gt;&lt;path d=&quot;M48.1 170.8 C98.3 169.7, 148.4 170.3, 232.5 168.9 M46.6 169.7 C83.9 168.1, 121.8 168.3, 233.1 170.3 M233.3 170 C238.7 168.2, 241.3 171.8, 240.4 177.7 M231.8 171.8 C237.5 169.3, 241.6 174.2, 241.3 174.9 M241.3 175.1 C241.3 187.6, 242.1 193.1, 241.1 201.7 M239.7 177.2 C239.3 184.3, 239.8 192.2, 239 202.6 M240 203.3 C240.5 206, 237.6 210.9, 234.6 211.7 M239.4 204.1 C240.4 207, 235.5 211.2, 231.3 208.2 M233 208.9 C159.5 211.4, 87.9 208.9, 45.6 208.1 M233.8 210.9 C193.8 211.1, 154.5 211.5, 46.7 210 M46.7 210 C43.1 210.4, 39.5 209, 40.6 202 M44.9 209.9 C41.9 210.6, 38.2 208.7, 41 205 M41 202 C40 196.4, 40.4 191.5, 41.6 174.7 M39.8 204 C40 194.9, 39.3 186.1, 39.4 176.5 M40 176.7 C40.7 173.2, 43.2 170.1, 46.4 169.6 M38.6 177.8 C38.5 170.8, 43.9 170.1, 47.7 168.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M44.8 210.6 C108.8 212.9, 167.1 207, 232.6 209 C238.9 211.2, 238.8 214.8, 238.7 216.5 C241.1 227.3, 240.2 234.9, 238.8 241.8 C237 249, 234.3 251.9, 233.2 250.2 C181 254.1, 133.7 254.9, 46.1 252.8 C42.7 247.6, 41.8 245.9, 37.4 240.3 C40 236.5, 39.1 224.6, 38.3 213.3 C38.9 212, 42.8 210.4, 50.1 212.4&quot; style=&quot;fill:var(--xd-yellow)&quot;/&gt;&lt;path d=&quot;M44.7 210.7 C98.4 209.4, 149.1 208.3, 233.9 211.1 M47.5 210.9 C96.1 211.3, 144.6 211.9, 234.1 210.6 M233.3 210 C238.8 209.9, 241 211.8, 239.3 215.1 M232 209.3 C236.4 212.1, 238.8 211.1, 240.3 216.2 M242 215.6 C241 227.4, 242 236.1, 239.3 245 M239.7 216.2 C238.8 223.9, 240.5 229.1, 240.7 243.1 M240 243.3 C241 248.3, 236.9 248.4, 234.1 248.8 M239.6 244.7 C238.3 246.6, 237 247.8, 233.3 251.7 M233.3 249.5 C173.9 251.2, 114 248, 45.5 250 M232.5 250.5 C180.4 249.4, 126.6 248.9, 47.6 249.7 M46.7 250 C42.4 251.8, 38.7 246.7, 39.3 243.5 M45.5 251.9 C40.3 251.4, 41.6 247.5, 39.4 242.9 M40.6 243.4 C38.1 236.8, 40.3 230.8, 40.2 216.8 M39.9 243.8 C39.5 234.9, 39.3 224.2, 39.3 217 M40 216.7 C40.4 212.8, 43.9 210.2, 47.9 211.4 M38.7 217.7 C39 214.3, 42.2 211.2, 44.4 208.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M49.6 249.5 C109.7 251.6, 181.4 252.4, 235.4 250.3 C235.6 247.2, 240.8 251, 241.2 253.2 C239.3 265.1, 237.4 269, 242.1 281.4 C243.5 289.7, 236.8 290, 234.9 293.1 C183.1 293.5, 126.8 292.4, 46.1 286.9 C45.1 289.5, 37.5 285.1, 38.7 282.2 C38.2 279.7, 41 271.7, 40.8 258.9 C37 254.2, 44.1 248.1, 48.2 249.5&quot; style=&quot;fill:var(--xd-orange)&quot;/&gt;&lt;path d=&quot;M45.3 250.5 C98.5 248.8, 145.8 250, 231.3 249.2 M46.4 250.1 C108.2 250.8, 167.3 251.8, 233.1 250.9 M233.3 250 C239 251.5, 240.8 251.9, 238.1 256.4 M232.1 250.8 C239.9 250.2, 240.5 252.7, 239.3 257.5 M238.7 256.1 C240.3 267.3, 241.3 279, 241.5 284.3 M239.7 257.1 C240.9 266.9, 239.7 276.6, 240.3 283.7 M240 283.3 C241.6 286.7, 236.3 289.9, 233.6 289.8 M239.8 285.3 C240.7 286.2, 238.5 289.1, 235.4 290.5 M233.6 290.1 C184.3 286.9, 136.1 287.1, 45.4 291.9 M233.1 290.2 C167 291.5, 98.6 292, 46.5 289.3 M46.7 290 C41.6 289.1, 41.9 288.5, 42 285 M46.1 289.9 C43.3 292.2, 40.4 286.4, 37.8 285.3 M40.3 284.7 C40.8 277.2, 40.7 270.2, 38.8 254.9 M40 283.5 C39.5 274.8, 39.9 264.3, 39.3 257.5 M40 256.7 C40.1 252.5, 40.7 250.2, 45.4 249.2 M38.8 257.6 C39.6 253.1, 40.5 252.2, 45.7 248.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M-0.3 290.2 C146.7 292, 291.8 291.8, 539.8 290.6 M0.2 289.7 C208.8 290.3, 417.5 290, 540.3 289.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M132.6 -25.2 C136.6 -26.9, 143.2 -26, 147.5 -24.2 C151.8 -22.4, 155.8 -18.4, 158.2 -14.3 C160.7 -10.3, 162.9 -4.7, 162.2 0 C161.6 4.7, 158.1 10.5, 154.2 13.7 C150.3 17, 143.4 19.5, 138.7 19.4 C134.1 19.4, 129.4 17, 126.2 13.5 C123 10, 120.3 3.3, 119.4 -1.5 C118.5 -6.2, 118.6 -11.2, 120.9 -15 C123.1 -18.9, 130.8 -23, 133.1 -24.7 C135.4 -26.3, 134.6 -25.1, 134.7 -25.1 M133 -24.8 C136.9 -26.2, 144 -25.6, 148.3 -23.8 C152.6 -21.9, 156.6 -17.9, 159 -13.5 C161.3 -9.1, 163.5 -1.9, 162.5 2.7 C161.5 7.3, 157 11.6, 153.1 14.2 C149.3 16.8, 143.9 18.4, 139.1 18.3 C134.3 18.3, 128.2 17.1, 124.5 13.7 C120.8 10.3, 117.6 2.9, 117 -2 C116.4 -6.9, 118 -11.7, 120.7 -15.8 C123.4 -19.9, 131.1 -25.1, 133.3 -26.7 C135.6 -28.3, 134.2 -26.2, 134.4 -25.4&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M141.3 -26.1 C145.7 -26, 152.2 -23.8, 155.5 -20.3 C158.8 -16.8, 160.6 -10.1, 161.1 -5.4 C161.5 -0.7, 160.6 4.3, 158.2 8.1 C155.7 12, 150.8 16.3, 146.4 17.8 C141.9 19.3, 135.7 19.2, 131.4 17.2 C127.1 15.1, 122.5 10, 120.4 5.5 C118.3 1.1, 117.6 -5.1, 118.6 -9.6 C119.6 -14.1, 122.2 -18.8, 126.6 -21.5 C131 -24.2, 141.7 -25.2, 145.2 -25.7 C148.7 -26.3, 147.8 -25.5, 147.6 -25 M133.8 -26.3 C137.8 -28, 143.9 -27.1, 147.9 -24.9 C152 -22.8, 155.9 -18.1, 158.2 -13.7 C160.4 -9.2, 162.3 -3.3, 161.2 1.5 C160.2 6.3, 155.4 12.2, 151.7 15.2 C148.1 18.3, 143.8 20.5, 139.3 19.8 C134.8 19.1, 128 14.8, 124.6 11 C121.2 7.3, 119.3 1.9, 118.8 -2.6 C118.3 -7.2, 119.2 -12.4, 121.7 -16.4 C124.3 -20.4, 131.6 -25.1, 133.9 -26.7 C136.3 -28.3, 135.7 -26.6, 135.7 -26.2&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M131.7 -12.7 C132.1 -12.9, 132.7 -13.1, 133.3 -12.9 C134 -12.7, 135.1 -12.2, 135.5 -11.6 C135.9 -10.9, 136.1 -9.4, 135.6 -8.8 C135.1 -8.2, 133.3 -8.4, 132.7 -8 C132.2 -7.6, 132.9 -6.5, 132.5 -6.3 C132.1 -6.2, 131.1 -6.4, 130.4 -7.1 C129.8 -7.8, 128.9 -10, 128.7 -10.7 C128.5 -11.4, 128.9 -11.1, 129.2 -11.5 C129.6 -11.9, 130.3 -13, 130.9 -13.1 C131.5 -13.2, 132.5 -12.1, 132.7 -12 M131.6 -13.3 C132.5 -13.5, 133.5 -12.6, 133.7 -12.6 C133.9 -12.6, 132.6 -13.5, 132.9 -13.2 C133.3 -12.8, 135.7 -11.5, 135.8 -10.4 C136 -9.4, 134.3 -7.4, 133.9 -6.6 C133.5 -5.8, 133.7 -5.5, 133.3 -5.7 C133 -5.8, 132.4 -6.9, 131.8 -7.5 C131.2 -8, 129.9 -8.5, 129.7 -9.1 C129.4 -9.7, 130.1 -10.9, 130.2 -11.3 C130.3 -11.7, 130.2 -11.1, 130.3 -11.5 C130.4 -11.8, 130.7 -13, 131 -13.1&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M132.1 -12.5 C132.5 -12.4, 132.6 -11.8, 133.1 -11.3 C133.6 -10.8, 134.7 -10.2, 135 -9.6 C135.4 -9.1, 135.5 -8.6, 135.1 -8 C134.7 -7.5, 133.2 -6.6, 132.6 -6.4 C131.9 -6.2, 131.8 -6.7, 131.4 -6.9 C130.9 -7.2, 130.3 -7.1, 129.9 -7.9 C129.5 -8.6, 129 -10.7, 129.1 -11.3 C129.1 -11.9, 129.7 -11.3, 130.1 -11.5 C130.6 -11.8, 131.3 -12.6, 131.8 -12.9 C132.2 -13.1, 132.6 -13.3, 132.9 -13.1 M132.8 -12.6 C133.4 -12.6, 132.9 -12.9, 133.2 -12.4 C133.4 -12, 133.9 -10.6, 134.3 -10 C134.6 -9.4, 135.6 -9.4, 135.1 -8.8 C134.7 -8.3, 132.4 -6.7, 131.6 -6.4 C130.7 -6.1, 130.7 -7, 130.3 -7.2 C129.8 -7.4, 128.9 -7.1, 128.7 -7.6 C128.5 -8, 128.8 -8.9, 129 -9.9 C129.2 -10.9, 129.4 -13.3, 129.7 -13.6 C130.1 -13.9, 130.8 -11.9, 131.1 -11.8 C131.4 -11.7, 131.6 -12.9, 131.5 -13.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M146.9 -12.8 C147.5 -12.8, 149.3 -12.4, 150 -11.9 C150.7 -11.5, 150.9 -10.9, 151.1 -10.2 C151.3 -9.4, 151.6 -8.3, 151.3 -7.7 C150.9 -7.1, 149.5 -6.5, 148.9 -6.3 C148.3 -6.1, 148.2 -6, 147.8 -6.4 C147.3 -6.9, 146.7 -8.2, 146.4 -9 C146 -9.8, 145.6 -10.6, 145.5 -11.1 C145.4 -11.6, 145.3 -11.9, 145.7 -12.1 C146 -12.4, 146.9 -12.1, 147.3 -12.4 C147.7 -12.6, 147.9 -13.5, 147.9 -13.5 M148.8 -12 C149.4 -11.9, 149.5 -12.3, 150 -11.9 C150.4 -11.5, 151.4 -10.5, 151.5 -9.7 C151.5 -8.9, 150.9 -7.6, 150.2 -7.2 C149.5 -6.8, 147.6 -7.1, 147.2 -7.2 C146.7 -7.3, 147.8 -7.1, 147.5 -7.7 C147.2 -8.3, 145.9 -10.2, 145.5 -10.8 C145 -11.3, 144.6 -10.5, 144.9 -11 C145.1 -11.5, 146.5 -13.6, 147.2 -13.8 C147.8 -14.1, 148.5 -12.5, 148.9 -12.5 C149.2 -12.5, 149.4 -13.5, 149.3 -13.7&quot; style=&quot;fill:var(--xd-gray)&quot;/&gt;&lt;path d=&quot;M148.4 -12.5 C148.8 -12.5, 149.2 -12.9, 149.7 -12.4 C150.3 -12, 151.7 -10.4, 151.6 -9.8 C151.6 -9.3, 149.9 -9.5, 149.6 -9.1 C149.3 -8.7, 150.2 -8, 149.9 -7.6 C149.5 -7.3, 148.6 -6.8, 147.7 -7 C146.8 -7.2, 144.9 -8.2, 144.5 -8.7 C144.1 -9.2, 145 -9.4, 145.4 -9.8 C145.8 -10.3, 146.3 -11, 146.8 -11.5 C147.3 -12.1, 148.1 -12.9, 148.4 -13.2 C148.7 -13.5, 148.8 -13.4, 148.7 -13.3 M147.7 -11.6 C148.5 -11.7, 149.5 -12.1, 150.1 -11.6 C150.6 -11.1, 150.9 -9.2, 151 -8.6 C151.2 -8.1, 151.3 -8.7, 151 -8.3 C150.7 -7.9, 149.9 -6.1, 149.2 -6.2 C148.5 -6.3, 147.7 -8.2, 146.8 -8.8 C145.9 -9.3, 144.2 -8.7, 143.9 -9.3 C143.6 -9.9, 144.4 -11.7, 144.8 -12.3 C145.2 -12.9, 145.5 -12.8, 146.4 -12.9 C147.3 -12.9, 149.8 -12.7, 150.3 -12.7 C150.8 -12.6, 149.5 -12.5, 149.4 -12.3&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M130 2 C138.7 6.5, 146.4 8.1, 149.9 3.2 C140.9 -0.7, 138.3 0.8, 133.3 4&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M130 2 C137.3 11.5, 143.3 11.8, 149.4 2.5 M130.9 3.3 C134.4 8.5, 144.8 8.6, 151.9 3.1 M151.9 1.4 C142.9 3.6, 138.5 2.4, 128.6 3.9 M149.7 2.2 C141.9 1.1, 135.1 2.1, 130 1.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M138.1 17.8 C141.5 34.9, 141.6 55.8, 138.4 84.2 M139.1 17.3 C141 36.8, 139.8 57.3, 139.8 85&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M141.5 85.1 C133.4 101.2, 124.2 117.2, 119.4 129.7 M139.5 84.9 C134.9 95.8, 128.7 108.1, 119.9 130.4&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M138 85 C148.1 103.4, 154.5 117.7, 160.8 131.8 M140.4 84.1 C147 99, 151.4 112.5, 160.9 130.7&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M138.6 36.9 C130 21.2, 118.2 5.6, 108.2 -4 M139.3 35.3 C128.5 21.3, 118.2 5.2, 109.9 -4.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M139.2 36.8 C152.1 19.1, 163.3 5.8, 169.6 -5.9 M140.2 36.6 C147.9 26.9, 155.3 16.6, 170.9 -4.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M74.8 -16.1 C81 -16.4, 86.6 -16.4, 89.7 -16.4 M74.3 -16.8 C79.9 -16.1, 83.6 -16.2, 88.9 -16.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M82.2 -23.2 C82.9 -19.6, 80.8 -12.7, 80.9 -10.7 M82 -22.9 C81.8 -19, 81.9 -13.8, 82.6 -9.5&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M191.6 -22.1 C197.1 -22.2, 200.7 -21.8, 204.8 -22 M191.6 -22.3 C194.3 -22.8, 197 -22.4, 204.9 -22.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M199 -29.2 C198.8 -25.3, 197.5 -18, 198.8 -16.2 M197.8 -29.8 C198.6 -25.6, 197.5 -20.9, 198.6 -14.9&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M67.8 47.3 C75.4 47.4, 79.8 48.3, 82.2 47.9 M69.6 47.6 C73.7 47, 79.6 46.5, 83.1 46.6&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M75.3 40.2 C77.2 44.4, 76.7 52.1, 76.2 53.6 M75.9 40 C76.3 43.3, 76.6 45.9, 76.9 53.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M196.3 42.4 C201.7 41.2, 206.5 40, 209.9 40.5 M196.2 41.6 C201.8 40.8, 206.9 41.5, 210.2 42&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M203.7 35.3 C203.3 41, 203.2 43.9, 203.9 49 M203.8 34 C204.1 37.2, 203.2 41.5, 203.9 47.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M278.8 -65 C345.7 -65.1, 409.8 -66.7, 510.6 -63.4 C515.1 -69.4, 523.1 -63.5, 520.9 -54.1 C519.5 -33.1, 516.1 -14.6, 522.6 10.3 C522.7 14.7, 515.4 16.7, 510.6 17.3 C457.2 15.3, 403.8 15.4, 281.3 17.7 C270.9 17.5, 272.6 11.3, 270.1 11.5 C270 -19.7, 268.4 -41, 266.9 -59.1 C272.8 -64.4, 274.6 -67, 282 -65.4&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M280.4 -65 C367 -67, 454.7 -67.9, 511.3 -66.8 M280.8 -65.5 C349.8 -66.5, 418.7 -66.7, 509.3 -66.4 M510 -66 C515 -66.1, 520.3 -63.3, 518.7 -54.3 M510.2 -64.3 C515.5 -66.5, 519.3 -63.5, 520.6 -56.8 M520.8 -57.9 C522.1 -34.5, 519.5 -18.7, 519.9 8.2 M519.2 -56 C521.3 -33.1, 520.3 -10, 519.5 7.2 M520 8 C521.8 15.1, 515.2 19.6, 509.5 17.9 M518.8 7.1 C521.5 15.5, 517.7 16, 508.3 19.3 M508.8 16.5 C424 20.1, 335.9 18.1, 281.3 17.4 M509.5 17.2 C446.3 19.4, 384.5 19.2, 279.3 17.6 M280 18 C272.7 19.3, 270.5 14.4, 268.7 8.9 M279 17.5 C272.5 18.7, 268.1 15, 268.6 6 M271.3 8.3 C268 -15, 268.4 -35.5, 270.9 -57.3 M270.9 8.4 C270 -16.3, 269.6 -40.5, 269.4 -56 M270 -56 C269.5 -63.3, 273.8 -67.5, 279.6 -65.1 M271.5 -57 C269 -61.6, 275.5 -64.9, 280.5 -63.8&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;path d=&quot;M270.7 -19.3 C236.5 -14.9, 208 -13.1, 166 -14 C192.8 -5.9, 212.3 -4.6, 270.1 8.5 C266.9 2.8, 267.1 -7.8, 267.7 -16.5&quot; style=&quot;fill:var(--xd-paper)&quot;/&gt;&lt;path d=&quot;M271 -14.9 C230.9 -12.9, 193.1 -14.2, 166.9 -10.8 M269.8 -16.2 C232.6 -14.4, 196.5 -13, 168.1 -12.1 M169.5 -11.9 C205.9 -4, 244.3 2.1, 270.4 4 M168.3 -11.1 C209.5 -4.4, 248.5 2.6, 270.5 5.4 M269.8 7.1 C270.5 -1.8, 272 -5.9, 268.9 -15 M269.5 6.5 C269.4 -2.5, 271.1 -10.2, 269.5 -16.1&quot; style=&quot;fill:none;stroke:var(--xd-ink);stroke-width:1.6&quot;/&gt;&lt;text text-anchor=&quot;middle&quot; dominant-baseline=&quot;central&quot; xml:space=&quot;preserve&quot; style=&quot;white-space:pre;font-variant-ligatures:none;font-family:&#x27;Excalifont MN&#x27;, &#x27;Comic Sans MS&#x27;, cursive;font-size:18px;fill:var(--xd-ink)&quot;&gt;&lt;tspan x=&quot;395&quot; y=&quot;-35.3&quot;&gt;the magic isn&#x27;t real.&lt;/tspan&gt;&lt;tspan x=&quot;395&quot; y=&quot;-12.8&quot;&gt;it&#x27;s just floors.&lt;/tspan&gt;&lt;/text&gt;&lt;/svg&gt;&lt;/figure&gt;</description></item></channel></rss>