PageSourceSearch

https://www.namtao.com/rust-is-the-new-c/

html namtao.com collected 2026-09-25 21:20:40 UTC 78,418 bytes, 141 lines download raw bytes

1<!doctype html> <html lang="en"> <head> <title>Rust is the New C</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> 
1<script type="importmap"> {
2  "imports": {
3    "d3-force": "https://cdn.jsdelivr.net/npm/[email protected]/+esm",
4    "d3-selection": "https://cdn.jsdelivr.net/npm/[email protected]/+esm",
5    "d3-zoom": "https://cdn.jsdelivr.net/npm/[email protected]/+esm",
6    "d3-drag": "https://cdn.jsdelivr.net/npm/[email protected]/+esm"
7  }
8} </script>
8 
8<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/pixi.min.js"></script>
8 
8<script async type="module">import mermaid from"https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs";mermaid.initialize({startOnLoad:!0})</script>
8 
8<script async src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/prism.min.js" integrity="sha512-hpZ5pDCF2bRCweL5WoA0/N1elet1KYL5mx3LP555Eg/0ZguaHawxNvEjF6O3rufAChs16HVNhEc6blF/rZoowQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
8 
8<script async src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/plugins/autoloader/prism-autoloader.min.js" integrity="sha512-sv0slik/5O0JIPdLBCR2A3XDg/1U3WuDEheZfI/DI5n8Yqc3h5kjrnr46FGBNiUAJF7rE4LHKwQ/SoSLRKAxEA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
8 
8<script>window.addEventListener("load",(()=>{document.querySelectorAll(".callout").forEach((e=>{const t=getComputedStyle(e).getPropertyValue("--callout-icon"),l=t&&t.trim().replace(/^lucide-/,"");if(l){const t=e.querySelector(".callout-title");if(t){const e=document.createElement("div"),c=document.createElement("i");e.appendChild(c),c.setAttribute("data-lucide",l),e.setAttribute("class","callout-icon"),t.insertBefore(e,t.firstChild)}}})),lucide.createIcons(),Array.from(document.querySelectorAll(".callout.is-collapsible")).forEach((e=>{e.querySelector(".callout-title").addEventListener("click",(t=>{e.classList.contains("is-collapsed")?e.classList.remove("is-collapsed"):e.classList.add("is-collapsed")}))}))}))</script>
8 
8<script defer="defer" src="https://fastly.jsdelivr.net/npm/@alpinejs/[email protected]/dist/cdn.min.js"></script>
8 
8<script defer="defer" src="https://fastly.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>
8 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/themes/prism-okaidia.min.css" integrity="sha512-mIs9kKbaw6JZFfSuo+MovjU+Ntggfoj8RwAmJbVXQ5mkAX5LlgETQEweFPI18humSPHymTb5iikEOKWF7I8ncQ==" crossorigin="anonymous" referrerpolicy="no-referrer" async> 
8<script src="https://fastly.jsdelivr.net/npm/[email protected]/dist/fetch.umd.min.js" crossorigin="anonymous" referrerpolicy="no-referrer" async></script>
8 <link href="/styles/obsidian-base.css" rel="stylesheet"> <link href="/styles/_theme.e70a086d.css" rel="stylesheet"> <link href="/styles/digital-garden-base.css" rel="stylesheet"> <link href="/styles/custom-style.css" rel="stylesheet"><link href="/plugins/copy-code-button/styles/copy.css?v=2026-09-17T19:50:15.225Z" rel="stylesheet"><link href="/plugins/moc-nav/styles/moc-nav.css?v=2026-09-17T19:50:15.225Z" rel="stylesheet"> <link rel="icon" href="/favicon.ico" sizes="any"> <link rel="icon" href="/favicon.svg" type="image/svg+xml"> <link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="manifest" href="/manifest.webmanifest"> <style>body.css-settings-manager{--b3ef-690d-before:'⚛️ ';--5aec-0f35-before:'🕮 ';--b814-49b6-before:'🗏 ';--8bd8-5153-before:'🗓 ';--6ba9-f019-before:'🗣';--4d0e-4dc2-before:'📍';--f2cc-8981-before:'🖼'}</style> <style></style> </head> <body class="theme-dark markdown-preview-view markdown-rendered markdown-preview-section title-note-icon filetree-note-icon links-note-icon backlinks-note-icon css-settings-manager theme-dark mod-linux is-frameless is-hidden-frameless obsidian-app styled-scrollbars show-inline-title is-floating-nav auto-full-screen pp-pill-padding-all base-tags-style css-settings-manager AT-multirow AT-column is-focused"> <div x-init="isDesktop = (window.innerWidth>=1000) ? true: false;" x-on:resize.window="isDesktop = (window.innerWidth>=1000) ? true : false;" x-data="{isDesktop: true, showFilesMobile: false}"> <div x-show.important="!isDesktop" style="display:none"> <nav class="navbar"> <div class="navbar-inner"> <span style="font-size:1.5rem;margin-right:10px" @click="showFilesMobile=!showFilesMobile"><i data-lucide="menu"></i></span> <a href="/" style="text-decoration:none;text-align:center"> <h1 style="margin:15px!important">Namtao Productions</h1> </a> </div> <div class="search-button align-icon" onclick="toggleSearch()"> <span class="search-icon"> <i data-lucide="search"></i> </span> <span class="search-text">Search</span> <span class="search-keys"><code>Ctrl</code>&nbsp;+&nbsp;<code>K</code></span> </div> </nav> </div> <div x-show="showFilesMobile && !isDesktop" @click="showFilesMobile = false" style="display:none" class="fullpage-overlay"></div> <div class="filetree-wrapper" x-show.important="isDesktop || showFilesMobile" style="display:none"> <nav class="filetree-sidebar moc-nav"> <a href="/" style="text-decoration:none;text-align:center"> <h1 style="text-align:center">Namtao Productions</h1> </a> <div class="search-button align-icon" onclick="toggleSearch()"> <span class="search-icon"> <i data-lucide="search"></i> </span> <span class="search-text">Search</span> <span class="search-keys"><code>Ctrl</code>&nbsp;+&nbsp;<code>K</code></span> </div> <div class="moc-heading">Navigation</div> <div class="moc-section" x-data="{isOpen: $persist(true).as('moc-/nb/')}"> <div class="moc-section-header" @click="isOpen=!isOpen"> <i x-show="isOpen" style="display:none" data-lucide="chevron-down"></i> <i x-show="!isOpen" data-lucide="chevron-right"></i> <a class="moc-section-link" href="/nb/" @click.stop data-note-icon="">No Boilerplate</a> </div> <div class="moc-children" x-show="isOpen" style="display:none"> <a class="moc-child active-note" href="/rust-is-the-new-c/" data-note-icon="">Rust is the New C</a> <a class="moc-child" href="/async-isn-t-real-and-can-t-hurt-you/" data-note-icon="">Async isn&#39;t real and can&#39;t hurt you</a> <a class="moc-child" href="/obsidian-for-learning/" data-note-icon="">Obsidian for Learning</a> <a class="moc-child" href="/misusing-macros-for-fn-and-profit/" data-note-icon="">Misusing Macros for Fn and profit</a> <a class="moc-child" href="/nb/powerlifting/" data-note-icon="">Hack Your Brain With Powerlifting</a> <a class="moc-child" href="/obsidian-for-learning-part-ii-process/" data-note-icon="">Obsidian For Learning Part II Process</a> <a class="moc-child" href="/relationship-anarchy/" data-note-icon="">HYBW Relationship Anarchy</a> <a class="moc-child" href="/obsidian-for-writers/" data-note-icon="">Obsidian for Writers</a> <a class="moc-child" href="/rust-dont-panic/" data-note-icon="">Rust Don&#39;t Panic</a> <a class="moc-child" href="/rust-toolkit-2026/" data-note-icon="">My 2026 Rust Toolkit</a> <a class="moc-child" href="/rust/" data-note-icon="">Rust</a> </div> </div> <div class="moc-section" x-data="{isOpen: $persist(true).as('moc-/lt/')}"> <div class="moc-section-header" @click="isOpen=!isOpen"> <i x-show="isOpen" style="display:none" data-lucide="chevron-down"></i> <i x-show="!isOpen" data-lucide="chevron-right"></i> <a class="moc-section-link" href="/lt/" @click.stop data-note-icon="">Lost Terminal</a> </div> <div class="moc-children" x-show="isOpen" style="display:none"> </div> </div> <div class="moc-section" x-data="{isOpen: $persist(true).as('moc-/mp/')}"> <div class="moc-section-header" @click="isOpen=!isOpen"> <i x-show="isOpen" style="display:none" data-lucide="chevron-down"></i> <i x-show="!isOpen" data-lucide="chevron-right"></i> <a class="moc-section-link" href="/mp/" @click.stop data-note-icon="">
8Modem Prometheus Home</a> </div> <div class="moc-children" x-show="isOpen" style="display:none"> </div> </div> <div class="moc-section" x-data="{isOpen: $persist(true).as('moc-/tpc/')}"> <div class="moc-section-header" @click="isOpen=!isOpen"> <i x-show="isOpen" style="display:none" data-lucide="chevron-down"></i> <i x-show="!isOpen" data-lucide="chevron-right"></i> <a class="moc-section-link" href="/tpc/" @click.stop data-note-icon="">Phosphene Catalogue</a> </div> <div class="moc-children" x-show="isOpen" style="display:none"> </div> </div> <div class="moc-section" x-data="{isOpen: $persist(true).as('moc-/dc/')}"> <div class="moc-section-header" @click="isOpen=!isOpen"> <i x-show="isOpen" style="display:none" data-lucide="chevron-down"></i> <i x-show="!isOpen" data-lucide="chevron-right"></i> <a class="moc-section-link" href="/dc/" @click.stop data-note-icon="">Decapsulate Home</a> </div> <div class="moc-children" x-show="isOpen" style="display:none"> </div> </div> </nav> </div> </div> <main class="content cm-s-obsidian print"> <header> <h1 data-note-icon="">Rust is the New C</h1> <div class="header-meta"> <div class="header-tags"> <a class="tag"> #project </a> </div> </div> <div class="timestamps"><div><i data-lucide="calendar-clock"></i> <span class="human-date" data-date="2026-09-10T10:03:37.991+01:00"></span></div></div> </header> <div style="position:relative;padding-top:56.25%"><iframe title="Rust is the New C" width="100%" height="100%" src="https://makertube.net/videos/embed/nfKBnifRfEpbEvMxFhReHq" frameborder="0" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" style="position:absolute;inset:0px"></iframe></div> <p>Here's something I think about often:</p> <h1 id="the-1970s-what-a-time-for-computing" tabindex="-1">The 1970s: What a time for computing</h1> <h2 id="1970" tabindex="-1">1970</h2> <p><picture src="/img/user/Resources/Meta/attachments/PDP-11-70.jpg" alt="image:width:100%"><source media="(max-width:480px)" srcset="/img/optimized/a7TfiMfnwT-500.webp" type="image/webp"> <source media="(max-width:480px)" srcset="/img/optimized/a7TfiMfnwT-500.jpeg"> <source media="(max-width:1920px)" srcset="/img/optimized/a7TfiMfnwT-700.webp" type="image/webp"><source media="(max-width:1920px)" srcset="/img/optimized/a7TfiMfnwT-700.jpeg"><img class="" src="/img/user/Resources/Meta/attachments/PDP-11-70.jpg" alt="image:width:100%" width=""></picture></p> <p>A PDP-11 minicomputer</p> <p><code>Alien</code></p> <h2 id="1975" tabindex="-1">1975</h2> <p><picture src="/img/user/Resources/Meta/attachments/altair-8800.png" alt=""><source media="(max-width:480px)" srcset="/img/optimized/Cm42CbWOl7-500.webp" type="image/webp"> <source media="(max-width:480px)" srcset="/img/optimized/Cm42CbWOl7-500.jpeg"> <source media="(max-width:1920px)" srcset="/img/optimized/Cm42CbWOl7-700.webp" type="image/webp"><source media="(max-width:1920px)" srcset="/img/optimized/Cm42CbWOl7-700.jpeg"><img class="" src="/img/user/Resources/Meta/attachments/altair-8800.png" alt="" width=""></picture></p> <p>The first personal computer</p> <p><code>Alien</code></p> <h2 id="1981" tabindex="-1">1981</h2> <p><picture src="/img/user/Resources/Meta/attachments/first-ibm-pc.png" alt=""><source media="(max-width:480px)" srcset="/img/optimized/Bql6o1eoBi-500.webp" type="image/webp"> <source media="(max-width:480px)" srcset="/img/optimized/Bql6o1eoBi-500.jpeg"> <source media="(max-width:1920px)" srcset="/img/optimized/Bql6o1eoBi-700.webp" type="image/webp"><source media="(max-width:1920px)" srcset="/img/optimized/Bql6o1eoBi-700.jpeg"><img class="" src="/img/user/Resources/Meta/attachments/first-ibm-pc.png" alt="" width=""></picture></p> <p>The first IBM PC</p> <p><code>Familiar</code></p> <p>THE 70s MUST HAVE BEEN A WILD TIME TO BE ALIVE, right?</p> <p>At the start of the decade, electronic calculators were not seen outside of laboratories, but by 1974 they were in every home.</p> <p>Video games like Pong introduced computer power to the general public, and by the late 70s it was looking like the microcomputer revolution would mean every house would have a computer, just like they suddenly had calculators.</p> <p>Against this backdrop, the C programming language was written, first for the PDP-11, then ported to basically every computer that has ever been built.</p> <p>I often daydream about the lives of people who picked up C just at this perfect time, right at the start.</p> <div class="callout" data-callout="note"><div class="callout-title"><div class="callout-title-inner">Note</div></div> <div class="callout-content"> <p> <em>I will refer to both C and C++ interchangeably as &quot;C&quot; in this video.</em><br> <br> My apologies.</p> </div></div> <p>After they learned this relatively small language, they could then have spent DECADES writing JUST C, one language (one ish languages) for all programs, on all devices!</p> <h1 id="c-will-never-die" tabindex="-1">C Will Never Die</h1> <p>
8<picture src="/img/user/Resources/Meta/attachments/redmonk-top-10-c-cpp.png" alt="image:width:100%"><source media="(max-width:480px)" srcset="/img/optimized/V2KYaVUL79-500.webp" type="image/webp"> <source media="(max-width:480px)" srcset="/img/optimized/V2KYaVUL79-500.jpeg"> <source media="(max-width:1920px)" srcset="/img/optimized/V2KYaVUL79-700.webp" type="image/webp"><source media="(max-width:1920px)" srcset="/img/optimized/V2KYaVUL79-700.jpeg"><img class="" src="/img/user/Resources/Meta/attachments/redmonk-top-10-c-cpp.png" alt="image:width:100%" width=""></picture></p> <p>C is doggedly refusing to leave Redmonk's top 10 languages, by github projects and stackoverflow tags.</p> <p>everything was, and to a large extent, still is, written in C:</p> <ul> <li>Games</li> <li>spreadsheets</li> <li>device drivers</li> <li>Operating Systems</li> <li>Firmware</li> <li>and even web and phone apps</li> </ul> <p>But there's only one language that can do all of this today, and it ain't C.</p> <h1 id="grace-pointer-s-cv-or-perhaps-and-quot-c-v-and-quot" tabindex="-1">Grace Pointer's CV (or Perhaps &quot;C++V&quot;)</h1> <div class="table-wrapper"><table> <thead> <tr> <th><code>DATE</code></th> <th><code>POSITION</code></th> <th><code>COMPANY</code></th> </tr> </thead> <tbody> <tr> <td><em>1978</em></td> <td><strong>Mainframe Development</strong></td> <td>IBM</td> </tr> <tr> <td><em>1983</em></td> <td><strong>Word 1.0</strong></td> <td>Microsoft</td> </tr> <tr> <td><em>1989</em></td> <td><strong>Excel 1.0</strong></td> <td>Microsoft</td> </tr> <tr> <td><em>1994</em></td> <td><strong>Web development</strong></td> <td>Yahoo</td> </tr> <tr> <td><em>2001</em></td> <td><strong>Game development</strong></td> <td>ID Software</td> </tr> <tr> <td><em>2009</em></td> <td><strong>Mobile App Dev</strong></td> <td>Apple</td> </tr> <tr> <td><em>2020</em></td> <td><strong>AI CUDA Dev</strong></td> <td>Wolfram</td> </tr> <tr> <td><em>2025</em></td> <td><strong>Open Source Contributor</strong></td> <td>Various</td> </tr> </tbody> </table></div> <p><picture src="/img/user/Resources/Meta/attachments/grace-pointer.png" alt=""><source media="(max-width:480px)" srcset="/img/optimized/dmhEEKNUTu-500.webp" type="image/webp"> <source media="(max-width:480px)" srcset="/img/optimized/dmhEEKNUTu-500.jpeg"> <source media="(max-width:1920px)" srcset="/img/optimized/dmhEEKNUTu-700.webp" type="image/webp"><source media="(max-width:1920px)" srcset="/img/optimized/dmhEEKNUTu-700.jpeg"><img class="" src="/img/user/Resources/Meta/attachments/grace-pointer.png" alt="" width=""></picture></p> <p>(Graphics design is my passion)</p> <blockquote> <p>A whole career in a <em>single</em> language!</p> </blockquote> <p>Lets imagine what her career could have looked like right up until today:</p> <ul> <li>minicomputer application development in the late 70s</li> <li>desktop application development in the early 80s</li> <li>by the late 80s, she started using this new thing called C++</li> <li>then Windows and mac desktop software in the early 90s</li> <li>and cgi web applications in the early web of the late 90s</li> </ul> <h1 id="cgi-rfc-3875" tabindex="-1">CGI RFC3875</h1> <div class="callout" data-callout="note"><div class="callout-title"><div class="callout-title-inner"> The Common Gateway Interface (CGI) Version 1.1<br></div></div> <div class="callout-content"> <p> For UNIX compatible operating systems, the following are defined:<br> </p> <ul> <li><em>Meta-Variables</em><br> <br> Meta-variables are passed to the script in identically named environment variables. These are accessed by the <code>C library routine getenv()</code> or variable environ.</li> </ul> </div></div> <p>— <a href="https://www.rfc-editor.org/rfc/rfc3875#section-7.2" target="_blank" class="external-link">https://www.rfc-editor.org/rfc/rfc3875#section-7.2</a></p> <p>The CGI spec was written assuming c, even in 1.1, last revised in 2004 - <a href="http://okcupid.com" target="_blank" class="external-link">okcupid.com</a> is <em>still</em> written in c!<br> C is vital to all webapps even to this day: if you look inside every python, ruby, and javascript app, the power behind the throne is the huge modules written in C</p> <ul> <li>Grace then tracked the explosion of game development in the 2000s</li> <li>And even got on the objective-C train with iphone app development</li> <li>during the AI explosion, she was writing GPU AI code, using Nvidia's CUDA platform, you guessed it, written in C</li> <li>HER SKILLS ARE STILL RELEVANT NOW SHE'S RETIRED <ul> <li>She can still do everything TODAY - how wild is that! Compare this to every other field. Not just teaching her skills, but the code she writes is relevant still, and will be, very likely, for her whole life. She remains a core contributor to a dozen open source projects that run on millions of machines around the world.</li> </ul> </li> </ul> <p>A whole career in a single language, compare that to the 12 new javascript preprocessors that came out yesterday!</p> <p>Grace's career sounds much more relaxing, doesn't it?<br> (null pointers notwithstanding, of course)<br> This is my pitch to you for your future, if you learn Rust TODAY.</p> <div class="callout" data-callout="quote"><div class="callout-title"><div class="callout-title-inner"> C Developers<br></div></div> <div class="callout-content"> <p> &quot;Lisp developers know<br> the <em>value</em> of everything<br> and the <em>cost</em> of nothing&quot;</p> </div></div> <p>*this is, naturally, applied to all other languages</p> <p>Let's take a step back: Why did C come to dominate our industry? in short, Low-level portability. Why is it STILL so relevant? low-level portability; write once, compile everywhere. Before C it was understood that if you wanted portability you had to sacrifice low-level power and speed, and vice versa:<br> If you wanted to write operating systems and games that needed to run FAST, you had to write low-level assembly for your specific architecture, and then rewrite it almost entirely for each new machine.</p> <h1 id="language-comparison" tabindex="-1">Language Comparison</h1> <div class="table-wrapper"><table> <thead> <tr> <th></th> <th>C</th> <th>JS</th> <th>Py</th> <th>Zig</th> <th>Go</th> <th>Rust</th> </tr> </thead> <tbody> <tr> <td>Frontend</td> <td><code>1</code></td> <td>✅</td> <td></td> <td><code>1</code></td> <td><code>2</code></td> <td>✅</td> </tr> <tr> <td>Backend</td> <td>✅</td> <td>✅</td> <td>✅</td> <td><code>1</code></td> <td>✅</td> <td>✅</td> </tr> <tr> <td>Games</td> <td>✅</td> <td>✅</td> <td></td> <td>✅</td> <td>✅</td> <td>✅</td> </tr> <tr> <td>ML/AI</td> <td>✅</td> <td></td> <td>✅</td> <td>✅</td> <td><code>3</code></td> <td>✅</td> </tr> <tr> <td>Desktop</td> <td>✅</td> <td>✅</td> <td>✅</td> <td>✅</td> <td>✅</td> <td>✅</td> </tr> <tr> <td>Driver</td> <td>✅</td> <td></td> <td></td> <td>✅</td> <td></td> <td>✅</td> </tr> <tr> <td>O/Ses</td> <td>✅</td> <td></td> <td></td> <td>✅</td> <td></td> <td>✅</td> </tr> <tr> <td>Linux</td> <td>✅</td> <td></td> <td></td> <td></td> <td></td> <td>✅</td> </tr> </tbody> </table></div> <p><code>1</code> <em>While it is possible to write web C/Zig code, it's not fun</em></p> <p><code>2</code> <em>Webasm isn't a native to Go, it requires the tinygo compiler</em></p> <p><code>3</code> <em>You can CALL GPU functions in Go, you can WRITE them in Rust</em></p> <div class="callout" data-callout="note"><div class="callout-title"><div class="callout-title-inner"> Note<br></div></div> <div class="callout-content"> <p> (This is all very approximate, please don't take this too seriously)</p> </div></div> <p>This reminds me of where we are today, where as generalist software developers, we write javascript for browser development, backend code in python, ruby or nodejs, and bare metal code still requires C, or perhaps Zig, if you're lucky. And if you want to do ios or windows application development, apple or microsoft have some very reasonably priced toolkits to show you.</p> <p>There is only one language today that allows you to follow Grace Pointer's example, and it's no longer C, and it's not js.<br> As web development has moved to high-level languages, leaving c behind, Rust is the only language that can do it all.<br> Yes, some of these applications are <strong>possible</strong> in other languages as well as C, but no-one would argue that would be FUN.</p> <h1 id="popularity-matters" tabindex="-1">Popularity Matters</h1> <div class="callout" data-callout="quote"><div class="callout-title"><div class="callout-title-inner"> Raffi Molero, video comment<br></div></div> <div class="callout-content"> <p> &quot;If you almost <em>never add</em> anything, <em>you get C</em>
8.<br> If you almost <em>never remove</em> anything, <em>you get C++</em>.&quot;</p> </div></div> <p>C takes backwards compatibility extremely seriously, with a pace of development that only a mother could love.</p> <p>High-level languages tend to have more of a fcuk it, ship it attitude. When new features are added you are expected to keep up with the pace of development if you want them. (React developers know what I'm talking about)</p> <h1 id="rust-editions" tabindex="-1">Rust Editions</h1> <div class="callout" data-callout="quote"><div class="callout-title"><div class="callout-title-inner"> Graydon Hoare<br></div></div> <div class="callout-content"> <p> &quot;Rust is over-engineered for survival&quot;</p> </div></div> <p>Rust has learned from C and Cpp, eschewing a middle road comprimise, instead taking a quantom superpositon of BOTH SIMULTANEIOUSLY<br> It is both uncomprimisingly backwards and uncomprimisingly forwards compatible.<br> This is guarenteed by the Rust Editions system, ensuring that libraries expecting different versions of Rust can still be compiled together in a single project.</p> <p>forwards compatibility is also augmented at a less formal level with the macro system.</p> <h1 id="rust-macros-are-witchcraft" tabindex="-1">Rust Macros are Witchcraft</h1> <pre><code class="language-rust">let n = await!(some_future_computation);
9</code></pre> <p>Expands to roughly:</p> <pre><code class="language-rust">let mut future = IntoFuture::into_future($expression);
10let mut pin = unsafe { Pin::new_unchecked(&amp;mut future) };
11let n = loop {
12    match Future::pollborrow(&amp;mut pin), &amp;mut ctx {
13          Poll::Ready(item) =&gt; break item,
14          Poll::Pending     =&gt; yield,
15    }
16}
17</code></pre> <div class="callout" data-callout="note"><div class="callout-title"><div class="callout-title-inner"> Rust RFC-2394<br></div></div> <div class="callout-content"> <p> &quot;<code>await!</code> is a compiler built-in to leave space for deciding its exact syntax later.&quot;</p> </div></div> <p>Like in Lisps, Rust macros make the whole language available at compile time to rewrite the syntax before passing the generated code to the compiler.</p> <p>This is a wildly powerful trick that deserves separate discussion, see my Witchcraft video for that.</p> <p>A concrete example of this forwards compatibility was with the <code>await!</code> macro, introduced to rust for testing while the community was figuring out if they wanted an await keyword, like Javascript, or to .await on a future.</p> <p>The latter won out, but no core language changes were needed to test it in real code - macros allow the new syntax to be a library.</p> <h1 id="part-2-all-the-things-you-can-do-with-rust" tabindex="-1">Part 2: All the things you can do with Rust</h1> <p><picture src="/img/user/Resources/Meta/attachments/davinci-notebook.jpg" alt=""><source media="(max-width:480px)" srcset="/img/optimized/y4VYTHKaPz-500.webp" type="image/webp"> <source media="(max-width:480px)" srcset="/img/optimized/y4VYTHKaPz-500.jpeg"> <source media="(max-width:1920px)" srcset="/img/optimized/y4VYTHKaPz-700.webp" type="image/webp"><source media="(max-width:1920px)" srcset="/img/optimized/y4VYTHKaPz-700.jpeg"><img class="" src="/img/user/Resources/Meta/attachments/davinci-notebook.jpg" alt="" width=""></picture></p> <p>(image unrelated)</p> <p>Here is speedrun of all the things you can build if you learn rust, a single language, in 2025:</p> <h1 id="leptos-dev" tabindex="-1">🌐 LEPTOS.dev</h1> <pre><code class="language-rust">#[component]
18pub fn button() -&gt; impl IntoView {
19  let (count, set_count) = signal(0);
20  view! {
21    &lt;button on:click=move |_| {
22      set_count.update(|n| *n += 1);
23    }&gt;
24      &quot;Click me: &quot; {count}
25    &lt;/button&gt;
26  }
27}
28</code></pre> <p><picture src="/img/user/Resources/Meta/attachments/leptos-counter-demo.png" alt=""><source media="(max-width:480px)" srcset="/img/optimized/_PXZ7CK3cx-500.webp" type="image/webp"> <source media="(max-width:480px)" srcset="/img/optimized/_PXZ7CK3cx-500.jpeg"> <source media="(max-width:1920px)" srcset="/img/optimized/_PXZ7CK3cx-700.webp" type="image/webp"><source media="(max-width:1920px)" srcset="/img/optimized/_PXZ7CK3cx-700.jpeg">
28<img class="" src="/img/user/Resources/Meta/attachments/leptos-counter-demo.png" alt="" width=""></picture></p> <ul> <li>Backend</li> <li>Frontend</li> <li>Full stack</li> <li>Fully typed</li> </ul> <p>Until you, my lovely audience, decided I should be a YouTuber, I was a web developer.<br> It's my favourite way to publish programs that users interact with.<br> The browser is an operating system unto itself, chromebooks certainly think so, and you can use it to make far more then pretty web pages.<br> Because you have access to the full suite of browser apis, you can:</p> <ul> <li>make music with webaudio</li> <li>write GPU accellerated games with WebGL and WebGPU</li> <li>Store data securily on the user's machine in local storage,</li> <li>and even communicate with low-level connected hardware (like kbs and mesh radio transcievers!) using webserial</li> </ul> <p>ALL THIS ECOSYSTEM is only available to javascript and languages that compile to webassembly, the most popular of which is of course, Rust.</p> <p>Javascript developers are half right in thinking they have a job and language for life...<br> EXCEPT to do what Leptos is doing here, embedd html/RSX-like syntax, you need external build tools, so enjoy (re)learning that ecosystem for each new framework.<br> In Leptos, as in every Rust project, build tools are a macro away.<br> The one used here on line 4 is called <code>view!</code>, you can tell a macro is being called because the compiler requires them to be named with a bang at the end of their name.</p> <h1 id="tauri-replacing-electron-for-mobile" tabindex="-1">Tauri Replacing Electron for Mobile</h1> <pre><code class="language-bash"># Android
29tauri android build -- --aab
30
31# iOS / macOS
32tauri build --bundles app \
33  --target universal-apple-darwin
34
35# Windows Store
36tauri build -- --no-bundle
37</code></pre> <p>Tauri supports:</p> <ul> <li>Android</li> <li>iOS</li> <li>Microsoft Store</li> <li>Windows installer</li> <li>Appimage</li> <li>Flathub</li> <li>Debian</li> <li>AUR</li> <li>and more</li> </ul> <div class="callout" data-callout="note"><div class="callout-title"><div class="callout-title-inner">Note</div></div> <div class="callout-content"> <p> All using with 90% less disk space than Electron, a <em>hello world</em> is 600KB</p> </div></div> <p>But what if you want your webapp to run offline on the user's device?</p> <p>No need to reach for Electron, Tauri is a rust-powered replacement supporting every store out there.</p> <h1 id="poem-htmx" tabindex="-1">Poem + HTMX</h1> <blockquote> <p>Poem</p> </blockquote> <blockquote> <p>HTMX</p> </blockquote> <pre><code class="language-rust">#[oai(path = &quot;/hi&quot;, method = &quot;get&quot;)]
38async fn index(&amp;self, name: MyQuery) -&gt; PlainText&lt;String&gt; {
39    match name.0 {
40        Some(name) =&gt; PlainText(format!(&quot;hi, {}!&quot;, name)),
41        None =&gt; PlainText(&quot;hello!&quot;.to_string())}}
42</code></pre> <pre><code class="language-html">&lt;div id=&quot;me&quot;&gt;&lt;/div&gt;
43&lt;button hx-post=&quot;/hi&quot; hx-target=&quot;#me&quot; hx-swap=&quot;outerHTML&quot;&gt;
44  Click Me
45&lt;/button&gt;
46</code></pre> <p>Write your native device code in Rust, and your application code in Rust, maybe even Poem and HTMX, here.<br> A simple, type-checked backend plus a simple frontend, wonderful!</p> <h1 id="windows-crate" tabindex="-1">Windows crate</h1> <ul> <li>Full access to all windows apis, wrapped in an idiomatic rust interface</li> <li>Stop laughing it's actually genius</li> <li>You can even compile windows for ARM binaries</li> <li>The <code>windows-sys</code> crate is available for <s>masochists</s> the low-level apis</li> </ul> <pre><code class="language-rust">use windows::{
47    core::*, 
48    Win32::UI::Shell::*, 
49    Win32::UI::WindowsAndMessaging::*};
50
51fn main() {
52    unsafe {
53        MessageBoxA(
54            None, 
55            s!(&quot;Hello&quot;), 
56            s!(&quot;World&quot;), 
57            MB_OK);
58    }
59}
60</code></pre> <p>Not native enough?</p> <p>All windows apis are available in the <code>windows</code> crate, from messageboxes to audio, file system, and networking,</p> <p>(Tauri actually uses this crate for some of its own native functionality)</p> <h1 id="direct-x12-example" tabindex="-1">DirectX12 Example</h1> <p>
60<picture src="/img/user/Resources/Meta/attachments/direct3d-demo-windows-crate.png" alt=""><source media="(max-width:480px)" srcset="/img/optimized/2wXmSqigb_-500.webp" type="image/webp"> <source media="(max-width:480px)" srcset="/img/optimized/2wXmSqigb_-500.jpeg"> <source media="(max-width:1920px)" srcset="/img/optimized/2wXmSqigb_-700.webp" type="image/webp"><source media="(max-width:1920px)" srcset="/img/optimized/2wXmSqigb_-700.jpeg"><img class="" src="/img/user/Resources/Meta/attachments/direct3d-demo-windows-crate.png" alt="" width=""></picture></p> <p>All windows apis <strong>INCLUDING DIRECT3D</strong> are available in the <code>windows</code> crate.</p> <pre><code class="language-rust">fn create_vertex_buffer(
61    device: &amp;ID3D12Device,
62) -&gt; D3DResult {
63    let vertices = [
64        Vertex {
65            position: [0.0, 0.25, 0.0],
66            color: [1.0, 0.0, 0.0, 1.0],},
67        Vertex {
68            position: [0.25, -0.25, 0.0],
69            color: [0.0, 1.0, 0.0, 1.0],},
70        Vertex {
71            position: [-0.25, -0.25, 0.0],
72            color: [0.0, 0.0, 1.0, 1.0],},
73    ]; //...
74</code></pre> <p>EVEN DIRECT3D is available, write your next native windows game using it!</p> <h1 id="game-dev-with-bevy-godot" tabindex="-1">Game Dev with Bevy/Godot</h1> <pre><code class="language-rust">#[derive(GodotConvert, Var, Export)]
75#[godot(via = GString)]
76pub enum Planet {
77    Earth, 
78    Mars,
79    Venus,
80}
81#[derive(GodotClass)]
82#[class(base=Node)]
83pub struct SpaceFarer {
84    #[export]
85    favorite_planet: Planet,
86}
87</code></pre> <p><picture src="/img/user/Resources/Meta/attachments/gadot-favourite-planet-screenshot.png" alt="image:width:100%"><source media="(max-width:480px)" srcset="/img/optimized/NGFi_X16it-465.webp" type="image/webp"> <source media="(max-width:480px)" srcset="/img/optimized/NGFi_X16it-465.jpeg"> <img class="" src="/img/user/Resources/Meta/attachments/gadot-favourite-planet-screenshot.png" alt="image:width:100%" width=""></picture></p> <div class="callout" data-callout="note"><div class="callout-title"><div class="callout-title-inner"> See more<br></div></div> <div class="callout-content"> <p> <a href="https://godot-rust.github.io/" target="_blank" class="external-link">https://godot-rust.github.io/</a><br> <br> <a href="https://bevyengine.org/" target="_blank" class="external-link">https://bevyengine.org/</a></p> </div></div> <p>Don't want to write your game engine from scractch? Me either!</p> <p>Godot has native support for Rust, and if you'd like the engine to be written top-to-bottom in Rust, the Bevy project might be just what you need!</p> <h1 id="ml-ai-computing" tabindex="-1">ML/AI Computing</h1> <p>Matrix addition running natively on the GPU with CUDA and the <code>cuda_std</code> crate.</p> <pre><code class="language-rust">#[kernel]
88pub unsafe fn add(a: &amp;[f32], b: &amp;[f32], c: *mut f32) {
89    let idx = thread::index_1d() as usize;
90    if idx &lt; a.len() {
91        let elem = &amp;mut *c.add(idx);
92        *elem = a[idx] + b[idx];
93    }
94} 
95// eg, [1,2,3,4] + [1,2,3,4] = [2,4,6,8]
96</code></pre> <div class="callout" data-callout="note"><div class="callout-title"><div class="callout-title-inner"> See more<br></div></div> <div class="callout-content"> <p> <a href="https://rust-gpu.github.io/" target="_blank" class="external-link">https://rust-gpu.github.io/</a></p> </div></div> <p>Running massively parallel workloads on comodity GPU hardware has been made much more accessbile by nVidia's CUDA framework.<br> FOR BETTER AND WORSE</p> <p>And while bindings exist that allow other languages such as python to offload computation to the GPU, what you're looking at in this example is the actual code that RUNS on the GPU.</p> <p>The <code>cuda_std</code> crate compiles rust directly into native gpu code.</p> <p>This is something that previously was only supported using C, C++ and (Am I reading this right?) FORTRAN. OK we HAVE to see some of that</p> <h1 id="from-n-vidia-s-cuda-fortran-examples" tabindex="-1">From nVidia's CUDA Fortran examples</h1> <pre><code class="language-js">real :: array(1000, 10)
97integer :: i, j, n, m
98!$acc data create(n, m) copy(array)
99!$acc kernels
100n = 1000
101m = 10
102!$acc end kernels
103!$acc parallel loop defualt(none) collapse(2)
104do j=1,m
105  do i=1,n
106    array(i, j) = i+j
107  end do
108end do
109</code></pre> <p>Incredibly <code>presenterm</code> doesn't have specific syntax highlighting for fortran.</p> <p>I know, I'm shocked too.</p> <p><a href="https://docs.nvidia.com/hpc-sdk/" target="_blank" class="external-link">Further reading for the extremely curious</a></p> <p>OK, cool! wow fortran's alive and well in high performance computing, eh?</p> <p>Moving on!</p> <h1 id="asahi-linux" tabindex="-1">Asahi Linux</h1> <p>
109<picture src="/img/user/Resources/Meta/attachments/asahi-macbook.png" alt="image:width:90%"><source media="(max-width:480px)" srcset="/img/optimized/tLb_VciNPS-500.webp" type="image/webp"> <source media="(max-width:480px)" srcset="/img/optimized/tLb_VciNPS-500.jpeg"> <source media="(max-width:1920px)" srcset="/img/optimized/tLb_VciNPS-700.webp" type="image/webp"><source media="(max-width:1920px)" srcset="/img/optimized/tLb_VciNPS-700.jpeg"><img class="" src="/img/user/Resources/Meta/attachments/asahi-macbook.png" alt="image:width:90%" width=""></picture></p> <p>Install on ANY M1/M2 machine</p> <pre><code class="language-sh">curl https://alx.sh | sh
110# after install:
111dnf upgrade --refresh
112dnf install steam 
113</code></pre> <div class="callout" data-callout="important"><div class="callout-title"><div class="callout-title-inner"> <a href="https://asahilinux.org/2024/10/aaa-gaming-on-asahi-linux/" target="_blank" class="external-link">https://asahilinux.org/2024/10/aaa-gaming-on-asahi-linux/</a><br></div></div> <div class="callout-content"> <p> &quot;The hardware is happy because the system is 16K, the game is happy because the virtual machine is 4K, and you’re happy because you can play Fallout 4.&quot;</p> </div></div> <p>What the asahi linux team have done to get linux working on apple silicon is nothing short of mirculous<br> An early breakthrough for the team was after they reverse-engineered the propriatory apple silicon GPU, they then wrote a driver for it using Rust.<br> They did this to sidestep the manual memory management, and inevitable bugs that driver code is plagued with if you write it in C.</p> <p>You don't just get some free language features when you chose Rust, you get superpowers, in this case, speed of development.<br> The first version of this driver was written by Asahi Lina in 5 weeks, a success she attributes to her language choice.<br> I don't regularly write entire drivers from scratch, but that does sound very fast!</p> <p>By the way, if you'd like try asahi linux, you can dual boot any m1 or m2 machine with this single command</p> <h1 id="uutils-coreutils" tabindex="-1">Uutils Coreutils</h1> <pre class="mermaid">xychart-beta
114    x-axis "(approximate)" [2021, 2022, 2023, 2024, 2025]
115    y-axis "Passing tests in GNU Coreutils Test Suite" 0 --> 600
116    line [140, 250, 350, 400, 506]
117    line [600, 600, 600, 600, 600]</pre><blockquote> <p>All coreutils have already been rewritten.<br> By ~2026 it will be 100% compliant with GNU coreutils.</p> </blockquote> <p>All my friends are invited:</p> <ul> <li><code>cat</code></li> <li><code>chown</code></li> <li><code>cp</code></li> <li><code>date</code></li> <li><code>dd</code></li> <li><code>echo</code></li> <li><code>hostname</code></li> <li><code>kill</code></li> <li><code>ls</code></li> <li><code>mv</code></li> <li><code>pwd</code></li> <li><code>rm</code></li> <li><code>uname</code></li> <li><code>whoami</code></li> <li>and more!</li> </ul> <p>uutils is an attempt at rewriting the core unix CLI utilities in Rust. It is available for Linux, Windows, Mac and other platforms.</p> <p>Yes, it's currently 7x larger than the extremely cut-down busybox (13MB on my machine), but busybox doesn't attempt to pass all the gnu coretils tests.<br> Uutils, as you can see, is nearly there.</p> <p>original image: <a href="https://raw.githubusercontent.com/uutils/coreutils-tracking/main/gnu-results.png" target="_blank" class="external-link">https://raw.githubusercontent.com/uutils/coreutils-tracking/main/gnu-results.png</a></p> <h1 id="bare-metal-rust" tabindex="-1">Bare-metal Rust</h1> <pre><code class="language-rust">//imports omitted
118fn main() -&gt; ! {
119    let mut led = Output::new(
120        peripherals.GPIO7, 
121        Level::Low, 
122        OutputConfig::default());
123    led.set_high();
124    let delay = Delay::new();
125    
126    loop {
127        led.toggle();
128        delay.delay_millis(500);
129    }
130}
131</code></pre> <p><picture src="/img/user/Resources/Meta/attachments/esp-rs.png" alt=""><source media="(max-width:480px)" srcset="/img/optimized/QRq-q5HFBU-500.webp" type="image/webp"> <source media="(max-width:480px)" srcset="/img/optimized/QRq-q5HFBU-500.jpeg"> <source media="(max-width:1920px)" srcset="/img/optimized/QRq-q5HFBU-700.webp" type="image/webp"><source media="(max-width:1920px)" srcset="/img/optimized/QRq-q5HFBU-700.jpeg">
131<img class="" src="/img/user/Resources/Meta/attachments/esp-rs.png" alt="" width=""></picture></p> <p>Docs: <code>docs.esp-rs.org</code></p> <p>Code:<br> <code>esp-rs/esp-idf-hal</code><br> or<br> <code>esp-rs/esp-hal</code> (no_std)</p> <p>(though this is for ESP32, other brands are available.)</p> <p>While an undesirable effect in physical engineering, I am extremely excited that I can write bare-metal rust, by which I mean rust running directly on real-time chips, for robotics or low-power sensor use.<br> Or maybe, even satalites!</p> <h1 id="things-people-who-have-never-compiled-rust-say" tabindex="-1">Things people who have never compiled Rust say:</h1> <blockquote> <p>&quot;You can't write a <em>kernel</em> in anything other than C.&quot;</p> </blockquote> <blockquote> <p>&quot;You can't write <em>web apps</em> in a systems language.&quot;</p> </blockquote> <blockquote> <p>&quot;You can't <em>prototype</em> in Rust, the compiler is too slow&quot;</p> </blockquote> <blockquote> <p>&quot;<em>Macros</em> are too confusing, no-one uses them.&quot;</p> </blockquote> <blockquote> <p>&quot;You can't write <em>game engines</em> in languages other than C++.&quot;</p> </blockquote> <p>Over the course of my short Rust career so far, I have read every counterarguement by people who have never compiled a line of rust.<br> They tell me I can't write low-level performant code, or high-level fast prototypes, or browser-based apps, or games, or whatever their pet domain is.</p> <p>If you hear these opinions, don't get stressed and argue with them, tell them what I say:</p> <p>Just you watch me.</p> <h1 id="i-can-finally-chill" tabindex="-1">I Can Finally Chill</h1> <pre class="mermaid">gantt
132    dateFormat YYYY-MM-DD
133    axisFormat %Y
134        Confusio Linguarum :a1, 1986-01-01, 34y
135        A Relaxed Life Coding In Rust:a2, 2020-01-01, 2071-01-01</pre> <p>(This graph is not as funny to me as I thought it was going to be, seeing that red line)</p> <ul> <li>c's low-level portability was important for a time when high-level languages only meant portability</li> <li>that's not the case any more, we expect far more of our high level languages: ergonomics, rapid prototyping, excellent tooling and deployment, and web-first interfaces</li> <li>rust can do them all, combined with the low-level efficiencies that games, robotics, and operating systems require</li> </ul> <p>I'm so relieved that just like Grace Pointer, I have found a single language I can write all my projects in.<br> Perhaps for the rest of my life.</p> <p>I can finally chill.</p> <h1 id="thank-you" tabindex="-1">Thank You!</h1> <p>To all my patrons, you make this possible.</p> <pre><code class="language-rust">let producers: [&amp;str; 0] = [];
136let sponsors = [
137 &quot;Jaycee&quot;, &quot;Gregory Taylor&quot;, &quot;Ything LLC&quot;
138];
139let patrons: [&amp;str; 887];
140</code></pre> <p>I'd be very grateful for your support on:</p> <ul> <li><a href="http://www.patreon.com/noboilerplate" target="_blank" class="external-link">Patreon</a></li> <li><a href="https://ko-fi.com/noboilerplate" target="_blank" class="external-link">Ko-Fi</a></li> <li><a href="https://namtao.gumroad.com" target="_blank" class="external-link">Gumroad</a></li> </ul> <p>If you would like to support my channel, get early ad-free and tracking-free videos, your name in the credits or 1:1 mentoring, head to my patreon or ko-fi.</p> <p>If you're interested in transhumanism and hopepunk, please check out my weekly sci-fi audiofiction podcast, Lost Terminal.</p> <p>I just finished Season 2 of The Phosphene Catalogue, if you like mysteries and art, check it out!</p> <p>MODEM PROMETHEUS IS OFF HIATUS<br> go to <a href="http://modemprometheus.com" target="_blank" class="external-link">modemprometheus.com</a> to subscribe</p> <p>Transcripts and compile-checked markdown sourcecode are available on <a href="http://namtao.com" target="_blank" class="external-link">namtao.com</a> and github, links in the description, and corrections are in the pinned ERRATA comment.</p> <p>Thank you so much for watching, talk to you on Discord.</p> </main> <aside> <div class="page-panel-backdrop" data-page-panel-close></div> <div class="sidebar" id="page-panel"> <div class="page-panel-header"> <span class="page-panel-handle" aria-hidden="true"></span> <button type="button" class="page-panel-close" data-page-panel-close aria-label="Close"> <i data-lucide="x"></i> </button> </div> <div class="sidebar-container"> 
140<script type="module">import{forceSimulation,forceManyBody,forceCenter,forceLink,forceCollide,forceRadial}from"d3-force";import{select}from"d3-selection";import{zoom as d3Zoom,zoomIdentity}from"d3-zoom";import{drag as d3Drag}from"d3-drag";const{Application:Application,Container:Container,Graphics:Graphics,Text:Text,Circle:Circle}=PIXI;async function fetchGraphData(){const e=await fetch("/graph.json").then((e=>e.json()));return{graphData:e,fullGraphData:filterFullGraphData(e)}}function filterFullGraphData(e){if(!e)return null;e=JSON.parse(JSON.stringify(e));const t=Object.values(e.nodes).filter((e=>e.hide)).map((e=>e.id));return{links:e.links.filter((e=>-1===t.indexOf(e.source)&&-1===t.indexOf(e.target))),nodes:Object.values(e.nodes).filter((e=>!e.hide))}}function filterLocalGraphData(e,t){if(!e)return null;t=t||1;const a=JSON.parse(JSON.stringify(e.nodes)),n=JSON.parse(JSON.stringify(e.links));let o=decodeURI(window.location.pathname),l=a[o];if(!l){const e=o.toLowerCase();l=Object.values(a).find((t=>t.url.toLowerCase()===e))}if(l||(l=Object.values(a).find((e=>e.home))),!l)return null;l.current=!0;const r=new Set(Object.values(a).filter((e=>e.hide)).map((e=>e.id))),i=e=>e===l.id||!r.has(e),c={};for(const e of n)i(e.source)&&i(e.target)&&((c[e.source]=c[e.source]||new Set).add(e.target),(c[e.target]=c[e.target]||new Set).add(e.source));const s=new Set([l.id]);let d=new Set([l.id]);for(let e=0;e<t&&d.size>0;e++){const e=new Set;for(const t of d)for(const a of c[t]||[])s.has(a)||(s.add(a),e.add(a));d=e}const u=Object.values(a).filter((e=>!e.hide&&s.has(e.id))),p=u.map((e=>e.id));return{nodes:u,links:n.filter((e=>p.indexOf(e.target)>-1&&p.indexOf(e.source)>-1))}}function getCssVar(e){return getComputedStyle(document.body).getPropertyValue(e).trim()}const _colorProbe=document.createElement("div");function resolveColor(e){_colorProbe.style.color=e;const t=getComputedStyle(_colorProbe).color.match(/(\d+),\s*(\d+),\s*(\d+)/);return t?(parseInt(t[1])<<16)+(parseInt(t[2])<<8)+parseInt(t[3]):6710886}_colorProbe.style.display="none",document.body.appendChild(_colorProbe);const _decodeEl=document.createElement("textarea");function htmlDecode(e){return _decodeEl.innerHTML=e,_decodeEl.value}function buildDegreeMap(e){const t={};for(const a of e){const e="object"==typeof a.source?a.source.id:a.source,n="object"==typeof a.target?a.target.id:a.target;t[e]=(t[e]||0)+1,t[n]=(t[n]||0)+1}return t}function nodeRadius(e,t){return 2+Math.sqrt(t[e]||0)}function renderGraph(e,t,a){if(!e||!e.nodes||0===e.nodes.length)return null;const n=document.getElementById(t);if(!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);const o=n.offsetWidth,l=n.offsetHeight||250;if(0===o)return null;const r=resolveColor(getCssVar("--dg-graph-node-color")||getCssVar("--graph-main")||"#666"),i=resolveColor(getCssVar("--dg-graph-node-color-muted")||getCssVar("--graph-muted")||"#ccc"),c=resolveColor(getCssVar("--dg-graph-label-color")||getCssVar("--text-normal")||"#eee"),s=getComputedStyle(document.body).fontFamily||"Sans-Serif",d=buildDegreeMap(e.links),u=e.nodes.map((e=>({...e,text:htmlDecode(e.title)}))),p=e.links.map((e=>({source:e.source,target:e.target}))),h=a?-300:-100,f=a?80:40,g=Math.min(o,l)/3,m=forceSimulation(u).force("charge",forceManyBody().strength(h)).force("center",forceCenter(o/2,l/2).strength(.5)).force("link",forceLink(p).id((e=>e.id)).distance(f)).force("collide",forceCollide((e=>nodeRadius(e.id,d)+1)).iterations(3)).force("radial",forceRadial(g,o/2,l/2).strength(.05)),y=new Application({width:o,height:l,antialias:!0,autoStart:!1,autoDensity:!0,backgroundAlpha:0,resolution:window.devicePixelRatio});n.appendChild(y.view);const C=y.stage;C.interactive=!0,C.hitArea=y.screen;const x=new Graphics,G=new Container,D=new Container;C.addChild(x,G,D);let b=null,v=new Set,w=!1,A=0,L=null,S=zoomIdentity;const M=[],k=[];function I(e){if(b=e,v.clear(),null===e){for(const e of M)e.active=!1;for(const e of k)e.active=!1}else{for(const t of k){const a=t.simulationData.source,n=t.simulationData.target,o="object"==typeof a?a.id:a,l="object"==typeof n?n.id:n;o!==e&&l!==e||(v.add(o),v.add(l)),t.active=o===e||l===e}for(const e of M)e.active=v.has(e.simulationData.id)}}for(const e of u){const t=nodeRadius(e.id,d),a=new Text(e.text,{fontSize:16,fill:c,fontFamily:s});a.resolution=2,a.anchor.set(.5,1),a.scale.set(1/3),a.alpha=0;const n=new Graphics;n.interactive=!0,n.cursor="pointer",n.hitArea=new Circle(0,0,t+2),n._nodeId=e.id;const o=e.current?r:i;n.beginFill(o),n.drawCircle(0,0,t),n.endFill(),e.current&&(n.lineStyle(.5,r),n.drawCircle(0,0,t+1.5));let l=0;n.on("pointerover",(()=>
140{I(n._nodeId),l=a.alpha,w||j()})),n.on("pointerleave",(()=>{I(null),a.alpha=l,w||j()})),G.addChild(n),D.addChild(a),M.push({simulationData:e,gfx:n,label:a,radius:t,active:!1,baseAlpha:1,targetAlpha:1,currentAlpha:1})}for(const e of p)k.push({simulationData:e,active:!1,baseAlpha:.4,targetAlpha:.4,currentAlpha:.4});function j(){for(const e of M)e.targetAlpha=null!==b?e.active?1:.1:e.baseAlpha;for(const e of k)e.targetAlpha=null!==b?e.active?.8:.05:e.baseAlpha}function E(e,t,a){return e+(t-e)*a}select(y.view).call(d3Drag().container((()=>y.view)).subject((()=>{if(!b)return null;const e=u.find((e=>e.id===b));return e?{x:e.x*S.k+S.x,y:e.y*S.k+S.y,node:e}:null})).on("start",(function(e){e.active||m.alphaTarget(1).restart();const t=e.subject.node;t.fx=t.x,t.fy=t.y,A=Date.now(),L={x:e.x,y:e.y},w=!0})).on("drag",(function(e){const t=e.subject.node;t.fx=(e.x-S.x)/S.k,t.fy=(e.y-S.y)/S.k})).on("end",(function(e){e.active||m.alphaTarget(0);const t=e.subject.node;t.fx=null,t.fy=null,w=!1;const a=Date.now()-A,n=e.x-L.x,o=e.y-L.y,l=Math.sqrt(n*n+o*o);a<500&&l<5&&t.url&&(window.location=t.url)})));const O=d3Zoom().extent([[0,0],[o,l]]).scaleExtent([.25,4]).on("zoom",(({transform:e})=>{S=e,C.scale.set(e.k,e.k),C.position.set(e.x,e.y);const t=Math.max((e.k-1)/3.75,0);for(const e of M)e.simulationData.id!==b&&(e.label.alpha=t)}));select(y.view).call(O);let P=!1;return requestAnimationFrame((function e(){if(!P){for(const e of M){const{x:t,y:a}=e.simulationData;null!=t&&null!=a&&(e.gfx.position.set(t,a),e.label.position.set(t,a-e.radius-2),e.currentAlpha=E(e.currentAlpha,e.targetAlpha,.15),e.gfx.alpha=e.currentAlpha,e.simulationData.id===b&&(e.label.alpha=1))}x.clear();for(const e of k){const t=e.simulationData.source,a=e.simulationData.target;null!=t.x&&null!=a.x&&(e.currentAlpha=E(e.currentAlpha,e.targetAlpha,.15),x.lineStyle(1,e.active?r:i,e.currentAlpha),x.moveTo(t.x,t.y),x.lineTo(a.x,a.y))}y.render(),requestAnimationFrame(e)}})),(a||e.nodes.length>4)&&setTimeout((()=>{let e=1/0,t=-1/0,a=1/0,n=-1/0;for(const o of u)null!=o.x&&null!=o.y&&(e=Math.min(e,o.x),t=Math.max(t,o.x),a=Math.min(a,o.y),n=Math.max(n,o.y));if(e===1/0)return;const r=t-e+100,i=n-a+100,c=Math.min(o/r,l/i,2),s=(e+t)/2,d=(a+n)/2,p=zoomIdentity.translate(o/2-s*c,l/2-d*c).scale(c);select(y.view).call(O.transform,p)}),500),function(){P=!0,m.stop(),select(y.view).on(".drag",null).on(".zoom",null),y.destroy(!0,{children:!0})}}let graphDataCache=null,fullGraphDataCache=null,localGraphCleanup=null,globalGraphCleanup=null,localGraphDepth=1,initPromise=null;function init(){return initPromise||(initPromise=fetchGraphData().then((({graphData:e,fullGraphData:t})=>{graphDataCache=e,fullGraphDataCache=t,renderLocal()}))),initPromise}const pagePanelMedia=window.matchMedia("(max-width: 1400px)");function localGraphHidden(){const e=document.getElementById("page-panel");return pagePanelMedia.matches&&e&&!e.classList.contains("is-open")}function renderLocal(){localGraphCleanup&&(localGraphCleanup(),localGraphCleanup=null);const e=renderGraph(filterLocalGraphData(graphDataCache,localGraphDepth),"link-graph",!1);localGraphCleanup=e}function setLocalGraphDepth(e){localGraphDepth=parseInt(e,10)||1,renderLocal()}function openModal(e){globalGraphCleanup&&(globalGraphCleanup(),globalGraphCleanup=null),document.getElementById("full-graph").style.display="",setTimeout((()=>{globalGraphCleanup=renderGraph(e,"full-graph-container",!0),lucide.createIcons({attrs:{class:["svg-icon"]}})}),50)}function openFullGraph(){openModal(fullGraphDataCache)}function openExpandedLocal(){openModal(filterLocalGraphData(graphDataCache,localGraphDepth))}function closeFullGraph(){document.getElementById("full-graph").style.display="none",globalGraphCleanup&&(globalGraphCleanup(),globalGraphCleanup=null)}window.__graph={openFullGraph:openFullGraph,closeFullGraph:closeFullGraph,openExpandedLocal:openExpandedLocal,rerenderLocal:renderLocal,setLocalGraphDepth:setLocalGraphDepth},document.addEventListener("forestry:css-changed",(function(){graphDataCache&&renderLocal()})),localGraphHidden()||init(),document.addEventListener("page-panel:open",(()=>init())),pagePanelMedia.addEventListener("change",(e=>{e.matches||init()}))</script>
140 <div id="graph-component" class="graph" x-data="{ showFullGraph: false, graphDepth: 1 }"> <div class="graph-title-container"> <div class="graph-title">Connected Pages</div> <div id="graph-controls"> <div class="ctrl-right"> <span id="global-graph-btn" x-on:click="showFullGraph = true; window.__graph.openFullGraph()"><i data-lucide="globe" aria-hidden="true"></i></span> <span id="graph-fs-btn" x-on:click="showFullGraph = true; window.__graph.openExpandedLocal()"><i data-lucide="expand" aria-hidden="true"></i></span> </div> </div> </div> <div id="link-graph"></div> <div x-show="showFullGraph" id="full-graph" class="show" style="display:none" x-on:click.self="window.__graph.closeFullGraph(); showFullGraph = false;"> <span id="full-graph-close" x-on:click="window.__graph.closeFullGraph(); showFullGraph = false;"><i data-lucide="x" aria-hidden="true"></i></span> <div id="full-graph-container"></div> </div> </div> <div class="toc"> <div class="toc-title-container"> <div class="toc-title"> Rust is the New C </div> </div> <div class="toc-container"> <nav class="toc"> <ol> <li><a href="#the-1970s-what-a-time-for-computing">The 1970s: What a time for computing</a> <ol> <li><a href="#1970">1970</a> </li> <li><a href="#1975">1975</a> </li> <li><a href="#1981">1981</a> </li> </ol> </li> <li><a href="#c-will-never-die">C Will Never Die</a> </li> <li><a href="#grace-pointer-s-cv-or-perhaps-and-quot-c-v-and-quot">Grace Pointer's CV (or Perhaps "C++V")</a> </li> <li><a href="#cgi-rfc-3875">CGI RFC3875</a> </li> <li><a href="#language-comparison">Language Comparison</a> </li> <li><a href="#popularity-matters">Popularity Matters</a> </li> <li><a href="#rust-editions">Rust Editions</a> </li> <li><a href="#rust-macros-are-witchcraft">Rust Macros are Witchcraft</a> </li> <li><a href="#part-2-all-the-things-you-can-do-with-rust">Part 2: All the things you can do with Rust</a> </li> <li><a href="#leptos-dev">🌐 LEPTOS.dev</a> </li> <li><a href="#tauri-replacing-electron-for-mobile">Tauri Replacing Electron for Mobile</a> </li> <li><a href="#poem-htmx">Poem + HTMX</a> </li> <li><a href="#windows-crate">Windows crate</a> </li> <li><a href="#direct-x12-example">DirectX12 Example</a> </li> <li><a href="#game-dev-with-bevy-godot">Game Dev with Bevy/Godot</a> </li> <li><a href="#ml-ai-computing">ML/AI Computing</a> </li> <li><a href="#from-n-vidia-s-cuda-fortran-examples">From nVidia's CUDA Fortran examples</a> </li> <li><a href="#asahi-linux">Asahi Linux</a> </li> <li><a href="#uutils-coreutils">Uutils Coreutils</a> </li> <li><a href="#bare-metal-rust">Bare-metal Rust</a> </li> <li><a href="#things-people-who-have-never-compiled-rust-say">Things people who have never compiled Rust say:</a> </li> <li><a href="#i-can-finally-chill">I Can Finally Chill</a> </li> <li><a href="#thank-you">Thank You!</a> </li> </ol> </nav> </div> </div> 
140<script>!function(){const t=document.querySelectorAll('.toc-container a[href^="#"]');if(!t.length)return;const e=Array.from(t).map((t=>{const e=decodeURIComponent(t.getAttribute("href").slice(1));return{link:t,target:document.getElementById(e)}})).filter((t=>t.target));function n(){let n=e[0];for(const t of e)t.target.getBoundingClientRect().top<=100&&(n=t);t.forEach((t=>t.classList.remove("toc-active"))),n&&n.link.classList.add("toc-active")}window.addEventListener("scroll",n,{passive:!0}),n()}()</script>
140 <div class="backlinks"> <div class="backlink-title">Pages mentioning this page</div> <div class="backlink-list"><div class="backlink-card"><a href="/nb/" data-note-icon="" class="backlink">No Boilerplate</a> </div></div> </div> </div> </div> 
140<script>!function(){const e=document.getElementById("page-panel");if(!e)return;const t=window.matchMedia("(max-width: 1400px)");function n(t){e.classList.toggle("is-open",t),document.body.classList.toggle("page-panel-open",t),document.querySelectorAll(".page-panel-toggle").forEach((e=>{e.setAttribute("aria-expanded",String(t))})),document.dispatchEvent(new CustomEvent(t?"page-panel:open":"page-panel:close"))}document.addEventListener("click",(a=>{a.target.closest(".page-panel-toggle")?n(!e.classList.contains("is-open")):(a.target.closest("[data-page-panel-close]")||t.matches&&a.target.closest("#page-panel a[href]"))&&n(!1)})),document.addEventListener("keydown",(t=>{"Escape"===t.key&&e.classList.contains("is-open")&&n(!1)})),t.addEventListener("change",(e=>{e.matches||n(!1)}))}()</script>
140 </aside> <div class="floating-actions floating-bottom-right"> <button type="button" class="page-panel-toggle page-panel-fab" aria-controls="page-panel" aria-expanded="false" aria-label="On this page" title="On this page"> <i data-lucide="panel-right"></i> </button> </div> 
140<script>window.location.hash&&document.getElementById(window.location.hash.slice(1)).classList.add("referred"),window.addEventListener("hashchange",(e=>{const t=e.oldURL.split("#");t[1]&&document.getElementById(t[1]).classList.remove("referred");const n=e.newURL.split("#");n[1]&&document.getElementById(n[1]).classList.add("referred")}),!1);const url_parts=window.location.href.split("#"),url=url_parts[0],referrence=url_parts[1];document.querySelectorAll(".cm-s-obsidian > *[id]").forEach((function(e){e.ondblclick=function(e){const t=url+"#"+e.target.id;navigator.clipboard.writeText(t)}}))</script>
140 
140<script>document.querySelectorAll(".content pre").forEach((function(e){var t=e.querySelector("code");if(t){var o=document.createElement("div");o.className="gp-code-wrapper",e.parentNode.insertBefore(o,e),o.appendChild(e);var n=document.createElement("button");n.className="gp-copy-code",n.type="button",n.textContent="Copy",n.setAttribute("aria-label","Copy code to clipboard"),o.appendChild(n),n.addEventListener("click",(function(){navigator.clipboard.writeText(t.innerText).then((function(){n.textContent="Copied!",n.classList.add("is-copied"),setTimeout((function(){n.textContent="Copy",n.classList.remove("is-copied")}),1500)}))}))}}))</script>
140 <style>#tooltip-wrapper{background:var(--background-primary);padding:1em;border-radius:4px;overflow:hidden;position:fixed;width:80%;max-width:400px;height:auto;max-height:300px;font-size:.8em;box-shadow:0 5px 10px rgba(0,0,0,.1);opacity:0;transition:opacity .1s;unicode-bidi:plaintext;overflow-y:scroll;z-index:10}#tooltip-wrapper:after{content:"";position:absolute;z-index:1;bottom:0;left:0;pointer-events:none;width:100%;unicode-bidi:plaintext;height:75px}.tooltip-pdf{width:100%;height:260px;border:0}</style> <div style="opacity:0;display:none" id="tooltip-wrapper"> <div id="tooltip-content"> </div> </div> <iframe style="display:none;height:0;width:0" id="link-preview-iframe" src=""> </iframe> 
140<script>var opacityTimeout,contentTimeout,transitionDurationMs=100,iframe=document.getElementById("link-preview-iframe"),tooltipWrapper=document.getElementById("tooltip-wrapper"),tooltipContent=document.getElementById("tooltip-content"),linkHistories={};function hideTooltip(){opacityTimeout=setTimeout((function(){tooltipWrapper.style.opacity=0,contentTimeout=setTimeout((function(){tooltipContent.innerHTML="",tooltipWrapper.style.display="none"}),transitionDurationMs+1)}),transitionDurationMs)}function positionTooltip(t){var o=t.getClientRects()[t.getClientRects().length-1],e=document.documentElement.clientWidth,i=window.innerHeight,p=12,n=10,l=(o.top,i-(o.top+o.height)),r=(o.left,e-(o.left+o.width)),s=l>=tooltipWrapper.offsetHeight+p?"bottom":"top",a=r>=tooltipWrapper.offsetWidth+p?"right":"left";tooltipWrapper.style.top="bottom"===s?o.top+o.height+p+"px":o.top-tooltipWrapper.offsetHeight-p+"px",tooltipWrapper.style.left="right"===a?o.left+o.width+p+"px":o.left-tooltipWrapper.offsetWidth-p+"px";var c=parseFloat(tooltipWrapper.style.top),f=parseFloat(tooltipWrapper.style.left);c<n?tooltipWrapper.style.top="10px":c+tooltipWrapper.offsetHeight+n>i&&(tooltipWrapper.style.top=i-tooltipWrapper.offsetHeight-n+"px"),f<n?tooltipWrapper.style.left="10px":f+tooltipWrapper.offsetWidth+n>e&&(tooltipWrapper.style.left=e-tooltipWrapper.offsetWidth-n+"px")}function showTooltip(t){var o=t.currentTarget||t.target;if(o){var e=o.getAttribute("href");if(-1===e.indexOf("http")||-1!==e.indexOf(window.location.host)){tooltipWrapper.style.display="block",tooltipWrapper.style.opacity=0,positionTooltip(o);let t=e.split("#")[0];if(t.toLowerCase().endsWith(".pdf"))return tooltipContent.innerHTML='<iframe class="tooltip-pdf" src="'+t+'"></iframe>',tooltipWrapper.scrollTop=0,void setTimeout((function(){positionTooltip(o),tooltipWrapper.style.opacity=1}),1);if(/\.(png|jpg|jpeg|gif|webp|svg)$/i.test(t))return tooltipContent.innerHTML='<img src="'+t+'" style="max-width:100%;height:auto;" />',tooltipWrapper.scrollTop=0,void setTimeout((function(){positionTooltip(o),tooltipWrapper.style.opacity=1}),1);linkHistories[t]?(tooltipContent.innerHTML=linkHistories[t],setTimeout((function(){if(positionTooltip(o),tooltipWrapper.style.opacity=1,-1!=e.indexOf("#")){let t=e.split("#")[1];const o=tooltipWrapper.querySelector(`[id='${t}']`);o.classList.add("referred"),o.scrollIntoView({behavior:"smooth"},!0)}else tooltipWrapper.scroll(0,0)}),1)):(iframe.src=t,iframe.onload=function(){let i,p;try{i=iframe.contentWindow,p=i?i.document:null}catch(t){return tooltipContent.innerHTML="<div>Preview not available for this file.</div>",tooltipWrapper.scrollTop=0,void setTimeout((function(){positionTooltip(o),tooltipWrapper.style.opacity=1}),1)}if(!p)return;const n=p.querySelector("h1"),l=p.querySelector(".content");if(tooltipContentHtml="",n&&(tooltipContentHtml+='<div style="font-weight: bold; unicode-bidi: plaintext;">'+n.innerHTML+"</div>"),l)tooltipContentHtml+=l.innerHTML;else if(p.body)tooltipContentHtml+=p.body.innerHTML;else{if(!p.documentElement)return;tooltipContentHtml+=p.documentElement.innerHTML}tooltipContent.innerHTML=tooltipContentHtml,linkHistories[t]=tooltipContentHtml,tooltipWrapper.scrollTop=0,setTimeout((function(){if(positionTooltip(o),tooltipWrapper.style.opacity=1,-1!=e.indexOf("#")){let t=e.split("#")[1];const o=tooltipWrapper.querySelector(`[id='${t}']`);o.classList.add("referred"),console.log(o),o.scrollIntoView({behavior:"smooth"},!0)}else tooltipWrapper.scroll(0,0)}),1)}),positionTooltip(o)}}}function setupListeners(t){t.addEventListener("mouseleave",(function(t){hideTooltip()})),tooltipWrapper.addEventListener("mouseleave",(function(t){hideTooltip()})),t.addEventListener("mouseenter",(function(t){clearTimeout(opacityTimeout),clearTimeout(contentTimeout),showTooltip(t)})),tooltipWrapper.addEventListener("mouseenter",(function(t){clearTimeout(opacityTimeout),clearTimeout(contentTimeout)}))}window.addEventListener("load",(function(t){document.querySelectorAll(".internal-link").forEach(setupListeners),document.querySelectorAll(".backlink-card a").forEach(setupListeners)}))</script>
140 <div class="search-container" id="globalsearch" onclick="toggleSearch()"> <div class="search-box" onclick="event.stopPropagation()"> <div class="search-header"> <input type="search" id="term" placeholder="Start typing..."> </div> <div class="search-layout no-preview" id="search-layout"> <div class="search-results-panel" id="search-results"> <span><i>Enter your search text in the box above</i></span> </div> <div class="search-preview-panel" id="search-preview"> <div class="preview-placeholder"> <i data-lucide="file-text"></i> <p>Select a result to preview</p> </div> <div class="preview-content" id="preview-content"></div> </div> </div> <footer class="search-box-footer"> <div class="navigation-hint"> <span><code>Enter</code>&nbsp;to select</span> </div> <div class="navigation-hint"> <span><code>⇅</code>&nbsp;to navigate</span> </div> <div class="navigation-hint"> <span><code>ESC</code>&nbsp;to close</span> </div> </footer> </div> </div> 
140<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/flexsearch.bundle.js"></script>
140 
140<script>document.addEventListener("DOMContentLoaded",init,!1),document.addEventListener("DOMContentLoaded",setCorrectShortcut,!1);const previewCache=new Map;window.toggleSearch=function(){const e=document.getElementById("globalsearch");e.classList.contains("active")?e.classList.remove("active"):(e.classList.add("active"),document.getElementById("term").focus())},window.toggleTagSearch=function(e){const t=e.textContent;t&&(document.getElementById("term").value=t.trim(),window.toggleSearch(),window.search())};const loadingSvg='\n    <div style="display: flex; justify-content: center; padding: 40px;">\n        <svg width="40" height="40" viewBox="0 0 45 45" xmlns="http://www.w3.org/2000/svg" stroke="currentColor">\n            <g fill="none" fill-rule="evenodd" transform="translate(1 1)" stroke-width="2">\n                <circle cx="22" cy="22" r="6" stroke-opacity="0">\n                    <animate attributeName="r" begin="1.5s" dur="3s" values="6;22" calcMode="linear" repeatCount="indefinite" />\n                    <animate attributeName="stroke-opacity" begin="1.5s" dur="3s" values="1;0" calcMode="linear" repeatCount="indefinite" />\n                    <animate attributeName="stroke-width" begin="1.5s" dur="3s" values="2;0" calcMode="linear" repeatCount="indefinite" />\n                </circle>\n                <circle cx="22" cy="22" r="6" stroke-opacity="0">\n                    <animate attributeName="r" begin="3s" dur="3s" values="6;22" calcMode="linear" repeatCount="indefinite" />\n                    <animate attributeName="stroke-opacity" begin="3s" dur="3s" values="1;0" calcMode="linear" repeatCount="indefinite" />\n                    <animate attributeName="stroke-width" begin="3s" dur="3s" values="2;0" calcMode="linear" repeatCount="indefinite" />\n                </circle>\n                <circle cx="22" cy="22" r="8">\n                    <animate attributeName="r" begin="0s" dur="1.5s" values="6;1;2;3;4;5;6" calcMode="linear" repeatCount="indefinite" />\n                </circle>\n            </g>\n        </svg>\n    </div>';function debounce(e,t,n){var r;return function(){var i=this,a=arguments,s=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||e.apply(i,a)}),t),s&&e.apply(i,a)}}function setCorrectShortcut(){navigator.platform.toUpperCase().indexOf("MAC")>=0&&document.querySelectorAll(".search-keys").forEach((e=>e.innerHTML="<code>⌘</code>&nbsp;+&nbsp;<code>K</code>"))}function tokenizeSearchTerms(e){const t=[],n=/"([^"]+)"|(\S+)/g;let r;for(;null!==(r=n.exec(e));){const e=(r[1]||r[2]).toLowerCase();e.length>1&&t.push(e)}return t.sort(((e,t)=>t.length-e.length))}function highlightTerms(e,t){if(!t||0===t.length||!e)return e;let n=e;return t.forEach((e=>{const t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`(${t})`,"gi");n=n.replace(r,'<span class="search-highlight">$1</span>')})),n}function getContextualExcerpt(e,t,n=150){if(!e)return"";const r=e.replace(/<[^>]*>/g,"");if(!t||0===t.length)return truncateText(r,n);let i=r.length;if(t.forEach((e=>{const t=r.toLowerCase().indexOf(e.toLowerCase());-1!==t&&t<i&&(i=t)})),i===r.length)return truncateText(r,n);const a=Math.max(0,i-50),s=Math.min(r.length,a+n);let o=r.substring(a,s);return a>0&&(o="..."+o),s<r.length&&(o+="..."),o}function truncateText(e,t){return e?(e=e.replace(/<[^>]*>/g,"")).length<=t?e:e.substring(0,t-3)+"...":""}async function fetchPreviewContent(e){if(previewCache.has(e))return previewCache.get(e);try{const t=await fetch(e),n=await t.text(),r=new DOMParser,i=r.parseFromString(n,"text/html").querySelector(".content, .cm-s-obsidian, article, main"),a=i?i.innerHTML:"";return previewCache.set(e,a),a}catch(e){return console.error("Failed to fetch preview:",e),""}}function highlightTextNodes(e,t){if(!t||0===t.length)return;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),r=[];for(;n.nextNode();)r.push(n.currentNode);r.forEach((e=>{const n=e.textContent;let r=!1;if(t.forEach((e=>{n.toLowerCase().includes(e.toLowerCase())&&(r=!0)})),r){const r=document.createElement("span");r.innerHTML=highlightTerms(n,t),e.parentNode.replaceChild(r,e)}}))}async function showPreview(e){const t=window.searchResults;if(!t||!t[e])return;const n=t[e],r=document.getElementById("search-preview"),i=document.getElementById("preview-content"),a=r.querySelector(".preview-placeholder");if(!r||!i)return;document.querySelectorAll(".searchresult").forEach((e=>e.classList.remove("active")));const s=document.querySelector(`.searchresult[data-index="${e}"]`);s&&s.classList.add("active"),i.innerHTML=loadingSvg,i.classList.add("has-content"),a.style.display="none";const o=await fetchPreviewContent(n.url),c=n.tags&&n.tags.length>0?`<div class="preview-tags">${n.tags.map((e=>`<a class="tag" href="javascript:void(0);" onclick="toggleTagSearch(this)">#${e}</a>`)).join("")}</div>`:"";i.innerHTML=`\n            <div class="preview-title">${highlightTerms(n.title,window.searchTerms)}</div>\n            ${c}\n            <div class="preview-body">${o}</div>\n        `;const l=i.querySelector(".preview-body");l&&window.searchTerms&&highlightTextNodes(l,window.searchTerms),window.currentPreviewIndex=e}function hidePreview(){const e=document.getElementById("search-preview"),t=document.getElementById("preview-content"),n=e?.querySelector(".preview-placeholder");n&&(n.style.display="flex"),t&&(t.classList.remove("has-content"),t.innerHTML=""),window.currentPreviewIndex=-1}function createIndex(e){const t=e=>(e=>e.toLowerCase().normalize("NFD").replace(/n\u0303/g,"ñ").replace(/[\u0300-\u036f]/g,"").normalize("NFC"))(e).split(/([^a-z]|[^\x00-\x7F])/),n=new FlexSearch.Document({cache:!0,charset:"latin:extra",optimize:!0,index:[{field:"content",tokenize:"reverse",encode:t},{field:"title",tokenize:"forward",encode:t},{field:"tags",tokenize:"forward",encode:t}]});return e.forEach(((e,t)=>{n.add({id:t,title:e.title,content:e.content,tags:e.tags})})),n}
140async function init(){const e=await fetch("/searchIndex.json?v=2026-09-17T19:50:15.225Z").then((e=>e.json())),t=createIndex(e);function n(e){const t=document.querySelectorAll(".searchresult");if(0===t.length)return;let n,r=-1;t.forEach(((e,t)=>{e.classList.contains("active")&&(r=t)})),-1===r?n=e>0?0:t.length-1:(n=r+e,n<0&&(n=t.length-1),n>=t.length&&(n=0)),t.forEach((e=>e.classList.remove("active"))),t[n].classList.add("active"),t[n].scrollIntoView({behavior:"smooth",block:"nearest"}),showPreview(parseInt(t[n].dataset.index))}window.docs=e,window.index=t,document.addEventListener("keydown",(e=>{if((e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),toggleSearch()),"Escape"===e.key&&document.getElementById("globalsearch").classList.remove("active"),document.getElementById("globalsearch").classList.contains("active")&&("ArrowDown"===e.key&&(e.preventDefault(),n(1)),"ArrowUp"===e.key&&(e.preventDefault(),n(-1)),"Enter"===e.key)){e.preventDefault();const t=document.querySelector(".searchresult.active");if(t){const e=t.dataset.url;e&&(window.location.href=e)}}}));const r=debounce(search,200,!1);window.field=document.querySelector("#term"),field.addEventListener("keydown",(e=>{"ArrowDown"!==e.key&&"ArrowUp"!==e.key&&"Enter"!==e.key&&r()})),window.resultsDiv=document.querySelector("#search-results");const i=new URL(location.href).searchParams;i.get("q")&&(field.setAttribute("value",i.get("q")),toggleSearch(),search())}async function search(){const e=field.value.trim(),t=document.getElementById("search-layout");if(!e)return resultsDiv.innerHTML="<span><i>Enter your search text in the box above</i></span>",hidePreview(),void(t&&t.classList.add("no-preview"));window.lastSearch=e,window.searchTerms=tokenizeSearchTerms(e),resultsDiv.innerHTML=loadingSvg,hidePreview();const n=offlineSearch(e);if(window.searchResults=n,!n.length)return t&&t.classList.add("no-preview"),void(resultsDiv.innerHTML=`\n                <div class="no-results">\n                    <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n                        <circle cx="11" cy="11" r="8"></circle>\n                        <line x1="21" y1="21" x2="16.65" y2="16.65"></line>\n                        <line x1="8" y1="11" x2="14" y2="11"></line>\n                    </svg>\n                    <p>No results for "${e}"</p>\n                </div>\n            `);t&&t.classList.remove("no-preview");let r="";n.forEach(((e,t)=>{const n=highlightTerms(getContextualExcerpt(e.content,window.searchTerms,120),window.searchTerms),i=highlightTerms(e.title,window.searchTerms),a=e.tags&&e.tags.length>0?`<div class="result-tags">${e.tags.map((e=>`<span class="tag">#${e}</span>`)).join("")}</div>`:"";r+=`\n                <div class="searchresult${0===t?" active":""}"\n                     data-index="${t}"\n                     data-url="${e.url}"\n                     onmouseenter="showPreview(${t})"\n                     onclick="window.location.href='${e.url}'">\n                    <span class="result-title">${i}</span>\n                    ${a}\n                    <div class="result-excerpt">${n}</div>\n                </div>\n            `})),resultsDiv.innerHTML=r,n.length>0&&showPreview(0),"undefined"!=typeof lucide&&lucide.createIcons()}function offlineSearch(e){const t=window.docs,n="#"===e[0]&&e.length>1?index.search(e.substring(1),[{field:"tags"}]):index.search(e,[{field:"title",limit:5},{field:"content",limit:10}]),r=e=>{const t=n.filter((t=>t.field===e));return 0===t.length?[]:[...t[0].result]};return[...new Set([...r("title"),...r("content"),...r("tags")])].map((e=>{const n={...t[e]};return n.tags=n.tags.filter((e=>
140"gardenEntry"!==e&&"note"!==e)),n}))}window.lastSearch="",window.searchResults=[],window.searchTerms=[],window.currentPreviewIndex=-1,window.search=search,document.addEventListener("click",(function(e){const t=e.target.closest("a.tag");if(!t||t.closest("#globalsearch"))return;const n=t.getAttribute("href");n&&"javascript:void(0);"!==n||window.toggleTagSearch(t)}))</script>
140 
140<script src="https://fastly.jsdelivr.net/npm/[email protected]/build/global/luxon.min.js"></script>
140 
140<script defer="defer">TIMESTAMP_FORMAT="yyyy-mm-dd h:mm a",DATE_FORMAT="MMM dd, yyyy",document.querySelectorAll(".human-date").forEach((function(e){try{date=e.getAttribute("data-date")||e.innerText,format=/^\d{4}-\d{2}-\d{2}$/.test(date.trim())?DATE_FORMAT:TIMESTAMP_FORMAT,parsed_date=luxon.DateTime.fromISO(date),null!=parsed_date.invalid&&(parsed_date=luxon.DateTime.fromSQL(date)),null!=parsed_date.invalid&&(parsed_date=luxon.DateTime.fromHTTP(date)),null==parsed_date.invalid&&(e.innerHTML=parsed_date.toFormat(format))}catch(e){}}))</script>
140 
140<script defer="defer" src="https://unpkg.com/lucide@latest"></script>
140 
140<script defer="defer">document.addEventListener("DOMContentLoaded",(()=>{lucide.createIcons({attrs:{class:["svg-icon"]}})}))</script>
140 
140<script>document.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll(".obsidian-bases-views").forEach((function(e){var t=e.querySelector(".obsidian-bases-active-view"),a=e.querySelector(".obsidian-bases-dropdown"),i=e.querySelectorAll(".obsidian-bases-dropdown-item"),n=e.querySelectorAll(".obsidian-bases-view-panel"),o=e.querySelector(".obsidian-bases-active-view-name"),r=e.querySelector(".obsidian-bases-count-value");t&&a&&(t.addEventListener("click",(function(e){e.stopPropagation();var i="none"!==a.style.display;a.style.display=i?"none":"block",t.setAttribute("aria-expanded",!i)})),document.addEventListener("click",(function(){a.style.display="none",t.setAttribute("aria-expanded","false")})),i.forEach((function(s){s.addEventListener("click",(function(s){s.stopPropagation();var d=this.getAttribute("data-view-index");i.forEach((function(e){e.classList.remove("active")})),this.classList.add("active"),n.forEach((function(e){e.style.display="none"}));var l=e.querySelector('.obsidian-bases-view-panel[data-view-index="'+d+'"]');l&&(l.style.display="block");var c=this.querySelector(".obsidian-bases-view-icon"),u=t.querySelector(".obsidian-bases-view-icon");if(c&&u&&u.replaceWith(c.cloneNode(!0)),o&&(o.textContent=this.textContent.trim()),r&&l){var b=l.querySelectorAll("tbody tr:not(.obsidian-base-group-row), .obsidian-base-card, .obsidian-base-list li");r.textContent=b.length}a.style.display="none",t.setAttribute("aria-expanded","false")}))})))})),document.querySelectorAll(".bases-dynamic-date").forEach((function(e){var t=e.getAttribute("data-type"),a=new Date;if("today"===t){var i=a.getFullYear(),n=String(a.getMonth()+1).padStart(2,"0"),o=String(a.getDate()).padStart(2,"0");e.textContent=i+"-"+n+"-"+o}else if("now"===t){i=a.getFullYear(),n=String(a.getMonth()+1).padStart(2,"0"),o=String(a.getDate()).padStart(2,"0");var r=String(a.getHours()).padStart(2,"0"),s=String(a.getMinutes()).padStart(2,"0");e.textContent=i+"-"+n+"-"+o+" "+r+":"+s}}))}))</script>
140 <style>.excalidraw-svg .excalidraw-embedded-note-content{width:100%;height:100%;overflow-y:auto;background:var(--background-primary);color:var(--text-normal);padding:.5em 1em;font-size:.8em;border:1px solid var(--background-modifier-border,#e3e3e3);border-radius:4px;box-sizing:border-box;unicode-bidi:plaintext}</style> 
140<script>window.addEventListener("load",(function(){document.querySelectorAll("iframe.excalidraw-embedded-note").forEach((function(e){function t(){var t;try{t=e.contentDocument}catch(e){return}if(t){var n=t.querySelector(".content");if(n){var c=document.createElement("div");c.className="excalidraw-embedded-note-content",c.innerHTML=n.innerHTML,e.parentNode.replaceChild(c,e)}}}e.contentDocument&&"complete"===e.contentDocument.readyState&&e.contentDocument.querySelector(".content")?t():e.addEventListener("load",t)}))}))</script>
140 
140<script type="module" src="https://static.cloudflareinsights.com/beacon.min.js/v31edd6df95cf4e85bb4c19e7a9bdbcba1788362987495" integrity="sha512-iIg7k2xntmwu6/uSb5tpc/hySgZc4eoL31yB29W6tJFo2akwjPWcEqnCEdJvGexCL0KEQwVYv5BlowfhVz26hg==" data-cf-beacon='{"version":"2024.11.0","token":"247e4fd42bc042aa87008cc937a7fbe2","r":1,"spa":2}' crossorigin="anonymous"></script>
140
141</body> </html> 

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.