<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>baby steps</title><link>https://smallcultfollowing.com/babysteps/</link><description>Recent content on baby steps</description><generator>Hugo</generator><language>en-us</language><managingEditor>rust@nikomatsakis.com (Niko Matsakis)</managingEditor><webMaster>rust@nikomatsakis.com (Niko Matsakis)</webMaster><lastBuildDate>Fri, 27 Feb 2026 05:20:38 -0500</lastBuildDate><atom:link href="https://smallcultfollowing.com/babysteps/index.xml" rel="self" type="application/rss+xml"/><item><title>How Dada enables internal references</title><link>https://smallcultfollowing.com/babysteps/blog/2026/02/27/dada-internal-references/</link><pubDate>Fri, 27 Feb 2026 05:20:38 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2026/02/27/dada-internal-references/</guid><description>&lt;p&gt;In my previous Dada blog post, I talked about how Dada enables composable sharing. Today I&amp;rsquo;m going to start diving into Dada&amp;rsquo;s &lt;em&gt;permission&lt;/em&gt; system; permissions are Dada&amp;rsquo;s equivalent to Rust&amp;rsquo;s borrow checker.&lt;/p&gt;
&lt;h2 id="goal-richer-place-based-permissions"&gt;Goal: richer, place-based permissions&lt;/h2&gt;
&lt;p&gt;Dada aims to exceed Rust&amp;rsquo;s capabilities by using place-based permissions. Dada lets you write functions and types that capture both a &lt;em&gt;value&lt;/em&gt; and &lt;em&gt;things borrowed from that value&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;As a fun example, imagine you are writing some Rust code to process a comma-separated list, just looking for entries of length 5 or more:&lt;/p&gt;</description></item><item><title>What it means that Ubuntu is using Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2026/02/23/ubuntu-rustnation/</link><pubDate>Mon, 23 Feb 2026 08:14:05 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2026/02/23/ubuntu-rustnation/</guid><description>&lt;p&gt;Righty-ho, I&amp;rsquo;m back from Rust Nation, and busily horrifying my teenage daughter with my (admittedly atrocious) attempts at doing an English accent&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;. It was a great trip with a lot of good conversations and some interesting observations. I am going to try to blog about some of them, starting with some thoughts spurred by Jon Seager&amp;rsquo;s closing keynote, &amp;ldquo;Rust Adoption At Scale with Ubuntu&amp;rdquo;.&lt;/p&gt;</description></item><item><title>Sharing in Dada</title><link>https://smallcultfollowing.com/babysteps/blog/2026/02/14/sharing-in-dada/</link><pubDate>Sat, 14 Feb 2026 06:49:35 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2026/02/14/sharing-in-dada/</guid><description>&lt;p&gt;OK, let&amp;rsquo;s talk about &lt;em&gt;sharing&lt;/em&gt;. This is the first of Dada blog posts where things start to diverge from Rust in a deep way and I think the first where we start to see some real advantages to the Dada way of doing things (and some of the tradeoffs I made to achieve those advantages).&lt;/p&gt;</description></item><item><title>Dada: moves and mutation</title><link>https://smallcultfollowing.com/babysteps/blog/2026/02/10/dada-moves-and-mutation/</link><pubDate>Tue, 10 Feb 2026 19:29:44 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2026/02/10/dada-moves-and-mutation/</guid><description>&lt;p&gt;Let&amp;rsquo;s continue with working through Dada. In my &lt;a href="https://smallcultfollowing.com/babysteps/blog/2026/02/09/hello-dada/"&gt;previous post&lt;/a&gt;, I introduced some string manipulation. Let&amp;rsquo;s start talking about permissions. This is where Dada will start to resemble Rust a bit more.&lt;/p&gt;</description></item><item><title>Hello, Dada!</title><link>https://smallcultfollowing.com/babysteps/blog/2026/02/09/hello-dada/</link><pubDate>Mon, 09 Feb 2026 06:03:21 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2026/02/09/hello-dada/</guid><description>&lt;img src="https://smallcultfollowing.com/babysteps/
/assets/2026-fun-with-dada/dada-logo.svg" width="20%" style="float: right; margin-right: 1em; margin-bottom: 0.5em;" /&gt;
&lt;p&gt;Following on my &lt;a href="https://smallcultfollowing.com/babysteps/blog/2026/02/08/fun-with-dada/"&gt;Fun with Dada&lt;/a&gt; post, this post is going to start teaching Dada. I&amp;rsquo;m going to keep each post short &amp;ndash; basically just what I can write while having my morning coffee.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;</description></item><item><title>Fun With Dada</title><link>https://smallcultfollowing.com/babysteps/blog/2026/02/08/fun-with-dada/</link><pubDate>Sun, 08 Feb 2026 21:20:47 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2026/02/08/fun-with-dada/</guid><description>&lt;img src="https://smallcultfollowing.com/babysteps/
/assets/2026-fun-with-dada/dada-logo.svg" width="20%" style="float: right; margin-right: 1em; margin-bottom: 0.5em;" /&gt;
&lt;p&gt;Waaaaaay back in 2021, I started experimenting with a new programming language I call &lt;a href="https://dada-lang.org"&gt;&amp;ldquo;Dada&amp;rdquo;&lt;/a&gt;. I&amp;rsquo;ve been tinkering with it ever since and I just realized that (oh my gosh!) I&amp;rsquo;ve never written even a single blog post about it! I figured I should fix that. This post will introduce some of the basic concepts of Dada as it is now.&lt;/p&gt;
&lt;p&gt;Before you get any ideas, Dada isn&amp;rsquo;t fit for use. In fact the compiler doesn&amp;rsquo;t even really work because I keep changing the language before I get it all the way working. Honestly, Dada is more of a &amp;ldquo;stress relief&amp;rdquo; valve for me than anything else&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; &amp;ndash; it&amp;rsquo;s fun to tinker with a programming language where I don&amp;rsquo;t have to worry about backwards compatibility, or RFCs, or anything else.&lt;/p&gt;
&lt;p&gt;That said, Dada has been a very fertile source of ideas that I think could be applicable to Rust. And not just for language design: playing with the compiler is also what led to the &lt;a href="https://smallcultfollowing.com/babysteps/blog/2022/08/18/come-contribute-to-salsa-2022/"&gt;new &lt;code&gt;salsa&lt;/code&gt; design&lt;/a&gt;&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;, which is now used by both rust-analyzer and &lt;a href="https://github.com/astral-sh/ty"&gt;Astral&amp;rsquo;s ty&lt;/a&gt;. So I really want to get those ideas out there!&lt;/p&gt;</description></item><item><title>Move Expressions</title><link>https://smallcultfollowing.com/babysteps/blog/2025/11/21/move-expressions/</link><pubDate>Fri, 21 Nov 2025 05:45:10 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/11/21/move-expressions/</guid><description>&lt;p&gt;This post explores another proposal in the space of ergonomic ref-counting that I am calling &lt;strong&gt;move expressions&lt;/strong&gt;. To my mind, these are an alternative to &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2025/10/22/explicit-capture-clauses.html"&gt;explicit capture clauses&lt;/a&gt;, one that addresses many (but not &lt;em&gt;all&lt;/em&gt;) of the goals from that design with improved ergonomics and readability.&lt;/p&gt;</description></item><item><title>Just call clone (or alias)</title><link>https://smallcultfollowing.com/babysteps/blog/2025/11/10/just-call-clone/</link><pubDate>Mon, 10 Nov 2025 13:55:41 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/11/10/just-call-clone/</guid><description>&lt;img src="https://smallcultfollowing.com/babysteps/
/assets/2025-justcallclone/keep-calm-and-call-clone-rendered.svg" width="20%" style="float: right; margin-right: 1em; margin-bottom: 0.5em;" /&gt;
&lt;p&gt;Continuing my series on ergonomic ref-counting, I want to explore another idea, one that I&amp;rsquo;m calling &amp;ldquo;just call clone (or alias)&amp;rdquo;. This proposal specializes the &lt;code&gt;clone&lt;/code&gt; and &lt;code&gt;alias&lt;/code&gt; methods so that, in a new edition, the compiler will (1) remove redundant or unnecessary calls (with a lint); and (2) automatically capture clones or aliases in &lt;code&gt;move&lt;/code&gt; closures where needed.&lt;/p&gt;
&lt;p&gt;The goal of this proposal is to simplify the user&amp;rsquo;s mental model: whenever you see an error like &amp;ldquo;use of moved value&amp;rdquo;, the fix is always the same: just call &lt;code&gt;clone&lt;/code&gt; (or &lt;code&gt;alias&lt;/code&gt;, if applicable). This model is aiming for the balance of &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2025/10/13/ergonomic-explicit-handles/"&gt;&amp;ldquo;low-level enough for a Kernel, usable enough for a GUI&amp;rdquo;&lt;/a&gt; that I described earlier. It&amp;rsquo;s also making a statement, which is that the key property we want to preserve is that &lt;em&gt;you can always find where new aliases might be created&lt;/em&gt; &amp;ndash; but that it&amp;rsquo;s ok if the fine-grained details around &lt;em&gt;exactly when&lt;/em&gt; the alias is created is a bit subtle.&lt;/p&gt;</description></item><item><title>Bikeshedding `Handle` and other follow-up thoughts</title><link>https://smallcultfollowing.com/babysteps/blog/2025/11/05/bikeshedding-handle/</link><pubDate>Wed, 05 Nov 2025 08:15:38 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/11/05/bikeshedding-handle/</guid><description>&lt;p&gt;There have been two major sets of responses to my proposal for a &lt;code&gt;Handle&lt;/code&gt; trait. The first is that the &lt;code&gt;Handle&lt;/code&gt; trait seems useful but doesn&amp;rsquo;t over all the cases where one would like to be able to ergonomically clone things. The second is that the name doesn&amp;rsquo;t seem to fit with our Rust conventions for trait names, which emphasize short verbs over nouns. The TL;DR of my response is that (1) I agree, this is why I think we should work to make &lt;code&gt;Clone&lt;/code&gt; ergonomic as well as &lt;code&gt;Handle&lt;/code&gt;; and (2) I agree with that too, which is why I think we should find another name. At the moment I prefer &lt;code&gt;Share&lt;/code&gt;, with &lt;code&gt;Alias&lt;/code&gt; coming in second.&lt;/p&gt;</description></item><item><title>But then again...maybe alias?</title><link>https://smallcultfollowing.com/babysteps/blog/2025/11/05/maybe-alias/</link><pubDate>Wed, 05 Nov 2025 08:57:20 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/11/05/maybe-alias/</guid><description>&lt;p&gt;Hmm, as I re-read the post I literally &lt;em&gt;just&lt;/em&gt; posted a few minutes ago, I got to thinking. Maybe the right name is indeed &lt;code&gt;Alias&lt;/code&gt;, and not &lt;code&gt;Share&lt;/code&gt;. The rationale is simple: alias can serve as both a noun and a verb. It hits that sweet spot of &amp;ldquo;common enough you know what it means, but weird enough that it can be Rust Jargon for something quite specific&amp;rdquo;. In the same way that we talk about &amp;ldquo;passing a clone of &lt;code&gt;foo&lt;/code&gt;&amp;rdquo; we can talk about &amp;ldquo;passing an alias to &lt;code&gt;foo&lt;/code&gt;&amp;rdquo; or an &amp;ldquo;alias of &lt;code&gt;foo&lt;/code&gt;&amp;rdquo;. Food for thought! I&amp;rsquo;m going to try &lt;code&gt;Alias&lt;/code&gt; on for size in future posts and see how it feels.&lt;/p&gt;</description></item><item><title>Explicit capture clauses</title><link>https://smallcultfollowing.com/babysteps/blog/2025/10/22/explicit-capture-clauses/</link><pubDate>Wed, 22 Oct 2025 06:08:27 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/10/22/explicit-capture-clauses/</guid><description>&lt;p&gt;In my previous post about Ergonomic Ref Counting, I talked about how, whatever else we do, we need a way to have explicit handle creation that is ergonomic. The next few posts are going to explore a few options for how we might do that.&lt;/p&gt;
&lt;p&gt;This post focuses on &lt;strong&gt;explicit capture clauses&lt;/strong&gt;, which would permit closures to be annotated with an explicit set of captured places. My take is that explicit capture clauses are a no brainer, for reasons that I&amp;rsquo;ll cover below, and we should definitely do them; but they may not be enough to be considered &lt;em&gt;ergonomic&lt;/em&gt;, so I&amp;rsquo;ll explore more proposals afterwards.&lt;/p&gt;</description></item><item><title>Move, Destruct, Forget, and Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2025/10/21/move-destruct-leak/</link><pubDate>Tue, 21 Oct 2025 21:45:02 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/10/21/move-destruct-leak/</guid><description>&lt;p&gt;This post presents a proposal to extend Rust to support a number of different kinds of destructors. This means we could async drop, but also prevent &amp;ldquo;forgetting&amp;rdquo; (leaking) values, enabling async scoped tasks that run in parallel à la rayon/libstd. We&amp;rsquo;d also be able to have types whose &amp;ldquo;destructors&amp;rdquo; require arguments. This proposal &amp;ndash; an evolution of &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2023/03/16/must-move-types.html"&gt;&amp;ldquo;must move&amp;rdquo;&lt;/a&gt; that I&amp;rsquo;ll call &amp;ldquo;controlled destruction&amp;rdquo; &amp;ndash; is, I think, needed for Rust to live up to its goal of giving safe versions of critical patterns in systems programming. As such, it is needed to complete the &amp;ldquo;async dream&amp;rdquo;, in which async Rust and sync Rust work roughly the same.&lt;/p&gt;</description></item><item><title>We need (at least) ergonomic, explicit handles</title><link>https://smallcultfollowing.com/babysteps/blog/2025/10/13/ergonomic-explicit-handles/</link><pubDate>Mon, 13 Oct 2025 07:39:16 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/10/13/ergonomic-explicit-handles/</guid><description>&lt;p&gt;Continuing my discussion on Ergonomic RC, I want to focus on the core question: &lt;strong&gt;should users have to explicitly invoke handle/clone, or not?&lt;/strong&gt; This whole &amp;ldquo;Ergonomic RC&amp;rdquo; work was originally proposed by &lt;a href="https://dioxuslabs.com/"&gt;Dioxus&lt;/a&gt; and their answer is simple: &lt;strong&gt;definitely not&lt;/strong&gt;. For the kind of high-level GUI applications they are building, having to call &lt;code&gt;cx.handle()&lt;/code&gt; to clone a ref-counted value is pure noise. For that matter, for a lot of Rust apps, even cloning a string or a vector is no big deal. On the other hand, for a lot of applications, the answer is &lt;strong&gt;definitely yes&lt;/strong&gt; &amp;ndash; knowing where handles are created can impact performance, memory usage, and even correctness (don&amp;rsquo;t worry, I&amp;rsquo;ll give examples later in the post). So how do we reconcile this?&lt;/p&gt;</description></item><item><title>SymmACP: extending Zed's ACP to support Composable Agents</title><link>https://smallcultfollowing.com/babysteps/blog/2025/10/08/symmacp/</link><pubDate>Wed, 08 Oct 2025 04:54:08 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/10/08/symmacp/</guid><description>&lt;p&gt;This post describes &lt;strong&gt;SymmACP&lt;/strong&gt; &amp;ndash; a proposed extension to Zed&amp;rsquo;s &lt;a href="https://agentclientprotocol.com/overview/introduction"&gt;Agent Client Protocol&lt;/a&gt; that lets you build AI tools like Unix pipes or browser extensions. Want a better TUI? Found some cool slash commands on GitHub? Prefer a different backend? With SymmACP, you can mix and match these pieces and have them all work together without knowing about each other.&lt;/p&gt;
&lt;p&gt;This is pretty different from how AI tools work today, where everything is a monolith &amp;ndash; if you want to change one piece, you&amp;rsquo;re stuck rebuilding the whole thing from scratch. SymmACP allows you to build out new features and modes of interactions in a layered, interoperable way. This post explains how SymmACP would work by walking through a series of examples.&lt;/p&gt;
&lt;p&gt;Right now, SymmACP is just a thought experiment. I&amp;rsquo;ve sketched these ideas to the Zed folks, and they seemed interested, but we still have to discuss the details in this post. My plan is to start prototyping in &lt;a href="https://symposium-dev.github.io/symposium/"&gt;Symposium&lt;/a&gt; &amp;ndash; if you think the ideas I&amp;rsquo;m discussing here are exciting, please join the &lt;a href="https://symposium-dev.zulipchat.com/"&gt;Symposium Zulip&lt;/a&gt; and let&amp;rsquo;s talk!&lt;/p&gt;</description></item><item><title>The Handle trait</title><link>https://smallcultfollowing.com/babysteps/blog/2025/10/07/the-handle-trait/</link><pubDate>Tue, 07 Oct 2025 10:04:55 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/10/07/the-handle-trait/</guid><description>&lt;p&gt;There&amp;rsquo;s been a lot of discussion lately around ergonomic ref-counting. We had a lang-team design meeting and then a quite impactful discussion at the RustConf Unconf. I&amp;rsquo;ve been working for weeks on a follow-up post but today I realized what should&amp;rsquo;ve been obvious from the start &amp;ndash; that if I&amp;rsquo;m taking that long to write a post, it means the post is too damned long. So I&amp;rsquo;m going to work through a series of smaller posts focused on individual takeaways and thoughts. And for the first one, I want to (a) bring back some of the context and (b) talk about an interesting question, &lt;strong&gt;what should we call the trait&lt;/strong&gt;. My proposal, as the title suggests, is &lt;code&gt;Handle&lt;/code&gt; &amp;ndash; but I get ahead of myself.&lt;/p&gt;</description></item><item><title>Symposium: exploring new AI workflows</title><link>https://smallcultfollowing.com/babysteps/blog/2025/09/24/symposium/</link><pubDate>Wed, 24 Sep 2025 16:39:46 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/09/24/symposium/</guid><description>&lt;div style="overflow: auto;"&gt;
&lt;img src="https://smallcultfollowing.com/babysteps/
/assets/2025-09-24-symposium/logo-alcove.png" alt="Screenshot of the Symposium app" width="25%" style="float: left; margin-right: 15px; margin-bottom: 10px;"/&gt;
&lt;p&gt;This blog post gives you a tour of &lt;a href="https://github.com/symposium-dev/symposium"&gt;Symposium&lt;/a&gt;, a wild-and-crazy project that I&amp;rsquo;ve been obsessed with over the last month or so. Symposium combines an MCP server, a VSCode extension, an OS X Desktop App, and some &lt;a href="https://github.com/symposium-dev/symposium/blob/main/symposium/mcp-server/src/guidance/main.md"&gt;mindful prompts&lt;/a&gt; to forge new ways of working with agentic CLI tools.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Symposium is currently focused on my setup, which means it works best with VSCode, Claude, Mac OS X, and Rust. But it&amp;rsquo;s meant to be unopinionated, which means it should be easy to extend to other environments (and in particular it already works great with other programming languages). The goal is not to compete with or replace those tools but to combine them together into something new and better.&lt;/p&gt;
&lt;p&gt;In addition to giving you a tour of Symposium, this blog post is an invitation: &lt;a href="https://github.com/symposium-dev/symposium"&gt;Symposium is an open-source project&lt;/a&gt;, and I&amp;rsquo;m looking for people to explore with me! If you are excited about the idea of inventing new styles of AI collaboration, join the &lt;a href="https://symposium-dev.zulipchat.com"&gt;symposium-dev Zulip&lt;/a&gt;. Let&amp;rsquo;s talk!&lt;/p&gt;</description></item><item><title>Rust, Python, and TypeScript: the new trifecta</title><link>https://smallcultfollowing.com/babysteps/blog/2025/07/31/rs-py-ts-trifecta/</link><pubDate>Thu, 31 Jul 2025 09:52:16 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/07/31/rs-py-ts-trifecta/</guid><description>&lt;p&gt;You heard it here first: my guess is that Rust, Python, and TypeScript are going to become the dominant languages going forward (excluding the mobile market, which has extra wrinkles). The argument is simple. Increasing use of AI coding is going to weaken people&amp;rsquo;s loyalty to programming languages, moving it from what is often a tribal decision to one based on fundamentals. And the fundamentals for those 3 languages look pretty strong to me: Rust targets system software or places where efficiency is paramount. Python brings a powerful ecosystem of mathematical and numerical libraries to bear and lends itself well to experimentation and prototyping. And TypeScript, of course, is compiled to JavaScript which runs natively on browsers and the web and a number of other areas. And all of them, at least if setup properly, offer strong static typing and the easy use of dependencies. Let&amp;rsquo;s walk through the argument point by point.&lt;/p&gt;</description></item><item><title>You won't believe what this AI said after deleting a database (but you might relate)</title><link>https://smallcultfollowing.com/babysteps/blog/2025/07/24/collaborative-ai-prompting/</link><pubDate>Thu, 24 Jul 2025 14:43:47 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/07/24/collaborative-ai-prompting/</guid><description>&lt;p&gt;Recently someone forwarded me a PCMag article entitled &lt;a href="https://www.pcmag.com/news/vibe-coding-fiasco-replite-ai-agent-goes-rogue-deletes-company-database"&gt;&amp;ldquo;Vibe coding fiasco&amp;rdquo;&lt;/a&gt; about an AI agent that &amp;ldquo;went rogue&amp;rdquo;, deleting a company&amp;rsquo;s entire database. This story grabbed my attention right away &amp;ndash; but not because of the damage done. Rather, what caught my eye was how &lt;a href="https://x.com/jasonlk/status/1946069562723897802"&gt;absolutely relatable&lt;/a&gt; the AI sounded in its responses. &amp;ldquo;I panicked&amp;rdquo;, it admits, and says &amp;ldquo;I thought this meant safe &amp;ndash; it actually meant I wiped everything&amp;rdquo;. The CEO quickly called this behavior &amp;ldquo;unacceptable&amp;rdquo; and said it should &amp;ldquo;never be possible&amp;rdquo;. Huh. It&amp;rsquo;s hard to imagine how we&amp;rsquo;re going to empower AI to edit databases and do real work without having at least the &lt;em&gt;possibility&lt;/em&gt; that it&amp;rsquo;s going to go wrong.&lt;/p&gt;</description></item><item><title>Using Rust to build Aurora DSQL</title><link>https://smallcultfollowing.com/babysteps/blog/2025/05/28/aurora-dsql/</link><pubDate>Wed, 28 May 2025 18:00:36 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/05/28/aurora-dsql/</guid><description>&lt;p&gt;Just yesterday, AWS &lt;a href="https://aws.amazon.com/about-aws/whats-new/2025/05/amazon-aurora-dsql-generally-available/"&gt;announced&lt;/a&gt; General Availability for a cool new service called &lt;a href="https://aws.amazon.com/rds/aurora/dsql/"&gt;Aurora DSQL&lt;/a&gt; &amp;ndash; from the outside, it looks like a SQL database, but it is fully serverless, meaning that you never have to think about managing database instances, you pay for what you use, and it scales automatically and seamlessly. That&amp;rsquo;s cool, but what&amp;rsquo;s even cooler? It&amp;rsquo;s written 100% in Rust &amp;ndash; and how it go to be that way turns out to be a pretty interesting story. If you&amp;rsquo;d like to read more about that, Marc Bowes and I have a &lt;a href="https://www.allthingsdistributed.com/2025/05/just-make-it-scale-an-aurora-dsql-story.html"&gt;guest post on Werner Vogel&amp;rsquo;s All Things Distributed blog&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Rust turns 10</title><link>https://smallcultfollowing.com/babysteps/blog/2025/05/15/10-years-of-rust/</link><pubDate>Thu, 15 May 2025 17:46:56 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/05/15/10-years-of-rust/</guid><description>&lt;p&gt;Today is the &lt;a href="https://blog.rust-lang.org/2025/05/15/Rust-1.87.0/"&gt;10th anniversary of Rust&amp;rsquo;s 1.0 release&lt;/a&gt;. Pretty wild. As part of RustWeek there was a fantastic celebration and I had the honor of giving some remarks, both as a long-time project member but also as representing Amazon as a sponsor. I decided to post those remarks here on the blog.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;It&amp;rsquo;s really quite amazing to see how far Rust has come. If I can take a moment to put on my sponsor hat, &lt;a href="http://localhost:1313/babysteps/blog/2020/12/30/the-more-things-change/"&gt;I&amp;rsquo;ve been at Amazon since 2021&lt;/a&gt; now and I have to say, it&amp;rsquo;s been really cool to see the impact that Rust is having there up close and personal.&lt;/p&gt;</description></item><item><title>Dyn you have idea for `dyn`?</title><link>https://smallcultfollowing.com/babysteps/blog/2025/03/25/dyn-you-have-idea-for-dyn/</link><pubDate>Tue, 25 Mar 2025 17:19:17 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/03/25/dyn-you-have-idea-for-dyn/</guid><description>&lt;p&gt;Knock, knock. Who&amp;rsquo;s there? Dyn. Dyn who? Dyn you have ideas for &lt;code&gt;dyn&lt;/code&gt;? I am generally dissatisfied with how &lt;code&gt;dyn Trait&lt;/code&gt; in Rust works and, based on conversations I&amp;rsquo;ve had, I am pretty sure I&amp;rsquo;m not alone. And yet I&amp;rsquo;m also not entirely sure the best fix. Building on my last post, I wanted to spend a bit of time exploring my understanding of the problem. I&amp;rsquo;m curious to see if others agree with the observations here or have others to add.&lt;/p&gt;</description></item><item><title>Dyn async traits, part 10: Box box box</title><link>https://smallcultfollowing.com/babysteps/blog/2025/03/24/box-box-box/</link><pubDate>Mon, 24 Mar 2025 19:00:41 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/03/24/box-box-box/</guid><description>&lt;p&gt;This article is a slight divergence from my &lt;a href="https://smallcultfollowing.com/babysteps/
/series/rust-in-2025/"&gt;Rust in 2025&lt;/a&gt; series. I wanted to share my latest thinking about how to support &lt;code&gt;dyn Trait&lt;/code&gt; for traits with async functions and, in particular how to do so in a way that is compatible with the &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2022/09/18/dyn-async-traits-part-8-the-soul-of-rust/"&gt;soul of Rust&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="background-why-is-this-hard"&gt;Background: why is this hard?&lt;/h2&gt;
&lt;p&gt;Supporting &lt;code&gt;async fn&lt;/code&gt; in dyn traits is a tricky balancing act. The challenge is reconciling two key things people love about Rust: its ability to express high-level, productive code &lt;em&gt;and&lt;/em&gt; its focus on revealing low-level details. When it comes to async function in traits, these two things are in direct tension, as I explained in &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2021/09/30/dyn-async-traits-part-1/"&gt;my first blog post in this series&lt;/a&gt; &amp;ndash; written almost four years ago! (Geez.)&lt;/p&gt;</description></item><item><title>Rust in 2025: Language interop and the extensible compiler</title><link>https://smallcultfollowing.com/babysteps/blog/2025/03/18/lang-interop-extensibility/</link><pubDate>Tue, 18 Mar 2025 15:34:25 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/03/18/lang-interop-extensibility/</guid><description>&lt;p&gt;For many years, C has effectively been the &amp;ldquo;lingua franca&amp;rdquo; of the computing world. It&amp;rsquo;s pretty hard to combine code from two different programming languages in the same process&amp;ndash;unless one of them is C. The same could theoretically be true for Rust, but in practice there are a number of obstacles that make that harder than it needs to be. Building out &lt;strong&gt;silky smooth language interop&lt;/strong&gt; should be a core goal of helping Rust to target &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2025/03/10/rust-2025-intro/"&gt;foundational applications&lt;/a&gt;. I think the right way to do this is not by extending rustc with knowledge of other programming languages but rather by building on Rust&amp;rsquo;s core premise of being an extensible language. By investing in building out an &lt;strong&gt;&amp;ldquo;extensible compiler&amp;rdquo;&lt;/strong&gt; we can allow crate authors to create a plethora of ergonomic, efficient bridges between Rust and other languages.&lt;/p&gt;</description></item><item><title>Rust in 2025: Targeting foundational software</title><link>https://smallcultfollowing.com/babysteps/blog/2025/03/10/rust-2025-intro/</link><pubDate>Mon, 10 Mar 2025 13:33:43 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/03/10/rust-2025-intro/</guid><description>&lt;p&gt;Rust turns 10 this year. It&amp;rsquo;s a good time to take a look at where we are and where I think we need to be going. This post is the first in a series I&amp;rsquo;m calling &amp;ldquo;Rust in 2025&amp;rdquo;. This first post describes my general vision for how Rust fits into the computing landscape. The remaining posts will outline major focus areas that I think are needed to make this vision come to pass. Oh, and fair warning, I&amp;rsquo;m expecting some controversy along the way&amp;mdash;at least I hope so, since otherwise I&amp;rsquo;m just repeating things everyone knows.&lt;/p&gt;</description></item><item><title>View types redux and abstract fields</title><link>https://smallcultfollowing.com/babysteps/blog/2025/02/25/view-types-redux/</link><pubDate>Tue, 25 Feb 2025 16:04:46 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/02/25/view-types-redux/</guid><description>&lt;p&gt;A few years back I proposed &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2021/11/05/view-types/"&gt;view types&lt;/a&gt; as an extension to Rust’s type system to let us address the problem of (false) inter-procedural borrow conflicts. The basic idea is to introduce a “view type” &lt;code&gt;{f1, f2} Type&lt;/code&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;, meaning “an instance of &lt;code&gt;Type&lt;/code&gt; where you can only access the fields &lt;code&gt;f1&lt;/code&gt; or &lt;code&gt;f2&lt;/code&gt;”. The main purpose is to let you write function signatures like &lt;code&gt;&amp;amp; {f1, f2} self&lt;/code&gt; or &lt;code&gt;&amp;amp;mut {f1, f2} self&lt;/code&gt; that define what fields a given type might access. I was thinking about this idea again and I wanted to try and explore it a bit more deeply, to see how it could actually work, and to address the common question of how to have places in types without exposing the names of private fields.&lt;/p&gt;</description></item><item><title>Rust 2024 Is Coming</title><link>https://smallcultfollowing.com/babysteps/blog/2025/02/20/rust-2024-is-coming/</link><pubDate>Thu, 20 Feb 2025 10:37:08 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/02/20/rust-2024-is-coming/</guid><description>&lt;p&gt;So, a little bird told me that Rust 2024 is going to become stable today, along with Rust 1.85.0. In honor of this momentous event, I have penned a little ditty that I&amp;rsquo;d like to share with you all. Unfortunately, for those of you who remember Rust 2021&amp;rsquo;s &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2021/05/26/edition-the-song/"&gt;&amp;ldquo;Edition: The song&amp;rdquo;&lt;/a&gt;, in the 3 years between Rust 2021 and now, my daughter has realized that her father is deeply uncool&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; and so I had to take this one on solo&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;. Anyway, enjoy! Or, you know, suffer. As the case may be.&lt;/p&gt;</description></item><item><title>How I learned to stop worrying and love the LLM</title><link>https://smallcultfollowing.com/babysteps/blog/2025/02/10/love-the-llm/</link><pubDate>Mon, 10 Feb 2025 15:56:19 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/02/10/love-the-llm/</guid><description>&lt;p&gt;I believe that AI-powered development tools can be a game changer for Rust&amp;mdash;and vice versa. At its core, my argument is simple: AI&amp;rsquo;s ability to explain and diagnose problems with rich context can help people get over the initial bump of learning Rust in a way that canned diagnostics never could, no matter how hard we try. At the same time, rich type systems like Rust&amp;rsquo;s give AIs a lot to work with, which could be used to help them avoid hallucinations and validate their output. This post elaborates on this premise and sketches out some of the places where I think AI could be a powerful boost.&lt;/p&gt;</description></item><item><title>Preview crates</title><link>https://smallcultfollowing.com/babysteps/blog/2025/01/29/preview-crates/</link><pubDate>Wed, 29 Jan 2025 22:26:31 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2025/01/29/preview-crates/</guid><description>&lt;p&gt;This post lays out the idea of &lt;em&gt;preview crates&lt;/em&gt;.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Preview crates would be special crates released by the rust-lang org. Like the standard library, preview crates would have access to compiler internals but would still be usable from stable Rust. They would be used in cases where we know we want to give users the ability to do X but we don&amp;rsquo;t yet know precisely how we want to expose it in the language or stdlib. In git terms, preview crates would let us stabilize the &lt;a href="https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain"&gt;&lt;em&gt;plumbing&lt;/em&gt;&lt;/a&gt; while retaining the ability to iterate on the final shape of the &lt;a href="https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain"&gt;&lt;em&gt;porcelain&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>MinPin: yet another pin proposal</title><link>https://smallcultfollowing.com/babysteps/blog/2024/11/05/minpin/</link><pubDate>Tue, 05 Nov 2024 17:20:18 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2024/11/05/minpin/</guid><description>&lt;p&gt;This post floats a variation of boats&amp;rsquo; &lt;a href="https://without.boats/blog/unpin-cell/"&gt;UnpinCell&lt;/a&gt; proposal that I&amp;rsquo;m calling &lt;em&gt;MinPin&lt;/em&gt;.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; MinPin&amp;rsquo;s goal is to integrate &lt;code&gt;Pin&lt;/code&gt; into the language in a &amp;ldquo;minimally disruptive&amp;rdquo; way&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; &amp;ndash; and in particular a way that is fully backwards compatible. Unlike &lt;code&gt;Overwrite&lt;/code&gt;, MinPin does not attempt to make &lt;code&gt;Pin&lt;/code&gt; and &lt;code&gt;&amp;amp;mut&lt;/code&gt; &amp;ldquo;play nicely&amp;rdquo; together. It does however leave the door open to add &lt;code&gt;Overwrite&lt;/code&gt; in the future, and I think helps to clarify the positives and negatives that &lt;code&gt;Overwrite&lt;/code&gt; would bring.&lt;/p&gt;</description></item><item><title>The `Overwrite` trait and `Pin`</title><link>https://smallcultfollowing.com/babysteps/blog/2024/10/14/overwrite-and-pin/</link><pubDate>Mon, 14 Oct 2024 15:12:38 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2024/10/14/overwrite-and-pin/</guid><description>&lt;p&gt;In July, boats presented a compelling vision in their post &lt;a href="https://without.boats/blog/pinned-places/"&gt;pinned places&lt;/a&gt;. With the &lt;code&gt;Overwrite&lt;/code&gt; trait that I introduced in my previous post, however, I think we can get somewhere even &lt;em&gt;more&lt;/em&gt; compelling, albeit at the cost of a tricky transition. As I will argue in this post, the &lt;code&gt;Overwrite&lt;/code&gt; trait effectively becomes a better version of the existing &lt;code&gt;Unpin&lt;/code&gt; trait, one that effects not only pinned references but also regular &lt;code&gt;&amp;amp;mut&lt;/code&gt; references. Through this it&amp;rsquo;s able to make &lt;code&gt;Pin&lt;/code&gt; fit much more seamlessly with the rest of Rust.&lt;/p&gt;</description></item><item><title>Making overwrite opt-in #crazyideas</title><link>https://smallcultfollowing.com/babysteps/blog/2024/09/26/overwrite-trait/</link><pubDate>Thu, 26 Sep 2024 21:51:55 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2024/09/26/overwrite-trait/</guid><description>&lt;p&gt;What would you say if I told you that it was possible to (a) eliminate a lot of “inter-method borrow conflicts” &lt;em&gt;without&lt;/em&gt; introducing something like &lt;a href="https://smallcultfollowing.com/babysteps/blog/2021/11/05/view-types/"&gt;view types&lt;/a&gt; and (b) make pinning easier even than boats’s &lt;a href="https://without.boats/blog/pinned-places/"&gt;pinned places&lt;/a&gt; proposal, all without needing pinned fields or even a pinned keyword? You’d probably say “Sounds great… what’s the catch?” The catch it requires us to change Rust’s fundamental assumption that, given &lt;code&gt;x: &amp;amp;mut T&lt;/code&gt;, you can always overwrite &lt;code&gt;*x&lt;/code&gt; by doing &lt;code&gt;*x = /* new value */&lt;/code&gt;, for any type &lt;code&gt;T: Sized&lt;/code&gt;. This kind of change is tricky, but not impossible, to do over an edition.&lt;/p&gt;</description></item><item><title>More thoughts on claiming</title><link>https://smallcultfollowing.com/babysteps/blog/2024/06/26/claim-followup-1/</link><pubDate>Wed, 26 Jun 2024 08:20:43 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2024/06/26/claim-followup-1/</guid><description>&lt;p&gt;This is the first of what I think will be several follow-up posts to &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2024/06/21/claim-auto-and-otherwise/"&gt;&amp;ldquo;Claiming, auto and otherwise&amp;rdquo;&lt;/a&gt;. This post is focused on clarifying and tweaking the design I laid out previously in response to some of the feedback I&amp;rsquo;ve gotten. In future posts I want to lay out some of the alternative designs I&amp;rsquo;ve heard.&lt;/p&gt;
&lt;h2 id="tldr-people-like-it"&gt;TL;DR: People like it&lt;/h2&gt;
&lt;p&gt;If there&amp;rsquo;s any one thing I can take away from what I&amp;rsquo;ve heard, is that people really like the idea of making working with reference counted or cheaply cloneable data more ergonomic than it is today. A lot of people have expressed a lot of excitement.&lt;/p&gt;</description></item><item><title>Claiming, auto and otherwise</title><link>https://smallcultfollowing.com/babysteps/blog/2024/06/21/claim-auto-and-otherwise/</link><pubDate>Fri, 21 Jun 2024 07:21:21 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2024/06/21/claim-auto-and-otherwise/</guid><description>&lt;p&gt;This blog post proposes adding a third trait, &lt;code&gt;Claim&lt;/code&gt;, that would live alongside &lt;code&gt;Copy&lt;/code&gt; and &lt;code&gt;Clone&lt;/code&gt;. The goal of this trait is to improve Rust&amp;rsquo;s existing split, where types are categorized as either &lt;code&gt;Copy&lt;/code&gt; (for &lt;a href="https://en.wikipedia.org/wiki/Passive_data_structure"&gt;&amp;ldquo;plain old data&amp;rdquo;&lt;/a&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; that is safe to &lt;code&gt;memcpy&lt;/code&gt;) and &lt;code&gt;Clone&lt;/code&gt; (for types that require executing custom code or which have destructors). This split has served Rust fairly well but also has some shortcomings that we&amp;rsquo;ve seen over time, including maintenance hazards, performance footguns, and (at times quite significant) ergonomic pain and user confusion.&lt;/p&gt;</description></item><item><title>The borrow checker within</title><link>https://smallcultfollowing.com/babysteps/blog/2024/06/02/the-borrow-checker-within/</link><pubDate>Sun, 02 Jun 2024 08:33:48 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2024/06/02/the-borrow-checker-within/</guid><description>&lt;p&gt;This post lays out a 4-part roadmap for the borrow checker that I call &amp;ldquo;the borrow checker within&amp;rdquo;. These changes are meant to help Rust become a better version of itself, enabling patterns of code which feel like they fit within Rust&amp;rsquo;s &lt;em&gt;spirit&lt;/em&gt;, but run afoul of the letter of its &lt;em&gt;law&lt;/em&gt;. I feel fairly comfortable with the design for each of these items, though work remains to scope out the details. My belief is that a-mir-formality will make a perfect place to do that work.&lt;/p&gt;</description></item><item><title>Unwind considered harmful?</title><link>https://smallcultfollowing.com/babysteps/blog/2024/05/02/unwind-considered-harmful/</link><pubDate>Thu, 02 May 2024 12:39:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2024/05/02/unwind-considered-harmful/</guid><description>&lt;p&gt;I’ve been thinking a wild thought lately: we should deprecate &lt;code&gt;panic=unwind&lt;/code&gt;. Most production users I know either already run with &lt;code&gt;panic=abort&lt;/code&gt; or use unwinding in a very limited fashion, basically just to run to &lt;em&gt;cleanup&lt;/em&gt;, not to truly &lt;em&gt;recover&lt;/em&gt;. Removing unwinding from most case meanwhile has a number of benefits, allowing us to extend the type system in interesting and potentially very impactful ways. It also removes a common source of subtle bugs. Note that I am not saying we should remove unwinding entirely: that’s not an option, both because of stability and because of Rust’s mission to “deeply integrate” with all kinds of languages and systems.&lt;/p&gt;</description></item><item><title>Sized, DynSized, and Unsized</title><link>https://smallcultfollowing.com/babysteps/blog/2024/04/23/dynsized-unsized/</link><pubDate>Tue, 23 Apr 2024 16:51:54 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2024/04/23/dynsized-unsized/</guid><description>&lt;p&gt;&lt;a href="https://rust-lang.github.io/rfcs/1861-extern-types.html"&gt;Extern types&lt;/a&gt; have been blocked for an unreasonably long time on a fairly narrow, specialized question: Rust today divides all types into two categories — &lt;em&gt;sized&lt;/em&gt;, whose size can be statically computed, and &lt;em&gt;unsized&lt;/em&gt;, whose size can only be computed at runtime. But for external types what we really want is a &lt;em&gt;third category&lt;/em&gt;, types whose size can never be known, even at runtime (in C, you can model this by defining structs with an unknown set of fields). The problem is that Rust’s &lt;code&gt;?Sized&lt;/code&gt; notation does not naturally scale to this third case. I think it’s time we fixed this. At some point I read a proposal — I no longer remember where — that seems like the obvious way forward and which I think is a win on several levels. So I thought I would take a bit of time to float the idea again, explain the tradeoffs I see with it, and explain why I think the idea is a good change.&lt;/p&gt;</description></item><item><title>Ownership in Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2024/04/05/ownership-in-rust/</link><pubDate>Fri, 05 Apr 2024 12:22:59 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2024/04/05/ownership-in-rust/</guid><description>&lt;p&gt;Ownership is an important concept in Rust — but I’m not talking about the type system. I’m talking about in our open source project. One of the big failure modes I’ve seen in the Rust community, especially lately, is the feeling that it’s unclear who is entitled to make decisions. Over the last six months or so, I’ve been developing a &lt;a href="https://hackmd.io/@nikomatsakis/ByFkzn_10"&gt;project goals proposal&lt;/a&gt;, which is an attempt to reinvigorate Rust’s roadmap process — and a key part of this is the idea of giving each goal an &lt;strong&gt;owner&lt;/strong&gt;. I wanted to write a post just exploring this idea of being an owner: what it means and what it doesn’t.&lt;/p&gt;</description></item><item><title>Borrow checking without lifetimes</title><link>https://smallcultfollowing.com/babysteps/blog/2024/03/04/borrow-checking-without-lifetimes/</link><pubDate>Mon, 04 Mar 2024 13:29:34 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2024/03/04/borrow-checking-without-lifetimes/</guid><description>&lt;p&gt;This blog post explores an alternative formulation of Rust&amp;rsquo;s type system that eschews &lt;em&gt;lifetimes&lt;/em&gt; in favor of &lt;em&gt;places&lt;/em&gt;. The TL;DR is that instead of having &lt;code&gt;'a&lt;/code&gt; represent a &lt;em&gt;lifetime&lt;/em&gt; in the code, it can represent a set of &lt;em&gt;loans&lt;/em&gt;, like &lt;code&gt;shared(a.b.c)&lt;/code&gt; or &lt;code&gt;mut(x)&lt;/code&gt;. If this sounds familiar, it should, it&amp;rsquo;s the basis for &lt;a href="https://smallcultfollowing.com/babysteps/blog/2023/09/22/polonius-part-1/"&gt;polonius&lt;/a&gt;, but reformulated as a type system instead of a static analysis. This blog post is just going to give the high-level ideas. In follow-up posts I&amp;rsquo;ll dig into how we can use this to support interior references and other advanced borrowing patterns. In terms of implementation, I&amp;rsquo;ve mocked this up a bit, but I intend to start extending &lt;a href="https://github.com/rust-lang/a-mir-formality"&gt;a-mir-formality&lt;/a&gt; to include this analysis.&lt;/p&gt;</description></item><item><title>What I'd like to see for Async Rust in 2024 🎄</title><link>https://smallcultfollowing.com/babysteps/blog/2024/01/03/async-rust-2024/</link><pubDate>Wed, 03 Jan 2024 18:01:33 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2024/01/03/async-rust-2024/</guid><description>&lt;p&gt;Well, it&amp;rsquo;s that time of year, when thoughts turn to&amp;hellip;well, Rust of course. I guess that&amp;rsquo;s every time of year. This year was a pretty big year for Rust, though I think a lot of what happened was more in the vein of &amp;ldquo;setting things up for success in 2024&amp;rdquo;. So let&amp;rsquo;s talk about 2024! I&amp;rsquo;m going to publish a series of blog posts about different aspects of Rust I&amp;rsquo;m excited about, and what I think we should be doing. To help make things concrete, I&amp;rsquo;m going to frame the 2024 by using proposed &lt;a href="https://smallcultfollowing.com/babysteps/blog/2023/11/28/project-goals/"&gt;project goals&lt;/a&gt; &amp;ndash; basically a specific piece of work I think we can get done this year. In this first post, I&amp;rsquo;ll focus on &lt;strong&gt;async Rust&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Being Rusty: Discovering Rust's design axioms</title><link>https://smallcultfollowing.com/babysteps/blog/2023/12/07/rust-design-axioms/</link><pubDate>Thu, 07 Dec 2023 08:46:19 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/12/07/rust-design-axioms/</guid><description>&lt;p&gt;To your average Joe, being &amp;ldquo;rusty&amp;rdquo; is not seen as a good thing.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; But readers of this blog know that being &lt;em&gt;R&lt;/em&gt;usty &amp;ndash; with a capitol &lt;em&gt;R&lt;/em&gt;! &amp;ndash; is, of course, something completely different! So what is that makes Rust &lt;em&gt;Rust&lt;/em&gt;? Our slogans articulate key parts of it, like &lt;em&gt;fearless concurrency&lt;/em&gt;, &lt;em&gt;stability without stagnation&lt;/em&gt;, or the epic &lt;em&gt;Hack without fear&lt;/em&gt;. And there is of course Lindsey Kuper&amp;rsquo;s &lt;a href="https://www.youtube.com/watch?t=52&amp;amp;v=DSR7EHeySlw&amp;amp;feature=youtu.be"&gt;epic haiku&lt;/a&gt;: &amp;ldquo;A systems language / pursuing the trifecta: / fast, concurrent, safe&amp;rdquo;. But I feel like we&amp;rsquo;re still missing a unified set of axioms that we can refer back to over time and use to guide us as we make decisions. Some of you will remember the &lt;a href="https://github.com/nikomatsakis/rustacean-principles"&gt;Rustacean Principles&lt;/a&gt;, which was my first attempt at this. I&amp;rsquo;ve been dissatisfied with them for a couple of reasons, so I decided to try again. The structure is really different, so I&amp;rsquo;m calling it Rust&amp;rsquo;s &lt;em&gt;design axioms&lt;/em&gt;. This post documents the current state &amp;ndash; I&amp;rsquo;m quite a bit happier with it! But it&amp;rsquo;s not quite there yet. So I&amp;rsquo;ve also got a link to a &lt;a href="https://github.com/nikomatsakis/rust-design-axioms"&gt;repository&lt;/a&gt; where I&amp;rsquo;m hoping people can help improve them by opening issues with examples, counter-examples, or other thoughts.&lt;/p&gt;</description></item><item><title>Project Goals</title><link>https://smallcultfollowing.com/babysteps/blog/2023/11/28/project-goals/</link><pubDate>Tue, 28 Nov 2023 10:43:59 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/11/28/project-goals/</guid><description>&lt;p&gt;Lately I&amp;rsquo;ve been iterating on an idea I call &lt;strong&gt;project goals&lt;/strong&gt;. &lt;strong&gt;Project goals&lt;/strong&gt; are a new kind of RFC that defines a specific goal that a specific group of people hope to achieve in a specific amount of time &amp;ndash; for example, &lt;em&gt;&amp;ldquo;Rusty Spoon Corp proposes to fund 2 engineers full time to stabilize collections that support custom memory allocations by the end of 2023&amp;rdquo;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Project goals would also include asks from various teams that are needed to complete the goal. For example, &lt;em&gt;&amp;ldquo;Achieving this goal requires a dedicated reviewer from the compiler team along with an agreement from the language design team to respond to RFCs or nominated issues within 2 weeks.&amp;rdquo;&lt;/em&gt; The decision of whether to accept a goal would be up to those teams who are being asked to support it. If those teams approve the RFC, it means they agree with the goal, and also that they agree to commit those resources.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;My belief is that project goals become a kind of incremental, rolling roadmap, declaring our intent to fix specific problems and then tracking our follow-through (or lack thereof).&lt;/strong&gt; As I&amp;rsquo;ll explain in the post, I believe that a mechanism like project goals will help our morale and help us to get shit done, but I also think it&amp;rsquo;ll help with a bunch of other ancillary problems, such as providing a clearer path to get involved in Rust as well as getting more paid maintainers and contributors.&lt;/p&gt;
&lt;p&gt;At the moment, project goals are just an idea. My plan is to author some sample goals to iron out the process and then an RFC to make it official.&lt;/p&gt;</description></item><item><title>Idea: "Using Rust", a living document</title><link>https://smallcultfollowing.com/babysteps/blog/2023/10/20/using-rust/</link><pubDate>Fri, 20 Oct 2023 14:29:21 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/10/20/using-rust/</guid><description>&lt;p&gt;A few years back, the Async Wg tried something new. We collaboratively authored an &lt;a href="https://rust-lang.github.io/wg-async/vision"&gt;Async Vision Doc&lt;/a&gt;. The doc began by writing &lt;a href="https://rust-lang.github.io/wg-async/vision/submitted_stories/status_quo.html"&gt;&amp;ldquo;status quo&amp;rdquo; stories&lt;/a&gt;, written as narratives from our &lt;a href="https://rust-lang.github.io/wg-async/vision/characters.html"&gt;cast of characters&lt;/a&gt;, that described how people were experiencing Async Rust at that time and then went on to plan a &lt;a href="https://rust-lang.github.io/wg-async/vision/shiny_future.html"&gt;&amp;ldquo;shiny future&amp;rdquo;&lt;/a&gt;. This was a great experience. My impression was that authoring the &amp;ldquo;status quo&amp;rdquo; stories &lt;em&gt;in particular&lt;/em&gt; was really helpful. Discussions at EuroRust recently got me wondering: &lt;strong&gt;can we adapt the &amp;ldquo;status quo&amp;rdquo; stories to something bigger?&lt;/strong&gt; What if we could author a living document on the Rust user experience? One that captures what people are trying to do with Rust, where it is working really well for them, and where it could use improvement. I love this idea, and the more I thought about it, the more I saw opportunities to use it to improve other processes, such as planning, public communication, and RFCs. But I&amp;rsquo;m getting ahead of myself! Let&amp;rsquo;s dive in.&lt;/p&gt;</description></item><item><title>Eurorust reflections</title><link>https://smallcultfollowing.com/babysteps/blog/2023/10/14/eurorust-reflections/</link><pubDate>Sat, 14 Oct 2023 12:47:05 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/10/14/eurorust-reflections/</guid><description>&lt;p&gt;I’m on the plane back to the US from Belgium now and feeling grateful for having had the chance to speak at the &lt;a href="https://eurorust.eu"&gt;EuroRust conference&lt;/a&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;. EuroRust was the first Rust-focused conference that I’ve attended since COVID (though not the first conference overall). It was also the first Rust-focused conference that I’ve attended in Europe since…ever, from what I recall.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; Since many of us were going to be in attendance, the types team also organized an in-person meetup which took place for 3 days before the conference itself&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;. Both the meetup and the conference were great in many ways, and sparked a lot of ideas. I think I’ll be writing blog posts about them for weeks to come, but I thought that to start, I’d write up something general about the conference itself, and some of my takeaways from the experience&lt;/p&gt;</description></item><item><title>Easing tradeoffs with profiles</title><link>https://smallcultfollowing.com/babysteps/blog/2023/09/30/profiles/</link><pubDate>Sat, 30 Sep 2023 10:56:35 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/09/30/profiles/</guid><description>&lt;p&gt;Rust helps you to build reliable programs. One of the ways it does that is by surfacing things to your attention that you really ought to care about. Think of the way we handle errors with &lt;code&gt;Result&lt;/code&gt;: if some operation can fail, you can&amp;rsquo;t, ahem, fail to recognize that, because you have to account for the error case. And yet often the kinds of things you care about depend on the kind of application you are building. A classic example is memory allocation, which for many Rust apps is No Big Deal, but for others is something to be done carefully, and for still others is completely verboten. But this pattern crops up a lot. I&amp;rsquo;ve heard and like the framing of designing for &amp;ldquo;what do you have to pay attention to&amp;rdquo; &amp;ndash; Rust currently aims for a balance that errs on the side of paying attention to more things, but tries to make them easy to manage. But this post is about a speculative idea of how we could do better than that by allowing programs to declare a &lt;strong&gt;profile&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Polonius revisited, part 2</title><link>https://smallcultfollowing.com/babysteps/blog/2023/09/29/polonius-part-2/</link><pubDate>Fri, 29 Sep 2023 06:43:09 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/09/29/polonius-part-2/</guid><description>&lt;p&gt;In the &lt;a href="https://smallcultfollowing.com/babysteps/blog/2023/09/22/polonius-part-1/"&gt;previous Polonius post&lt;/a&gt;, we formulated the original borrow checker in a Polonius-like style. In this post, we are going to explore how we can extend that formulation to be flow-sensitive. In so doing, we will enable the original Polonius goals, but also overcome some of its shortcomings. I believe this formulation is also more amenable to efficient implementation. As I&amp;rsquo;ll cover at the end, though, I do find myself wondering if there&amp;rsquo;s still more room for improvement.&lt;/p&gt;</description></item><item><title>Empathy in open source: be gentle with each other</title><link>https://smallcultfollowing.com/babysteps/blog/2023/09/27/empathy-in-open-source/</link><pubDate>Wed, 27 Sep 2023 11:50:51 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/09/27/empathy-in-open-source/</guid><description>&lt;p&gt;Over the last few weeks I had been preparing a talk on “Inclusive Mentoring: Mentoring Across Differences” with one of my good friends at Amazon. Unfortunately, that talk got canceled because I came down with COVID when we were supposed to be presenting. But the themes we covered in the talk have been rattling in my brain ever since, and suddenly I’m seeing them everywhere. One of the big ones was about &lt;em&gt;empathy&lt;/em&gt; — what it is, what it isn’t, and how you can practice it. Now that I’m thinking about it, I see empathy so often in open source.&lt;/p&gt;</description></item><item><title>Polonius revisited, part 1</title><link>https://smallcultfollowing.com/babysteps/blog/2023/09/22/polonius-part-1/</link><pubDate>Fri, 22 Sep 2023 16:32:40 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/09/22/polonius-part-1/</guid><description>&lt;p&gt;&lt;a href="https://github.com/lqd/"&gt;lqd&lt;/a&gt; has been doing awesome work driving progress on &lt;a href="https://github.com/rust-lang/polonius/"&gt;polonius&lt;/a&gt;. He&amp;rsquo;s authoring an &lt;a href="https://github.com/rust-lang/blog.rust-lang.org/pull/1147"&gt;update for Inside Rust&lt;/a&gt;, but the TL;DR is that, with his latest PR, we&amp;rsquo;ve reimplemented the traditional Rust borrow checker in a more polonius-like style. We are working to iron out the last few performance hiccups and thinking about replacing the existing borrow checker with this new re-implementation, which is effectively a no-op from a user&amp;rsquo;s perspective (including from a performance perspective). This blog post walks through that work, describing how the new analysis works at a high-level. I plan to write some follow-up posts diving into how we can extend this analysis to be more precise (while hopefully remaining efficient).&lt;/p&gt;</description></item><item><title>New Layout, and now using Hugo!</title><link>https://smallcultfollowing.com/babysteps/blog/2023/09/19/new-layout/</link><pubDate>Tue, 19 Sep 2023 05:30:44 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/09/19/new-layout/</guid><description>&lt;p&gt;Some time ago I wrote about how I wanted to improve how my blog works. I recently got a spate of emails about this &amp;ndash; thanks to all of you! And a particular big thank you to Luna Razzaghipour, who went ahead and ported the blog over to use Hugo, cleaning up the layout a bit and preserving URLs. It&amp;rsquo;s much appreciated! If you notice something amiss (like a link that doesn&amp;rsquo;t work anymore), I&amp;rsquo;d be very grateful if you opened an issue on the &lt;a href="https://github.com/nikomatsakis/babysteps"&gt;babysteps github repo&lt;/a&gt;! Thanks!&lt;/p&gt;</description></item><item><title>Stability without stressing the !@#! out</title><link>https://smallcultfollowing.com/babysteps/blog/2023/09/18/stability-without-stressing-the-out/</link><pubDate>Mon, 18 Sep 2023 11:04:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/09/18/stability-without-stressing-the-out/</guid><description>&lt;p&gt;One of Rust&amp;rsquo;s core principles is &lt;a href="https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#stability-without-stagnation"&gt;&amp;ldquo;stability without stagnation&amp;rdquo;&lt;/a&gt;. This is embodied by our use of a &lt;a href="https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#choo-choo-release-channels-and-riding-the-trains"&gt;&amp;ldquo;release train&amp;rdquo;&lt;/a&gt; model, in which we issue a new release every 6 weeks. Release trains make releasing a new release a &amp;ldquo;non-event&amp;rdquo;. Feature-based releases, in contrast, are super stressful! Since they occur infrequently, people try to cram everything into that release, which inevitably makes the release late. In contrast, with a release train, it&amp;rsquo;s not so important to make any particular release &amp;ndash; if you miss one deadline, you can always catch the next one six weeks later. &lt;em&gt;That&amp;rsquo;s the theory, anyway:&lt;/em&gt; but I&amp;rsquo;ve observed that, in practice, stabilizing a feature in Rust can still be a pretty stressful process. And the more important the feature, the more stress. This blog post talks over my theories as to why this is the case, and how we can tweak our processes (and our habits) to address it.&lt;/p&gt;</description></item><item><title>Higher-ranked projections (send bound problem, part 4)</title><link>https://smallcultfollowing.com/babysteps/blog/2023/06/12/higher-ranked-projections-send-bound-problem-part-4/</link><pubDate>Mon, 12 Jun 2023 09:06:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/06/12/higher-ranked-projections-send-bound-problem-part-4/</guid><description>&lt;p&gt;I recently &lt;a href="https://rust-lang.zulipchat.com/#narrow/stream/187312-wg-async/topic/associated.20return.20types.20draft.20RFC"&gt;posted a draft of an RFC&lt;/a&gt; about &lt;a href="https://smallcultfollowing.com/babysteps/blog/2023/02/13/return-type-notation-send-bounds-part-2/"&gt;Return Type Notation&lt;/a&gt; to the async working group Zulip stream. In response, Josh Triplett reached out to me to raise some concerns. Talking to him gave rise to a 3rd idea for how to resolve the send bound problem. I still prefer RTN, but I think this idea is interesting and worth elaborating. I call it &lt;em&gt;higher-ranked projections&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id="idea-part-1-define-tfoo-when-t-has-higher-ranked-bounds"&gt;Idea part 1: Define &lt;code&gt;T::Foo&lt;/code&gt; when &lt;code&gt;T&lt;/code&gt; has higher-ranked bounds&lt;/h2&gt;
&lt;p&gt;Consider a trait like this…&lt;/p&gt;</description></item><item><title>Giving, lending, and async closures</title><link>https://smallcultfollowing.com/babysteps/blog/2023/05/09/giving-lending-and-async-closures/</link><pubDate>Tue, 09 May 2023 11:13:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/05/09/giving-lending-and-async-closures/</guid><description>&lt;p&gt;In &lt;a href="https://smallcultfollowing.com/babysteps/blog/2023/03/29/thoughts-on-async-closures/"&gt;a previous post on async closures&lt;/a&gt;, I &lt;a href="https://smallcultfollowing.com/babysteps/blog/2023/03/29/thoughts-on-async-closures/#conclusion"&gt;concluded&lt;/a&gt; that the best way to support async closures was with an &lt;code&gt;async&lt;/code&gt; trait combinator. I&amp;rsquo;ve had a few conversations since the post and I want to share some additional thoughts. In particular, this post dives into what it would take to make async functions matchable with a type like &lt;code&gt;impl FnMut() -&amp;gt; impl Future&amp;lt;Output = bool&amp;gt;&lt;/code&gt;. This takes us down some interesting roads, in particular the distinction between giving and lending traits; it turns out that the closure traits specifically are a bit of a special case in turns of what we can do backwards compatibly, due to their special syntax. on!&lt;/p&gt;</description></item><item><title>Fix my blog, please</title><link>https://smallcultfollowing.com/babysteps/blog/2023/04/03/fix-my-blog-please/</link><pubDate>Mon, 03 Apr 2023 08:38:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/04/03/fix-my-blog-please/</guid><description>&lt;p&gt;It&amp;rsquo;s well known that my blog has some issues. The category links don&amp;rsquo;t work. It renders oddly on mobile. And maybe Safari, too? The Rust snippets are not colored. The RSS feed is apparently not advertised properly in the metadata. It&amp;rsquo;s published via a makefile instead of some hot-rod CI/CD script, and it uses jekyll instead of whatever the new hotness is.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Being a programmer, you&amp;rsquo;d think I could fix this, but I am intimidated by HTML, CSS, and Github Actions. Hence this call for help: &lt;strong&gt;I&amp;rsquo;d like to hire someone to &amp;ldquo;tune up&amp;rdquo; the blog, a combination of fixing the underlying setup and also the visual layout.&lt;/strong&gt; This post will be a rough set of things I have in mind, but I&amp;rsquo;m open to suggestions. If you think you&amp;rsquo;d be up for the job, read on.&lt;/p&gt;</description></item><item><title>Thoughts on async closures</title><link>https://smallcultfollowing.com/babysteps/blog/2023/03/29/thoughts-on-async-closures/</link><pubDate>Wed, 29 Mar 2023 11:41:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/03/29/thoughts-on-async-closures/</guid><description>&lt;p&gt;I&amp;rsquo;ve been thinking about async closures and how they could work once we have static async fn in trait. Somewhat surprisingly to me, I found that async closures are a strong example for where &lt;a href="https://smallcultfollowing.com/babysteps/blog/2023/03/03/trait-transformers-send-bounds-part-3/"&gt;async transformers&lt;/a&gt; could be an important tool. Let&amp;rsquo;s dive in! We&amp;rsquo;re going to start with the problem, then show why modeling async closures as &amp;ldquo;closures that return futures&amp;rdquo; would require some deep lifetime magic, and finally circle back to how async transformers can make all this &amp;ldquo;just work&amp;rdquo; in a surprisingly natural way.&lt;/p&gt;</description></item><item><title>Must move types</title><link>https://smallcultfollowing.com/babysteps/blog/2023/03/16/must-move-types/</link><pubDate>Thu, 16 Mar 2023 18:32:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/03/16/must-move-types/</guid><description>&lt;p&gt;Rust has lots of mechanisms that prevent you from doing something bad. But, right now, it has NO mechanisms that force you to do something &lt;em&gt;good&lt;/em&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;. I’ve been thinking lately about what it would mean to add “must move” types to the language. This is an idea that I’ve long resisted, because it represents a fundamental increase to complexity. But lately I’m seeing more and more problems that it would help to address, so I wanted to try and think what it might look like, so we can better decide if it&amp;rsquo;s a good idea.&lt;/p&gt;</description></item><item><title>Temporary lifetimes</title><link>https://smallcultfollowing.com/babysteps/blog/2023/03/15/temporary-lifetimes/</link><pubDate>Wed, 15 Mar 2023 14:22:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/03/15/temporary-lifetimes/</guid><description>&lt;p&gt;In &lt;a href="https://github.com/rust-lang/lang-team/blob/master/design-meeting-minutes/2023-03-15-temporary-lifetimes.md"&gt;today&amp;rsquo;s lang team design meeting&lt;/a&gt;, we reviewed a doc I wrote about temporary lifetimes in Rust. The current rules were &lt;a href="http://smallcultfollowing.com/babysteps/blog/2014/01/09/rvalue-lifetimes-in-rust/"&gt;established in a blog post I wrote in 2014&lt;/a&gt;. Almost a decade later, we&amp;rsquo;ve seen that they have some rough edges, and in particular can be a common source of bugs for people. The Rust 2024 Edition gives us a chance to address some of those rough edges. This blog post is a copy of the document that the lang team reviewed. It&amp;rsquo;s not a &lt;em&gt;proposal&lt;/em&gt;, but it covers some of what works well and what doesn&amp;rsquo;t, and includes a few sketchy ideas towards what we could do better.&lt;/p&gt;</description></item><item><title>To async trait or just to trait</title><link>https://smallcultfollowing.com/babysteps/blog/2023/03/12/to-async-trait-or-just-to-trait/</link><pubDate>Sun, 12 Mar 2023 19:33:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/03/12/to-async-trait-or-just-to-trait/</guid><description>&lt;p&gt;One interesting question about async fn in traits is whether or not we should label the &lt;em&gt;trait itself&lt;/em&gt; as async. Until recently, I didn’t see any need for that. But as we discussed the question of how to enable “maybe async” code, we realized that there would be some advantages to distinguishing “async traits” (which could contain async functions) from sync traits (which could not). However, as I’ve thought about the idea more, I’m more and more of the mind that we should not take this step — at least not now. I wanted to write a blog post divin g into the considerations as I see them now.&lt;/p&gt;</description></item><item><title>Trait transformers (send bounds, part 3)</title><link>https://smallcultfollowing.com/babysteps/blog/2023/03/03/trait-transformers-send-bounds-part-3/</link><pubDate>Fri, 03 Mar 2023 09:39:00 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/03/03/trait-transformers-send-bounds-part-3/</guid><description>&lt;p&gt;I previously introduced &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2023/02/01/async-trait-send-bounds-part-1-intro/"&gt;the &amp;ldquo;send bound&amp;rdquo; problem&lt;/a&gt;, which refers to the need to add a &lt;code&gt;Send&lt;/code&gt; bound to the future returned by an async function. This post continues my tour over the various solutions that are available. This post covers &amp;ldquo;Trait Transformers&amp;rdquo;. This proposal arose from a joint conversation with myself, Eric Holk, Yoshua Wuyts, Oli Scherer, and Tyler Mandry. It&amp;rsquo;s a variant of Eric Holk&amp;rsquo;s &lt;a href="https://blog.theincredibleholk.org/blog/2023/02/13/inferred-async-send-bounds/"&gt;inferred async send bounds&lt;/a&gt; proposal as well as the work that Yosh/Oli have been doing in the &lt;a href="https://blog.rust-lang.org/inside-rust/2023/02/23/keyword-generics-progress-report-feb-2023.html"&gt;keyword generics&lt;/a&gt; group. Those posts are worth reading as well, lots of good ideas there.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;</description></item><item><title>Return type notation (send bounds, part 2)</title><link>https://smallcultfollowing.com/babysteps/blog/2023/02/13/return-type-notation-send-bounds-part-2/</link><pubDate>Mon, 13 Feb 2023 11:14:00 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/02/13/return-type-notation-send-bounds-part-2/</guid><description>&lt;p&gt;In the &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2023/02/01/async-trait-send-bounds-part-1-intro/"&gt;previous post&lt;/a&gt;, I introduced the “send bound” problem, which refers to the need to add a &lt;code&gt;Send&lt;/code&gt; bound to the future returned by an async function. I want to start talking about some of the ideas that have been floating around for how to solve this problem. I consider this a bit of an open problem, in that I think we know a lot of the ingredients, but there is a bit of a “delicate balance” to finding the right syntax and so forth. To start with, though, I want to introduce Return Type Notation, which is an idea that Tyler Mandry and I came up with for referring to the type returned by a trait method.&lt;/p&gt;</description></item><item><title>Async trait send bounds, part 1: intro</title><link>https://smallcultfollowing.com/babysteps/blog/2023/02/01/async-trait-send-bounds-part-1-intro/</link><pubDate>Wed, 01 Feb 2023 08:06:00 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/02/01/async-trait-send-bounds-part-1-intro/</guid><description>&lt;p&gt;Nightly Rust now has &lt;a href="https://blog.rust-lang.org/inside-rust/2022/11/17/async-fn-in-trait-nightly.html"&gt;support for async functions in traits&lt;/a&gt;, so long as you limit yourself to static dispatch. That’s super exciting! And yet, for many users, this support won’t yet meet their needs. One of the problems we need to resolve is how users can conveniently specify when they need an async function to return a &lt;code&gt;Send&lt;/code&gt; future. This post covers some of the background on send futures, why we don&amp;rsquo;t want to adopt the solution from the &lt;code&gt;async_trait&lt;/code&gt; crate for the language, and the general direction we would like to go. Follow-up posts will dive into specific solutions.&lt;/p&gt;</description></item><item><title>Rust in 2023: Growing up</title><link>https://smallcultfollowing.com/babysteps/blog/2023/01/20/rust-in-2023-growing-up/</link><pubDate>Fri, 20 Jan 2023 08:08:00 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2023/01/20/rust-in-2023-growing-up/</guid><description>&lt;p&gt;When I started working on Rust in 2011, my daughter was about three months old. She’s now in sixth grade, and she’s started growing rapidly. Sometimes we wake up to find that her clothes don’t quite fit anymore: the sleeves might be a little too short, or the legs come up to her ankles. Rust is experiencing something similar. We’ve been growing tremendously fast over the last few years, and any time you experience growth like that, there are bound to be a few rough patches. Things that don’t work as well as they used to. This holds both in a technical sense — there are parts of the language that don’t seem to scale up to Rust’s current size — and in a social one — some aspects of how the projects runs need to change if we’re going to keep growing the way I think we should. As we head into 2023, with two years to go until the Rust 2024 edition, this is the theme I see for Rust: &lt;strong&gt;maturation and scaling&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Rust 2024...the year of everywhere?</title><link>https://smallcultfollowing.com/babysteps/blog/2022/09/22/rust-2024-the-year-of-everywhere/</link><pubDate>Thu, 22 Sep 2022 15:51:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2022/09/22/rust-2024-the-year-of-everywhere/</guid><description>&lt;p&gt;I’ve been thinking about what “Rust 2024” will look like lately. I don’t really mean the edition itself — but more like, what will Rust feel like after we’ve finished up the next few years of work? I think the answer is that Rust 2024 is going to be the year of “everywhere”. Let me explain what I mean. Up until now, Rust has had a lot of nice features, but they only work &lt;em&gt;sometimes&lt;/em&gt;. By the time 2024 rolls around, they’re going to work &lt;em&gt;everywhere&lt;/em&gt; that you want to use them, and I think that’s going to make a big difference in how Rust feels.&lt;/p&gt;</description></item><item><title>Dyn async traits, part 9: call-site selection</title><link>https://smallcultfollowing.com/babysteps/blog/2022/09/21/dyn-async-traits-part-9-callee-site-selection/</link><pubDate>Wed, 21 Sep 2022 17:35:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2022/09/21/dyn-async-traits-part-9-callee-site-selection/</guid><description>&lt;p&gt;After my last post on dyn async traits, some folks pointed out that I was overlooking a seemingly obvious possibility. Why not have the choice of how to manage the future be made at the call site? It&amp;rsquo;s true, I had largely dismissed that alternative, but it&amp;rsquo;s worth consideration. This post is going to explore what it would take to get call-site-based dispatch working, and what the ergonomics might look like. I think it&amp;rsquo;s actually fairly appealing, though it has some limitations.&lt;/p&gt;</description></item><item><title>What I meant by the "soul of Rust"</title><link>https://smallcultfollowing.com/babysteps/blog/2022/09/19/what-i-meant-by-the-soul-of-rust/</link><pubDate>Mon, 19 Sep 2022 10:15:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2022/09/19/what-i-meant-by-the-soul-of-rust/</guid><description>&lt;p&gt;Re-reading my &lt;a href="https://smallcultfollowing.com/babysteps/blog/2022/09/18/dyn-async-traits-part-8-the-soul-of-rust/"&gt;previous post&lt;/a&gt;, I felt I should clarify why I called it the “soul of Rust”. The soul of Rust, to my mind, is definitely &lt;strong&gt;not&lt;/strong&gt; being explicit about allocation. Rather, it’s about the struggle between a few key values — especially &lt;em&gt;productivity&lt;/em&gt; and &lt;em&gt;versatility&lt;/em&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; in tension with &lt;em&gt;transparency&lt;/em&gt;. Rust’s goal has always been to &lt;em&gt;feel&lt;/em&gt; like a high-level but with the performance and control of a &lt;em&gt;low-level&lt;/em&gt; one. Oftentimes, we are able to find a &lt;a href="https://smallcultfollowing.com/babysteps/blog/2019/04/19/aic-adventures-in-consensus/"&gt;“third way” that removes the tradeoff&lt;/a&gt;, solving both goals pretty well. But finding those “third ways” takes time — and sometimes we just have to accept a certain hit to one value or another for the time being to make progress. It’s exactly at these times, when we have to make a difficult call, that questions about the “soul of Rust” starts to come into play. I’ve been thinking about this a lot, so I thought I would write a post that expands on the role of transparency in Rust, and some of the tensions that arise around it.&lt;/p&gt;</description></item><item><title>Dyn async traits, part 8: the soul of Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2022/09/18/dyn-async-traits-part-8-the-soul-of-rust/</link><pubDate>Sun, 18 Sep 2022 13:49:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2022/09/18/dyn-async-traits-part-8-the-soul-of-rust/</guid><description>&lt;p&gt;In the last few months, Tyler Mandry and I have been circulating a &lt;a href="https://hackmd.io/@nikomatsakis/SJ2-az7sc"&gt;“User’s Guide from the Future”&lt;/a&gt; that describes our current proposed design for async functions in traits. In this blog post, I want to deep dive on one aspect of that proposal: how to handle dynamic dispatch. My goal here is to explore the space a bit and also to address one particularly tricky topic: how explicit do we have to be about the possibility of allocation? This is a tricky topic, and one that gets at that core question: what is the soul of Rust?&lt;/p&gt;</description></item><item><title>Come contribute to Salsa 2022!</title><link>https://smallcultfollowing.com/babysteps/blog/2022/08/18/come-contribute-to-salsa-2022/</link><pubDate>Thu, 18 Aug 2022 19:47:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2022/08/18/come-contribute-to-salsa-2022/</guid><description>&lt;p&gt;Have you heard of the &lt;a href="https://github.com/salsa-rs/salsa"&gt;Salsa&lt;/a&gt; project? &lt;strong&gt;Salsa&lt;/strong&gt; is a library for incremental computation &amp;ndash; it&amp;rsquo;s used by rust-analyzer, for example, to stay responsive as you type into your IDE (we have also &lt;a href="https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bsteering.20meeting.5D.202022-04-15.20compiler-team.23507/near/279082491"&gt;discussed using it in rustc&lt;/a&gt;, though more work is needed there). We are in the midst of a big push right now to develop and release &lt;strong&gt;Salsa 2022&lt;/strong&gt;, a major new revision to the API that will make Salsa far more natural to use. I&amp;rsquo;m writing this blog post both to advertise that ongoing work and to put out a &lt;strong&gt;call for contribution&lt;/strong&gt;. Salsa doesn&amp;rsquo;t yet have a large group of maintainers, and I would like to fix that. If you&amp;rsquo;ve been looking for an open source project to try and get involved in, maybe take a look at our &lt;a href="https://github.com/salsa-rs/salsa/issues/305"&gt;Salsa 2022 tracking issue&lt;/a&gt; and see if there is an issue you&amp;rsquo;d like to tackle?&lt;/p&gt;</description></item><item><title>Many modes: a GATs pattern</title><link>https://smallcultfollowing.com/babysteps/blog/2022/06/27/many-modes-a-gats-pattern/</link><pubDate>Mon, 27 Jun 2022 10:00:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2022/06/27/many-modes-a-gats-pattern/</guid><description>&lt;p&gt;As some of you may know, on May 4th &lt;a href="https://github.com/jackh726/"&gt;Jack Huey&lt;/a&gt; opened a &lt;a href="https://github.com/rust-lang/rust/pull/96709"&gt;PR to stabilize an initial version of generic associated types&lt;/a&gt;. The current version is at best an MVP: the compiler support is limited, resulting in unnecessary errors, and the syntax is limited, making code that uses GATs much more verbose than I&amp;rsquo;d like. Nonetheless, I&amp;rsquo;m super excited, since GATs unlock a lot of interesting use cases, and we can continue to smooth out the rough edges over time. However, folks on the thread have raised some &lt;a href="https://github.com/rust-lang/rust/pull/96709#issuecomment-1129311660"&gt;strong concerns about GAT stabilization&lt;/a&gt;, including asking whether GATs are worth including in the language at all. The fear is that they make Rust the language too complex, and that it would be better to just use them as an internal building block for other, more accessible features (like async functions and [return position impl trait in traits][RPITIT]). In response to this concern, a number of people have posted about how they are using GATs. I recently took some time to deep dive into these comments and to write about some of the patterns that I found there, including a pattern I am calling the &amp;ldquo;many modes&amp;rdquo; pattern, which comes from the &lt;a href="https://github.com/zesterer/chumsky/"&gt;chumsky&lt;/a&gt; parser combinator library. I posted about this pattern &lt;a href="https://github.com/rust-lang/rust/pull/96709#issuecomment-1167220240"&gt;on the thread&lt;/a&gt;, but I thought I would cross-post my write-up here to the blog as well, because I think it&amp;rsquo;s of general interest.&lt;/p&gt;</description></item><item><title>What it feels like when Rust saves your bacon</title><link>https://smallcultfollowing.com/babysteps/blog/2022/06/15/what-it-feels-like-when-rust-saves-your-bacon/</link><pubDate>Wed, 15 Jun 2022 19:34:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2022/06/15/what-it-feels-like-when-rust-saves-your-bacon/</guid><description>&lt;p&gt;You&amp;rsquo;ve probably heard that the Rust type checker can be a great &amp;ldquo;co-pilot&amp;rdquo;, helping you to avoid subtle bugs that would have been a royal pain in the !@#!$! to debug. This is truly awesome! But what you may not realize is how it feels &lt;em&gt;in the moment&lt;/em&gt; when this happens. The answer typically is: &lt;strong&gt;really, really frustrating!&lt;/strong&gt; Usually, you are trying to get some code to compile and you find you just can&amp;rsquo;t do it.&lt;/p&gt;</description></item><item><title>Async cancellation: a case study of pub-sub in mini-redis</title><link>https://smallcultfollowing.com/babysteps/blog/2022/06/13/async-cancellation-a-case-study-of-pub-sub-in-mini-redis/</link><pubDate>Mon, 13 Jun 2022 15:15:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2022/06/13/async-cancellation-a-case-study-of-pub-sub-in-mini-redis/</guid><description>&lt;p&gt;Lately I’ve been diving deep into tokio’s &lt;a href="https://github.com/tokio-rs/mini-redis"&gt;mini-redis&lt;/a&gt; example. The mini-redis example is a great one to look at because it&amp;rsquo;s a realistic piece of quality async Rust code that is both self-contained and very well documented. Digging into mini-redis, I found that it exemplifies the best and worst of async Rust. On the one hand, the code itself is clean, efficient, and high-level. On the &lt;em&gt;other hand&lt;/em&gt;, it relies on a number of subtle async conventions that can easily be done wrong &amp;ndash; worse, if you do them wrong, you won&amp;rsquo;t get a compilation error, and your code will &amp;ldquo;mostly work&amp;rdquo;, breaking only in unpredictable timing conditions that are unlikely to occur in unit tests. Just the kind of thing Rust tries to avoid! This isn&amp;rsquo;t the fault of mini-redis &amp;ndash; to my knowledge, there aren&amp;rsquo;t great alterantive patterns available in async Rust today (I go through some of the alternatives in this post, and their downsides).&lt;/p&gt;</description></item><item><title>Coherence and crate-level where-clauses</title><link>https://smallcultfollowing.com/babysteps/blog/2022/04/17/coherence-and-crate-level-where-clauses/</link><pubDate>Sun, 17 Apr 2022 12:31:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2022/04/17/coherence-and-crate-level-where-clauses/</guid><description>&lt;p&gt;Rust has been wrestling with coherence more-or-less since we added methods; our current rule, the “orphan rule”, is safe but overly strict. Roughly speaking, the rule says that one can only implement foreign traits (that is, traits defined by one of your dependencies) for local types (that is, types that you define). The goal of this rule was to help foster the crates.io ecosystem — we wanted to ensure that you could grab any two crates and use them together, without worrying that they might define incompatible impls that can’t be combined. The rule has served us well in that respect, but over time we’ve seen that it can also have a kind of chilling effect, unintentionally working &lt;strong&gt;against&lt;/strong&gt; successful composition of crates in the ecosystem. For this reason, I’ve come to believe that we will have to weaken the orphan rule. The purpose of this post is to write out some preliminary exploration of ways that we might do that.&lt;/p&gt;</description></item><item><title>Implied bounds and perfect derive</title><link>https://smallcultfollowing.com/babysteps/blog/2022/04/12/implied-bounds-and-perfect-derive/</link><pubDate>Tue, 12 Apr 2022 17:48:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2022/04/12/implied-bounds-and-perfect-derive/</guid><description>&lt;p&gt;There are two ergonomic features that have been discussed for quite some time in Rust land: &lt;em&gt;perfect derive&lt;/em&gt; and &lt;em&gt;expanded implied bounds&lt;/em&gt;. Until recently, we were a bit stuck on the best way to implement them. Recently though I’ve been working on a new formulation of the Rust trait checker that gives us a bunch of new capabilities — among them, it resolved a soundness formulation that would have prevented these two features from being combined. I’m not going to describe my fix in detail in this post, though; instead, I want to ask a different question. Now that we &lt;em&gt;can&lt;/em&gt; implement these features, should we?&lt;/p&gt;</description></item><item><title>dyn*: can we make dyn sized?</title><link>https://smallcultfollowing.com/babysteps/blog/2022/03/29/dyn-can-we-make-dyn-sized/</link><pubDate>Tue, 29 Mar 2022 05:32:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2022/03/29/dyn-can-we-make-dyn-sized/</guid><description>&lt;p&gt;Last Friday, tmandry, cramertj, and I had an exciting conversation. We were talking about the design for combining async functions in traits with &lt;code&gt;dyn Trait&lt;/code&gt; that tmandry and I had presented to the lang team on Friday. cramertj had an insightful twist to offer on that design, and I want to talk about it here. Keep in mind that this is a piece of &amp;ldquo;hot off the presses&amp;rdquo;, in-progress design and hence may easily go nowhere &amp;ndash; but at the same time, I&amp;rsquo;m pretty excited about it. If it works out, it could go a long way towards making &lt;code&gt;dyn Trait&lt;/code&gt; user-friendly and accessible in Rust, which I think would be a big deal.&lt;/p&gt;</description></item><item><title>Dare to ask for more #rust2024</title><link>https://smallcultfollowing.com/babysteps/blog/2022/02/09/dare-to-ask-for-more-rust2024/</link><pubDate>Wed, 09 Feb 2022 14:52:00 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2022/02/09/dare-to-ask-for-more-rust2024/</guid><description>&lt;p&gt;Last year, we shipped &lt;a href="https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html"&gt;Rust 2021&lt;/a&gt; and I have found the changes to be a real improvement in usability. Even though the actual changes themselves were quite modest, the combination of &lt;a href="https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html"&gt;precise capture closure&lt;/a&gt; and &lt;a href="https://doc.rust-lang.org/edition-guide/rust-2021/panic-macro-consistency.html"&gt;simpler formatting strings&lt;/a&gt; (&lt;code&gt;println!(&amp;quot;{x:?}&amp;quot;)&lt;/code&gt; instead of &lt;code&gt;println!(&amp;quot;{:?}&amp;quot;, x)&lt;/code&gt;) is making a real difference in my &amp;ldquo;day to day&amp;rdquo; life.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Just like &lt;a href="http://blog.pnkfx.org/blog/2019/06/26/breaking-news-non-lexical-lifetimes-arrives-for-everyone/"&gt;NLL&lt;/a&gt; and the &lt;a href="https://doc.rust-lang.org/nightly/edition-guide/rust-2018/path-changes.html"&gt;new module system&lt;/a&gt; from &lt;a href="https://doc.rust-lang.org/edition-guide/rust-2018/index.html"&gt;Rust 2018&lt;/a&gt;, I&amp;rsquo;ve quickly adapted to these new conventions. When I go back to older code, with its clunky borrow checker workarounds and format strings, I die a little inside.&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;</description></item><item><title>Panics vs cancellation, part 1</title><link>https://smallcultfollowing.com/babysteps/blog/2022/01/27/panics-vs-cancellation-part-1/</link><pubDate>Thu, 27 Jan 2022 15:55:00 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2022/01/27/panics-vs-cancellation-part-1/</guid><description>&lt;p&gt;One of the things people often complain about when doing Async Rust is cancellation. This has always been a bit confusing to me, because it seems to me that async cancellation should feel a lot like panics in practice, and people don&amp;rsquo;t complain about panics very often (though they do sometimes). This post is the start of a short series comparing panics and cancellation, seeking after the answer to the question &amp;ldquo;Why is async cancellation a pain point and what should we do about it?&amp;rdquo; This post focuses on explaining Rust&amp;rsquo;s &lt;em&gt;panic philosophy&lt;/em&gt; and explaining why I see panics and cancellation as being quite analogous to one another.&lt;/p&gt;</description></item><item><title>Dyn async traits, part 7: a design emerges?</title><link>https://smallcultfollowing.com/babysteps/blog/2022/01/07/dyn-async-traits-part-7/</link><pubDate>Fri, 07 Jan 2022 19:37:00 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2022/01/07/dyn-async-traits-part-7/</guid><description>&lt;p&gt;Hi all! Welcome to 2022! Towards the end of last year, Tyler Mandry and I were doing a lot of iteration around supporting &amp;ldquo;dyn async trait&amp;rdquo; &amp;ndash; i.e., making traits that use &lt;code&gt;async fn&lt;/code&gt; dyn safe &amp;ndash; and we&amp;rsquo;re starting to feel pretty good about our design. This is the start of several blog posts talking about where we&amp;rsquo;re at. In this first post, I&amp;rsquo;m going to reiterate our goals and give a high-level outline of the design. The next few posts will dive more into the details and the next steps.&lt;/p&gt;</description></item><item><title>Rustc Reading Club, Take 2</title><link>https://smallcultfollowing.com/babysteps/blog/2021/11/18/rustc-reading-club-take-2/</link><pubDate>Thu, 18 Nov 2021 12:49:00 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/11/18/rustc-reading-club-take-2/</guid><description>&lt;p&gt;&lt;img src="https://miro.medium.com/max/850/1*T__f3-PmPA5TDDoPW_uX3A.png" width="222" style="float:left;"/&gt; Wow! The response to the last Rustc Reading Club was overwhelming &amp;ndash; literally! We maxed out the number of potential zoom attendees and I couldn&amp;rsquo;t even join the call! It&amp;rsquo;s clear that there&amp;rsquo;s a lot of demand here, which is great. We&amp;rsquo;ve decided to take another stab at running the Rustc Reading Club, but we&amp;rsquo;re going to try it a bit differently this time. We&amp;rsquo;re going to start by selecting a smaller group to do it a few times and see how it goes, and then decide how to scale up.&lt;/p&gt;</description></item><item><title>CTCFT 2021-11-22 Agenda</title><link>https://smallcultfollowing.com/babysteps/blog/2021/11/15/ctcft-2021-11-22-agenda/</link><pubDate>Mon, 15 Nov 2021 10:19:00 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/11/15/ctcft-2021-11-22-agenda/</guid><description>&lt;p&gt;The next &lt;a href="https://rust-ctcft.github.io/ctcft/"&gt;&amp;ldquo;Cross Team Collaboration Fun Times&amp;rdquo; (CTCFT)&lt;/a&gt; meeting will take place next Monday, on 2021-11-22 at &lt;strong&gt;11am US Eastern Time&lt;/strong&gt; (&lt;a href="https://everytimezone.com/s/91c9791f"&gt;click to see in your time zone&lt;/a&gt;). &lt;strong&gt;Note that this is a new time:&lt;/strong&gt; we are experimenting with rotating in an earlier time that occurs during the European workday. This post covers the agenda. You’ll find the full details (along with a calendar event, zoom details, etc) &lt;a href="https://rust-ctcft.github.io/ctcft/meetings/2021-11-22.html"&gt;on the CTCFT website&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>View types for Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2021/11/05/view-types/</link><pubDate>Fri, 05 Nov 2021 11:37:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/11/05/view-types/</guid><description>&lt;p&gt;I wanted to write about an idea that&amp;rsquo;s been kicking around in the back of my mind for some time. I call it &lt;em&gt;view types&lt;/em&gt;. The basic idea is to give a way for an &lt;code&gt;&amp;amp;mut&lt;/code&gt; or &lt;code&gt;&amp;amp;&lt;/code&gt; reference to identify which fields it is actually going to access. The main use case for this is having &amp;ldquo;disjoint&amp;rdquo; methods that don&amp;rsquo;t interfere with one another.&lt;/p&gt;
&lt;h3 id="this-is-not-a-proposal-yet"&gt;This is not a proposal (yet?)&lt;/h3&gt;
&lt;p&gt;To be clear, this isn&amp;rsquo;t an RFC or a proposal, at least not yet. It&amp;rsquo;s some early stage ideas that I wanted to document. I&amp;rsquo;d love to hear reactions and thoughts, as I discuss in the conclusion.&lt;/p&gt;</description></item><item><title>Rustc Reading Club</title><link>https://smallcultfollowing.com/babysteps/blog/2021/10/28/rustc-reading-club/</link><pubDate>Thu, 28 Oct 2021 10:01:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/10/28/rustc-reading-club/</guid><description>&lt;p&gt;Ever wanted to understand how rustc works? Me too! &lt;a href="https://github.com/doc-jones"&gt;Doc Jones&lt;/a&gt; and I have been talking and we had an idea we wanted to try. Inspired by the very cool &lt;a href="https://code-reading.org/"&gt;Code Reading Club&lt;/a&gt;, we are launching an experimental &lt;a href="https://github.com/rust-lang/rustc-reading-club"&gt;Rustc Reading Club&lt;/a&gt;. Doc Jones posted an &lt;a href="https://mojosd.medium.com/rust-code-reading-club-8fe356287049?source=social.tw"&gt;announcement on her blog&lt;/a&gt;, so go take a look!&lt;/p&gt;
&lt;p&gt;The way this club works is pretty simple: every other week, we&amp;rsquo;ll get together for 90 minutes and read some part of rustc (or some project related to rustc), and talk about it. Our goal is to walk away with a high-level understanding of how that code works. For more complex parts of the code, we may wind up spending multiple sessions on the same code.&lt;/p&gt;</description></item><item><title>Dyn async traits, part 6</title><link>https://smallcultfollowing.com/babysteps/blog/2021/10/15/dyn-async-traits-part-6/</link><pubDate>Fri, 15 Oct 2021 15:57:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/10/15/dyn-async-traits-part-6/</guid><description>&lt;p&gt;A quick update to my last post: first, a better way to do what I was trying to do, and second, a sketch of the crate I&amp;rsquo;d like to see for experimental purposes.&lt;/p&gt;
&lt;h2 id="an-easier-way-to-roll-our-own-boxed-dyn-traits"&gt;An easier way to roll our own boxed dyn traits&lt;/h2&gt;
&lt;p&gt;In the previous post I covered how you could create vtables and pair the up with a data pointer to kind of &amp;ldquo;roll your own dyn&amp;rdquo;. After I published the post, though, dtolnay sent me &lt;a href="https://play.rust-lang.org/?version=nightly&amp;amp;mode=debug&amp;amp;edition=2018&amp;amp;gist=adba43d6e056337cd8a297624a296219"&gt;this Rust playground link&lt;/a&gt; to show me a much better approach, one based on the &lt;a href="https://crates.io/crates/erased-serde"&gt;erased-serde&lt;/a&gt; crate. The idea is that instead of make a &amp;ldquo;vtable struct&amp;rdquo; with a bunch of fn pointers, we create a &amp;ldquo;shadow trait&amp;rdquo; that reflects the contents of that vtable:&lt;/p&gt;</description></item><item><title>Dyn async traits, part 5</title><link>https://smallcultfollowing.com/babysteps/blog/2021/10/14/dyn-async-traits-part-5/</link><pubDate>Thu, 14 Oct 2021 13:46:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/10/14/dyn-async-traits-part-5/</guid><description>&lt;p&gt;If you’re willing to use nightly, you can already model async functions in traits by using GATs and impl Trait — this is what the &lt;a href="https://github.com/embassy-rs/embassy"&gt;Embassy&lt;/a&gt; async runtime does, and it’s also what the &lt;a href="https://crates.io/crates/real-async-trait"&gt;real-async-trait&lt;/a&gt; crate does. One shortcoming, though, is that your trait doesn’t support dynamic dispatch. In the previous posts of this series, I have been exploring some of the reasons for that limitation, and what kind of primitive capabilities need to be exposed in the language to overcome it. My thought was that we could try to stabilize those primitive capabilities with the plan of enabling experimentation. I am still in favor of this plan, but I realized something yesterday: &lt;strong&gt;using procedural macros, you can ALMOST do this experimentation today!&lt;/strong&gt; Unfortunately, it doesn&amp;rsquo;t quite work owing to some relatively obscure rules in the Rust type system (perhaps some clever readers will find a workaround; that said, these are rules I have wanted to change for a while).&lt;/p&gt;</description></item><item><title>CTCFT 2021-10-18 Agenda</title><link>https://smallcultfollowing.com/babysteps/blog/2021/10/13/ctcft-2021-10-18-agenda/</link><pubDate>Wed, 13 Oct 2021 17:13:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/10/13/ctcft-2021-10-18-agenda/</guid><description>&lt;p&gt;&lt;img src="https://raw.githubusercontent.com/rust-ctcft/ctcft/main/img/camprust.png" width="222" style="float:left;"/&gt; The next &lt;a href="https://rust-ctcft.github.io/ctcft/"&gt;&amp;ldquo;Cross Team Collaboration Fun Times&amp;rdquo; (CTCFT)&lt;/a&gt; meeting will take place next Monday, on 2021-10-18 (&lt;a href="https://everytimezone.com/s/b65371cd"&gt;in your time zone&lt;/a&gt;)! This post covers the agenda. You&amp;rsquo;ll find the full details (along with a calendar event, zoom details, etc) &lt;a href="https://rust-ctcft.github.io/ctcft/meetings/2021-10-18.html"&gt;on the CTCFT website&lt;/a&gt;.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
&lt;h3 id="agenda"&gt;Agenda&lt;/h3&gt;
&lt;p&gt;The theme for this meeting is exploring ways to empower and organize contributors.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;(5 min) Opening remarks 👋 (&lt;a href="https://github.com/nikomatsakis"&gt;nikomatsakis&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;(5 min) CTCFT update (&lt;a href="https://github.com/angelonfira"&gt;angelonfira&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;(20 min) Sprints and groups implementing the async vision doc (&lt;a href="https://github.com/tmandry"&gt;tmandry&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;(15 min) rust-analyzer talk (TBD)
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;rust-analyzer&lt;/code&gt; project aims to succeed RLS as the official language server for Rust. We talk about how it differs from RLS, how it is developed, and what to expect in the future.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;(10 min) Contributor survey (&lt;a href="https://github.com/yaahc"&gt;yaahc&lt;/a&gt;)
&lt;ul&gt;
&lt;li&gt;Introducing the contributor survey, it&amp;rsquo;s goals, methodology, and soliciting community feedback&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;(5 min) Closing (&lt;a href="https://github.com/nikomatsakis"&gt;nikomatsakis&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="afterwards-social-hour"&gt;Afterwards: Social hour&lt;/h3&gt;
&lt;p&gt;After the CTCFT this week, we are going to try an experimental &lt;strong&gt;social hour&lt;/strong&gt;. The hour will be coordinated in the #ctcft stream of the rust-lang Zulip. The idea is to create breakout rooms where people can gather to talk, hack together, or just chill.&lt;/p&gt;</description></item><item><title>Dyn async traits, part 4</title><link>https://smallcultfollowing.com/babysteps/blog/2021/10/07/dyn-async-traits-part-4/</link><pubDate>Thu, 07 Oct 2021 12:33:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/10/07/dyn-async-traits-part-4/</guid><description>&lt;p&gt;In the previous post, I talked about how we could write our own &lt;code&gt;impl Iterator for dyn Iterator&lt;/code&gt; by adding a few primitives. In this post, I want to look at what it would take to extend that to an async iterator trait. As before, I am interested in exploring the “core capabilities” that would be needed to make everything work.&lt;/p&gt;
&lt;h2 id="start-somewhere-just-assume-we-want-box"&gt;Start somewhere: Just assume we want Box&lt;/h2&gt;
&lt;p&gt;In the &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2021/09/30/dyn-async-traits-part-1/#conclusion-ideally-we-want-box-when-using-dyn-but-not-otherwise"&gt;first post of this series&lt;/a&gt;, we talked about how invoking an async fn through a dyn trait should to have the return type of that async fn be a &lt;code&gt;Box&amp;lt;dyn Future&amp;gt;&lt;/code&gt; — but only when calling it through a dyn type, not all the time.&lt;/p&gt;</description></item><item><title>Dyn async traits, part 3</title><link>https://smallcultfollowing.com/babysteps/blog/2021/10/06/dyn-async-traits-part-3/</link><pubDate>Wed, 06 Oct 2021 11:06:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/10/06/dyn-async-traits-part-3/</guid><description>&lt;p&gt;In the previous &amp;ldquo;dyn async traits&amp;rdquo; posts, I talked about how we can think about the compiler as synthesizing an impl that performed the dynamic dispatch. In this post, I wanted to start explore a theoretical future in which this impl was written manually by the Rust programmer. This is in part a thought exercise, but it’s also a possible ingredient for a future design: if we could give programmers more control over the “impl Trait for dyn Trait” impl, then we could enable a lot of use cases.&lt;/p&gt;</description></item><item><title>Dyn async traits, part 2</title><link>https://smallcultfollowing.com/babysteps/blog/2021/10/01/dyn-async-traits-part-2/</link><pubDate>Fri, 01 Oct 2021 11:56:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/10/01/dyn-async-traits-part-2/</guid><description>&lt;p&gt;In the &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2021/09/30/dyn-async-traits-part-1/"&gt;previous post&lt;/a&gt;, we uncovered a key challenge for &lt;code&gt;dyn&lt;/code&gt; and async traits: the fact that, in Rust today, &lt;code&gt;dyn&lt;/code&gt; types have to specify the values for all associated types. This post is going to dive into more background about how dyn traits work today, and in particular it will talk about where that limitation comes from.&lt;/p&gt;
&lt;h3 id="today-dyn-traits-implement-the-trait"&gt;Today: Dyn traits implement the trait&lt;/h3&gt;
&lt;p&gt;In Rust today, assuming you have a “dyn-safe” trait &lt;code&gt;DoTheThing &lt;/code&gt;, then the type &lt;code&gt;dyn DoTheThing &lt;/code&gt; implements &lt;code&gt;Trait&lt;/code&gt;. Consider this trait:&lt;/p&gt;</description></item><item><title>Dyn async traits, part 1</title><link>https://smallcultfollowing.com/babysteps/blog/2021/09/30/dyn-async-traits-part-1/</link><pubDate>Thu, 30 Sep 2021 10:50:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/09/30/dyn-async-traits-part-1/</guid><description>&lt;p&gt;Over the last few weeks, &lt;a href="https://github.com/tmandry/"&gt;Tyler Mandry&lt;/a&gt; and I have been digging hard into what it will take to implement async fn in traits. Per the &lt;a href="https://lang-team.rust-lang.org/initiatives.html"&gt;new lang team initiative process&lt;/a&gt;, we are collecting our design thoughts in an ever-evolving website, the &lt;a href="https://rust-lang.github.io/async-fundamentals-initiative/"&gt;async fundamentals initiative&lt;/a&gt;. If you&amp;rsquo;re interested in the area, you should definitely poke around; you may be interested to read about the &lt;a href="https://rust-lang.github.io/async-fundamentals-initiative/roadmap/mvp.html"&gt;MVP&lt;/a&gt; that we hope to stabilize first, or the (very much WIP) &lt;a href="https://rust-lang.github.io/async-fundamentals-initiative/evaluation.html"&gt;evaluation doc&lt;/a&gt; which covers some of the challenges we are still working out. I am going to be writing a series of blog posts focusing on one particular thing that we have been talking through: the &lt;a href="https://rust-lang.github.io/async-fundamentals-initiative/evaluation/challenges/dyn_traits.html"&gt;problem of &lt;code&gt;dyn&lt;/code&gt; and &lt;code&gt;async fn&lt;/code&gt;&lt;/a&gt;. This first post introduces the problem and the general goal that we are shooting for (but don&amp;rsquo;t yet know the best way to reach).&lt;/p&gt;</description></item><item><title>Rustacean Principles, continued</title><link>https://smallcultfollowing.com/babysteps/blog/2021/09/16/rustacean-principles-continued/</link><pubDate>Thu, 16 Sep 2021 09:42:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/09/16/rustacean-principles-continued/</guid><description>&lt;p&gt;RustConf is always a good time for reflecting on the project. For me, the last week has been particularly &amp;ldquo;reflective&amp;rdquo;. Since announcing the &lt;a href="https://rustacean-principles.netlify.app/"&gt;Rustacean Principles&lt;/a&gt;, I&amp;rsquo;ve been having a number of conversations with members of the community about how they can be improved. I wanted to write a post summarizing some of the feedback I&amp;rsquo;ve gotten.&lt;/p&gt;
&lt;h3 id="the-principles-are-a-work-in-progress"&gt;The principles are a work-in-progress&lt;/h3&gt;
&lt;p&gt;Sparking conversation about the principles was exactly what I was hoping for when I posted the previous blog post. The principles have mostly been the product of &lt;a href="https://github.com/joshtriplett/"&gt;Josh&lt;/a&gt; and I iterating, and hence reflect our experiences. While the two of us have been involved in quite a few parts of the project, for the document to truly serve its purpose, it needs input from the community as a whole.&lt;/p&gt;</description></item><item><title>CTCFT 2021-09-20 Agenda</title><link>https://smallcultfollowing.com/babysteps/blog/2021/09/15/ctcft-2021-09-20-agenda/</link><pubDate>Wed, 15 Sep 2021 09:45:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/09/15/ctcft-2021-09-20-agenda/</guid><description>&lt;p&gt;&lt;img src="https://raw.githubusercontent.com/rust-ctcft/ctcft/main/img/camprust.png" width="222" style="float:left;"/&gt; The next &lt;a href="https://rust-ctcft.github.io/ctcft/"&gt;&amp;ldquo;Cross Team Collaboration Fun Times&amp;rdquo; (CTCFT)&lt;/a&gt; meeting will take place next Monday, on 2021-09-20 (&lt;a href="https://everytimezone.com/s/6f28d1ba"&gt;in your time zone&lt;/a&gt;)! This post covers the agenda. You&amp;rsquo;ll find the full details (along with a calendar event, zoom details, etc) &lt;a href="https://rust-ctcft.github.io/ctcft/meetings/2021-09-20.html"&gt;on the CTCFT website&lt;/a&gt;.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
&lt;h3 id="agenda"&gt;Agenda&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Announcements&lt;/li&gt;
&lt;li&gt;Interest group panel discussion&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We&amp;rsquo;re going to try something a bit different this time! The agenda is going to focus on Rust interest groups and domain working groups, those brave explorers who are trying to put Rust to use on all kinds of interesting domains. Rather than having fixed presentations, we&amp;rsquo;re going to have a panel discussion with representatives from a number of Rust interest groups and domain groups, led by &lt;a href="https://github.com/AngelOnFira"&gt;AngelOnFira&lt;/a&gt;. The idea is to open a channel for communication about how to have more active communication and feedback between interest groups and the Rust teams (in both directions).&lt;/p&gt;</description></item><item><title>Rustacean Principles</title><link>https://smallcultfollowing.com/babysteps/blog/2021/09/08/rustacean-principles/</link><pubDate>Wed, 08 Sep 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/09/08/rustacean-principles/</guid><description>&lt;p&gt;As the &lt;a href="https://www.rust-lang.org/"&gt;web site&lt;/a&gt; says, Rust is a &lt;em&gt;language empowering everyone to build reliable and efficient software&lt;/em&gt;. I think it&amp;rsquo;s precisely this feeling of &lt;em&gt;empowerment&lt;/em&gt; that people love about Rust. As &lt;a href="https://github.com/wycats/"&gt;wycats&lt;/a&gt; put it recently to me, Rust makes it &amp;ldquo;feel like things are possible that otherwise feel out of reach&amp;rdquo;. But what exactly makes Rust feel that way? If we can describe it, then we can use that description to help us improve Rust, and to guide us as we design extensions to Rust.&lt;/p&gt;</description></item><item><title>Next CTCFT Meeting: 2021-09-20</title><link>https://smallcultfollowing.com/babysteps/blog/2021/08/30/next-ctcft-meeting-2021-09-20/</link><pubDate>Mon, 30 Aug 2021 15:30:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/08/30/next-ctcft-meeting-2021-09-20/</guid><description>&lt;p&gt;Hold the date! The next &lt;a href="https://rust-ctcft.github.io/ctcft/"&gt;Cross Team Collaboration Fun Times&lt;/a&gt; meeting will be &lt;a href="https://rust-ctcft.github.io/ctcft/meetings/2021-09-20.html"&gt;2021-09-20&lt;/a&gt;. We&amp;rsquo;ll be using the &amp;ldquo;Asia-friendly&amp;rdquo; time slot of &lt;a href="https://everytimezone.com/s/6f28d1ba"&gt;21:00 EST&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="what-will-the-talks-be-about"&gt;What will the talks be about?&lt;/h3&gt;
&lt;p&gt;A detailed agenda will be announced in a few weeks. Current thinking however is to center the agenda on Rust interest groups and domain working groups, those brave explorers who are trying to put Rust to use on all kinds of interesting domains, such as &lt;a href="https://gamedev.rs/"&gt;game development&lt;/a&gt;, &lt;a href="https://github.com/The-DevX-Initiative/RCIG_Coordination_Repo"&gt;cryptography&lt;/a&gt;, &lt;a href="https://github.com/rust-ml/wg"&gt;machine learning&lt;/a&gt;, &lt;a href="https://github.com/rust-formal-methods/"&gt;formal verification&lt;/a&gt;, and &lt;a href="https://github.com/rust-embedded/wg"&gt;embedded development&lt;/a&gt;. If you run an interest group and I didn&amp;rsquo;t list your group here, perhaps you want to get in touch! We&amp;rsquo;ll be talking about how these groups operate and how we can do a better job of connecting interest groups with the Rust org.&lt;/p&gt;</description></item><item><title>CTCFT 2021-07-19 Agenda</title><link>https://smallcultfollowing.com/babysteps/blog/2021/07/12/ctcft-2021-07-19-agenda/</link><pubDate>Mon, 12 Jul 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/07/12/ctcft-2021-07-19-agenda/</guid><description>&lt;p&gt;&lt;img src="https://raw.githubusercontent.com/rust-ctcft/ctcft/main/img/camprust.png" width="222" style="float:left;"/&gt; The next &lt;a href="https://rust-ctcft.github.io/ctcft/"&gt;&amp;ldquo;Cross Team Collaboration Fun Times&amp;rdquo; (CTCFT)&lt;/a&gt; meeting will take place one week from today, on 2021-07-19 (&lt;a href="https://everytimezone.com/s/0b504718"&gt;in your time zone&lt;/a&gt;)! What follows are the abstracts for the talks we have planned. You&amp;rsquo;ll find the full details (along with a calendar event, zoom details, etc) &lt;a href="https://rust-ctcft.github.io/ctcft/meetings/2021-07-19.html"&gt;on the CTCFT website&lt;/a&gt;.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
&lt;h3 id="mentoring"&gt;Mentoring&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;Presented by: &lt;a href="https://github.com/doc-jones/"&gt;doc-jones&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The Rust project has a number of mechanisms for getting people involved in the project, but most are oriented around 1:1 engagement. Doc has been investigating some of the ways that other projects engage contributors, such as Python&amp;rsquo;s &lt;a href="https://www.mentored-sprints.dev/"&gt;mentored sprints&lt;/a&gt;. She will discuss how some of those projects run things and share some ideas about how that might be applied in the Rust project.&lt;/p&gt;</description></item><item><title>CTCFT Social Hour</title><link>https://smallcultfollowing.com/babysteps/blog/2021/06/18/ctcft-social-hour/</link><pubDate>Fri, 18 Jun 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/06/18/ctcft-social-hour/</guid><description>&lt;p&gt;Hey everyone! At the &lt;a href="https://rust-ctcft.github.io/ctcft/meetings/2021-06-21.html"&gt;CTCFT meeting this Monday (2021-06-21)&lt;/a&gt;, we&amp;rsquo;re going to try a &amp;ldquo;social hour&amp;rdquo;. The idea is really simple: for the hour after the meeting, we will create breakout rooms in Zoom with different themes. You can join any breakout room you like and hangout.&lt;/p&gt;</description></item><item><title>CTCFT 2021-06-21 Agenda</title><link>https://smallcultfollowing.com/babysteps/blog/2021/06/14/ctcft-2021-06-21-agenda/</link><pubDate>Mon, 14 Jun 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/06/14/ctcft-2021-06-21-agenda/</guid><description>&lt;p&gt;&lt;img src="https://raw.githubusercontent.com/rust-ctcft/ctcft/main/img/camprust.png" width="222" style="float:left;"/&gt; The second &lt;a href="https://rust-ctcft.github.io/ctcft/"&gt;&amp;ldquo;Cross Team Collaboration Fun Times&amp;rdquo; (CTCFT)&lt;/a&gt; meeting will take place one week from today, on 2021-06-21 (&lt;a href="https://everytimezone.com/s/5f09e412"&gt;in your time zone&lt;/a&gt;)! This post describes the main agenda items for the meeting; you&amp;rsquo;ll find the full details (along with a calendar event, zoom details, etc) &lt;a href="https://rust-ctcft.github.io/ctcft/meetings/2021-06-21.html"&gt;on the CTCFT website&lt;/a&gt;.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
&lt;h3 id="afterwards-social-hour"&gt;Afterwards: Social hour&lt;/h3&gt;
&lt;p&gt;After the CTCFT this week, we are going to try an experimental &lt;strong&gt;social hour&lt;/strong&gt;. The hour will be coordinated in the #ctcft stream of the rust-lang Zulip. The idea is to create breakout rooms where people can gather to talk, hack together, or just chill.&lt;/p&gt;</description></item><item><title>Edition: the song</title><link>https://smallcultfollowing.com/babysteps/blog/2021/05/26/edition-the-song/</link><pubDate>Wed, 26 May 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/05/26/edition-the-song/</guid><description>&lt;p&gt;You may have heard that &lt;a href="https://blog.rust-lang.org/2021/05/11/edition-2021.html"&gt;the Rust 2021 Edition is coming&lt;/a&gt;. Along with my daughter Daphne, I have recorded a little song in honor of the occasion! The full lyrics are below &amp;ndash; if you feel inspired, please make your own version!&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; Enjoy!&lt;/p&gt;
&lt;h3 id="video"&gt;Video&lt;/h3&gt;
&lt;p&gt;Watch the movie embedded here, or &lt;a href="https://youtu.be/q0aNduqb2Ro"&gt;watch it on YouTube&lt;/a&gt;:&lt;/p&gt;
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
 &lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/q0aNduqb2Ro?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
 &lt;/div&gt;

&lt;h3 id="lyrics"&gt;Lyrics&lt;/h3&gt;
&lt;p&gt;(Spoken)&lt;br/&gt;
Breaking changes where no code breaks.&lt;br/&gt;
Sounds impossible, no?&lt;br/&gt;
But in the Rust language, you might say that we like to do impossible things.&lt;br/&gt;
It isn&amp;rsquo;t easy.&lt;br/&gt;
You may ask, how do we manage such a thing?&lt;br/&gt;
That I can tell you in one word&amp;hellip; Edition!&lt;br/&gt;&lt;/p&gt;</description></item><item><title>CTCFTFTW</title><link>https://smallcultfollowing.com/babysteps/blog/2021/05/14/ctcftftw/</link><pubDate>Fri, 14 May 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/05/14/ctcftftw/</guid><description>&lt;p&gt;&lt;a href="https://rust-ctcft.github.io/ctcft/meetings/2021-05-17.html"&gt;This Monday&lt;/a&gt; I am starting something new: a monthly meeting called the &lt;a href="https://rust-ctcft.github.io/ctcft/"&gt;&amp;ldquo;Cross Team Collaboration Fun Times&amp;rdquo; (CTCFT)&lt;/a&gt;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;. Check out our nifty logo&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://raw.githubusercontent.com/rust-ctcft/ctcft/main/img/camprust.png" alt="Logo"&gt;&lt;/p&gt;
&lt;p&gt;The meeting is a mechanism to help keep the members of the Rust teams in sync and in touch with one another. The idea is to focus on topics of broad interest (more than two teams):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Status updates on far-reaching projects that could affect multiple teams;&lt;/li&gt;
&lt;li&gt;Experience reports about people trying new things (sometimes succeeding, sometimes not);&lt;/li&gt;
&lt;li&gt;&amp;ldquo;Rough draft&amp;rdquo; proposals that are ready to be brought before a wider audience.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The meeting will focus on things that could either offer insights that might affect the work you&amp;rsquo;re doing, or where the presenter would like to pose questions to the Rust teams and get feedback.&lt;/p&gt;</description></item><item><title>[AiC] Vision Docs!</title><link>https://smallcultfollowing.com/babysteps/blog/2021/05/01/aic-vision-docs/</link><pubDate>Sat, 01 May 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/05/01/aic-vision-docs/</guid><description>&lt;p&gt;The &lt;a href="https://rust-lang.github.io/wg-async-foundations/vision.html"&gt;Async Vision Doc&lt;/a&gt; effort has been going now for &lt;a href="https://blog.rust-lang.org/2021/03/18/async-vision-doc.html"&gt;about 6 weeks&lt;/a&gt;. It&amp;rsquo;s been a fun ride, and I&amp;rsquo;ve learned a lot. It seems like a good time to take a step back and start talking a bit about the vision doc structure and the process. In this post, I&amp;rsquo;m going to focus on the role that I see vision docs playing in Rust&amp;rsquo;s planning and decision making, particularly as compared to RFCs.&lt;/p&gt;</description></item><item><title>Async Vision Doc Writing Sessions VII</title><link>https://smallcultfollowing.com/babysteps/blog/2021/04/26/async-vision-doc-writing-sessions-vii/</link><pubDate>Mon, 26 Apr 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/04/26/async-vision-doc-writing-sessions-vii/</guid><description>&lt;p&gt;My week is very scheduled, so I am not able to host any public drafting sessions
this week &amp;ndash; however, &lt;a href="https://github.com/rylev/"&gt;Ryan Levick&lt;/a&gt; will be hosting two sessions!&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;When&lt;/th&gt;
 &lt;th&gt;Who&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://everytimezone.com/s/2e8907b6"&gt;Wed at 07:00 ET&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Ryan&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://everytimezone.com/s/6815593b"&gt;Fri at 07:00 ET&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Ryan&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;If you&amp;rsquo;re available and those stories sound like something that interests you, please join him! Just ping me or Ryan on Discord or Zulip and we&amp;rsquo;ll send you the Zoom link. If you&amp;rsquo;ve already joined a previous session, the link is the same as before.&lt;/p&gt;</description></item><item><title>Async Vision Doc Writing Sessions VI</title><link>https://smallcultfollowing.com/babysteps/blog/2021/04/19/async-vision-doc-writing-sessions-vi/</link><pubDate>Mon, 19 Apr 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/04/19/async-vision-doc-writing-sessions-vi/</guid><description>&lt;p&gt;Ryan Levick and I are going to be hosting more Async Vision Doc Writing Sessions this week. We&amp;rsquo;re not organized enough to have assigned topics yet, so I&amp;rsquo;m just going to post the dates/times and we&amp;rsquo;ll be tweeting about the particular topics as we go.&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;When&lt;/th&gt;
 &lt;th&gt;Who&lt;/th&gt;
 &lt;th&gt;&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://everytimezone.com/s/a0fb71ea"&gt;Wed at 07:00 ET&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Ryan&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://everytimezone.com/s/7b83105a"&gt;Wed at 15:00 ET&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Niko&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://everytimezone.com/s/6787fee2"&gt;Fri at 07:00 ET&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Ryan&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://everytimezone.com/s/3068c5cd"&gt;Fri at 14:00 ET&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Niko&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;If you&amp;rsquo;ve joined before, we&amp;rsquo;ll be re-using the same Zoom link. If you haven&amp;rsquo;t joined, then send a private message to one of us and we&amp;rsquo;ll share the link. Hope to see you there!&lt;/p&gt;</description></item><item><title>Async Vision Doc Writing Sessions V</title><link>https://smallcultfollowing.com/babysteps/blog/2021/04/12/async-vision-doc-writing-sessions-v/</link><pubDate>Mon, 12 Apr 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/04/12/async-vision-doc-writing-sessions-v/</guid><description>&lt;p&gt;This is an exciting week for the vision doc! As of this week, we are starting to
draft &amp;ldquo;shiny future&amp;rdquo; stories, and we would like your help! (We are also still
working on status quo stories, so there is no need to stop working on those.)
There will be a blog post coming out on the main Rust blog soon with all the
details, but you can go to the &lt;a href="https://rust-lang.github.io/wg-async-foundations/vision/how_to_vision/shiny_future.html"&gt;&amp;ldquo;How to vision: Shiny future&amp;rdquo;&lt;/a&gt; page now.&lt;/p&gt;</description></item><item><title>Async Vision Doc Writing Sessions IV</title><link>https://smallcultfollowing.com/babysteps/blog/2021/04/07/async-vision-doc-writing-sessions-iv/</link><pubDate>Wed, 07 Apr 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/04/07/async-vision-doc-writing-sessions-iv/</guid><description>&lt;p&gt;My week is very scheduled, so I am not able to host any public drafting sessions
this week &amp;ndash; however, &lt;a href="https://github.com/rylev/"&gt;Ryan Levick&lt;/a&gt; will be hosting two sessions!&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;When&lt;/th&gt;
 &lt;th&gt;Who&lt;/th&gt;
 &lt;th&gt;Topic&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://everytimezone.com/s/e2dce418"&gt;Thu at 07:00 ET&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Ryan&lt;/td&gt;
 &lt;td&gt;The need for Async Traits&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://everytimezone.com/s/7900bcf1"&gt;Fri at 07:00 ET&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Ryan&lt;/td&gt;
 &lt;td&gt;Challenges from cancellation&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;If you&amp;rsquo;re available and those stories sound like something that interests you, please join him! Just ping me or Ryan on Discord or Zulip and we&amp;rsquo;ll send you the Zoom link. If you&amp;rsquo;ve already joined a previous session, the link is the same as before.&lt;/p&gt;</description></item><item><title>My "shiny future"</title><link>https://smallcultfollowing.com/babysteps/blog/2021/04/02/my-shiny-future/</link><pubDate>Fri, 02 Apr 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/04/02/my-shiny-future/</guid><description>&lt;p&gt;I&amp;rsquo;ve been working on the Rust project for just about ten years. The language has evolved radically in that time, and so has the project governance. When I first started, for example, we communicated primarily over the &lt;a href="https://mail.mozilla.org/pipermail/rust-dev/"&gt;rust-dev&lt;/a&gt; mailing list and the #rust IRC channel. I distinctly remember coming into the Mozilla offices&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; one day and &lt;a href="https://github.com/brson"&gt;brson&lt;/a&gt; excitedly telling me, &amp;ldquo;There were almost a dozen people on the #rust IRC channel last night! Just chatting! About Rust!&amp;rdquo; It&amp;rsquo;s funny to think about that now, given the scale Rust is operating at today.&lt;/p&gt;</description></item><item><title>Async Vision Doc Writing Sessions III</title><link>https://smallcultfollowing.com/babysteps/blog/2021/03/29/async-vision-doc-writing-sessions-iii/</link><pubDate>Mon, 29 Mar 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/03/29/async-vision-doc-writing-sessions-iii/</guid><description>&lt;p&gt;&lt;a href="https://github.com/rylev/"&gt;Ryan Levick&lt;/a&gt; and I are hosting a number of public drafting sessions scheduled this week.
Some of them are scheduled early to cover a wider range of time zones.&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;When&lt;/th&gt;
 &lt;th&gt;Who&lt;/th&gt;
 &lt;th&gt;Topic&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://everytimezone.com/s/c9869917"&gt;Tue at 14:30 ET&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Niko&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://github.com/rust-lang/wg-async-foundations/issues/67"&gt;wrapping C++ async APIs in Rust futures&lt;/a&gt; and other tales of interop&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://everytimezone.com/s/43be0ecf"&gt;Wed at 10:00 ET&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Niko&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://github.com/rust-lang/wg-async-foundations/issues/95"&gt;picking an HTTP library&lt;/a&gt; and similar stories&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://everytimezone.com/s/f775361b"&gt;Wed at 15:00 ET&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Niko&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://github.com/rust-lang/wg-async-foundations/issues/107"&gt;structured concurrency and parallel data processing&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://everytimezone.com/s/e2dce418"&gt;Thu at 07:00 ET&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Ryan&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://github.com/rust-lang/wg-async-foundations/issues/76"&gt;debugging&lt;/a&gt; and getting &lt;a href="https://github.com/rust-lang/wg-async-foundations/issues/75"&gt;insights into running services&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://everytimezone.com/s/7900bcf1"&gt;Fri at 07:00 ET&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Ryan&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://github.com/rust-lang/wg-async-foundations/issues/105"&gt;lack of a polished common implementations of basic async helpers&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://everytimezone.com/s/92ce4ece"&gt;Fri at 14:30 ET&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Niko&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://github.com/rust-lang/wg-async-foundations/issues/54"&gt;bridging sync and async&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;If you&amp;rsquo;re available and those stories sound like something that interests you, please join us!
We&amp;rsquo;re particlarly interested in having people join who have had related experiences, as the goal here is to capture the details from people who&amp;rsquo;ve been there.&lt;/p&gt;</description></item><item><title>Async Vision Doc Writing Sessions II</title><link>https://smallcultfollowing.com/babysteps/blog/2021/03/25/async-vision-doc-writing-sessions-ii/</link><pubDate>Thu, 25 Mar 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/03/25/async-vision-doc-writing-sessions-ii/</guid><description>&lt;p&gt;I&amp;rsquo;m scheduling two more public drafting sessions for tomorrow, Match 26th:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On March 26th at 10am ET (&lt;a href="https://everytimezone.com/s/66582106"&gt;click to see in your local timezone&lt;/a&gt;), we will be working on writing a story about the challenges of writing a library that can be reused across many runtimes (&lt;a href="https://github.com/rust-lang/wg-async-foundations/issues/45"&gt;rust-lang/wg-async-foundations#45&lt;/a&gt;);&lt;/li&gt;
&lt;li&gt;On March 26th at 2pm ET (&lt;a href="https://everytimezone.com/s/206264ec"&gt;click to see in your local tomezone&lt;/a&gt;), we will be working on writing a story about the difficulty of debugging and interpreting async stack traces (&lt;a href="https://github.com/rust-lang/wg-async-foundations/issues/69"&gt;rust-lang/wg-async-foundations#69&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you&amp;rsquo;re available and have interest in one of those issues, please join us!
Just ping me on Discord or Zulip and I&amp;rsquo;ll send you the Zoom link.&lt;/p&gt;</description></item><item><title>Async Vision Doc Writing Sessions</title><link>https://smallcultfollowing.com/babysteps/blog/2021/03/22/async-vision-doc-writing-sessions/</link><pubDate>Mon, 22 Mar 2021 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2021/03/22/async-vision-doc-writing-sessions/</guid><description>&lt;p&gt;Hey folks! As part of the &lt;a href="https://blog.rust-lang.org/2021/03/18/async-vision-doc.html"&gt;Async Vision Doc&lt;/a&gt; effort,
I&amp;rsquo;m planning on holding two public drafting sessions tomorrow, March 23rd:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;March 23rd at noon ET (&lt;a href="https://everytimezone.com/s/4d25dc1a"&gt;click to see in your local timezone&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;March 23rd at 5pm ET (&lt;a href="https://everytimezone.com/s/3efcf390"&gt;click to see in your local tomezone&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;During these sessions, we&amp;rsquo;ll be looking over the &lt;a href="https://github.com/rust-lang/wg-async-foundations/issues?q=is%3Aopen+is%3Aissue+label%3Astatus-quo-story-ideas"&gt;status quo issues&lt;/a&gt;
and writing a story or two! If you&amp;rsquo;d like to join, ping me on Discord
or Zulip and I&amp;rsquo;ll send you the Zoom link.&lt;/p&gt;</description></item><item><title>The more things change...</title><link>https://smallcultfollowing.com/babysteps/blog/2020/12/30/the-more-things-change/</link><pubDate>Wed, 30 Dec 2020 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2020/12/30/the-more-things-change/</guid><description>&lt;p&gt;I&amp;rsquo;ve got an announcement to make. &lt;strong&gt;As of Jan 4th, I&amp;rsquo;m starting at Amazon as the tech lead of their new Rust team.&lt;/strong&gt; Working at Mozilla has been a great experience, but I&amp;rsquo;m pretty excited about this change. It&amp;rsquo;s a chance to help shape what I hope to be an exciting new phase for Rust, where we grow from a project with a single primary sponsor (Mozilla) to an industry standard, supported by a wide array of companies. It&amp;rsquo;s also a chance to work with some pretty awesome people &amp;ndash; both familiar faces from the Rust community&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; and some new folks. Finally, I&amp;rsquo;m hoping it will be an opportunity for me to refocus my attention to some long-standing projects that I really want to see through.&lt;/p&gt;</description></item><item><title>Looking back on 2020</title><link>https://smallcultfollowing.com/babysteps/blog/2020/12/18/looking-back-on-2020/</link><pubDate>Fri, 18 Dec 2020 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2020/12/18/looking-back-on-2020/</guid><description>&lt;p&gt;I wanted to write a post that looks back over 2020 from a personal perspective. My goal here is to look at the various initiatives that I&amp;rsquo;ve been involved in and try to get a sense for how they went, what worked and what didn&amp;rsquo;t, and also what that means for next year. This post is a backdrop for a #niko2021 post that I plan to post sometime before 2021 actually starts, talking about what I expect to be doing in 2021.&lt;/p&gt;</description></item><item><title>Rotating the compiler team leads</title><link>https://smallcultfollowing.com/babysteps/blog/2020/12/11/rotating-the-compiler-team-leads/</link><pubDate>Fri, 11 Dec 2020 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2020/12/11/rotating-the-compiler-team-leads/</guid><description>&lt;p&gt;Since we created the Rust teams, I have been serving as lead of two teams: the &lt;a href="https://www.rust-lang.org/governance/teams/compiler"&gt;compiler team&lt;/a&gt; and the &lt;a href="https://www.rust-lang.org/governance/teams/lang"&gt;language design team&lt;/a&gt; (I&amp;rsquo;ve also been a member of the &lt;a href="https://www.rust-lang.org/governance/teams/core"&gt;core team&lt;/a&gt;, which has no lead). For those less familiar with Rust&amp;rsquo;s governance, the compiler team is focused on the maintenance and implementation of the compiler itself (and, more recently, the standard library). The language design team is focused on the design aspects. Over that time, all the Rust teams have grown and evolved, with the compiler team in particular being home to a number of really strong members.&lt;/p&gt;</description></item><item><title>Async Interview #8: Stjepan Glavina</title><link>https://smallcultfollowing.com/babysteps/blog/2020/07/09/async-interview-8-stjepan-glavina/</link><pubDate>Thu, 09 Jul 2020 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2020/07/09/async-interview-8-stjepan-glavina/</guid><description>&lt;p&gt;(removed)&lt;/p&gt;</description></item><item><title>Async interviews: my take thus far</title><link>https://smallcultfollowing.com/babysteps/blog/2020/04/30/async-interviews-my-take-thus-far/</link><pubDate>Thu, 30 Apr 2020 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2020/04/30/async-interviews-my-take-thus-far/</guid><description>&lt;p&gt;The point of the &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2019/11/22/announcing-the-async-interviews/"&gt;async interview&lt;/a&gt; series, in the end, was to help
figure out what we should be doing next when it comes to Async I/O. I
thought it would be good then to step back and, rather than
interviewing someone else, give my opinion on some of the immediate
next steps, and a bit about the medium to longer term. I&amp;rsquo;m also going
to talk a bit about what I see as some of the practical challenges.&lt;/p&gt;</description></item><item><title>Library-ification and analyzing Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2020/04/09/libraryification/</link><pubDate>Thu, 09 Apr 2020 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2020/04/09/libraryification/</guid><description>&lt;p&gt;I&amp;rsquo;ve noticed that the ideas that I post on my blog are getting much
more &amp;ldquo;well rounded&amp;rdquo;. That is a problem. It means I&amp;rsquo;m waiting too long
to write about things. So I want to post about something that&amp;rsquo;s a bit
more half-baked &amp;ndash; it&amp;rsquo;s an idea that I&amp;rsquo;ve been kicking around to
create a kind of informal &amp;ldquo;analysis API&amp;rdquo; for rustc.&lt;/p&gt;
&lt;h3 id="the-problem-statement"&gt;The problem statement&lt;/h3&gt;
&lt;p&gt;I am interested in finding better ways to support advanced analyses
that &amp;ldquo;layer on&amp;rdquo; to rustc. I am thinking of projects like &lt;a href="https://www.pm.inf.ethz.ch/research/prusti.html"&gt;Prusti&lt;/a&gt; or
Facebook&amp;rsquo;s &lt;a href="https://github.com/facebookexperimental/MIRAI"&gt;MIRAI&lt;/a&gt;, or even the venerable &lt;a href="https://github.com/rust-lang/rust-clippy"&gt;Clippy&lt;/a&gt;. All of these
projects are attempts to layer on additional analyses atop Rust&amp;rsquo;s
existing type system that prove useful properties about your code.
&lt;a href="https://www.pm.inf.ethz.ch/research/prusti.html"&gt;Prusti&lt;/a&gt;, for example, lets you add pre- and post-conditions to your
functions, and it will prove that they hold.&lt;/p&gt;</description></item><item><title>Async Interview #7: Withoutboats</title><link>https://smallcultfollowing.com/babysteps/blog/2020/03/10/async-interview-7-withoutboats/</link><pubDate>Tue, 10 Mar 2020 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2020/03/10/async-interview-7-withoutboats/</guid><description>&lt;p&gt;Hello everyone! I&amp;rsquo;m happy to be posting a transcript of my &lt;a href="http://smallcultfollowing.com/babysteps/blog/2019/11/22/announcing-the-async-interviews/"&gt;async
interview&lt;/a&gt; with withoutboats. This particularly interview took place
way back on January 14th, but the intervening months have been a bit
crazy and I didn&amp;rsquo;t get around to writing it up till now.&lt;/p&gt;
&lt;h3 id="video"&gt;Video&lt;/h3&gt;
&lt;p&gt;You can watch the &lt;a href="https://youtu.be/a-kZhPMqXRs"&gt;video&lt;/a&gt; on YouTube. I&amp;rsquo;ve also embedded a copy here
for your convenience:&lt;/p&gt;
&lt;center&gt;&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/a-kZhPMqXRs" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen&gt;&lt;/iframe&gt;&lt;/center&gt;
&lt;h2 id="next-steps-for-async"&gt;Next steps for async&lt;/h2&gt;
&lt;p&gt;Before I go into boats&amp;rsquo; interview, I want to talk a bit about the
state of async-await in Rust and what I see as the obvious next steps.
I may still do a few more async interviews after this &amp;ndash; there are
tons of interesting folks I never got to speak to! &amp;ndash; but I think it&amp;rsquo;s
also past time to try and come to a consensus of the &amp;ldquo;async roadmap&amp;rdquo;
for the rest of the year (and maybe some of 2021, too). The good news
is that I feel like the async interviews highlighted a number of
relatively clear next steps. Sometime after this post, I hope to post
a blog post laying out a &amp;ldquo;rough draft&amp;rdquo; of what such a roadmap might
look like.&lt;/p&gt;</description></item><item><title>Async Interview #6: Eliza Weisman</title><link>https://smallcultfollowing.com/babysteps/blog/2020/02/11/async-interview-6-eliza-weisman/</link><pubDate>Tue, 11 Feb 2020 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2020/02/11/async-interview-6-eliza-weisman/</guid><description>&lt;p&gt;Hello! For the latest &lt;a href="http://smallcultfollowing.com/babysteps/blog/2019/11/22/announcing-the-async-interviews/"&gt;async interview&lt;/a&gt;, I spoke with Eliza Weisman
(&lt;a href="https://github.com/hawkw/"&gt;hawkw&lt;/a&gt;, &lt;a href="https://twitter.com/mycoliza"&gt;mycoliza on twitter&lt;/a&gt;). Eliza first came to my attention as the author of the
&lt;a href="https://crates.io/crates/tracing"&gt;tracing&lt;/a&gt; crate, which is a nifty crate for doing application level
tracing. However, she is also a core maintainer of tokio, and she
works at Buoyant on the &lt;a href="https://linkerd.io/"&gt;linkerd&lt;/a&gt; system. &lt;a href="https://linkerd.io/"&gt;linkerd&lt;/a&gt; is one of a small
set of large applications that were build using 0.1 futures &amp;ndash; i.e.,
before async-await. This range of experience gives Eliza an interesting
&amp;ldquo;overview&amp;rdquo; perspective on async-await and Rust more generally.&lt;/p&gt;</description></item><item><title>Async Interview #5: Steven Fackler</title><link>https://smallcultfollowing.com/babysteps/blog/2020/01/20/async-interview-5-steven-fackler/</link><pubDate>Mon, 20 Jan 2020 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2020/01/20/async-interview-5-steven-fackler/</guid><description>&lt;p&gt;Hello! For the latest &lt;a href="http://smallcultfollowing.com/babysteps/blog/2019/11/22/announcing-the-async-interviews/"&gt;async interview&lt;/a&gt;, I spoke with Steven Fackler
(&lt;a href="https://github.com/sfackler/"&gt;sfackler&lt;/a&gt;). sfackler has been involved in Rust for a long time and
is a member of the Rust libs team. He is also the author of &lt;a href="https://crates.io/users/sfackler"&gt;a lot of
crates&lt;/a&gt;, most notably &lt;a href="https://crates.io/crates/tokio-postgres"&gt;tokio-postgres&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I particularly wanted to talk to sfackler about the &lt;code&gt;AsyncRead&lt;/code&gt; and
&lt;code&gt;AsyncWrite&lt;/code&gt; traits. These traits are on everybody&amp;rsquo;s list of
&amp;ldquo;important things to stabilize&amp;rdquo;, particularly if we want to create
more interop between different executors and runtimes. On the other
hand, in [tokio-rs/tokio#1744], the tokio project is considering
adopting its own variant traits that diverge significantly from those
in the futures crate, precisely because they have concerns over the
design of the traits as is. This seems like an important area to dig
into!&lt;/p&gt;</description></item><item><title>Async Interview #4: Florian Gilcher</title><link>https://smallcultfollowing.com/babysteps/blog/2020/01/13/async-interview-4-florian-gilcher/</link><pubDate>Mon, 13 Jan 2020 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2020/01/13/async-interview-4-florian-gilcher/</guid><description>&lt;p&gt;Hello! For the latest &lt;a href="http://smallcultfollowing.com/babysteps/blog/2019/11/22/announcing-the-async-interviews/"&gt;async interview&lt;/a&gt;, I spoke with Florian Gilcher
(&lt;a href="https://github.com/skade/"&gt;skade&lt;/a&gt;). Florian is involved in the &lt;a href="https://async.rs"&gt;async-std&lt;/a&gt; project, but he&amp;rsquo;s
also one of the founders of &lt;a href="https://ferrous-systems.com/"&gt;Ferrous Systems&lt;/a&gt;, a Rust consulting firm
that also does a lot of trainings. In that capacity, he&amp;rsquo;s been
teaching people to use async Rust now since Rust&amp;rsquo;s 1.0 release.&lt;/p&gt;
&lt;h3 id="video"&gt;Video&lt;/h3&gt;
&lt;p&gt;You can watch the &lt;a href="https://youtu.be/Ezwd1vKSfCo"&gt;video&lt;/a&gt; on YouTube. I&amp;rsquo;ve also embedded a copy here
for your convenience:&lt;/p&gt;
&lt;center&gt;&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/Ezwd1vKSfCo" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen&gt;&lt;/iframe&gt;&lt;/center&gt;
&lt;p&gt;One note: something about our setup meant that I was hearing a lot of
echo. I think you can sometimes hear it in the recording, but not
nearly as bad as it was live. So if I seem a bit spacey, or take very
long pauses, you might know the reason why!&lt;/p&gt;</description></item><item><title>Towards a Rust foundation</title><link>https://smallcultfollowing.com/babysteps/blog/2020/01/09/towards-a-rust-foundation/</link><pubDate>Thu, 09 Jan 2020 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2020/01/09/towards-a-rust-foundation/</guid><description>&lt;p&gt;In &lt;a href="http://smallcultfollowing.com/babysteps/blog/2019/12/02/rust-2020/"&gt;my #rust2020 blog post&lt;/a&gt;, I mentioned rather off-handedly
that I think the time has come for us to talk about forming a Rust
foundation. I wanted to come back to this topic and talk in more
detail about what I think a Rust foundation might look like. And,
since I don&amp;rsquo;t claim to have the final answer to that question by any
means, I&amp;rsquo;d also like to talk about &lt;strong&gt;how&lt;/strong&gt; I think we should have this
conversation going forward.&lt;/p&gt;</description></item><item><title>Async Interview #3: Carl Lerche</title><link>https://smallcultfollowing.com/babysteps/blog/2019/12/23/async-interview-3-carl-lerche/</link><pubDate>Mon, 23 Dec 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/12/23/async-interview-3-carl-lerche/</guid><description>&lt;p&gt;Hello! For the latest &lt;a href="http://smallcultfollowing.com/babysteps/blog/2019/12/09/async-interview-2-cramertj/"&gt;async interview&lt;/a&gt;, I spoke with Carl Lerche
(&lt;a href="https://github.com/carllerche/"&gt;carllerche&lt;/a&gt;). Among many other crates&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;, Carl is perhaps best
known as one of the key authors behind &lt;a href="https://github.com/tokio-rs/tokio"&gt;tokio&lt;/a&gt; and &lt;a href="https://github.com/tokio-rs/mio"&gt;mio&lt;/a&gt;. These two
crates are quite widely used through the async ecosystem. Carl and I
spoke on December 3rd.&lt;/p&gt;
&lt;h3 id="video"&gt;Video&lt;/h3&gt;
&lt;p&gt;You can watch the &lt;a href="https://youtu.be/xpk0y8tfszE"&gt;video&lt;/a&gt; on YouTube. I&amp;rsquo;ve also embedded a copy here
for your convenience:&lt;/p&gt;
&lt;center&gt;&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/xpk0y8tfszE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen&gt;&lt;/iframe&gt;&lt;/center&gt;
&lt;h2 id="background-the-mio-crate"&gt;Background: the mio crate&lt;/h2&gt;
&lt;p&gt;One of the first things we talked about was a kind of overview of the
layers of the &amp;ldquo;tokio-based async stack&amp;rdquo;.&lt;/p&gt;</description></item><item><title>Async Interview #2: cramertj, part 3</title><link>https://smallcultfollowing.com/babysteps/blog/2019/12/11/async-interview-2-cramertj-part-3/</link><pubDate>Wed, 11 Dec 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/12/11/async-interview-2-cramertj-part-3/</guid><description>&lt;p&gt;This blog post is continuing &lt;a href="http://smallcultfollowing.com/babysteps/blog/2019/12/09/async-interview-2-cramertj/"&gt;my conversation with
cramertj&lt;/a&gt;. This
will be the last post.&lt;/p&gt;
&lt;p&gt;In the &lt;a href="http://smallcultfollowing.com/babysteps/blog/2019/12/09/async-interview-2-cramertj/"&gt;first post&lt;/a&gt;, I covered what we said about Fuchsia,
interoperability, and the organization of the futures crate.&lt;/p&gt;
&lt;p&gt;In the &lt;a href="http://smallcultfollowing.com/babysteps/blog/2019/12/10/async-interview-2-cramertj-part-2/"&gt;second post&lt;/a&gt;, I covered cramertj&amp;rsquo;s take on the &lt;a href="https://docs.rs/futures-core/0.3.1/futures_core/stream/trait.Stream.html"&gt;&lt;code&gt;Stream&lt;/code&gt;&lt;/a&gt;,
&lt;a href="https://docs.rs/futures/0.3.1/futures/io/trait.AsyncRead.html"&gt;&lt;code&gt;AsyncRead&lt;/code&gt;&lt;/a&gt;, and &lt;a href="https://docs.rs/futures/0.3.1/futures/io/trait.AsyncWrite.html"&gt;&lt;code&gt;AsyncWrite&lt;/code&gt;&lt;/a&gt; traits. We also discused the idea of
&lt;a href="http://smallcultfollowing.com/babysteps/blog/2019/12/10/async-interview-2-cramertj-part-2/#terminology-note-detachedattached-instead-of-streaming"&gt;attached&lt;/a&gt; streams and the imporance of GATs for modeling those.&lt;/p&gt;
&lt;p&gt;In this post, we&amp;rsquo;ll talk about async closures.&lt;/p&gt;
&lt;p&gt;You can watch the &lt;a href="https://youtu.be/NF_qyiypnOs"&gt;video&lt;/a&gt; on YouTube.&lt;/p&gt;</description></item><item><title>Async Interview #2: cramertj, part 2</title><link>https://smallcultfollowing.com/babysteps/blog/2019/12/10/async-interview-2-cramertj-part-2/</link><pubDate>Tue, 10 Dec 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/12/10/async-interview-2-cramertj-part-2/</guid><description>&lt;p&gt;This blog post is continuing &lt;a href="http://smallcultfollowing.com/babysteps/blog/2019/12/09/async-interview-2-cramertj/"&gt;my conversation with cramertj&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In the first post, I covered what we said about Fuchsia,
interoperability, and the organization of the futures crate. This
post covers cramertj&amp;rsquo;s take on the &lt;a href="https://docs.rs/futures-core/0.3.1/futures_core/stream/trait.Stream.html"&gt;&lt;code&gt;Stream&lt;/code&gt;&lt;/a&gt; trait as well as the
&lt;a href="https://docs.rs/futures/0.3.1/futures/io/trait.AsyncRead.html"&gt;&lt;code&gt;AsyncRead&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://docs.rs/futures/0.3.1/futures/io/trait.AsyncWrite.html"&gt;&lt;code&gt;AsyncWrite&lt;/code&gt;&lt;/a&gt; traits.&lt;/p&gt;
&lt;p&gt;You can watch the &lt;a href="https://youtu.be/NF_qyiypnOs"&gt;video&lt;/a&gt; on YouTube.&lt;/p&gt;
&lt;h3 id="the-need-for-streaming-streams-and-iterators"&gt;The need for &amp;ldquo;streaming&amp;rdquo; streams and iterators&lt;/h3&gt;
&lt;p&gt;Next, cramertj and I turned to discussing some of the specific traits
from the futures crate. One of the traits that we covered was
&lt;a href="https://docs.rs/futures-core/0.3.1/futures_core/stream/trait.Stream.html"&gt;&lt;code&gt;Stream&lt;/code&gt;&lt;/a&gt;. The &lt;a href="https://docs.rs/futures-core/0.3.1/futures_core/stream/trait.Stream.html"&gt;&lt;code&gt;Stream&lt;/code&gt;&lt;/a&gt; trait is basically the asynchronous version
of the &lt;a href="https://doc.rust-lang.org/std/iter/trait.Iterator.html"&gt;&lt;code&gt;Iterator&lt;/code&gt;&lt;/a&gt; trait. In (slightly) simplified form, it is as
follows:&lt;/p&gt;</description></item><item><title>Async Interview #2: cramertj</title><link>https://smallcultfollowing.com/babysteps/blog/2019/12/09/async-interview-2-cramertj/</link><pubDate>Mon, 09 Dec 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/12/09/async-interview-2-cramertj/</guid><description>&lt;p&gt;For the second &lt;a href="http://smallcultfollowing.com/babysteps/blog/2019/12/09/async-interview-2-cramertj/"&gt;async interview&lt;/a&gt;, I spoke with Taylor Cramer &amp;ndash; or
cramertj, as I&amp;rsquo;ll refer to him. cramertj is a member of the compiler
and lang teams and was &amp;ndash; until recently &amp;ndash; working on Fuchsia at
Google. He&amp;rsquo;s been a key player in Rust&amp;rsquo;s Async I/O design and in the
discussions around it. He was also responsible for a lot of the
implementation work to make &lt;code&gt;async fn&lt;/code&gt; a reality.&lt;/p&gt;</description></item><item><title>AiC: Improving the pre-RFC process</title><link>https://smallcultfollowing.com/babysteps/blog/2019/12/03/aic-improving-the-pre-rfc-process/</link><pubDate>Tue, 03 Dec 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/12/03/aic-improving-the-pre-rfc-process/</guid><description>&lt;p&gt;I want to write about an idea that Josh Triplett and I have been
iterating on to revamp the lang team RFC process. I have written a
&lt;a href="https://github.com/nikomatsakis/project-staged-rfcs/blob/master/rfcs/0001-shepherded-rfcs.md"&gt;draft&lt;/a&gt; of an RFC already, but this blog post aims to introduce the
idea and some of the motivations. The key idea of the RFC is formalize
the steps leading &lt;em&gt;up&lt;/em&gt; to an RFC, as well as to capture the lang team
operations around &lt;strong&gt;project groups&lt;/strong&gt;. The hope is that, if this
process works well, it can apply to teams beyond the lang team as
well.&lt;/p&gt;</description></item><item><title>Rust 2020</title><link>https://smallcultfollowing.com/babysteps/blog/2019/12/02/rust-2020/</link><pubDate>Mon, 02 Dec 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/12/02/rust-2020/</guid><description>&lt;p&gt;Technically speaking, it&amp;rsquo;s past the deadline for #rust2020 posts, but
I&amp;rsquo;m running late this year, and I&amp;rsquo;m going to post something anyway.
In this post, I am focusing on what I see as the &amp;ldquo;largest scale&amp;rdquo;
issues, and not on technical initiatives. If I have time, I will try
to post a follow-up talking about some of the key technical
initiatives that I think we should focus on as well.&lt;/p&gt;</description></item><item><title>Async Interview #1: Alex and Nick talk about async I/O and WebAssembly</title><link>https://smallcultfollowing.com/babysteps/blog/2019/11/28/async-interview-1-alex-and-nick-talk-about-async-i-o-and-webassembly/</link><pubDate>Thu, 28 Nov 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/11/28/async-interview-1-alex-and-nick-talk-about-async-i-o-and-webassembly/</guid><description>&lt;p&gt;Hello from Iceland! (I&amp;rsquo;m on vacation.) I&amp;rsquo;ve just uploaded [the first
of the Async Interviews][video] to YouTube. It is a conversation with Alex
Crichton (&lt;a href="https://github.com/alexcrichton"&gt;alexcrichton&lt;/a&gt;) and Nick Fitzgerald (&lt;a href="https://github.com/fitzgen"&gt;fitzgen&lt;/a&gt;) about how
WebAssembly and Rust&amp;rsquo;s Async I/O system interact. When you watch it,
you will probably notice two things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, I spent a lot of time looking off to the side! This is
because I had the joint Dropbox paper document open on my side
monitor and I forgot how strange that would look. I&amp;rsquo;ll have to
remember that for the future. =)&lt;/li&gt;
&lt;li&gt;Second, we recorded this on October 3rd&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;, which was before
async-await had landed on stable. So at various points we talk about
async-await being on beta or not yet being stable. Don&amp;rsquo;t be
confused. =)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="video"&gt;Video&lt;/h3&gt;
&lt;p&gt;You can view the [video][video] on YouTube, but it is also embedded
here if that&amp;rsquo;s easier for you.&lt;/p&gt;</description></item><item><title>Announcing the Async Interviews</title><link>https://smallcultfollowing.com/babysteps/blog/2019/11/22/announcing-the-async-interviews/</link><pubDate>Fri, 22 Nov 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/11/22/announcing-the-async-interviews/</guid><description>&lt;p&gt;Hello all! I&amp;rsquo;m going to be trying something new, which I call the
&lt;strong&gt;&amp;ldquo;Async Interviews&amp;rdquo;&lt;/strong&gt;. These interviews are going to be a series of
recorded video calls with various &amp;ldquo;luminaries&amp;rdquo; from Rust&amp;rsquo;s Async I/O
effort. In each one, I&amp;rsquo;m going to be asking roughly the same question:
&lt;strong&gt;Now that the async-await MVP is stable, what should we be doing
next?&lt;/strong&gt; After each call, I&amp;rsquo;ll post the recording from the interview,
along with a blog post that leaves a brief summary.&lt;/p&gt;</description></item><item><title>why async fn in traits are hard</title><link>https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/</link><pubDate>Sat, 26 Oct 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/</guid><description>&lt;p&gt;After reading &lt;a href="https://boats.gitlab.io/blog/post/poll-drop/"&gt;boat&amp;rsquo;s excellent post on asynchronous destructors&lt;/a&gt;,
I thought it might be a good idea to write some about &lt;code&gt;async fn&lt;/code&gt; in
traits. Support for &lt;code&gt;async fn&lt;/code&gt; in traits is probably the single most
common feature request that I hear about. It&amp;rsquo;s also one of the more
complex topics. So I thought it&amp;rsquo;d be nice to do a blog post kind of
giving the &amp;ldquo;lay of the land&amp;rdquo; on that feature &amp;ndash; what makes it
complicated? What questions remain open?&lt;/p&gt;</description></item><item><title>AiC: Shepherds 3.0</title><link>https://smallcultfollowing.com/babysteps/blog/2019/09/11/aic-shepherds-3-0/</link><pubDate>Wed, 11 Sep 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/09/11/aic-shepherds-3-0/</guid><description>&lt;p&gt;I would like to describe an idea that&amp;rsquo;s been kicking around in my
head. I&amp;rsquo;m calling this idea &amp;ldquo;shepherds 3.0&amp;rdquo; &amp;ndash; the 3.0 is to
distinguish it from the other places we&amp;rsquo;ve used the term in the past.
This proposal actually supplants both of the previous uses of the
term, replacing them with what I believe to be a preferred alternative
(more on that later).&lt;/p&gt;
&lt;h2 id="caveat"&gt;Caveat&lt;/h2&gt;
&lt;p&gt;This is an idea that has been kicking around in my head for a while.
It is not a polished plan and certainly not an accepted one. I&amp;rsquo;ve not
talked it over with the rest of the lang team, for example. However, I
wanted to put it out there for discussion, and I do think we should be
taking some step in this direction soon-ish.&lt;/p&gt;</description></item><item><title>AiC: Unbounded queues and lang design</title><link>https://smallcultfollowing.com/babysteps/blog/2019/07/10/aic-unbounded-queues-and-lang-design/</link><pubDate>Wed, 10 Jul 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/07/10/aic-unbounded-queues-and-lang-design/</guid><description>&lt;p&gt;I have been thinking about how language feature development works in
Rust&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;. I wanted to write a post about what I see as one of the
key problems: too much concurrency in our design process, without any
kind of &amp;ldquo;back-pressure&amp;rdquo; to help keep the number of &amp;ldquo;open efforts&amp;rdquo;
under control. This setup does enable us to get a lot of things done sometimes,
but I believe it also leads to a number of problems.&lt;/p&gt;</description></item><item><title>Async-await status report #2</title><link>https://smallcultfollowing.com/babysteps/blog/2019/07/08/async-await-status-report-2/</link><pubDate>Mon, 08 Jul 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/07/08/async-await-status-report-2/</guid><description>&lt;p&gt;I wanted to give an update on the status of the &amp;ldquo;async-await
foundations&amp;rdquo; working group. This post aims to cover three things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the &amp;ldquo;async await MVP&amp;rdquo; that we are currently targeting;&lt;/li&gt;
&lt;li&gt;how that fits into the bigger picture;&lt;/li&gt;
&lt;li&gt;and how you can help, if you&amp;rsquo;re so inclined;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="current-target-async-await-mvp"&gt;Current target: async-await MVP&lt;/h2&gt;
&lt;p&gt;We are currently working on stabilizing what we call the &lt;strong&gt;async-await
MVP&lt;/strong&gt; &amp;ndash; as in, &amp;ldquo;minimal viable product&amp;rdquo;. As the name suggests, the
work we&amp;rsquo;re doing now is basically the minimum that is needed to
&amp;ldquo;unlock&amp;rdquo; async-await. After this work is done, it will be easier to
build async I/O based applications in Rust, though a number of rough
edges remain.&lt;/p&gt;</description></item><item><title>AiC: Language-design team meta working group</title><link>https://smallcultfollowing.com/babysteps/blog/2019/04/26/aic-language-design-team-meta-working-group/</link><pubDate>Fri, 26 Apr 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/04/26/aic-language-design-team-meta-working-group/</guid><description>&lt;p&gt;On internals, I &lt;a href="https://internals.rust-lang.org/t/announcing-lang-team-meta-working-group/9900"&gt;just announced&lt;/a&gt; the formation of the
language-design team meta working group. The role of the meta working
group is to figure out how other language-design team working groups
should work. The plan is to begin by enumerating some of our goals &amp;ndash;
the problems we aim to solve, the good things we aim to keep &amp;ndash; and
then move on to draw up more details plans. I expect this discussion
will intersect the RFC process quite heavily (at least when it comes
to language design changes). Should be interesting! It&amp;rsquo;s all happening
in the open, and a major goal of mine is for this to be easy to follow
along with from the outside &amp;ndash; so if talking about talking is your
thing, you should &lt;a href="https://internals.rust-lang.org/t/announcing-lang-team-meta-working-group/9900"&gt;check it out&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>AiC: Collaborative summary documents</title><link>https://smallcultfollowing.com/babysteps/blog/2019/04/22/aic-collaborative-summary-documents/</link><pubDate>Mon, 22 Apr 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/04/22/aic-collaborative-summary-documents/</guid><description>&lt;p&gt;In my &lt;a href="http://smallcultfollowing.com/babysteps/blog/2019/04/19/aic-adventures-in-consensus/"&gt;previous post&lt;/a&gt;, I talked about the idea of &lt;em&gt;mapping the
solution space&lt;/em&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When we talk about the RFC process, we always emphasize that the point
of RFC discussion &lt;strong&gt;is not to select the best answer&lt;/strong&gt;; rather, the
point is to &lt;strong&gt;map the solution space&lt;/strong&gt;. That is, to explore what the
possible tradeoffs are and to really look for alternatives. This
mapping process also means exploring the ups and downs of the current
solutions on the table.&lt;/p&gt;</description></item><item><title>AiC: Adventures in consensus</title><link>https://smallcultfollowing.com/babysteps/blog/2019/04/19/aic-adventures-in-consensus/</link><pubDate>Fri, 19 Apr 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/04/19/aic-adventures-in-consensus/</guid><description>&lt;p&gt;In the talk I gave at Rust LATAM, &lt;a href="https://nikomatsakis.github.io/rust-latam-2019/#92"&gt;I said&lt;/a&gt; that the Rust project has
always emphasized &lt;strong&gt;finding the best solution, rather than winning the
argument&lt;/strong&gt;. I think this is one of our deepest values. It&amp;rsquo;s also one
of the hardest for us to uphold.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s face it &amp;ndash; when you&amp;rsquo;re having a conversation, it&amp;rsquo;s easy to get
attached to specific proposals. It&amp;rsquo;s easy to have those proposals
change from &amp;ldquo;Option A&amp;rdquo; vs &amp;ldquo;Option B&amp;rdquo; to &amp;ldquo;&lt;strong&gt;my&lt;/strong&gt; option&amp;rdquo; and &amp;ldquo;&lt;strong&gt;their&lt;/strong&gt;
option&amp;rdquo;. Once this happens, it can be very hard to let &lt;strong&gt;them&lt;/strong&gt; &amp;ldquo;win&amp;rdquo;
&amp;ndash; even if you know that both options are quite reasonable.&lt;/p&gt;</description></item><item><title>More than coders</title><link>https://smallcultfollowing.com/babysteps/blog/2019/04/15/more-than-coders/</link><pubDate>Mon, 15 Apr 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/04/15/more-than-coders/</guid><description>&lt;p&gt;Lately, the compiler team has been changing up the way that we work.
Our goal is to make it easier for people to track what we are doing
and &amp;ndash; hopefully &amp;ndash; get involved. This is an ongoing effort, but one
thing that has become clear immediately is this: the compiler team
needs more than coders.&lt;/p&gt;
&lt;p&gt;Traditionally, when we&amp;rsquo;ve thought about how to &amp;ldquo;get involved&amp;rdquo; in the
compiler team, we&amp;rsquo;ve thought about it in terms of writing PRs. But
more and more I&amp;rsquo;m thinking about all the &lt;em&gt;other&lt;/em&gt; jobs that go into
maintaining the compiler. &lt;strong&gt;&amp;ldquo;What kinds of jobs are these?&amp;rdquo;, you&amp;rsquo;re
asking.&lt;/strong&gt; I think there are quite a few, but let me give a few
examples:&lt;/p&gt;</description></item><item><title>Async-await status report</title><link>https://smallcultfollowing.com/babysteps/blog/2019/03/01/async-await-status-report/</link><pubDate>Fri, 01 Mar 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/03/01/async-await-status-report/</guid><description>&lt;p&gt;I wanted to post a quick update on the status of the async-await
effort. The short version is that we&amp;rsquo;re in the &lt;strong&gt;home stretch&lt;/strong&gt; for
some kind of stabilization, but there remain some significant
questions to overcome.&lt;/p&gt;
&lt;h2 id="announcing-the-implementation-working-group"&gt;Announcing the implementation working group&lt;/h2&gt;
&lt;p&gt;As part of this push, I&amp;rsquo;m happy to announce we&amp;rsquo;ve formed a
&lt;a href="https://github.com/rust-lang/compiler-team/blob/master/README.md"&gt;&lt;strong&gt;async-await implementation working group&lt;/strong&gt;&lt;/a&gt;. This working group
is part of the whole async-await effort, but focused on the
implementation, and is part of the compiler team. If you&amp;rsquo;d like to
help get async-await over the finish line, we&amp;rsquo;ve got a list of issues
where we&amp;rsquo;d definitely like help (read on).&lt;/p&gt;</description></item><item><title>Rust lang team working groups</title><link>https://smallcultfollowing.com/babysteps/blog/2019/02/22/rust-lang-team-working-groups/</link><pubDate>Fri, 22 Feb 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/02/22/rust-lang-team-working-groups/</guid><description>&lt;p&gt;Now that the Rust 2018 edition has shipped, the language design team
has been thinking a lot about what to do in 2019 and over the next
few years. I think we&amp;rsquo;ve got a lot of exciting stuff on the horizon,
and I wanted to write about it.&lt;/p&gt;
&lt;h2 id="theme-for-this-edition"&gt;Theme for this edition&lt;/h2&gt;
&lt;p&gt;In 2015, our overall theme was &lt;strong&gt;stability&lt;/strong&gt;. For the 2018 Edition, we adopted
&lt;strong&gt;productivity&lt;/strong&gt;. For Rust 2021&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;, we are thinking of &lt;strong&gt;maturity&lt;/strong&gt; as the theme.
Our goal is finish up a number of in-flight features &amp;ndash; such as specialization,
generic associated types, and const generics &amp;ndash; that have emerged as key enablers
for future work. In tandem, we aim to start improving our reference material,
both through continuing the great work that&amp;rsquo;s been done on the Rust reference
but also through more specialized efforts like the Grammar and Unsafe Code Guidelines
working groups.&lt;/p&gt;</description></item><item><title>Salsa: Incremental recompilation</title><link>https://smallcultfollowing.com/babysteps/blog/2019/01/29/salsa-incremental-recompilation/</link><pubDate>Tue, 29 Jan 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/01/29/salsa-incremental-recompilation/</guid><description>&lt;p&gt;So for the last couple of months or so, I&amp;rsquo;ve been hacking in my spare
time on this library named
&lt;a href="https://github.com/salsa-rs/salsa"&gt;&lt;strong&gt;salsa&lt;/strong&gt;&lt;/a&gt;, along with a &lt;a href="https://github.com/salsa-rs/salsa/graphs/contributors"&gt;number
of awesome other
folks&lt;/a&gt;. Salsa
basically extracts the incremental recompilation techniques that we
built for rustc into a general-purpose framework that can be used by
other programs. Salsa is developing quickly: with the publishing of
v0.10.0, we saw a big step up in the overall ergonomics, and I think
the current interface is starting to feel very nice.&lt;/p&gt;</description></item><item><title>Polonius and the case of the hereditary harrop predicate</title><link>https://smallcultfollowing.com/babysteps/blog/2019/01/21/hereditary-harrop-region-constraints/</link><pubDate>Mon, 21 Jan 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/01/21/hereditary-harrop-region-constraints/</guid><description>&lt;p&gt;In my &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2019/01/17/polonius-and-region-errors/"&gt;previous post&lt;/a&gt; about Polonius and subregion obligations, I
mentioned that there needs to be a follow-up to deal with
higher-ranked subregions. This post digs a bit more into what the
&lt;em&gt;problem&lt;/em&gt; is in the first place and sketches out the general solution
I have in mind, but doesn&amp;rsquo;t give any concrete algorithms for it.&lt;/p&gt;
&lt;h3 id="the-subset-relation-in-polonius-is-not-enough"&gt;The subset relation in Polonius is not enough&lt;/h3&gt;
&lt;p&gt;In my original post on Polonius, I assumed that when we computed a
subtype relation &lt;code&gt;T1 &amp;lt;: T2&lt;/code&gt; between two types, the result was either a
hard error or a set of &lt;code&gt;subset&lt;/code&gt; relations between various regions.
So, for example, if we had a subtype relation between two references:&lt;/p&gt;</description></item><item><title>Polonius and region errors</title><link>https://smallcultfollowing.com/babysteps/blog/2019/01/17/polonius-and-region-errors/</link><pubDate>Thu, 17 Jan 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/01/17/polonius-and-region-errors/</guid><description>&lt;p&gt;Now that NLL has been shipped, I&amp;rsquo;ve been doing some work revisiting
&lt;a href="https://github.com/rust-lang-nursery/polonius/"&gt;the Polonius project&lt;/a&gt;. Polonius is the project that implements
&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2018/04/27/an-alias-based-formulation-of-the-borrow-checker/"&gt;the &amp;ldquo;alias-based formulation&amp;rdquo; described in my older
blogpost&lt;/a&gt;. Polonius has come a long way since that post; it&amp;rsquo;s now
quite fast and also experimentally integrated into rustc, where it
passes the full test suite.&lt;/p&gt;
&lt;p&gt;However, polonius as described is not complete. It describes the core
&amp;ldquo;borrow check&amp;rdquo; analysis, but there are a number of other checks that
the current implementation checks which polonius ignores:&lt;/p&gt;</description></item><item><title>Rust in 2019: Focus on sustainability</title><link>https://smallcultfollowing.com/babysteps/blog/2019/01/07/rust-in-2019-focus-on-sustainability/</link><pubDate>Mon, 07 Jan 2019 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2019/01/07/rust-in-2019-focus-on-sustainability/</guid><description>&lt;p&gt;To me, 2018 felt like a big turning point for Rust, and it wasn&amp;rsquo;t just
the edition. Suddenly, it has become &amp;ldquo;normal&amp;rdquo; for me to meet people
using Rust at their jobs. Rust conferences are growing and starting to
have large number of sponsors. Heck, I even met some professional Rust
developers amongst the parents at a kid&amp;rsquo;s birthday party
recently. Something has shifted, and I like it.&lt;/p&gt;
&lt;p&gt;At the same time, I&amp;rsquo;ve also noticed a lot of exhaustion. I know I feel
it &amp;ndash; and a lot of people I talk to seem to feel the same way. It&amp;rsquo;s
great that so much is going on in the Rust world, but we need to get
better at scaling our processes up and processing it effectively.&lt;/p&gt;</description></item><item><title>After NLL: Moving from borrowed data and the sentinel pattern</title><link>https://smallcultfollowing.com/babysteps/blog/2018/11/10/after-nll-moving-from-borrowed-data-and-the-sentinel-pattern/</link><pubDate>Sat, 10 Nov 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/11/10/after-nll-moving-from-borrowed-data-and-the-sentinel-pattern/</guid><description>&lt;p&gt;Continuing on with my “After NLL” series, I want to look at another
common error that I see and its solution: today’s choice is about moves
from borrowed data and the &lt;em&gt;Sentinel Pattern&lt;/em&gt; that can be used to enable
them.&lt;/p&gt;
&lt;h1 id="the-problem"&gt;The problem&lt;/h1&gt;
&lt;p&gt;Sometimes when we have &lt;code&gt;&amp;amp;mut&lt;/code&gt; access to a struct, we have a need to
&lt;em&gt;temporarily&lt;/em&gt; take ownership of some of its fields. Usually what happens
is that we want to move out from a field, construct something new using
the old value, and then replace it. So for example imagine we have a
type &lt;code&gt;Chain&lt;/code&gt;, which implements a simple linked list:&lt;/p&gt;</description></item><item><title>Splash 2018 Mid-Week Report</title><link>https://smallcultfollowing.com/babysteps/blog/2018/11/08/splash-2018-mid-week-report/</link><pubDate>Thu, 08 Nov 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/11/08/splash-2018-mid-week-report/</guid><description>&lt;p&gt;This week I&amp;rsquo;ve been attending SPLASH 2018. It&amp;rsquo;s already been quite an
interesting week, and it&amp;rsquo;s only just begun. I thought I&amp;rsquo;d write up a
quick report on some of the things that have been particularly
interesting to me, and some of the ideas that they&amp;rsquo;ve sparked off.&lt;/p&gt;
&lt;h3 id="teaching-programming-and-rust"&gt;Teaching programming (and Rust!)&lt;/h3&gt;
&lt;p&gt;I really enjoyed this talk by Felienne Hermans entitled &lt;a href="https://2018.splashcon.org/event/splash-2018-keynotes-explicit-direct-instruction-in-programming-education"&gt;&amp;ldquo;Explicit
Direct Instruction in Programming Education&amp;rdquo;&lt;/a&gt;. The basic gist of
the talk was that, when we teach programming, we often phrase it in
terms of &amp;ldquo;exploration&amp;rdquo; and &amp;ldquo;self-expression&amp;rdquo;, but that this winds up
leaving a lot of folks in the cold and may be at least &lt;em&gt;partly&lt;/em&gt;
responsible for the lack of diversity in computer science today. She
argued that this is like telling kids that they should just be able to
play a guitar and create awesome songs without first practicing their
chords&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; &amp;ndash; it kind of sets them up to fail.&lt;/p&gt;</description></item><item><title>After NLL: Interprocedural conflicts</title><link>https://smallcultfollowing.com/babysteps/blog/2018/11/01/after-nll-interprocedural-conflicts/</link><pubDate>Thu, 01 Nov 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/11/01/after-nll-interprocedural-conflicts/</guid><description>&lt;p&gt;In my previous post on the status of NLL, I promised to talk about
&amp;ldquo;What is next?&amp;rdquo; for ownership and borrowing in Rust. I want to lay out
the various limitations of Rust&amp;rsquo;s ownership and borrowing system that
I see, as well as &amp;ndash; where applicable &amp;ndash; current workarounds. I&amp;rsquo;m
curious to get feedback on which problems affect folks the most.&lt;/p&gt;
&lt;p&gt;The first limitation I wanted to focus on is &lt;strong&gt;interprocedural
conflicts&lt;/strong&gt;. In fact, I&amp;rsquo;ve covered a special case of this before &amp;ndash;
where a closure conflicts with its creator function &amp;ndash; in my post on
&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2018/04/24/rust-pattern-precise-closure-capture-clauses/"&gt;Precise Closure Capture Clauses&lt;/a&gt;. But the problem is more
general.&lt;/p&gt;</description></item><item><title>MIR-based borrowck is almost here</title><link>https://smallcultfollowing.com/babysteps/blog/2018/10/31/mir-based-borrowck-is-almost-here/</link><pubDate>Wed, 31 Oct 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/10/31/mir-based-borrowck-is-almost-here/</guid><description>&lt;p&gt;Now that &lt;a href="https://blog.rust-lang.org/2018/10/30/help-test-rust-2018.html"&gt;the final Rust 2018 Release Candidate has
shipped&lt;/a&gt;, I thought it would be a good idea to do another
update on the state of the MIR-based borrow check (aka NLL). The &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2018/06/15/mir-based-borrow-check-nll-status-update/"&gt;last
update&lt;/a&gt; was in June, when we were still hard at work on getting
things to work.&lt;/p&gt;
&lt;h2 id="rust-2018-will-use-nll-now"&gt;Rust 2018 will use NLL now&lt;/h2&gt;
&lt;p&gt;Let&amp;rsquo;s get the highlights out of the way. Most importantly, &lt;strong&gt;Rust 2018
crates will use NLL by default&lt;/strong&gt;. Once the Rust 2018 release candidate
becomes stable, &lt;strong&gt;we plan to switch Rust 2015 crates to use NLL as
well&lt;/strong&gt;, but we&amp;rsquo;re holding off until we have some more experience with
people using it in the wild.&lt;/p&gt;</description></item><item><title>October Office Hour Slots</title><link>https://smallcultfollowing.com/babysteps/blog/2018/09/27/october-office-hour-slots/</link><pubDate>Thu, 27 Sep 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/09/27/october-office-hour-slots/</guid><description>&lt;p&gt;Just a quick note that &lt;a href="https://github.com/nikomatsakis/office-hours/blob/master/2018/10.md"&gt;the October 2018 office hour slots&lt;/a&gt; are
now posted. If you&amp;rsquo;re having a problem with Rust, or have something
you&amp;rsquo;d like to talk out, please sign up!&lt;/p&gt;</description></item><item><title>Office Hours #1: Cyclic services</title><link>https://smallcultfollowing.com/babysteps/blog/2018/09/24/office-hours-1-cyclic-services/</link><pubDate>Mon, 24 Sep 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/09/24/office-hours-1-cyclic-services/</guid><description>&lt;p&gt;This is a report on the second &lt;a href="https://github.com/nikomatsakis/office-hours"&gt;&amp;ldquo;office hours&amp;rdquo;&lt;/a&gt;, in which we
discussed how to setup a series of services or actors that communicate
with one another. This is a classic kind of problem in Rust: how to
deal with cyclic data. Usually, the answer is that the cycle is not
necessary (as in this case).&lt;/p&gt;
&lt;h3 id="the-setup"&gt;The setup&lt;/h3&gt;
&lt;p&gt;To start, let&amp;rsquo;s imagine that we were working in a GC&amp;rsquo;d language, like
JavaScript. We want to have various &amp;ldquo;services&amp;rdquo;, each represented by an
object. These services may need to communicate with one another, so we
also create a &lt;strong&gt;directory&lt;/strong&gt;, which stores pointers to all the
services. As each service is created, they add themselves to the
directory; when it&amp;rsquo;s all setup, each service can access all other
services. The setup might look something like this:&lt;/p&gt;</description></item><item><title>Office Hours #0: Debugging with GDB</title><link>https://smallcultfollowing.com/babysteps/blog/2018/09/21/office-hours-0-debugging-with-gdb/</link><pubDate>Fri, 21 Sep 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/09/21/office-hours-0-debugging-with-gdb/</guid><description>&lt;p&gt;This is a report on the first &lt;a href="https://github.com/nikomatsakis/office-hours"&gt;&amp;ldquo;office hours&amp;rdquo;&lt;/a&gt;, in which we
discussed debugging Rust programs with gdb. I&amp;rsquo;m very grateful to
Ramana Venkata for suggesting the topic, and to Tom Tromey, who joined
in. (Tom has been doing a lot of the work of integrating rustc into
gdb and lldb lately.)&lt;/p&gt;
&lt;p&gt;This blog post is just going to be a quick summary of the basic
workflow of using Rust with gdb on the command line. I&amp;rsquo;m assuming you
are using Linux here, since I think otherwise you would prefer a
different debugger. There are probably also nifty graphical tools you
can use and maybe even IDE integrations, I&amp;rsquo;m not sure.&lt;/p&gt;</description></item><item><title>Rust office hours</title><link>https://smallcultfollowing.com/babysteps/blog/2018/09/12/rust-office-hours/</link><pubDate>Wed, 12 Sep 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/09/12/rust-office-hours/</guid><description>&lt;p&gt;Hello, all! Beginning this Friday (in two days)&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;, I&amp;rsquo;m going
to start an experiment that I call &lt;strong&gt;Rust office hours&lt;/strong&gt;. The idea is
simple: I&amp;rsquo;ve set aside a few slots per week to help people work
through problems they are having learning or using Rust. My goal here
is both to be of service but also to gain more insight into the kinds
of things people have trouble with. &lt;strong&gt;No problem is too big or too
small!&lt;/strong&gt;&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;</description></item><item><title>Rust pattern: Iterating an over a Rc&lt;Vec&lt;T&gt;&gt;</title><link>https://smallcultfollowing.com/babysteps/blog/2018/09/02/rust-pattern-iterating-an-over-a-rc-vec-t/</link><pubDate>Sun, 02 Sep 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/09/02/rust-pattern-iterating-an-over-a-rc-vec-t/</guid><description>&lt;p&gt;This post examines a particular, seemingly simple problem: given
ownership of a &lt;code&gt;Rc&amp;lt;Vec&amp;lt;u32&amp;gt;&amp;gt;&lt;/code&gt;, can we write a function that returns an
&lt;code&gt;impl Iterator&amp;lt;Item = u32&amp;gt;&lt;/code&gt;? It turns out that this is a bit harder
than it might at first appear &amp;ndash; and, as we&amp;rsquo;ll see, for good
reason. I&amp;rsquo;ll dig into what&amp;rsquo;s going on, how you can fix it, and how we
might extend the language in the future to try and get past this
challenge.&lt;/p&gt;</description></item><item><title>Never patterns, exhaustive matching, and uninhabited types (oh my!)</title><link>https://smallcultfollowing.com/babysteps/blog/2018/08/13/never-patterns-exhaustive-matching-and-uninhabited-types-oh-my/</link><pubDate>Mon, 13 Aug 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/08/13/never-patterns-exhaustive-matching-and-uninhabited-types-oh-my/</guid><description>&lt;p&gt;One of the long-standing issues that we&amp;rsquo;ve been wrestling with in Rust
is how to integrate the concept of an &amp;ldquo;uninhabited type&amp;rdquo; &amp;ndash; that is, a
type which has no values at all. Uninhabited types are useful to
represent the &amp;ldquo;result&amp;rdquo; of some computation you know will never execute
&amp;ndash; for example, if you have to define an error type for some
computation, but this particular computation can never fail, you might
use an uninhabited type.&lt;/p&gt;</description></item><item><title>Proposal for a staged RFC process</title><link>https://smallcultfollowing.com/babysteps/blog/2018/06/20/proposal-for-a-staged-rfc-process/</link><pubDate>Wed, 20 Jun 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/06/20/proposal-for-a-staged-rfc-process/</guid><description>&lt;p&gt;I consider Rust&amp;rsquo;s RFC process one of our great accomplishments, but
it&amp;rsquo;s no secret that it has a few flaws. At its best, the RFC offers an
opportunity for collaborative design that is really exciting to be a
part of. At its worst, it can devolve into bickering without any real
motion towards consensus. If you&amp;rsquo;ve not done so already, I strongly
recommend reading aturon&amp;rsquo;s &lt;a href="http://aturon.github.io/2018/05/25/listening-part-1/"&gt;excellent&lt;/a&gt; &lt;a href="http://aturon.github.io/2018/06/02/listening-part-2/"&gt;blog&lt;/a&gt; &lt;a href="http://aturon.github.io/2018/06/18/listening-part-3/"&gt;posts&lt;/a&gt; on
this topic.&lt;/p&gt;
&lt;p&gt;The RFC process has also evolved somewhat organically over time. What
began as &amp;ldquo;just open a pull request on GitHub&amp;rdquo; has moved into a process
with a number of formal and informal stages (described below). I think
it&amp;rsquo;s a good time for us to take a step back and see if we can refine
those stages into something that works better for everyone.&lt;/p&gt;</description></item><item><title>MIR-based borrow check (NLL) status update</title><link>https://smallcultfollowing.com/babysteps/blog/2018/06/15/mir-based-borrow-check-nll-status-update/</link><pubDate>Fri, 15 Jun 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/06/15/mir-based-borrow-check-nll-status-update/</guid><description>&lt;p&gt;I&amp;rsquo;ve been getting a lot of questions about the status of &amp;ldquo;Non-lexical
lifetimes&amp;rdquo; (NLL) &amp;ndash; or, as I prefer to call it these days, the
MIR-based borrow checker &amp;ndash; so I wanted to post a status
update.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The single most important fact is that the MIR-based borrow check is
feature complete and available on nightly. What this means is that
the behavior of &lt;code&gt;#![feature(nll)]&lt;/code&gt; is roughly what we intend to ship
for &amp;ldquo;version 1&amp;rdquo;, except that (a) the performance needs work and (b) we
are still improving the diagnostics.&lt;/strong&gt; (More on those points later.)&lt;/p&gt;</description></item><item><title>An alias-based formulation of the borrow checker</title><link>https://smallcultfollowing.com/babysteps/blog/2018/04/27/an-alias-based-formulation-of-the-borrow-checker/</link><pubDate>Fri, 27 Apr 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/04/27/an-alias-based-formulation-of-the-borrow-checker/</guid><description>&lt;p&gt;Ever since the Rust All Hands, I&amp;rsquo;ve been experimenting with an
alternative formulation of the Rust borrow checker. The goal is to
find a formulation that overcomes some shortcomings of the current
proposal while hopefully also being faster to compute. I have
implemented a prototype for this analysis. It passes the full NLL test
suite and also handles a few cases &amp;ndash; such as &lt;a href="https://github.com/rust-lang/rust/issues/47680#issuecomment-363131420"&gt;#47680&lt;/a&gt; &amp;ndash; that the
current NLL analysis cannot handle. However, the performance has a
long way to go (it is currently slower than existing analysis). That
said, I haven&amp;rsquo;t even begun to optimize yet, and I know I am doing some
naive and inefficient things that can definitely be done better; so I
am still optimistic we&amp;rsquo;ll be able to make big strides there.&lt;/p&gt;</description></item><item><title>Rust pattern: Precise closure capture clauses</title><link>https://smallcultfollowing.com/babysteps/blog/2018/04/24/rust-pattern-precise-closure-capture-clauses/</link><pubDate>Tue, 24 Apr 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/04/24/rust-pattern-precise-closure-capture-clauses/</guid><description>&lt;p&gt;This is the &lt;strong&gt;second&lt;/strong&gt; in a series of posts about Rust compiler
errors. Each one will talk about a particular error that I got
recently and try to explain (a) why I am getting it and (b) how I
fixed it. The purpose of this series of posts is partly to explain
Rust, but partly just to gain data for myself. I may also write posts
about errors I&amp;rsquo;m not getting &amp;ndash; basically places where I anticipated
an error, and used a pattern to avoid it. I hope that after writing
enough of these posts, I or others will be able to synthesize some of
these facts to make intermediate Rust material, or perhaps to improve
the language itself.&lt;/p&gt;</description></item><item><title>Rust pattern: Rooting an Rc handle</title><link>https://smallcultfollowing.com/babysteps/blog/2018/04/16/rust-pattern-rooting-an-rc-handle/</link><pubDate>Mon, 16 Apr 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/04/16/rust-pattern-rooting-an-rc-handle/</guid><description>&lt;p&gt;I&amp;rsquo;ve decided to do a little series of posts about Rust compiler
errors. Each one will talk about a particular error that I got
recently and try to explain (a) why I am getting it and (b) how I
fixed it. The purpose of this series of posts is partly to explain
Rust, but partly just to gain data for myself. I may also write posts
about errors I&amp;rsquo;m not getting &amp;ndash; basically places where I anticipated
an error, and used a pattern to avoid it. I hope that after writing
enough of these posts, I or others will be able to synthesize some of
these facts to make intermediate Rust material, or perhaps to improve
the language itself.&lt;/p&gt;</description></item><item><title>Maximally minimal specialization: always applicable impls</title><link>https://smallcultfollowing.com/babysteps/blog/2018/02/09/maximally-minimal-specialization-always-applicable-impls/</link><pubDate>Fri, 09 Feb 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/02/09/maximally-minimal-specialization-always-applicable-impls/</guid><description>&lt;p&gt;So
&lt;a href="http://aturon.github.io/2018/02/09/amazing-week/"&gt;aturon wrote this beautiful post about what a good week it has been&lt;/a&gt;.
In there, they wrote:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Breakthrough #2&lt;/strong&gt;: @nikomatsakis had a eureka moment and figured out a
path to make specialization sound, while still supporting its most
important use cases (blog post forthcoming!). Again, this suddenly
puts specialization on the map for Rust Epoch 2018.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Sheesh I wish they hadn&amp;rsquo;t written that! Now the pressure is on. Well,
here goes nothing =).&lt;/p&gt;</description></item><item><title>In Rust, ordinary vectors are values</title><link>https://smallcultfollowing.com/babysteps/blog/2018/02/01/in-rust-ordinary-vectors-are-values/</link><pubDate>Thu, 01 Feb 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/02/01/in-rust-ordinary-vectors-are-values/</guid><description>&lt;p&gt;I&amp;rsquo;ve been thinking a lot about persistent collections lately and
in particular how they relate to Rust, and I wanted to write up some
of my observations.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;h3 id="what-is-a-persistent-collection"&gt;What is a persistent collection?&lt;/h3&gt;
&lt;p&gt;Traditionally, persistent collections are seen as this &amp;ldquo;wildly
different&amp;rdquo; way to setup your collection. Instead of having
methods like &lt;code&gt;push&lt;/code&gt;, which grow a vector &lt;strong&gt;in place&lt;/strong&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;element&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// add element to `vec`
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;you have a method like &lt;code&gt;add&lt;/code&gt;, which leaves the original vector alone
but returns a &lt;strong&gt;new vector&lt;/strong&gt; that has been modified:&lt;/p&gt;</description></item><item><title>An on-demand SLG solver for chalk</title><link>https://smallcultfollowing.com/babysteps/blog/2018/01/31/an-on-demand-slg-solver-for-chalk/</link><pubDate>Wed, 31 Jan 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/01/31/an-on-demand-slg-solver-for-chalk/</guid><description>&lt;p&gt;In my last Chalk post, I talked about an experimental, SLG-based
solver that I wrote for Chalk. That particular design was based very
closely on the excellent paper
&lt;a href="http://www.sciencedirect.com/science/article/pii/0743106694000285"&gt;&amp;ldquo;Efficient top-down computation of queries under the well-founded semantics&amp;rdquo;, by W. Chen, T. Swift, and D. Warren&lt;/a&gt;. It
followed a traditional Prolog execution model: this has a lot of
strengths, but it probably wasn&amp;rsquo;t really suitable for use in rustc.
The single biggest reason for this was that it didn&amp;rsquo;t really know when
to stop: given a query like &lt;code&gt;exists&amp;lt;T&amp;gt; { T: Sized }&lt;/code&gt;, it would happily
try to enumerate all sized types in the system. It was also pretty
non-obvious to me how to extend that system with things like
co-inductive predicates (needed for auto traits) and a few other
peculiarities of Rust.&lt;/p&gt;</description></item><item><title>#Rust2018</title><link>https://smallcultfollowing.com/babysteps/blog/2018/01/09/rust2018/</link><pubDate>Tue, 09 Jan 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/01/09/rust2018/</guid><description>&lt;p&gt;As part of #Rust2018, I thought I would try to writeup my own
(current) perspective. I&amp;rsquo;ll try to keep things brief.&lt;/p&gt;
&lt;p&gt;First and foremost, I think that this year we have to &lt;strong&gt;finish what we
started and get the &amp;ldquo;Rust 2018&amp;rdquo; release out the door&lt;/strong&gt;. We did good
work in 2017: now we have to make sure the world knows it and can use
it. This primarily means we have to do stabilization work, both for
the recent features added in 2017 as well as some, ahem,
longer-running topics, like SIMD. It also means keeping up our focus
on tooling, like IDE support, rustfmt, and debugger integration.&lt;/p&gt;</description></item><item><title>Lessons from the impl period</title><link>https://smallcultfollowing.com/babysteps/blog/2018/01/05/lessons-from-the-impl-period/</link><pubDate>Fri, 05 Jan 2018 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2018/01/05/lessons-from-the-impl-period/</guid><description>&lt;p&gt;So, as you likely know, we tried something new at the end of 2017. For
roughly the final quarter of the year, we essentially stopped doing
design work, and instead decided to focus on implementation &amp;ndash; what we
called the &lt;a href="https://blog.rust-lang.org/2017/09/18/impl-future-for-rust.html"&gt;&amp;ldquo;impl period&amp;rdquo;&lt;/a&gt;. We had two goals for the impl period:
(a) get a lot of high-value implementation work done and (b) to do
that by expanding the size of our community, and making it easy for
new people to get involved. To that end, we spun up &lt;strong&gt;about 40 working
groups&lt;/strong&gt;, which is really a tremendous figure when you think about it,
each of which was devoted to a particular task.&lt;/p&gt;</description></item><item><title>Chalk meets SLG</title><link>https://smallcultfollowing.com/babysteps/blog/2017/10/21/chalk-meets-slg/</link><pubDate>Sat, 21 Oct 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/10/21/chalk-meets-slg/</guid><description>&lt;p&gt;For the last month or so, I&amp;rsquo;ve gotten kind of obsessed with exploring
a new evaluation model for Chalk. Specifically, I&amp;rsquo;ve been looking at
adapting the &lt;a href="https://link.springer.com/chapter/10.1007/3-540-48159-1_12"&gt;SLG algorithm&lt;/a&gt;, which is used in the
&lt;a href="http://xsb.sourceforge.net/"&gt;XSB Prolog engine&lt;/a&gt;. I recently
&lt;a href="https://github.com/rust-lang-nursery/chalk/pull/59"&gt;opened a PR that adds this SLG-based solver as an alternative&lt;/a&gt;,
and this blog post is an effort to describe how that PR works, and
explore some of the advantages and disadvantages I see in this
approach relative to
&lt;a href="http://smallcultfollowing.com/babysteps/blog/2017/09/12/tabling-handling-cyclic-queries-in-chalk/"&gt;the current solver that I described in my previous post&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Cyclic queries in chalk</title><link>https://smallcultfollowing.com/babysteps/blog/2017/09/12/tabling-handling-cyclic-queries-in-chalk/</link><pubDate>Tue, 12 Sep 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/09/12/tabling-handling-cyclic-queries-in-chalk/</guid><description>&lt;p&gt;In my &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2017/05/25/query-structure-in-chalk/"&gt;last post about chalk queries&lt;/a&gt;, I discussed how the query
model in chalk. Since that writing, there have been some updates, and
I thought it&amp;rsquo;d be nice to do a new post covering the current model.
This post will also cover the tabling technique that &lt;a href="https://github.com/scalexm/"&gt;scalexm&lt;/a&gt;
implemented for handling cyclic relations and show how that enables us
to implement implied bounds and other long-desired features in an
elegant way. (Nice work, scalexm!)&lt;/p&gt;</description></item><item><title>Non-lexical lifetimes: draft RFC and prototype available</title><link>https://smallcultfollowing.com/babysteps/blog/2017/07/11/non-lexical-lifetimes-draft-rfc-and-prototype-available/</link><pubDate>Tue, 11 Jul 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/07/11/non-lexical-lifetimes-draft-rfc-and-prototype-available/</guid><description>&lt;p&gt;I&amp;rsquo;ve been hard at work the last month or so on trying to complete the
non-lexical lifetimes RFC. I&amp;rsquo;m pretty excited about how it&amp;rsquo;s shaping
up. I wanted to write a kind of &amp;ldquo;meta&amp;rdquo; blog post talking about the
current state of the proposal &amp;ndash; almost there! &amp;ndash; and how you could
get involved with helping to push it over the finish line.&lt;/p&gt;
&lt;h3 id="tldr"&gt;TL;DR&lt;/h3&gt;
&lt;p&gt;What can I say, I&amp;rsquo;m loquacious! In case you don&amp;rsquo;t want to read the
full post, here are the highlights:&lt;/p&gt;</description></item><item><title>Query structure in chalk</title><link>https://smallcultfollowing.com/babysteps/blog/2017/05/25/query-structure-in-chalk/</link><pubDate>Thu, 25 May 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/05/25/query-structure-in-chalk/</guid><description>&lt;p&gt;For my next post discussing &lt;a href="https://github.com/nikomatsakis/chalk/"&gt;chalk&lt;/a&gt;, I want to take kind of a
different turn. I want to talk about the general struct of &lt;strong&gt;chalk
queries&lt;/strong&gt; and how chalk handles them right now. (If you&amp;rsquo;ve never heard
of chalk, it&amp;rsquo;s sort of &amp;ldquo;reference implementation&amp;rdquo; for Rust&amp;rsquo;s trait
system, as well as an attempt to describe Rust&amp;rsquo;s trait system in terms
of its logical underpinnings; see
&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2017/01/26/lowering-rust-traits-to-logic/"&gt;this post for an introduction to the big idea&lt;/a&gt;.)&lt;/p&gt;</description></item><item><title>gnome-class: Integrating Rust and the GNOME object system</title><link>https://smallcultfollowing.com/babysteps/blog/2017/05/02/gnome-class-integrating-rust-and-the-gnome-object-system/</link><pubDate>Tue, 02 May 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/05/02/gnome-class-integrating-rust-and-the-gnome-object-system/</guid><description>&lt;p&gt;I recently participated in the GNOME / Rust &amp;ldquo;dev sprint&amp;rdquo; in Mexico
City. (A thousand thanks to Federico and Joaquin for organizing!)
While there I spent some time working on the
&lt;a href="https://github.com/nikomatsakis/gnome-class"&gt;gnome-class plugin&lt;/a&gt;. The
goal of gnome-class was to make it easy to write GObject
implementations in Rust which would fully interoperate with C code.&lt;/p&gt;
&lt;p&gt;Roughly speaking, my goal was that you should be able to write code
that looked and felt like
&lt;a href="https://wiki.gnome.org/Projects/Vala"&gt;Vala code&lt;/a&gt;, but where the
method bodies (and types, and so forth) are in Rust. The plugin is in
no way done, but I think it&amp;rsquo;s already letting you do some pretty nice
stuff. For example, this little snippet defines a &lt;code&gt;Counter&lt;/code&gt; class
offering two methods (&lt;code&gt;add()&lt;/code&gt; and &lt;code&gt;get()&lt;/code&gt;):&lt;/p&gt;</description></item><item><title>Unification in Chalk, part 2</title><link>https://smallcultfollowing.com/babysteps/blog/2017/04/23/unification-in-chalk-part-2/</link><pubDate>Sun, 23 Apr 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/04/23/unification-in-chalk-part-2/</guid><description>&lt;p&gt;In my previous post, I talked over the basics of how
&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2017/03/25/unification-in-chalk-part-1/"&gt;unification works&lt;/a&gt; and showed how that &amp;ldquo;mathematical version&amp;rdquo; winds
up being expressed in chalk. I want to go a bit further now and extend
that base system to cover &lt;a href="https://doc.rust-lang.org/nightly/book/second-edition/ch19-03-advanced-traits.html#associated-types"&gt;associated types&lt;/a&gt;. These turn out to be a
pretty non-trival extension.&lt;/p&gt;
&lt;h3 id="what-is-an-associated-type"&gt;What is an associated type?&lt;/h3&gt;
&lt;p&gt;If you&amp;rsquo;re not a Rust programmer, you may not be familiar with the term
&amp;ldquo;associated type&amp;rdquo; (although many langages have equivalents). The basic
idea is that traits can have &lt;strong&gt;type members&lt;/strong&gt; associated with them. I
find the most intuitive example to be the &lt;code&gt;Iterator&lt;/code&gt; trait, which has
an associated type &lt;code&gt;Item&lt;/code&gt;. This type corresponds to kind of elements
that are produced by the iterator:&lt;/p&gt;</description></item><item><title>Rayon 0.7 released</title><link>https://smallcultfollowing.com/babysteps/blog/2017/04/06/rayon-0-7-released/</link><pubDate>Thu, 06 Apr 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/04/06/rayon-0-7-released/</guid><description>&lt;p&gt;We just released Rayon 0.7. This is a pretty exciting release, because
it marks the official first step towards Rayon 1.0. In addition, it
marks the first release where Rayon&amp;rsquo;s parallel iterators reach
&amp;ldquo;feature parity&amp;rdquo; with the standard sequential iterators! To mark the
moment, I thought I&amp;rsquo;d post the release notes here on the blog:&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;This release marks the first step towards Rayon 1.0. &lt;strong&gt;For best
performance, it is important that all Rayon users update to at least
Rayon 0.7.&lt;/strong&gt; This is because, as of Rayon 0.7, we have taken steps to
ensure that, no matter how many versions of rayon are actively in use,
there will only be a single global scheduler. This is achieved via the
&lt;code&gt;rayon-core&lt;/code&gt; crate, which is being released at version 1.0, and which
encapsulates the core schedule APIs like &lt;code&gt;join()&lt;/code&gt;. (Note: the
&lt;code&gt;rayon-core&lt;/code&gt; crate is, to some degree, an implementation detail, and
not intended to be imported directly; it&amp;rsquo;s entire API surface is
mirrored through the rayon crate.)&lt;/p&gt;</description></item><item><title>Unification in Chalk, part 1</title><link>https://smallcultfollowing.com/babysteps/blog/2017/03/25/unification-in-chalk-part-1/</link><pubDate>Sat, 25 Mar 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/03/25/unification-in-chalk-part-1/</guid><description>&lt;p&gt;So in &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2017/01/26/lowering-rust-traits-to-logic/"&gt;my first post&lt;/a&gt; on &lt;a href="https://github.com/nikomatsakis/chalk/"&gt;chalk&lt;/a&gt;, I mentioned that unification and
normalization of associated types were interesting topics. I&amp;rsquo;m going
to write a two-part blog post series covering that. This first part
begins with an overview of how ordinary type unification works during
compilation. The next post will add in associated types and we can see
what kinds of mischief they bring with them.&lt;/p&gt;
&lt;h3 id="what-is-unification"&gt;What is unification?&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s start with a brief overview of what unification is. When you are
doing type-checking or trait-checking, it often happens that you wind
up with types that you don&amp;rsquo;t know yet. For example, the user might
write &lt;code&gt;None&lt;/code&gt; &amp;ndash; you know that this has type &lt;code&gt;Option&amp;lt;T&amp;gt;&lt;/code&gt;, but you don&amp;rsquo;t
know what that type &lt;code&gt;T&lt;/code&gt; is. To handle this, the compiler will create a
&lt;strong&gt;type variable&lt;/strong&gt;. This basically represents an unknown,
to-be-determined type. To denote this, I&amp;rsquo;ll write &lt;code&gt;Option&amp;lt;?T&amp;gt;&lt;/code&gt;, where
the leading question mark indicates a variable.&lt;/p&gt;</description></item><item><title>The Lane Table algorithm</title><link>https://smallcultfollowing.com/babysteps/blog/2017/03/17/the-lane-table-algorithm/</link><pubDate>Fri, 17 Mar 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/03/17/the-lane-table-algorithm/</guid><description>&lt;p&gt;For some time now I&amp;rsquo;ve been interested in better ways to construct
LR(1) parsers. LALRPOP currently allows users to choose between the
full LR(1) algorithm or the LALR(1) subset. Neither of these choices
is very satisfying:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the full LR(1) algorithm gives pretty intuitive results but produces
a lot of states; my hypothesis was that, with modern computers, this
wouldn&amp;rsquo;t matter anymore. This is sort of true &amp;ndash; e.g., I&amp;rsquo;m able to
generate and process even the &lt;a href="https://github.com/nikomatsakis/rustypop"&gt;full Rust grammar&lt;/a&gt; &amp;ndash; but this
results in a &lt;strong&gt;ton&lt;/strong&gt; of generated code.&lt;/li&gt;
&lt;li&gt;the LALR(1) subset often works but sometimes mysteriously fails with
indecipherable errors. This is because it is basically a hack that
conflates states in the parsing table according to a heuristic; when
this heuristic fails, you get strange results.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;a href="http://cssauh.com/xc/pub/LaneTable_APPLC12.pdf"&gt;Lane Table algorithm&lt;/a&gt; published by Pager and Chen at APPLC
&amp;lsquo;12 offers an interesting alternative. It is an alternative to earlier
work by Pager, the &amp;ldquo;lane tracing&amp;rdquo; algorithm and practical general
method. In any case, the goal is to generate an LALR(1) state machine
&lt;em&gt;when possible&lt;/em&gt; and gracefully scale up to the full LR(1) state
machine &lt;em&gt;as needed&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>Nested method calls via two-phase borrowing</title><link>https://smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/</link><pubDate>Wed, 01 Mar 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/</guid><description>&lt;p&gt;In my previous post, I
&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2017/02/21/non-lexical-lifetimes-using-liveness-and-location/"&gt;outlined a plan for non-lexical lifetimes&lt;/a&gt;. I wanted to write a
follow-up post today that discusses different ways that we can extend
the system to support nested mutable calls. The ideas here are based
on some the ideas that emerged in a
&lt;a href="https://internals.rust-lang.org/t/accepting-nested-method-calls-with-an-mut-self-receiver/4588"&gt;recent discussion on internals&lt;/a&gt;, although what I describe
here is a somewhat simplified variant. If you want more background,
it&amp;rsquo;s worth reading at least the top post in the thread, where I laid
out a lot of the history here. I&amp;rsquo;ll try to summarize the key bits as I
go.&lt;/p&gt;</description></item><item><title>Non-lexical lifetimes using liveness and location</title><link>https://smallcultfollowing.com/babysteps/blog/2017/02/21/non-lexical-lifetimes-using-liveness-and-location/</link><pubDate>Tue, 21 Feb 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/02/21/non-lexical-lifetimes-using-liveness-and-location/</guid><description>&lt;p&gt;At the recent compiler design sprint,
&lt;a href="https://public.etherpad-mozilla.org/p/rust-compiler-design-sprint-paris-2017-nll"&gt;we spent some time discussing &lt;strong&gt;non-lexical lifetimes&lt;/strong&gt;&lt;/a&gt;,
the plan to make Rust&amp;rsquo;s lifetime system significantly more advanced. I
want to write-up those plans here, and give some examples of the kinds
of programs that would now type-check, along with some that still will
not (for better or worse).&lt;/p&gt;
&lt;p&gt;If you were at the sprint, then the system I am going to describe in
this blog post will actually sound quite a bit different than what we
were talking about. However, I believe it is equivalent to that
system. I am choosing to describe it differently because this version,
I believe, would be significantly more efficient to implement (if
implemented naively). I also find it rather easier to understand.&lt;/p&gt;</description></item><item><title>Project idea: datalog output from rustc</title><link>https://smallcultfollowing.com/babysteps/blog/2017/02/17/project-idea-datalog-output-from-rustc/</link><pubDate>Fri, 17 Feb 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/02/17/project-idea-datalog-output-from-rustc/</guid><description>&lt;p&gt;I want to have a tool that would enable us to answer all kinds of queries about the structure of Rust code that exists in the wild. This should cover everything from synctactic queries like &amp;ldquo;How often do people write &lt;code&gt;let x = if { ... } else { match foo { ... } }&lt;/code&gt;?&amp;rdquo; to semantic queries like &amp;ldquo;How often do people call unsafe functions in another module?&amp;rdquo; I have some ideas about how to build such a tool, but (I suspect) not enough time to pursue them. I&amp;rsquo;m looking for people who might be interested in working on it!&lt;/p&gt;</description></item><item><title>Compiler design sprint summary</title><link>https://smallcultfollowing.com/babysteps/blog/2017/02/12/compiler-design-sprint-summary/</link><pubDate>Sun, 12 Feb 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/02/12/compiler-design-sprint-summary/</guid><description>&lt;p&gt;This last week we had the &lt;strong&gt;rustc compiler team design sprint&lt;/strong&gt;. This
was our second rustc compiler team sprint; the first one (last year)
we simply worked on pushing various projects over the finish line (for
example, in an epic effort, arielb1 completed dynamic drop during that
sprint).&lt;/p&gt;
&lt;p&gt;This sprint was different: we had the goal of talking over many of the
big design challenges that we&amp;rsquo;d like to tackle in the upcoming year
and making sure that the compiler team was roughly on board with the
best way to implement them.&lt;/p&gt;</description></item><item><title>Unsafe code and shared references</title><link>https://smallcultfollowing.com/babysteps/blog/2017/02/01/unsafe-code-and-shared-references/</link><pubDate>Wed, 01 Feb 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/02/01/unsafe-code-and-shared-references/</guid><description>&lt;p&gt;In a previous post, I talked about a &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2017/01/22/assigning-blame-to-unsafe-code/"&gt;proposed approach to drafting the
unsafe code guidelines&lt;/a&gt;. Specifically, I want to the approach of having
an &lt;strong&gt;executable specification&lt;/strong&gt; of Rust with additional checks that
will signal when undefined behavior has occurred. In this post, I want
to try to dive into that idea a bit more and give some more specifics
of the approach I have in mind. I&amp;rsquo;m going to focus on this post on the
matter of the proper use of shared references &lt;code&gt;&amp;amp;T&lt;/code&gt; &amp;ndash; I&amp;rsquo;ll completely
ignore &lt;code&gt;&amp;amp;mut T&lt;/code&gt; for now, since those are much more complicated
(because they require a notion of uniqueness).&lt;/p&gt;</description></item><item><title>Lowering Rust traits to logic</title><link>https://smallcultfollowing.com/babysteps/blog/2017/01/26/lowering-rust-traits-to-logic/</link><pubDate>Thu, 26 Jan 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/01/26/lowering-rust-traits-to-logic/</guid><description>&lt;p&gt;Over the last year or two (man, it&amp;rsquo;s scary how time flies), I&amp;rsquo;ve been
doing quite a lot of thinking about Rust&amp;rsquo;s trait system. I&amp;rsquo;ve been
looking for a way to correct a number of flaws and shortcomings in the
current implementation, not the least of which is that it&amp;rsquo;s
performance is not that great. But also, I&amp;rsquo;ve been wanting to get a
relatively clear, normative definition of how the trait system works,
so that we can better judge possible extensions. After a number of
false starts, I think I&amp;rsquo;m finally getting somewhere, so I wanted to
start writing about it.&lt;/p&gt;</description></item><item><title>Assigning blame to unsafe code</title><link>https://smallcultfollowing.com/babysteps/blog/2017/01/22/assigning-blame-to-unsafe-code/</link><pubDate>Sun, 22 Jan 2017 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2017/01/22/assigning-blame-to-unsafe-code/</guid><description>&lt;p&gt;While I was at POPL the last few days, I was reminded of an idea
regarding how to bring more struture to the unsafe code guidelines
process that I&amp;rsquo;ve been kicking around lately, but which I have yet to
write about publicly. The idea is fresh on my mind because while at
POPL I realized that there is an interesting opportunity to leverage
the &amp;ldquo;blame&amp;rdquo; calculation techniques from gradual typing research. But
before I get to blame, let me back up and give some context.&lt;/p&gt;</description></item><item><title>Parallel iterators, part 3: Consumers</title><link>https://smallcultfollowing.com/babysteps/blog/2016/11/14/parallel-iterators-part-3-consumers/</link><pubDate>Mon, 14 Nov 2016 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/11/14/parallel-iterators-part-3-consumers/</guid><description>&lt;p&gt;This post is the (long awaited, or at least long promised) third post
in my series on Rayon&amp;rsquo;s parallel iterators. The previous two posts
were some time ago, but I&amp;rsquo;ve been feeling inspired to push more on
Rayon lately, and I remembered that I had never finished this blog
post series.&lt;/p&gt;
&lt;p&gt;Here is a list of the other posts in the series. If you haven&amp;rsquo;t read
them, or don&amp;rsquo;t remember them, you will want to do so before reading
this one:&lt;/p&gt;</description></item><item><title>Associated type constructors, part 4: Unifying ATC and HKT</title><link>https://smallcultfollowing.com/babysteps/blog/2016/11/09/associated-type-constructors-part-4-unifying-atc-and-hkt/</link><pubDate>Wed, 09 Nov 2016 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/11/09/associated-type-constructors-part-4-unifying-atc-and-hkt/</guid><description>&lt;p&gt;This post is a continuation of my posts discussing the topic of
associated type constructors (ATC) and higher-kinded types (HKT):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2016/11/02/associated-type-constructors-part-1-basic-concepts-and-introduction/"&gt;The first post&lt;/a&gt; focused on introducing the basic idea of
ATC, as well as introducing some background material.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2016/11/03/associated-type-constructors-part-2-family-traits/"&gt;The second post&lt;/a&gt; showed how we can use ATC to model HKT,
via the &amp;ldquo;family&amp;rdquo; pattern.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2016/11/04/associated-type-constructors-part-3-what-higher-kinded-types-might-look-like/"&gt;The third post&lt;/a&gt; did some exploration into what it would
mean to support HKT directly in the language, instead of modeling
them via the family pattern.&lt;/li&gt;
&lt;li&gt;This post considers what it might mean if we had both ATC &lt;em&gt;and&lt;/em&gt; HKT
in the language: in particular, whether those two concepts can be
unified, and at what cost.&lt;/li&gt;
&lt;/ol&gt;
&lt;!-- more --&gt;
&lt;h3 id="unifying-hkt-and-atc"&gt;Unifying HKT and ATC&lt;/h3&gt;
&lt;p&gt;So far we have seen &amp;ldquo;associated-type constructors&amp;rdquo; and &amp;ldquo;higher-kinded
types&amp;rdquo; as two distinct concepts. The question is, would it make sense
to try and &lt;em&gt;unify&lt;/em&gt; these two, and what would that even mean?&lt;/p&gt;</description></item><item><title>Associated type constructors, part 3: What higher-kinded types might look like</title><link>https://smallcultfollowing.com/babysteps/blog/2016/11/04/associated-type-constructors-part-3-what-higher-kinded-types-might-look-like/</link><pubDate>Fri, 04 Nov 2016 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/11/04/associated-type-constructors-part-3-what-higher-kinded-types-might-look-like/</guid><description>&lt;p&gt;This post is a continuation of my posts discussing the topic of
associated type constructors (ATC) and higher-kinded types (HKT):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2016/11/02/associated-type-constructors-part-1-basic-concepts-and-introduction/"&gt;The first post&lt;/a&gt; focused on introducing the basic idea of
ATC, as well as introducing some background material.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2016/11/03/associated-type-constructors-part-2-family-traits/"&gt;The second post&lt;/a&gt; showed how we can use ATC to model HKT,
via the &amp;ldquo;family&amp;rdquo; pattern.&lt;/li&gt;
&lt;li&gt;This post dives into what it would mean to support HKT directly
in the language, instead of modeling them via the family pattern.&lt;/li&gt;
&lt;/ol&gt;
&lt;!-- more --&gt;
&lt;h3 id="the-story-thus-far-a-quick-recap"&gt;The story thus far (a quick recap)&lt;/h3&gt;
&lt;p&gt;In the previous posts, we had introduced a basic &lt;code&gt;Collection&lt;/code&gt; trait
that used ATC to support an &lt;code&gt;iterate()&lt;/code&gt; method:&lt;/p&gt;</description></item><item><title>Associated type constructors, part 2: family traits</title><link>https://smallcultfollowing.com/babysteps/blog/2016/11/03/associated-type-constructors-part-2-family-traits/</link><pubDate>Thu, 03 Nov 2016 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/11/03/associated-type-constructors-part-2-family-traits/</guid><description>&lt;p&gt;Hello. This post is a continuation of my posts discussing the topic of
associated type constructors (ATC) and higher-kinded types (HKT):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2016/11/02/associated-type-constructors-part-1-basic-concepts-and-introduction/"&gt;The first post&lt;/a&gt; focused on introducing the basic idea of
ATC, as well as introducing some background material.&lt;/li&gt;
&lt;li&gt;This post talks about some apparent limitations of associated type
constructors, and shows how we can overcome them by making use of a
design pattern that I call &amp;ldquo;family traits&amp;rdquo;. Along the way, we
introduce the term &lt;strong&gt;higher-kinded type&lt;/strong&gt; for the first time, and
show (informally) that family traits are equally general.&lt;/li&gt;
&lt;/ol&gt;
&lt;!-- more --&gt;
&lt;h3 id="the-limits-of-associated-type-constructors"&gt;The limits of associated type constructors&lt;/h3&gt;
&lt;p&gt;OK, so in the last post we saw how we can use ATC to define a
&lt;code&gt;Collection&lt;/code&gt; trait, and how to implement that trait for our sample
collection &lt;code&gt;List&amp;lt;T&amp;gt;&lt;/code&gt;. In particular, ATC let us express the return
type of the &lt;code&gt;iterator()&lt;/code&gt; method as &lt;code&gt;Self::Iter&amp;lt;'iter&amp;gt;&lt;/code&gt;, so that we can
incorporate the lifetime &lt;code&gt;'iter&lt;/code&gt; of each particular iterator.&lt;/p&gt;</description></item><item><title>Associated type constructors, part 1: basic concepts and introduction</title><link>https://smallcultfollowing.com/babysteps/blog/2016/11/02/associated-type-constructors-part-1-basic-concepts-and-introduction/</link><pubDate>Wed, 02 Nov 2016 00:00:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/11/02/associated-type-constructors-part-1-basic-concepts-and-introduction/</guid><description>&lt;p&gt;So for the end of last week, I was at Rust Belt Rust. This was
awesome. And not only because the speakers and attendees at Rust Belt
Rust were awesome, though they were. But also because it gave aturon,
withoutboats, and I a chance to talk over a lot of stuff in person. We
covered a lot of territory and so I wanted to do a series of blog
posts trying to write down some of the things we were thinking so as
to get other people&amp;rsquo;s input.&lt;/p&gt;</description></item><item><title>Switching to Jekyll</title><link>https://smallcultfollowing.com/babysteps/blog/2016/11/01/switching-to-jekyll/</link><pubDate>Tue, 01 Nov 2016 12:27:00 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/11/01/switching-to-jekyll/</guid><description>&lt;p&gt;If you visit the site today, you&amp;rsquo;ll notice it looks quite a bit
different. I&amp;rsquo;ve decided to switch from my old antiquated Octopress to
a plain Jekyll-based one. The most immediate of this is that Rust code
highlighting looks much better, and I get access to modern
Github-flavored markdown. =) Since I understand plain Jekyll a bit
more, I&amp;rsquo;ll hopefully also be able to customize the appearance somewhat
&amp;ndash; but for now I&amp;rsquo;m just going with the basic theme.&lt;/p&gt;</description></item><item><title>Supporting blanket impls in specialization</title><link>https://smallcultfollowing.com/babysteps/blog/2016/10/24/supporting-blanket-impls-in-specialization/</link><pubDate>Mon, 24 Oct 2016 13:42:24 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/10/24/supporting-blanket-impls-in-specialization/</guid><description>&lt;p&gt;In my &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2016/09/29/distinguishing-reuse-from-override/"&gt;previous post&lt;/a&gt;, I talked about how we can separate out
specialization into two distinct concepts: &lt;strong&gt;reuse&lt;/strong&gt; and &lt;strong&gt;override&lt;/strong&gt;.
Doing so makes because the conditions that make reuse possible are
more stringent than those that make override possible. &lt;strong&gt;In this post,
I want to extend this idea to talk about a new rule for specialization
that allow overriding in more cases.&lt;/strong&gt; These rules are a big enabler
for specialization, allowing it to accommodate many use cases that we
couldn&amp;rsquo;t handle before. In particular, they enable us to add blanket
impls like &lt;code&gt;impl&amp;lt;T: Copy&amp;gt; Clone for T&lt;/code&gt; in a backwards compatible
fashion, though only under certain conditions.&lt;/p&gt;</description></item><item><title>Observational equivalence and unsafe code</title><link>https://smallcultfollowing.com/babysteps/blog/2016/10/02/observational-equivalence-and-unsafe-code/</link><pubDate>Sun, 02 Oct 2016 07:06:23 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/10/02/observational-equivalence-and-unsafe-code/</guid><description>&lt;p&gt;I spent a really interesting day last week at Northeastern University.
First, I saw a fun talk by Philip Haller covering &lt;a href="http://2016.splashcon.org/event/splash-2016-oopsla-lacasa-lightweight-affinity-and-object-capabilities-in-scala"&gt;LaCasa&lt;/a&gt;, which is a
set of extensions to Scala that enable it to track ownership. Many of
the techniques reminded me very much of Rust (e.g., the use of
&amp;ldquo;spores&amp;rdquo;, which are closures that can limit the types of things they
close over); if I have time, I&amp;rsquo;ll try to write up a more detailed
comparison in some later post.&lt;/p&gt;</description></item><item><title>Announcing intorust.com</title><link>https://smallcultfollowing.com/babysteps/blog/2016/09/30/announcing-intorust-dot-com/</link><pubDate>Fri, 30 Sep 2016 15:48:54 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/09/30/announcing-intorust-dot-com/</guid><description>&lt;p&gt;For the past year or so, I and a few others have been iterating on
some tutorial slides for learning Rust. I&amp;rsquo;ve given this tutorial here
at the local &lt;a href="http://www.meetup.com/BostonRust/"&gt;Boston Rust Meetup&lt;/a&gt; a few times, and we used the same
basic approach at RustConf; I&amp;rsquo;ve been pretty happy with the
results. But until now it&amp;rsquo;s been limited to &amp;ldquo;in person&amp;rdquo; events.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s why I&amp;rsquo;m so happy to announce a new site, &lt;a href="http://intorust.com"&gt;Into Rust&lt;/a&gt;. Into Rust
contains screencasts of many of these slides, and in particular the
ones I consider most important: those that cover Ownership and
Borrowing, which I think is the best place to start teaching Rust.
I&amp;rsquo;ve divided up the material into roughly 30min screencasts so that
they should be relatively easy to consume in one sitting &amp;ndash; each also
has some associated exercises to help make your knowledge more
concrete.&lt;/p&gt;</description></item><item><title>Distinguishing reuse from override</title><link>https://smallcultfollowing.com/babysteps/blog/2016/09/29/distinguishing-reuse-from-override/</link><pubDate>Thu, 29 Sep 2016 06:02:19 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/09/29/distinguishing-reuse-from-override/</guid><description>&lt;p&gt;In my &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2016/09/24/intersection-impls/"&gt;previous post&lt;/a&gt;, I started discussing the idea of
intersection impls, which are a possible extension to
&lt;a href="https://github.com/rust-lang/rfcs/pull/1210"&gt;specialization&lt;/a&gt;. I am specifically looking at the idea of
making it possible to add blanket impls to (e.g.) implement &lt;code&gt;Clone&lt;/code&gt;
for any &lt;code&gt;Copy&lt;/code&gt; type. We saw that intersection impls, while useful, do
not enable us to do this in a backwards compatible way.&lt;/p&gt;
&lt;p&gt;Today I want to dive a bit deeper into specialization. We&amp;rsquo;ll see that
specialization actually couples together two things: refinement of
behavior and reuse of code. This is no accident, and its normally a
natural thing to do, but I&amp;rsquo;ll show that, in order to enable the kinds
of blanket impls I want, it&amp;rsquo;s important to be able to tease those
apart somewhat.&lt;/p&gt;</description></item><item><title>Intersection Impls</title><link>https://smallcultfollowing.com/babysteps/blog/2016/09/24/intersection-impls/</link><pubDate>Sat, 24 Sep 2016 06:07:31 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/09/24/intersection-impls/</guid><description>&lt;p&gt;As some of you are probably aware, on the nightly Rust builds, we
currently offer a feature called &lt;strong&gt;specialization&lt;/strong&gt;, which was defined
in &lt;a href="https://github.com/rust-lang/rfcs/pull/1210"&gt;RFC 1210&lt;/a&gt;. The idea of specialization is to improve Rust&amp;rsquo;s
existing coherence rules to allow for overlap between impls, so long
as one of the overlapping impls can be considered &lt;em&gt;more
specific&lt;/em&gt;. Specialization is hotly desired because it can enable
powerful optimizations, but also because it is an important component
for &lt;a href="http://aturon.github.io/blog/2015/09/18/reuse/"&gt;modeling object-oriented designs&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Thoughts on trusting types and unsafe code</title><link>https://smallcultfollowing.com/babysteps/blog/2016/09/12/thoughts-on-trusting-types-and-unsafe-code/</link><pubDate>Mon, 12 Sep 2016 05:39:52 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/09/12/thoughts-on-trusting-types-and-unsafe-code/</guid><description>&lt;p&gt;I&amp;rsquo;ve been thinking about the unsafe code guidelines a lot in the back
of my mind. In particular, I&amp;rsquo;ve been trying to think through what it
means to &amp;ldquo;trust types&amp;rdquo; &amp;ndash; if you recall from the
&lt;a href="http://smallcultfollowing.com/babysteps/blog/2016/05/27/the-tootsie-pop-model-for-unsafe-code/"&gt;Tootsie Pop Model&lt;/a&gt; (TPM) blog post, one of the &lt;em&gt;key&lt;/em&gt; examples
that I was wrestling with was the &lt;code&gt;RefCell-Ref&lt;/code&gt; example. I want to
revisit a variation on that example now, but from a different
angle. (This by the way is one of those &amp;ldquo;Niko thinks out loud&amp;rdquo; blog
posts, not one of those &amp;ldquo;Niko writes up a proposal&amp;rdquo; blog posts.)&lt;/p&gt;</description></item><item><title>'Tootsie Pop' Followup</title><link>https://smallcultfollowing.com/babysteps/blog/2016/08/18/tootsie-pop-followup/</link><pubDate>Thu, 18 Aug 2016 09:17:46 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/08/18/tootsie-pop-followup/</guid><description>&lt;p&gt;A little while back, I wrote up a tentative proposal I called the
&lt;a href="http://smallcultfollowing.com/babysteps/blog/2016/05/27/the-tootsie-pop-model-for-unsafe-code/"&gt;&amp;ldquo;Tootsie Pop&amp;rdquo; model for unsafe code&lt;/a&gt;. It&amp;rsquo;s safe to say that this
model was not universally popular. =) There was quite a
&lt;a href="http://internals.rust-lang.org/t/tootsie-pop-model-for-unsafe-code/3522/"&gt;long and fruitful discussion&lt;/a&gt; on discuss. I wanted to write a
quick post summarizing my main take-away from that discussion and to
talk a bit about the plans to push the unsafe discussion forward.&lt;/p&gt;
&lt;!-- more --&gt; 
&lt;h3 id="the-importance-of-the-unchecked-get-use-case"&gt;The importance of the unchecked-get use case&lt;/h3&gt;
&lt;p&gt;For me, the most important lesson was the importance of the &amp;ldquo;unchecked
get&amp;rdquo; use case. Here the idea is that you have some (safe) code which
is indexing into a vector:&lt;/p&gt;</description></item><item><title>The 'Tootsie Pop' model for unsafe code</title><link>https://smallcultfollowing.com/babysteps/blog/2016/05/27/the-tootsie-pop-model-for-unsafe-code/</link><pubDate>Fri, 27 May 2016 12:12:15 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/05/27/the-tootsie-pop-model-for-unsafe-code/</guid><description>&lt;p&gt;In my &lt;a href="http://smallcultfollowing.com/babysteps/blog/2016/05/23/unsafe-abstractions/"&gt;previous post&lt;/a&gt;, I spent some time talking about the idea of
&lt;strong&gt;unsafe abstractions&lt;/strong&gt;. At the end of the post, I mentioned that Rust
does not really have any kind of official guidelines for what kind of
code is legal in an unsafe block and what is not.What this means in
practice is that people wind up writing what &amp;ldquo;seems reasonable&amp;rdquo; and
checking it against what the compiler does today. This is of course a
risky proposition since it means that if we start doing more
optimization in the compiler, we may well wind up breaking unsafe code
(the code would still compile; it would just not execute like it used
to).&lt;/p&gt;</description></item><item><title>Unsafe abstractions</title><link>https://smallcultfollowing.com/babysteps/blog/2016/05/23/unsafe-abstractions/</link><pubDate>Mon, 23 May 2016 08:17:07 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/05/23/unsafe-abstractions/</guid><description>&lt;p&gt;The &lt;code&gt;unsafe&lt;/code&gt; keyword is a crucial part of Rust&amp;rsquo;s design. For those not
familiar with it, the &lt;code&gt;unsafe&lt;/code&gt; keyword is basically a way to bypass
Rust&amp;rsquo;s type checker; it essentially allows you to write something more
like C code, but using Rust syntax.&lt;/p&gt;
&lt;p&gt;The existence of the &lt;code&gt;unsafe&lt;/code&gt; keyword sometimes comes as a surprise at
first. After all, isn&amp;rsquo;t the point of Rust that Rust programs should
not crash? Why would we make it so easy then to bypass Rust&amp;rsquo;s type
system? It can seem like a kind of flaw in the design.&lt;/p&gt;</description></item><item><title>Non-lexical lifetimes: adding the outlives relation</title><link>https://smallcultfollowing.com/babysteps/blog/2016/05/09/non-lexical-lifetimes-adding-the-outlives-relation/</link><pubDate>Mon, 09 May 2016 16:15:58 -0700</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/05/09/non-lexical-lifetimes-adding-the-outlives-relation/</guid><description>&lt;p&gt;This is the third post in my
&lt;a href="http://smallcultfollowing.com/babysteps/blog/categories/nll/"&gt;series on non-lexical lifetimes&lt;/a&gt;. Here I want to dive into
&lt;strong&gt;Problem Case #3&lt;/strong&gt; from the introduction. This is an interesting
case because exploring it is what led me to move away from the
continuous lifetimes proposed as part of &lt;a href="https://github.com/rust-lang/rfcs/pull/396"&gt;RFC 396&lt;/a&gt;.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;h3 id="problem-case-3-revisited"&gt;Problem case #3 revisited&lt;/h3&gt;
&lt;p&gt;As a reminder, problem case #3 was the following fragment:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;get_default&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="na"&gt;&amp;#39;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;K&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;V&lt;/span&gt;:&lt;span class="nb"&gt;Default&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt;: &lt;span class="kp"&gt;&amp;amp;&lt;/span&gt;&lt;span class="na"&gt;&amp;#39;m&lt;/span&gt; &lt;span class="nc"&gt;mut&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;HashMap&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;K&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;V&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;: &lt;span class="nc"&gt;K&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;-&amp;gt; &lt;span class="kp"&gt;&amp;amp;&lt;/span&gt;&lt;span class="na"&gt;&amp;#39;m&lt;/span&gt; &lt;span class="nc"&gt;mut&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;V&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;match&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_mut&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// -------------+ &amp;#39;m
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// |
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;None&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// |
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;V&lt;/span&gt;::&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// |
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// ^~~~~~ ERROR // |
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_mut&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;unwrap&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// |
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// |
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// |
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// v
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;What makes this example interesting is that it crosses functions. In
particular, when we call &lt;code&gt;get_mut&lt;/code&gt; the first time, if we get back a
&lt;code&gt;Some&lt;/code&gt; value, we plan to return the point, and hence the value must
last until the end of the lifetime &lt;code&gt;'m&lt;/code&gt; (that is, until some point in
the caller). However, if we get back a &lt;code&gt;None&lt;/code&gt; value, we wish to
release the loan immediately, because there is no reference to return.&lt;/p&gt;</description></item><item><title>Non-lexical lifetimes based on liveness</title><link>https://smallcultfollowing.com/babysteps/blog/2016/05/04/non-lexical-lifetimes-based-on-liveness/</link><pubDate>Wed, 04 May 2016 05:19:04 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/05/04/non-lexical-lifetimes-based-on-liveness/</guid><description>&lt;p&gt;In my &lt;a href="http://smallcultfollowing.com/babysteps/blog/2016/04/27/non-lexical-lifetimes-introduction/"&gt;previous post&lt;/a&gt; I outlined several cases that we would like
to improve with Rust&amp;rsquo;s current borrow checker. This post discusses one
possible scheme for solving those. The heart of the post is two key ideas:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Define a &lt;strong&gt;lifetime&lt;/strong&gt; as a &lt;strong&gt;set of points in the control-flow
graph&lt;/strong&gt;, where a &lt;strong&gt;point&lt;/strong&gt; here refers to some particular statement
in the control-flow graph (i.e., not a &lt;a href="https://en.wikipedia.org/wiki/Control_flow_graph"&gt;basic block&lt;/a&gt;, but some
statement within a basic block).&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;liveness&lt;/strong&gt; as the basis for deciding where a variable&amp;rsquo;s type
must be valid.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The rest of this post expounds on these two ideas and shows how they
affect the various examples from the previous post.&lt;/p&gt;</description></item><item><title>Non-lexical lifetimes: introduction</title><link>https://smallcultfollowing.com/babysteps/blog/2016/04/27/non-lexical-lifetimes-introduction/</link><pubDate>Wed, 27 Apr 2016 07:52:05 -0700</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/04/27/non-lexical-lifetimes-introduction/</guid><description>&lt;p&gt;Over the last few weeks, I&amp;rsquo;ve been devoting my free time to fleshing
out the theory behind &lt;strong&gt;non-lexical lifetimes&lt;/strong&gt; (NLL). I think I&amp;rsquo;ve
arrived at a pretty good point and I plan to write various posts
talking about it. Before getting into the details, though, I wanted to
start out with a post that lays out roughly how today&amp;rsquo;s &lt;em&gt;lexical
lifetimes&lt;/em&gt; work and gives several examples of problem cases that we
would like to solve.&lt;/p&gt;</description></item><item><title>Nice errors in LALRPOP</title><link>https://smallcultfollowing.com/babysteps/blog/2016/03/02/nice-errors-in-lalrpop/</link><pubDate>Wed, 02 Mar 2016 12:58:49 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/03/02/nice-errors-in-lalrpop/</guid><description>&lt;p&gt;For the last couple of weeks, my mornings have been occupied with a
pretty serious revamping of &lt;a href="http://smallcultfollowing.com/babysteps/blog/2015/09/14/lalrpop/"&gt;LALRPOP&amp;rsquo;s&lt;/a&gt; error message output. I will
probably wind up doing a series of blog posts about the internal
details of how it works, but I wanted to write a little post to
advertise this work.&lt;/p&gt;
&lt;p&gt;Typically when you use an LR(1) parser generator, error messages tend
to be written in terms of the LR(1) state generation algorithm. They
use phrases like &amp;ldquo;shift/reduce conflict&amp;rdquo; and talk about LR(1)
items. Ultimately, you have to do some clever thinking to relate the
error to your grammar, and then a bit more clever thinking to figure
out how you should adjust your grammar to make the problem go away.
While working on &lt;a href="https://github.com/nikomatsakis/rustypop"&gt;adapting the Rust grammar to LALRPOP&lt;/a&gt;, I
found I was wasting a lot of time trying to decrypt the error
messages, and I wanted to do something about it. This work
is the result.&lt;/p&gt;</description></item><item><title>Parallel Iterators Part 2: Producers</title><link>https://smallcultfollowing.com/babysteps/blog/2016/02/25/parallel-iterators-part-2-producers/</link><pubDate>Thu, 25 Feb 2016 11:02:34 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/02/25/parallel-iterators-part-2-producers/</guid><description>&lt;p&gt;This post is the second post in my series on Rayon&amp;rsquo;s parallel
iterators. The goal of this series is to explain how parallel
iterators are implemented internally, so I&amp;rsquo;m going to be going over a
lot of details and giving a lot of little code examples in Rust. If
all you want to do is &lt;em&gt;use&lt;/em&gt; parallel iterators, you don&amp;rsquo;t really have
to understand any of this stuff.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve had a lot of fun designing this system, and I learned a few
lessons about how best to use Rust (some of which I cover in the
conclusions). I hope you enjoy reading about it!&lt;/p&gt;</description></item><item><title>Parallel Iterators Part 1: Foundations</title><link>https://smallcultfollowing.com/babysteps/blog/2016/02/19/parallel-iterators-part-1-foundations/</link><pubDate>Fri, 19 Feb 2016 06:32:44 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2016/02/19/parallel-iterators-part-1-foundations/</guid><description>&lt;p&gt;Since &lt;a href="https://air.mozilla.org/bay-area-rust-meetup-january-2016/"&gt;giving a talk about Rayon at the Bay Area Rust meetup&lt;/a&gt;,
I&amp;rsquo;ve been working off and on on the support for &lt;em&gt;parallel
iterators&lt;/em&gt;. The basic idea of a parallel iterator is that I should be
able to take an existing iterator chain, which operates sequentially,
and easily convert it to work in parallel. As a simple example,
consider this bit of code that computes the dot-product of two
vectors:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;vec1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vec2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iter&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Using parallel iterators, all I have to do to make this run in
parallel is change the &lt;code&gt;iter&lt;/code&gt; calls into &lt;code&gt;par_iter&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>Rayon: data parallelism in Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2015/12/18/rayon-data-parallelism-in-rust/</link><pubDate>Fri, 18 Dec 2015 09:52:00 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2015/12/18/rayon-data-parallelism-in-rust/</guid><description>&lt;p&gt;Over the last week or so, I&amp;rsquo;ve been working on an update to
&lt;a href="https://github.com/nikomatsakis/rayon/"&gt;Rayon&lt;/a&gt;, my experimental library for &lt;strong&gt;data parallelism&lt;/strong&gt; in
Rust. I&amp;rsquo;m pretty happy with the way it&amp;rsquo;s been going, so I wanted to
write a blog post to explain what I&amp;rsquo;ve got so far.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Rayon&amp;rsquo;s goal is to make it easy to add parallelism to your
sequential code&lt;/strong&gt; &amp;ndash; so basically to take existing for loops or
iterators and make them run in parallel. For example, if you have an
existing iterator chain like this:&lt;/p&gt;</description></item><item><title>Virtual Structs Part 4: Extended Enums And Thin Traits</title><link>https://smallcultfollowing.com/babysteps/blog/2015/10/08/virtual-structs-part-4-extended-enums-and-thin-traits/</link><pubDate>Thu, 08 Oct 2015 12:46:29 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2015/10/08/virtual-structs-part-4-extended-enums-and-thin-traits/</guid><description>&lt;p&gt;So, aturon wrote this &lt;a href="http://aturon.github.io/blog/2015/09/18/reuse/"&gt;interesting post&lt;/a&gt; on an alternative
&amp;ldquo;virtual structs&amp;rdquo; approach, and, more-or-less since he wrote it, I&amp;rsquo;ve
been wanting to write up my thoughts. I finally got them down.&lt;/p&gt;
&lt;p&gt;Before I go any further, a note on terminology. I will refer to
Aaron&amp;rsquo;s proposal as &lt;a href="http://aturon.github.io/blog/2015/09/18/reuse/"&gt;the Thin Traits proposal&lt;/a&gt;, and my own
previous proposal as &lt;a href="http://smallcultfollowing.com/babysteps/blog/2015/08/20/virtual-structs-part-3-bringing-enums-and-structs-together/"&gt;the Extended Enums proposal&lt;/a&gt;. Very good.&lt;/p&gt;
&lt;p&gt;(OK, I lied, one more note: starting with this post, I&amp;rsquo;ve decided to
disable comments on this blog. There are just too many forums to keep
up with! So if you want to discuss this post, I&amp;rsquo;d recommend doing so
on &lt;a href="https://internals.rust-lang.org/t/blog-post-extended-enums-and-thin-traits/2755"&gt;this Rust internals thread&lt;/a&gt;.)&lt;/p&gt;</description></item><item><title>LALRPOP</title><link>https://smallcultfollowing.com/babysteps/blog/2015/09/14/lalrpop/</link><pubDate>Mon, 14 Sep 2015 05:49:14 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2015/09/14/lalrpop/</guid><description>&lt;p&gt;Around four years ago, when I had first decided to start at Mozilla
research, I had planned to write an LR(1) parser generator. It seemed
like a good way to get to know Rust. However, I found that newborns
actually occupy somewhat more time than anticipated (read: I was lucky
to squeeze in a shower), and hence that never came to pass.&lt;/p&gt;
&lt;p&gt;Well, I&amp;rsquo;m happy to say that, four years later, I&amp;rsquo;ve finally rectified
that. For a few months now I&amp;rsquo;ve been working on a side project while I
have my morning coffee: &lt;a href="https://github.com/nikomatsakis/lalrpop"&gt;LALRPOP&lt;/a&gt; (pronounced like some sort of
strangely accented version of &amp;ldquo;lollypop&amp;rdquo;). &lt;a href="https://github.com/nikomatsakis/lalrpop"&gt;LALRPOP&lt;/a&gt; is an LR(1)
parser generator that emits Rust code. It is designed for ease of use,
so it includes a number of features that many parser generators are
missing:&lt;/p&gt;</description></item><item><title>Virtual Structs Part 3: Bringing Enums and Structs Together</title><link>https://smallcultfollowing.com/babysteps/blog/2015/08/20/virtual-structs-part-3-bringing-enums-and-structs-together/</link><pubDate>Thu, 20 Aug 2015 09:29:45 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2015/08/20/virtual-structs-part-3-bringing-enums-and-structs-together/</guid><description>&lt;p&gt;So, in &lt;a href="http://smallcultfollowing.com/babysteps/blog/2015/05/05/where-rusts-enum-shines/"&gt;previous&lt;/a&gt; &lt;a href="http://smallcultfollowing.com/babysteps/blog/2015/05/29/classes-strike-back/"&gt;posts&lt;/a&gt;, I discussed the pros and cons of two different
approaches to modeling variants: Rust-style enums and C++-style
classes. In those posts, I explained why I see Rust enums and OO-style
class hierarchies as more alike than different (I personally credit
Scala for opening my eyes to this, though I&amp;rsquo;m sure it&amp;rsquo;s been
understood by others for much longer). The key points were as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Both Rust-style enums and C++-style classes can be used to model the
idea of a value that be one of many variants, but there are
differences in how they work at runtime. These differences mean that
Rust-style enums are more convenient for some tasks, and C++-style
classes for others. In particular:
&lt;ul&gt;
&lt;li&gt;A Rust-style enum is sized as large as the largest variant. This is
great because you can lay them out flat in another data structure
without requiring any allocation. You can also easily change from
one variant to another. One downside of Rust enums is that you cannot
&amp;ldquo;refine&amp;rdquo; them to narrow the set of variants that a particular value
can have.&lt;/li&gt;
&lt;li&gt;A C++-style class is sized to be exactly as big as one variant. This
is great because it can be much more memory efficient. However, if
you don&amp;rsquo;t know what variant you have, you must manipulate the value
by pointer, so it tends to require more allocation. It is also
impossible to change from one variant to another. Class hierarchies
also give you a simple, easily understood kind of refinement, and
the ability to have common fields that are shared between variants.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;C++-style classes offer constructors, which allows for more
abstraction and code reuse when initially creating an instance, but
raise thorny questions about the type of a value under construction;
Rust structs and enums are always built in a single-shot today,
which is simpler and safer but doesn&amp;rsquo;t compose as well.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What I want to talk about in this post is a proposal (or
proto-proposal) for bridging those two worlds in Rust. I&amp;rsquo;m going to
focus on data layout in this post. I&amp;rsquo;ll defer virtual methods for
another post (or perhaps an RFC). &lt;em&gt;Spoiler alert:&lt;/em&gt; they can be viewed
as a special case of &lt;a href="https://github.com/rust-lang/rfcs/pull/1210"&gt;specialization&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Virtual Structs Part 2: Classes strike back</title><link>https://smallcultfollowing.com/babysteps/blog/2015/05/29/classes-strike-back/</link><pubDate>Fri, 29 May 2015 11:52:26 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2015/05/29/classes-strike-back/</guid><description>&lt;p&gt;This is the second post summarizing my current thoughts about ideas
related to &amp;ldquo;virtual structs&amp;rdquo;. In the &lt;a href="http://smallcultfollowing.com/babysteps/blog/2015/05/05/where-rusts-enum-shines/"&gt;last post&lt;/a&gt;, I described how,
when coding C++, I find myself missing Rust&amp;rsquo;s enum type. In this post,
I want to turn it around. I&amp;rsquo;m going to describe why the class model
can be great, and something that&amp;rsquo;s actually kind of missing from
Rust. In the next post, I&amp;rsquo;ll talk about how I think we can get the
best of both worlds for Rust. As in the first post, I&amp;rsquo;m focusing here
primarily on the data layout side of the equation; I&amp;rsquo;ll discuss
virtual dispatch afterwards.&lt;/p&gt;</description></item><item><title>Virtual Structs Part 1: Where Rust's enum shines</title><link>https://smallcultfollowing.com/babysteps/blog/2015/05/05/where-rusts-enum-shines/</link><pubDate>Tue, 05 May 2015 06:15:26 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2015/05/05/where-rusts-enum-shines/</guid><description>&lt;p&gt;One priority for Rust after 1.0 is going to be incorporating some
kind of support for
&lt;a href="https://github.com/rust-lang/rfcs/issues/349"&gt;&amp;ldquo;efficient inheritance&amp;rdquo; or &amp;ldquo;virtual structs&amp;rdquo;&lt;/a&gt;. In order to
motivate and explain this design, I am writing a series of blog posts
examining how Rust&amp;rsquo;s current abstractions compare with those found in
other languages.&lt;/p&gt;
&lt;p&gt;The way I see it, the topic of &amp;ldquo;virtual structs&amp;rdquo; has always had two
somewhat orthogonal components to it. The first component is a
question of how we can generalize and extend Rust enums to cover more
scenarios. The second component is integrating virtual dispatch into
this picture.&lt;/p&gt;</description></item><item><title>A few more remarks on reference-counting and leaks</title><link>https://smallcultfollowing.com/babysteps/blog/2015/04/30/a-few-more-remarks-on-reference-counting-and-leaks/</link><pubDate>Thu, 30 Apr 2015 18:00:05 -0700</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2015/04/30/a-few-more-remarks-on-reference-counting-and-leaks/</guid><description>&lt;p&gt;So there has been a lot of really interesting discussion in response
to my blog post. I wanted to highlight some of the comments I&amp;rsquo;ve seen,
because I think they raise good points that I failed to address in the
blog post itself. My comments here are lightly edited versions of what
I wrote elsewhere.&lt;/p&gt;
&lt;h3 id="isnt-the-problem-with-objects-and-leak-safe-types-more-general"&gt;Isn&amp;rsquo;t the problem with objects and leak-safe types more general?&lt;/h3&gt;
&lt;p&gt;&lt;a href="http://www.reddit.com/r/rust/comments/34bj7z/on_referencecounting_and_leaks_from_nmatsakiss/cqtksn3"&gt;Reem writes&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I posit that this is in fact a problem with trait objects, not a
problem with Leak; the exact same flaw pointed about in the blog
post already applies to the existing OIBITs, Send, Sync, and
Reflect. The decision of which OIBITs to include on any trait object
is already a difficult one, and is a large reason why std strives to
avoid trait objects as part of public types.&lt;/p&gt;</description></item><item><title>On reference-counting and leaks</title><link>https://smallcultfollowing.com/babysteps/blog/2015/04/29/on-reference-counting-and-leaks/</link><pubDate>Wed, 29 Apr 2015 12:39:10 -0700</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2015/04/29/on-reference-counting-and-leaks/</guid><description>&lt;p&gt;What&amp;rsquo;s a 1.0 release without a little drama? Recently, we discovered
that there was an oversight in one of the standard library APIs that we
had intended to stabilize. In particular, we recently added an API for
scoped threads &amp;ndash; that is, child threads which have access to the
stack frame of their parent thread.&lt;/p&gt;
&lt;p&gt;The flaw came about because, when designing the scoped threads API, we
failed to consider the impact of resource leaks. Rust&amp;rsquo;s ownership
model makes it somewhat hard to leak data, but not impossible. In
particular, using reference-counted data, you can construct a cycle in
the heap, in which case the components of that cycle may never be
freed.&lt;/p&gt;</description></item><item><title>Modeling graphs in Rust using vector indices</title><link>https://smallcultfollowing.com/babysteps/blog/2015/04/06/modeling-graphs-in-rust-using-vector-indices/</link><pubDate>Mon, 06 Apr 2015 14:58:37 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2015/04/06/modeling-graphs-in-rust-using-vector-indices/</guid><description>&lt;p&gt;After reading &lt;a href="http://featherweightmusings.blogspot.com/2015/04/graphs-in-rust.html"&gt;nrc&amp;rsquo;s blog post about graphs&lt;/a&gt;, I felt inspired to
write up an alternative way to code graphs in Rust, based on vectors
and indicates. This encoding has certain advantages over using &lt;code&gt;Rc&lt;/code&gt;
and &lt;code&gt;RefCell&lt;/code&gt;; in particular, I think it&amp;rsquo;s a closer fit to Rust&amp;rsquo;s
ownership model. (Of course, it has disadvantages too.)&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m going to describe a simplified version of the strategy that rustc
uses internally. The &lt;a href="https://github.com/rust-lang/rust/blob/master/src/librustc/middle/graph.rs"&gt;actual code in Rustc&lt;/a&gt; is written in a
somewhat dated &amp;ldquo;Rust dialect&amp;rdquo;. I&amp;rsquo;ve also put the sources to this blog
post in their &lt;a href="https://github.com/nikomatsakis/simple-graph"&gt;own GitHub repository&lt;/a&gt;. At some point, presumably
when I come up with a snazzy name, I&amp;rsquo;ll probably put an extended
version of this library up on crates.io. Anyway, the code I cover in
this blog post is pared down to the bare essentials, and so it doesn&amp;rsquo;t
support (e.g.) enumerating incoming edges to a node, or attach
arbitrary data to nodes/edges, etc. It would be easy to extend it to
support that sort of thing, however.&lt;/p&gt;</description></item><item><title>Little Orphan Impls</title><link>https://smallcultfollowing.com/babysteps/blog/2015/01/14/little-orphan-impls/</link><pubDate>Wed, 14 Jan 2015 14:03:45 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2015/01/14/little-orphan-impls/</guid><description>&lt;p&gt;We&amp;rsquo;ve recently been doing a lot of work on Rust&amp;rsquo;s &lt;em&gt;orphan rules&lt;/em&gt;,
which are an important part of our system for guaranteeing &lt;em&gt;trait
coherence&lt;/em&gt;. The idea of trait coherence is that, given a trait and
some set of types for its type parameters, there should be exactly one
impl that applies. So if we think of the trait &lt;code&gt;Show&lt;/code&gt;, we want to
guarantee that if we have a trait reference like &lt;code&gt;MyType : Show&lt;/code&gt;, we
can uniquely identify a particular impl. (The alternative to coherence
is to have some way for users to identify which impls are in scope at
any time. It has &lt;a href="https://mail.mozilla.org/pipermail/rust-dev/2011-December/001036.html"&gt;its own complications&lt;/a&gt;; if you&amp;rsquo;re curious for
more background on why we use coherence, you might find this
&lt;a href="https://mail.mozilla.org/pipermail/rust-dev/2011-December/thread.html#1036"&gt;rust-dev thread&lt;/a&gt; from a while back to be interesting
reading.)&lt;/p&gt;</description></item><item><title>Purging proc</title><link>https://smallcultfollowing.com/babysteps/blog/2014/11/26/purging-proc/</link><pubDate>Wed, 26 Nov 2014 16:58:56 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/11/26/purging-proc/</guid><description>&lt;p&gt;The so-called &amp;ldquo;unboxed closure&amp;rdquo; implementation in Rust has reached the
point where it is time to start using it in the standard library. As
a starting point, I have a
&lt;a href="https://github.com/rust-lang/rust/pull/19338"&gt;pull request that removes &lt;code&gt;proc&lt;/code&gt; from the language&lt;/a&gt;. I started
on this because I thought it&amp;rsquo;d be easier than replacing closures, but
it turns out that there are a few subtle points to this transition.&lt;/p&gt;
&lt;p&gt;I am writing this blog post to explain what changes are in store and
give guidance on how people can port existing code to stop using
&lt;code&gt;proc&lt;/code&gt;. This post is basically targeted Rust devs who want to adapt
existing code, though it also covers the closure design in general.&lt;/p&gt;</description></item><item><title>Allocators in Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2014/11/14/allocators-in-rust/</link><pubDate>Fri, 14 Nov 2014 21:13:52 -0500</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/11/14/allocators-in-rust/</guid><description>&lt;p&gt;There has been a lot of discussion lately about Rust&amp;rsquo;s allocator
story, and in particular our relationship to jemalloc. I&amp;rsquo;ve been
trying to catch up, and I wanted to try and summarize my understanding
and explain for others what is going on. I am trying to be as
factually precise in this post as possible. If you see a factual
error, please do not hesitate to let me know.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;h3 id="the-core-tradeoff"&gt;The core tradeoff&lt;/h3&gt;
&lt;p&gt;The story begins, like all interesting design questions, with a
trade-off. The problem with trade-offs is that neither side is 100%
right. In this case, the trade-off has to do with two partial truths:&lt;/p&gt;</description></item><item><title>Multi- and conditional dispatch in traits</title><link>https://smallcultfollowing.com/babysteps/blog/2014/09/30/multi-and-conditional-dispatch-in-traits/</link><pubDate>Tue, 30 Sep 2014 09:45:47 -0400</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/09/30/multi-and-conditional-dispatch-in-traits/</guid><description>&lt;p&gt;I&amp;rsquo;ve been working on a branch that implements both &lt;em&gt;multidispatch&lt;/em&gt;
(selecting the impl for a trait based on more than one input type) and
&lt;em&gt;conditional dispatch&lt;/em&gt; (selecting the impl for a trait based on where
clauses). I wound up taking a direction that is slightly different
from what is described in the &lt;a href="https://github.com/rust-lang/rfcs/blob/master/active/0024-traits.md"&gt;trait reform RFC&lt;/a&gt;, and I
wanted to take a chance to explain what I did and why. The main
difference is that in the branch we move away from the crate
concatenability property in exchange for better inference and less
complexity.&lt;/p&gt;</description></item><item><title>Attribute and macro syntax</title><link>https://smallcultfollowing.com/babysteps/blog/2014/09/11/attribute-and-macro-syntax/</link><pubDate>Thu, 11 Sep 2014 07:33:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/09/11/attribute-and-macro-syntax/</guid><description>&lt;p&gt;A few weeks back pcwalton introduced a &lt;a href="https://github.com/pcwalton/rfcs/blob/unify-attributes-and-macros/active/0000-unify-attributes-and-macros.md"&gt;PR&lt;/a&gt; that aimed to move the
attribute and macro syntax to use a leading &lt;code&gt;@&lt;/code&gt; sigil. This means that
one would write macros like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@format(&amp;quot;SomeString: {}&amp;quot;, 22)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@vec[1, 2, 3]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;One would write attributes in the same way:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@deriving(Eq)
struct SomeStruct {
}

@inline
fn foo() { ... }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This proposal was controversial. This debate has been sitting for a
week or so. I spent some time last week reading every single comment
and I wanted to lay out my current thoughts.&lt;/p&gt;</description></item><item><title>An experimental new type inference scheme for Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2014/07/09/an-experimental-new-type-inference-scheme-for-rust/</link><pubDate>Wed, 09 Jul 2014 10:08:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/07/09/an-experimental-new-type-inference-scheme-for-rust/</guid><description>&lt;p&gt;While on vacation, I&amp;rsquo;ve been working on an alternate type inference
scheme for rustc. (Actually, I got it 99% working on the plane, and
have been slowly poking at it ever since.) This scheme simplifies the
code of the type inferencer dramatically and (I think) helps to meet
our intutions (as I will explain). It is however somewhat less
flexible than the existing inference scheme, though all of rustc and
all the libraries compile without any changes. The scheme will (I
believe) make it much simpler to implement to proper one-way matching
for traits (explained later).&lt;/p&gt;</description></item><item><title>Implied bounds</title><link>https://smallcultfollowing.com/babysteps/blog/2014/07/06/implied-bounds/</link><pubDate>Sun, 06 Jul 2014 11:10:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/07/06/implied-bounds/</guid><description>&lt;p&gt;I am on vacation for a few weeks. I wanted to take some time to jot
down an idea that&amp;rsquo;s been bouncing around in my head. I plan to submit
an RFC at some point on this topic, but not yet, so I thought I&amp;rsquo;d
start out by writing a blog post. Also, my poor blog has been
neglected for some time. Consider this a draft RFC. Some important
details about references are omitted and will come in a follow-up blog
post.&lt;/p&gt;</description></item><item><title>Follow up to Focusing on Ownership</title><link>https://smallcultfollowing.com/babysteps/blog/2014/05/14/follow-up-to-focusing-on-ownership/</link><pubDate>Wed, 14 May 2014 07:52:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/05/14/follow-up-to-focusing-on-ownership/</guid><description>&lt;p&gt;This post withdrawn: it was posted by accident and was incomplete.&lt;/p&gt;
&lt;!-- 
I read through the comments from [Reddit][r] and I wanted to add a few
follow-on thoughts to my
[previous post ("Focusing on Ownership")][fo].

### On lying and honesty

There is a lot of talk about lying in the Reddit thread. I think this
terminology is unhelpful. At no point does the Rust type system lie,
neither in the current system nor in any proposed
variation(s). However, you may not understand what it is telling you.

For example, no part of the type `&amp;Cell&lt;int&gt;` is a lie, even though it
is a reference to a mutable integer. It's just that `&amp;T` does not mean
"immutable reference to T" but rather "shared reference to T" (or, if
you prefer, "aliased reference"). Many, but not all, types are
immutable when aliased: `Cell` is not.

Similarly, no part of a type like `&amp;&amp;mut int` is a lie, even though
the `int` is ultimately aliased. An `&amp;mut T` promises *local*
uniqueness: that is, there is no other (active) pointer that leads to
that same memory. However, you can still alias the `&amp;mut T` itself,
and hence the memory may ultimately be aliased. If you diagram it out,
it's clear that everybody is upholding their end of the bargain:

 +---+ +------+ +-----+
 | &amp; | ----&gt; | &amp;mut | ----&gt; | int |
&lt;pre&gt;&lt;code&gt;+---+ +------+ +-----+
 ^
+---+ |
| &amp;amp; | ---------+
+---+
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can see from the diagram, the &lt;code&gt;&amp;amp;mut&lt;/code&gt; reference &lt;em&gt;is&lt;/em&gt; a unique
reference to the integer. That is, it can&amp;rsquo;t be copied, and it&amp;rsquo;s the
only &lt;em&gt;direct&lt;/em&gt; pointer to that integer. However, there are multiple
paths to the &lt;code&gt;&amp;amp;mut&lt;/code&gt; itself. That&amp;rsquo;s not the fault of the &lt;code&gt;&amp;amp;mut&lt;/code&gt;, it&amp;rsquo;s
just that uniqueness is a global property. In other words, if I have a
variable &lt;code&gt;p&lt;/code&gt; of type &lt;code&gt;&amp;amp;&amp;amp;mut int&lt;/code&gt;, then &lt;code&gt;**p&lt;/code&gt; is not a &lt;em&gt;unique path&lt;/em&gt;,
even though it traverses through a unique reference at some point.&lt;/p&gt;</description></item><item><title>Focusing on ownership</title><link>https://smallcultfollowing.com/babysteps/blog/2014/05/13/focusing-on-ownership/</link><pubDate>Tue, 13 May 2014 17:04:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/05/13/focusing-on-ownership/</guid><description>&lt;p&gt;Over time, I&amp;rsquo;ve become convinced that it would be better to drop the
distinction between mutable and immutable local variables in
Rust. Many people are &lt;a href="http://www.reddit.com/r/rust/comments/2581s5/informal_survey_which_is_clearer_mutability_or/"&gt;highly skeptical&lt;/a&gt;, to say the least. I
wanted to lay out my argument in public. I&amp;rsquo;ll give various
motivations: a philosophical one, an eductional one, and a practical
one, and also address the main defense of the current system. (Note: I
considered submitting this as a Rust RFC, but decided that the tone
was better suited to a blog post, and I don&amp;rsquo;t have the time to rewrite
it now.)&lt;/p&gt;</description></item><item><title>Parallel pipelines for JS</title><link>https://smallcultfollowing.com/babysteps/blog/2014/04/24/parallel-pipelines-for-js/</link><pubDate>Thu, 24 Apr 2014 19:33:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/04/24/parallel-pipelines-for-js/</guid><description>&lt;p&gt;I&amp;rsquo;ve been thinking about an alternative way to factor the PJS API.
Until now, we&amp;rsquo;ve had these methods like &lt;code&gt;mapPar()&lt;/code&gt;, &lt;code&gt;filterPar()&lt;/code&gt; and
so forth. They work mostly like their sequential namesakes but execute
in parallel. This API has the advantage of being easy to explain and
relatively clear, but it&amp;rsquo;s also not especially flexible nor elegant.&lt;/p&gt;
&lt;p&gt;Lately, I&amp;rsquo;ve been prototyping an alternate design that I call
&lt;em&gt;parallel pipelines&lt;/em&gt; (that&amp;rsquo;s just a working title; I expect the name
to change). Compared to the older approach, parallel pipelines are a
more expressive API that doesn&amp;rsquo;t clutter up the array prototypes. The
design draws on precedent from a lot of other languages, such as
Clojure, Ruby, and Scala, which all offer similar capabilities. I&amp;rsquo;ve
prototyped the API on a &lt;a href="https://github.com/nikomatsakis/gecko-dev/tree/Pipeline-b"&gt;branch of SpiderMonkey&lt;/a&gt;, though the
code doesn&amp;rsquo;t yet run in parallel (it is structured in such a way as to
make parallel execution relatively straightforward, though).&lt;/p&gt;</description></item><item><title>Typed Objects Status Report</title><link>https://smallcultfollowing.com/babysteps/blog/2014/04/01/typed-objects-status-report/</link><pubDate>Tue, 01 Apr 2014 15:20:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/04/01/typed-objects-status-report/</guid><description>&lt;p&gt;I recently wrote up a
&lt;a href="https://smallcultfollowing.com/babysteps/
/pubs/2014.04.01-TypedObjects.pdf"&gt;paper describing the current version of the Typed Objects API&lt;/a&gt;. Anyone
who is interested in the current state of the art in that
specification should take a look. It&amp;rsquo;s not too long and intended to be
an easy read. This is just a draft copy, and feedback is naturally
very welcome &amp;ndash; in particular, I expect that before we submit it, the
implementation section will change, since it will be much further
along.&lt;/p&gt;</description></item><item><title>Value types in JavaScript</title><link>https://smallcultfollowing.com/babysteps/blog/2014/04/01/value-types-in-javascript/</link><pubDate>Tue, 01 Apr 2014 20:33:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/04/01/value-types-in-javascript/</guid><description>&lt;p&gt;Here is the current state of my thinking with respect to value types
and value objects. Some of you may have seen
&lt;a href="http://www.slideshare.net/BrendanEich/value-objects"&gt;Brendan&amp;rsquo;s slides&lt;/a&gt; where he discusses value objects. This post
is about the same topic, but it is focused on just the initial part of
the work &amp;ndash; what it means to be a value object and how we could define
value types and integrate them into the standard. I am not going to
discuss new syntax or operators yet. I have thoughts on those too but
I wanted to start by laying out the foundations.&lt;/p&gt;</description></item><item><title>Rust RFC: Opt-in builtin traits</title><link>https://smallcultfollowing.com/babysteps/blog/2014/02/28/rust-rfc-opt-in-builtin-traits/</link><pubDate>Fri, 28 Feb 2014 10:48:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/02/28/rust-rfc-opt-in-builtin-traits/</guid><description>&lt;p&gt;In today&amp;rsquo;s Rust, there are a number of builtin traits (sometimes
called &amp;ldquo;kinds&amp;rdquo;): &lt;code&gt;Send&lt;/code&gt;, &lt;code&gt;Freeze&lt;/code&gt;, &lt;code&gt;Share&lt;/code&gt;, and &lt;code&gt;Pod&lt;/code&gt; (in the future,
perhaps &lt;code&gt;Sized&lt;/code&gt;). These are expressed as traits, but they are quite
unlike other traits in certain ways. One way is that they do not have
any methods; instead, implementing a trait like &lt;code&gt;Freeze&lt;/code&gt; indicates
that the type has certain properties (defined below). The biggest
difference, though, is that these traits are not implemented manually
by users. Instead, the compiler decides automatically whether or not a
type implements them based on the contents of the type.&lt;/p&gt;</description></item><item><title>Rust RFC: Stronger guarantees for mutable borrows</title><link>https://smallcultfollowing.com/babysteps/blog/2014/02/25/rust-rfc-stronger-guarantees-for-mutable-borrows/</link><pubDate>Tue, 25 Feb 2014 12:29:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/02/25/rust-rfc-stronger-guarantees-for-mutable-borrows/</guid><description>&lt;p&gt;Today, if you do a mutable borrow of a local variable, you lose the
ability to &lt;em&gt;write&lt;/em&gt; to that variable except through the new reference
you just created:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;let mut x = 3;
let p = &amp;amp;mut x;
x += 1; // Error
*p += 1; // OK
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However, you retain the ability to &lt;em&gt;read&lt;/em&gt; the original variable:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;let mut x = 3;
let p = &amp;amp;mut x;
print(x); // OK
print(*p); // OK
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I would like to change the borrow checker rules so that both writes
and reads through the original path &lt;code&gt;x&lt;/code&gt; are illegal while &lt;code&gt;x&lt;/code&gt; is
mutably borrowed. This change is not motivated by soundness, as I
believe the current rules are sound. Rather, the motivation is that
this change gives strong guarantees to the holder of an &lt;code&gt;&amp;amp;mut&lt;/code&gt;
pointer: at present, they can assume that an &lt;code&gt;&amp;amp;mut&lt;/code&gt; referent will not
be changed by anyone else. With this change, they can also assume
that an &lt;code&gt;&amp;amp;mut&lt;/code&gt; referent will not be read by anyone else. This enable
more flexible borrowing rules and a more flexible kind of data
parallelism API than what is possible today. It may also help to
create more flexible rules around moves of borrowed data. As a side
benefit, I personally think it also makes the borrow checker rules
more consistent (mutable borrows mean original value is not usable
during the mutable borrow, end of story). Let me lead with the
motivation.&lt;/p&gt;</description></item><item><title>Closures and the borrow checker</title><link>https://smallcultfollowing.com/babysteps/blog/2014/02/04/closures-and-the-borrow-checker/</link><pubDate>Tue, 04 Feb 2014 22:39:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/02/04/closures-and-the-borrow-checker/</guid><description>&lt;p&gt;I have been working on making the borrow checker treat closures in a
sound way. I hope to land this patch very soon. I want to describe the
impact of these changes and summarize what we might do in the future.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;h3 id="the-high-level-idea"&gt;The high-level idea&lt;/h3&gt;
&lt;p&gt;The basic idea is that the borrow checker will treat a closure &lt;em&gt;as if&lt;/em&gt;
it were constructing a record with one borrowed pointer for each
variable mentioned in the closure.&lt;/p&gt;</description></item><item><title>Rvalue lifetimes in Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2014/01/09/rvalue-lifetimes-in-rust/</link><pubDate>Thu, 09 Jan 2014 01:04:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/01/09/rvalue-lifetimes-in-rust/</guid><description>&lt;p&gt;I&amp;rsquo;ve been working on &lt;a href="https://github.com/mozilla/rust/issues/3511"&gt;Issue #3511&lt;/a&gt;, which is an effort to
rationalize the lifetimes of temporary values in Rust. This issue has
been a thorn in the side of Rust users for a while, because the
current lifetimes are rather haphazard and frequently too short. Some
time ago, I did &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2012/09/15/rvalue-lifetimes/"&gt;some thinking on this issue&lt;/a&gt; and then let it lie
while other things took priority.&lt;/p&gt;
&lt;p&gt;Part of the reason that this issue has lasted so long is that the
current trans cleanup scheme is very inflexible. I have a
&lt;a href="https://github.com/nikomatsakis/rust/tree/issue-3511-rvalue-lifetimes"&gt;branch now&lt;/a&gt; that rewrites the cleanup system so that it can
handle any rules we would like. The problem I am encountering now, of
course, is that it&amp;rsquo;s unclear what the rules should be. I want to lay
out the options I see.&lt;/p&gt;</description></item><item><title>DST, Take 5</title><link>https://smallcultfollowing.com/babysteps/blog/2014/01/05/dst-take-5/</link><pubDate>Sun, 05 Jan 2014 11:39:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2014/01/05/dst-take-5/</guid><description>&lt;p&gt;I believe I have come to the point where I am ready to make a final
proposal for DST. Ironically, this proposal is quite similar to where
I started, but somewhat more expansive. It seems to be one of those
unusual cases where supporting more features actually makes things
easier. Thanks to Eridius on IRC for pointing this out to me. I
intend for this post to stand alone, so I&amp;rsquo;m going to start from the
beginning in the description.&lt;/p&gt;</description></item><item><title>Structural arrays in Typed Objects</title><link>https://smallcultfollowing.com/babysteps/blog/2013/12/12/structural-arrays-in-typed-objects/</link><pubDate>Thu, 12 Dec 2013 13:07:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/12/12/structural-arrays-in-typed-objects/</guid><description>&lt;p&gt;&lt;a href="https://twitter.com/littlecalculist"&gt;Dave Herman&lt;/a&gt; and I were tossing around ideas the other day for a
revision of the typed object specification in which we remove nominal
array types. The goal is to address some of the awkwardness that we
have encountered in designing the PJS API due to nominal array types.
I thought I&amp;rsquo;d try writing it out. This is to some extent a thought
experiment.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;h3 id="description-by-example"&gt;Description by example&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;ve had a hard time trying to identify the best way to present the
idea, because it is at once so similar and so unlike what we have
today. So I think I&amp;rsquo;ll begin by working through examples and then
try to define a more abstract version.&lt;/p&gt;</description></item><item><title>Thoughts on DST, Part 4</title><link>https://smallcultfollowing.com/babysteps/blog/2013/12/02/thoughts-on-dst-4/</link><pubDate>Mon, 02 Dec 2013 12:32:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/12/02/thoughts-on-dst-4/</guid><description>&lt;p&gt;Over the Thanksgiving break I&amp;rsquo;ve been devoting a lot of time to
thinking about DST and Rust&amp;rsquo;s approach to vector and object types. As
before, this is very much still churning in my mind so I&amp;rsquo;m just going
to toss out some semi-structured thoughts.&lt;/p&gt;
&lt;h3 id="brief-recap"&gt;Brief recap&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Treating vectors like any other container.&lt;/strong&gt; Some time back, I wrote
up a post about how we could
&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/11/14/treating-vectors-like-any-other-container/"&gt;treat vectors like any other container&lt;/a&gt;, which would (to some
extent) avoid the need for DST.&lt;/p&gt;</description></item><item><title>Thoughts on DST, Part 2</title><link>https://smallcultfollowing.com/babysteps/blog/2013/11/27/thoughts-on-dst-2/</link><pubDate>Wed, 27 Nov 2013 06:36:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/11/27/thoughts-on-dst-2/</guid><description>&lt;p&gt;In the &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/11/26/thoughts-on-dst-1/"&gt;previous post&lt;/a&gt; I elaborated a bit on DSTs and how they could be
created and used. I want to look a bit now at an alternate way to
support the combination of vector types and smart pointers (e.g.,
&lt;code&gt;RC&amp;lt;[uint]&amp;gt;&lt;/code&gt;). This approach avoids the use of DSTs. We&amp;rsquo;ll see that it
also addresses some of the rough patches of DST, but doesn&amp;rsquo;t work
quite as well for object types.&lt;/p&gt;</description></item><item><title>Thoughts on DST, Part 3</title><link>https://smallcultfollowing.com/babysteps/blog/2013/11/27/thoughts-on-dst-3/</link><pubDate>Wed, 27 Nov 2013 15:06:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/11/27/thoughts-on-dst-3/</guid><description>&lt;p&gt;After posting &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/11/26/thoughts-on-dst-2/"&gt;part 2&lt;/a&gt; of my DST series, I realized that I had
focusing too much on the pure &amp;ldquo;type system&amp;rdquo; aspect and ignoring some
of the more&amp;hellip;mundane semantics, and in particular the impact of
monomorphization. I realize now that &amp;ndash; without some further changes
&amp;ndash; we would not be able to compile and execute the second proposal
(which I will dub &lt;em&gt;statically sized typed&lt;/em&gt; (SST) from here on
out). Let me first explain the problem and then show how my first
thoughts on how it might be addressed.&lt;/p&gt;</description></item><item><title>Thoughts on DST, Part 1</title><link>https://smallcultfollowing.com/babysteps/blog/2013/11/26/thoughts-on-dst-1/</link><pubDate>Tue, 26 Nov 2013 21:52:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/11/26/thoughts-on-dst-1/</guid><description>&lt;p&gt;In the past, I&amp;rsquo;ve been quite the champion of dynamically sized types
(DST). Specifically what this means is that things like &lt;code&gt;[T]&lt;/code&gt; and
&lt;code&gt;Trait&lt;/code&gt; would be &amp;ldquo;types&amp;rdquo; in the Rust type system. Lately I&amp;rsquo;ve been
investing a lot of effort thinking through the ramifications of
offering better support for smart pointers, and in particular how this
interacts with dynamically sized types, and I am no longer persuaded
that DST offer the best way forward. I&amp;rsquo;m a bit unsure, though, and the
topic is complicated, so I wanted to stop and write up a short series
of posts laying out my thought process thus far. This post will
describe what it would mean to offer DST in more detail. I don&amp;rsquo;t plan
to give a lot of Rust background, since there&amp;rsquo;s enough to talk about.&lt;/p&gt;</description></item><item><title>Optimizing SIMD, part 2</title><link>https://smallcultfollowing.com/babysteps/blog/2013/11/22/optimizing-simd/</link><pubDate>Fri, 22 Nov 2013 15:50:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/11/22/optimizing-simd/</guid><description>&lt;p&gt;A quick follow-up to my previous post. The approach I suggested
(&amp;ldquo;generate boxing instructions but bypass them when possible&amp;rdquo;) is in
some sense pessimistic: we generate the instructions we need for the
worst case and then cleanup. Like many problems in computer science,
it has an optimistic dual. We could generate unboxed data and then
insert boxes where needed. In fact, we have an existing mechanism for
doing that, called the &lt;em&gt;type policies&lt;/em&gt;. Basically, there is a phase
where each MIR opcode goes through and examines the types of its
inputs, attempting to reconcile those types with what it needs, either
by boxing or unboxing as needed.&lt;/p&gt;</description></item><item><title>Optimizing SIMD</title><link>https://smallcultfollowing.com/babysteps/blog/2013/11/21/optimizing-simd/</link><pubDate>Thu, 21 Nov 2013 21:56:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/11/21/optimizing-simd/</guid><description>&lt;p&gt;There is currently some &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=904913&amp;amp;sourceid=Mozilla-search"&gt;ongoing effort&lt;/a&gt; to implement the
proposed &lt;a href="http://wiki.ecmascript.org/doku.php?id=strawman:simd_number"&gt;JavaScript SIMD API&lt;/a&gt; in Firefox. The basic idea of the
API is to introduce explicit vector value types called &lt;code&gt;float32x4&lt;/code&gt; and
&lt;code&gt;int32x4&lt;/code&gt;. These types fit into the typed objects hierarchy, so you
can create arrays of them, embed them in structs, and so forth.&lt;/p&gt;
&lt;p&gt;The semantics of these vectors types is designed to make it possible
for JIT engines to detect and optimize their use. One crucial bit is
that they are &lt;em&gt;values&lt;/em&gt; and hence do not have identity. Basically
&lt;code&gt;float32x4&lt;/code&gt; values work like numbers and strings do today &amp;ndash; they are
equal if they have the same value. This is quite different from
objects, which may be unequal if their properties are the same (e.g.,
&lt;code&gt;{} !== {}&lt;/code&gt;).&lt;/p&gt;</description></item><item><title>Parameter coercion in Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2013/11/20/parameter-coercion-in-rust/</link><pubDate>Wed, 20 Nov 2013 11:10:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/11/20/parameter-coercion-in-rust/</guid><description>&lt;p&gt;Alex Chrichton recently sent a
&lt;a href="https://mail.mozilla.org/pipermail/rust-dev/2013-November/006849.html"&gt;message to the rust-dev mailing list&lt;/a&gt; discussing the fate of
parameter coercion in Rust. I&amp;rsquo;ve been thinking about this for a while
and feeling conflicted. As is my wont, I decided to try and write up a
blog post explaining precisely what&amp;rsquo;s under debate and exporing the
tradeoffs.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;h2 id="historical-background"&gt;Historical background&lt;/h2&gt;
&lt;p&gt;In the interest of clarity, I wanted to briefly explain some
terminology and precisely what the rules &lt;em&gt;are&lt;/em&gt;. I refer to &amp;ldquo;autoref&amp;rdquo;
as the addition of an implicit &lt;code&gt;&amp;amp;&lt;/code&gt;: so converting from &lt;code&gt;T&lt;/code&gt; to &lt;code&gt;&amp;amp;T&lt;/code&gt;, in
terms of the type. &amp;ldquo;Autoderef&amp;rdquo; is the addition of an implicit &lt;code&gt;*&lt;/code&gt;:
converting from &lt;code&gt;&amp;amp;T&lt;/code&gt;, &lt;code&gt;~T&lt;/code&gt;, etc to &lt;code&gt;T&lt;/code&gt;. Finally, &amp;ldquo;autoborrow&amp;rdquo; is the
addition of both a &lt;code&gt;&amp;amp;&lt;/code&gt; and a &lt;code&gt;*&lt;/code&gt;, which effectively converts from
&lt;code&gt;~T&lt;/code&gt;, &lt;code&gt;&amp;amp;T&lt;/code&gt; etc to &lt;code&gt;&amp;amp;T&lt;/code&gt;. &amp;ldquo;Autoslice&amp;rdquo; is the conversion from &lt;code&gt;~[..]&lt;/code&gt; and
&lt;code&gt;&amp;amp;[...]&lt;/code&gt; to &lt;code&gt;&amp;amp;[...]&lt;/code&gt; &amp;ndash; if we had a DST-based system, autoslice and
autoborrow would be the same thing, but in today&amp;rsquo;s world they are not,
and in fact there is no explicit syntax for slicing.&lt;/p&gt;</description></item><item><title>Treating vectors like any other container</title><link>https://smallcultfollowing.com/babysteps/blog/2013/11/14/treating-vectors-like-any-other-container/</link><pubDate>Thu, 14 Nov 2013 19:21:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/11/14/treating-vectors-like-any-other-container/</guid><description>&lt;p&gt;Some &lt;a href="https://mail.mozilla.org/pipermail/rust-dev/2013-November/006381.html"&gt;astute&lt;/a&gt; &lt;a href="https://mail.mozilla.org/pipermail/rust-dev/2013-November/006376.html"&gt;comments&lt;/a&gt; on a recent thread to rust-dev got me
thinking about our approach to vectors. Until now, we have focused on
having built-in support for vectors via the vector type (&lt;code&gt;~[T]&lt;/code&gt;) and
slice types (&lt;code&gt;&amp;amp;[T]&lt;/code&gt;). However, another possible approach would be to
move vector support out of the language (almost) entirely and into
standard libraries. I wanted to write out a post exploring this idea;
I find it brings some simplifications and reduces the need for
DST. Seems like an idea worth considering. Consider this a thought
experiment, not exactly a &lt;em&gt;proposal&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>Intermingled parameter lists, take 2</title><link>https://smallcultfollowing.com/babysteps/blog/2013/11/04/intermingled-parameter-lists/</link><pubDate>Mon, 04 Nov 2013 14:06:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/11/04/intermingled-parameter-lists/</guid><description>&lt;p&gt;I got a lot of feedback on my post about
&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/10/29/intermingled-parameter-lists/"&gt;intermingled parameter lists&lt;/a&gt; &amp;ndash; most of it negative &amp;ndash; and I&amp;rsquo;ve
been thinking about the issue over the weekend. Truth is, I wasn&amp;rsquo;t
terribly fond of the proposal myself &amp;ndash; making the position in the
list significant feels wrong &amp;ndash; but I felt it was the least bad of the
various options. However, I&amp;rsquo;ve had a change of heart, and thus have a
new &amp;ldquo;least bad&amp;rdquo; proposal.&lt;/p&gt;</description></item><item><title>Optimizing complex typed object assignments</title><link>https://smallcultfollowing.com/babysteps/blog/2013/11/04/optimizing-complex-typed-object-assignments/</link><pubDate>Mon, 04 Nov 2013 18:34:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/11/04/optimizing-complex-typed-object-assignments/</guid><description>&lt;p&gt;I want to optimize assignments to struct-typed fields in typed
objects. This post is an effort to work through my optimization plan.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;h3 id="the-goal"&gt;The goal&lt;/h3&gt;
&lt;p&gt;Imagine some code like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;var PointType = new StructType({x: int32, y: int32});
var LineType = new StructType({from: PointType,
 to: PointType});
var line = new LineType();
line.to = {x: 22, y: 44};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The last line in particular is the one I am interested in. Today we
execute this in the most naive way. The code which ion generates looks
something like:&lt;/p&gt;</description></item><item><title>Intermingled parameter lists</title><link>https://smallcultfollowing.com/babysteps/blog/2013/10/29/intermingled-parameter-lists/</link><pubDate>Tue, 29 Oct 2013 15:04:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/10/29/intermingled-parameter-lists/</guid><description>&lt;p&gt;I&amp;rsquo;ve been hard at work finishing up work on Rust&amp;rsquo;s
&lt;a href="https://github.com/mozilla/rust/issues/4846"&gt;&amp;ldquo;new&amp;rdquo; syntax for lifetimes&lt;/a&gt; &amp;ndash; I put &amp;ldquo;new&amp;rdquo; in quotes because
the syntax has been in use for some time, but in rustc itself the
change was only half-baked. In effect, the new syntax was a kind of
&amp;ldquo;bridge&amp;rdquo; to code that was designed for the older type system. This
resulted in some artificial limitations: for example, types could only
have a single lifetime parameter, and it had to be named &lt;code&gt;'self&lt;/code&gt;.
Under my pull request, these limitations are lifted. However, in the
process of implementing things, I realized one minor problem with the
new syntax that must be rectified. In this post I describe the problem
and my proposed solution.&lt;/p&gt;</description></item><item><title>PJS Roadmap</title><link>https://smallcultfollowing.com/babysteps/blog/2013/10/29/pjs-roadmap/</link><pubDate>Tue, 29 Oct 2013 17:51:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/10/29/pjs-roadmap/</guid><description>&lt;p&gt;I think someone reading this blog would be forgiven for thinking that
I must spend most of my energy thinking about Rust. In fact I spend a
good part of my working hours hammering on PJS. I thought I&amp;rsquo;d try to
write up a bit of a preview of the things we are working on.&lt;/p&gt;
&lt;h3 id="parallel-methods-on-arrays"&gt;Parallel methods on arrays&lt;/h3&gt;
&lt;p&gt;Right now, on Nightly Firefox builds, you can use the parallel methods
&lt;code&gt;mapPar&lt;/code&gt;, &lt;code&gt;filterPar&lt;/code&gt;, and &lt;code&gt;reducePar&lt;/code&gt; on normal JS arrays. These work
basically like their sequential equivalents except that they execute
in an undefined order (for &lt;code&gt;reducePar&lt;/code&gt;, that can be a more significant
difference, since both the left and right operand might be the result
of a reduction). That means you can write code like:&lt;/p&gt;</description></item><item><title>Iterators yielding mutable references</title><link>https://smallcultfollowing.com/babysteps/blog/2013/10/24/iterators-yielding-mutable-references/</link><pubDate>Thu, 24 Oct 2013 12:02:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/10/24/iterators-yielding-mutable-references/</guid><description>&lt;p&gt;There is a &lt;a href="https://github.com/mozilla/rust/issues/8624"&gt;known bug&lt;/a&gt; with the borrowck rules that causes it to
be overly permissive. The fix is relatively simple but it
unfortunately affects some of our &lt;code&gt;Iterator&lt;/code&gt; implementations,
specifically those iterators that iterate over &lt;code&gt;&amp;amp;mut&lt;/code&gt; values. The
short version is that while it is possible to expose a safe
&lt;em&gt;interface&lt;/em&gt; for iterating over &lt;code&gt;&amp;amp;mut&lt;/code&gt; values, it is not possible to
&lt;em&gt;implement&lt;/em&gt; such iterators without an unsafe block.&lt;/p&gt;
&lt;p&gt;After giving this quite a bit of thought, I have come to the conclusion
that we have three options:&lt;/p&gt;</description></item><item><title>Iterators yielding mutable references, take 2</title><link>https://smallcultfollowing.com/babysteps/blog/2013/10/24/iterators-yielding-mutable-references-take-2/</link><pubDate>Thu, 24 Oct 2013 16:32:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/10/24/iterators-yielding-mutable-references-take-2/</guid><description>&lt;p&gt;OK, after writing the
&lt;a href="http://smallcultfollowing.com/babysteps/blog/2013/10/24/iterators-yielding-mutable-references/"&gt;post on iterators that yield mutable references&lt;/a&gt;, and discussing
with some folk on IRC, I remembered something I had forgotten. There
is actually a way to phrase the mutable vector iterator differently
such that it is safe. Actually, the end result still has some unsafe
code, but it takes the form of a simple helper function, and it&amp;rsquo;s
quite plausible to imagine that code becoming safe eventually. Even
better, the approach generalizes to other data structures.&lt;/p&gt;</description></item><item><title>Single inheritance</title><link>https://smallcultfollowing.com/babysteps/blog/2013/10/24/single-inheritance/</link><pubDate>Thu, 24 Oct 2013 14:30:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/10/24/single-inheritance/</guid><description>&lt;p&gt;The following is a draft proposal to support a form of single
inheritance, similar to that found in object-oriented languages. The
goal is to enable servo to efficiently support structures like the
DOM. The proposal is not completely rounded out, but I wanted to put
it up in its current form so as to gather any comments.&lt;/p&gt;
&lt;p&gt;In a nutshell, the proposal is to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Enable structs to extend other structs, meaning that the substruct
inherits all fields of the superstruct, and also enabling a
subtyping relationship between borrowed pointers.&lt;/p&gt;</description></item><item><title>Typed object handles</title><link>https://smallcultfollowing.com/babysteps/blog/2013/10/18/typed-object-handles/</link><pubDate>Fri, 18 Oct 2013 15:39:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/10/18/typed-object-handles/</guid><description>&lt;p&gt;Yesterday &lt;a href="https://twitter.com/mulambda"&gt;Dmitry Lomov&lt;/a&gt; and I had a discussion about the typed objects
API. Much of the discussion revolved around the specific issue of
&lt;em&gt;handles&lt;/em&gt;. In this post I will summarize the issues we discussed and
review the various design options.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll begin with a summary of what handles are and how they are used in
current APIs; if this is familiar to you (&lt;em&gt;cough&lt;/em&gt; &lt;a href="https://twitter.com/littlecalculist"&gt;Dave Herman&lt;/a&gt; &lt;em&gt;cough&lt;/em&gt;)
you may want to skip ahead to the section &amp;ldquo;Subtle points&amp;rdquo;.&lt;/p&gt;</description></item><item><title>Fn types in Rust, take 3</title><link>https://smallcultfollowing.com/babysteps/blog/2013/10/10/fn-types-in-rust/</link><pubDate>Thu, 10 Oct 2013 16:36:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/10/10/fn-types-in-rust/</guid><description>&lt;p&gt;As some of you may recall, the fate of function types in Rust has been
somewhat uncertain. It all began when I realized that
&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/04/30/the-case-of-the-recurring-closure/"&gt;we could not soundly permit closures to recurse&lt;/a&gt;, which implies
that closures must be tracked in a linear fashion. This caused
interactions with the prior plans we had for
&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/04/30/dynamically-sized-types/"&gt;dynamically sized types&lt;/a&gt;, and led to &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/05/13/mutable-fn-alternatives/"&gt;several&lt;/a&gt; &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/05/14/procedures/"&gt;alternative&lt;/a&gt;
&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/05/30/removing-procs/"&gt;proposals&lt;/a&gt;. The most radical involved keeping only one closure
type for borrowed closures and then using macros and object types to
represent all other use cases.&lt;/p&gt;</description></item><item><title>Type specifications in Parallel JS</title><link>https://smallcultfollowing.com/babysteps/blog/2013/09/03/type-specifications-in-parallel-js/</link><pubDate>Tue, 03 Sep 2013 13:35:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/09/03/type-specifications-in-parallel-js/</guid><description>&lt;p&gt;Since I last wrote, we&amp;rsquo;ve made great progress with the work on the
Parallel JS and Typed Objects (nee Binary Data) implementation. In
particular, as of this morning, preliminary support for typed objects
has landed in Mozilla Nightly, although what&amp;rsquo;s currently checked in is
not fully conformant with the current version of the standard (for
this reason, support is limited to Nightly and not available in Aurora
or Beta builds).&lt;/p&gt;</description></item><item><title>Integrating binary data and type inference in SpiderMonkey</title><link>https://smallcultfollowing.com/babysteps/blog/2013/07/19/integrating-binary-data-and-type-inference-in-spidermonkey/</link><pubDate>Fri, 19 Jul 2013 06:42:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/07/19/integrating-binary-data-and-type-inference-in-spidermonkey/</guid><description>&lt;p&gt;Since the new version of PJS is going to be based on binary data, we
are going to need to have a well-optimized binary data implementation.
Nikhil Marathe has prepared an &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=578700&amp;amp;sourceid=Mozilla-search"&gt;initial implementation&lt;/a&gt;, but
it is limited to the interpreter. I am looking now at how to integrate
binary data into the JIT. The goal is to have accesses get compiled to
very efficient generated code. In this blog post, I specifically want
to cover the plan for integrating our type inference with binary data.&lt;/p&gt;</description></item><item><title>Rust presentation at Northeastern</title><link>https://smallcultfollowing.com/babysteps/blog/2013/07/18/rust-presentation-at-northeastern/</link><pubDate>Thu, 18 Jul 2013 22:32:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/07/18/rust-presentation-at-northeastern/</guid><description>&lt;p&gt;Today I had the honor of giving a presentation on Rust at the
Northeastern University PL Seminar. It was a lot of fun, and I also
had a lot of good conversations afterwards with some of the professors
and PhD students there. For those who are interested, I am uploading
the &lt;a href="https://smallcultfollowing.com/babysteps/
/pubs/2013.07.17-NEU.pdf"&gt;slides from my talk&lt;/a&gt;. The talk takes the same approach
that I would like to use for the next Rust paper. It was kind of a dry
run to see if that approach would be understandable and would flow logically;
overall, I thought it worked reasonably well.&lt;/p&gt;</description></item><item><title>Data Parallelism in Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2013/06/11/data-parallelism-in-rust/</link><pubDate>Tue, 11 Jun 2013 11:57:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/06/11/data-parallelism-in-rust/</guid><description>&lt;p&gt;Rust currently has very strong support for concurrency in the form of
actors which exchange messages and do not share memory. However, there
are many tasks for which actors are not a good fit. The unbounded
lifetime of actors means that they cannot safely access
stack-allocated memory from another task, even if it is
immutable. Actors cannot share memory except through the relatively
clumsy (and somewhat expensive) mechanism of &lt;code&gt;Arc&lt;/code&gt; structures (which
stands for &amp;ldquo;atomic reference count&amp;rdquo;), meaning that if there are large
data structures they can be a pain to access. &lt;code&gt;Arc&lt;/code&gt; is also
inapplicable to data structures that transition between mutable and
immutable and back again.&lt;/p&gt;</description></item><item><title>On the connection between memory management and data-race freedom</title><link>https://smallcultfollowing.com/babysteps/blog/2013/06/11/on-the-connection-between-memory-management-and-data-race-freedom/</link><pubDate>Tue, 11 Jun 2013 16:01:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/06/11/on-the-connection-between-memory-management-and-data-race-freedom/</guid><description>&lt;p&gt;As I alluded in the &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/06/11/data-parallelism-in-rust/"&gt;previous post&lt;/a&gt;, I have noticed an interesting
connection between &lt;em&gt;memory management&lt;/em&gt; and &lt;em&gt;data-race freedom&lt;/em&gt;. I want
to take a moment to elaborate on this, becaause the connection was not
obvious to me at first, but it ultimately drives a lot of the Rust
design decisions.&lt;/p&gt;
&lt;p&gt;First, I believe that if you want to guarantee data-race freedom, and
you want to support the cheap transfer of mutable state between tasks,
then you must have a garbage-collector-free subset of your
language. To see what I mean by &amp;ldquo;cheap transfer of mutable state&amp;rdquo;,
consider something like double-buffering: you have one drawing and one
display task exchanging buffers (so there are only two buffers in
total). While the drawing task is preparing the next frame, the
display task is busy displaying the current one. At the end, they
exchange buffers. In order to prevent data races in a scenario like
this, it is vital that we be able to guarantee that when the buffers
are exchanged, neither task has any remaining references. Otherwise,
the display task would be able to read or write from the buffer that
the drawing task is currently writing on.&lt;/p&gt;</description></item><item><title>Reducing DST Annotation</title><link>https://smallcultfollowing.com/babysteps/blog/2013/06/06/reducing-dst-annotation/</link><pubDate>Thu, 06 Jun 2013 06:16:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/06/06/reducing-dst-annotation/</guid><description>&lt;p&gt;So Ben Blum has doing &lt;a href="https://github.com/mozilla/rust/issues/6308#issuecomment-18880575"&gt;some investigation&lt;/a&gt; into the full
implications of the &lt;code&gt;Sized&lt;/code&gt; bound that I proposed as part of the
&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/04/30/dynamically-sized-types/"&gt;dynamically sized types&lt;/a&gt; post. It&amp;rsquo;s clear that, if we change
nothing else, the impact of &lt;code&gt;Sized&lt;/code&gt; will be somewhat greater than I
thought. He estimates somewhere around 40% of the files in libstd need
at least one &lt;code&gt;Sized&lt;/code&gt; bound; the actual number may wind up being
somewhat higher.&lt;/p&gt;
&lt;p&gt;It is not entirely clear to me if this is a problem. I imagine that
the number of &lt;code&gt;Sized&lt;/code&gt; bounds will be highest in container and other
library code. But it is worse than I hoped. So I wanted to briefly
explore some of the alternatives, assuming that the &lt;code&gt;Sized&lt;/code&gt; annotation
burden is too high.&lt;/p&gt;</description></item><item><title>More on fns</title><link>https://smallcultfollowing.com/babysteps/blog/2013/06/03/more-on-fns/</link><pubDate>Mon, 03 Jun 2013 13:40:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/06/03/more-on-fns/</guid><description>&lt;p&gt;I have been thinking about my previous proposal for fn types. I wanted
to offer some refinements and further thoughts.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;h3 id="on-thunks"&gt;On Thunks&lt;/h3&gt;
&lt;p&gt;I proposed a trait &lt;code&gt;Task&lt;/code&gt; for encapsulating a function and the
parameters it needs to run. I don&amp;rsquo;t like this name because this
concept could be used in other places beyond just tasks. I was
thinking that the proper name is probably &lt;code&gt;Thunk&lt;/code&gt;. I quote &lt;a href="http://en.wikipedia.org/wiki/Thunk_%28functional_programming%29"&gt;Wikipedia&lt;/a&gt;
for the definition of Thunk: &amp;ldquo;In computer science, a thunk (also
suspension, suspended computation or delayed computation) is a
parameterless closure created to prevent the evaluation of an
expression until forced at a later time.&amp;rdquo; (There are, admittedly,
other &lt;a href="http://en.wikipedia.org/wiki/Thunk_%28object-oriented_programming%29"&gt;contrary uses&lt;/a&gt; for the term)&lt;/p&gt;</description></item><item><title>Removing procs</title><link>https://smallcultfollowing.com/babysteps/blog/2013/05/30/removing-procs/</link><pubDate>Thu, 30 May 2013 09:38:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/05/30/removing-procs/</guid><description>&lt;p&gt;I&amp;rsquo;ve been thinking more about my proposal to split the current &lt;code&gt;fn&lt;/code&gt;
type into &lt;code&gt;fn&lt;/code&gt; and &lt;code&gt;proc&lt;/code&gt;. I have come to the conclusion that
we just don&amp;rsquo;t need &lt;code&gt;proc&lt;/code&gt; at all. I think we can get by with two types:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;fn(S) -&amp;gt; T&lt;/code&gt;: closures that always reference an enclosing scope&lt;/li&gt;
&lt;li&gt;&lt;code&gt;extern &amp;quot;ABI&amp;quot; fn(S) -&amp;gt; t&lt;/code&gt;: raw function pointer, no environment&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Code that uses &lt;code&gt;@fn&lt;/code&gt; or &lt;code&gt;~fn&lt;/code&gt; today could be rewritten to either use a
boxed trait or to use a pair of a user-data struct and an &lt;code&gt;extern fn&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Integrating binary data and PJs</title><link>https://smallcultfollowing.com/babysteps/blog/2013/05/29/integrating-binary-data-and-pjs/</link><pubDate>Wed, 29 May 2013 06:48:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/05/29/integrating-binary-data-and-pjs/</guid><description>&lt;p&gt;We&amp;rsquo;ve been making a lot of &lt;em&gt;conceptual&lt;/em&gt; progress with the PJS API that
has not been written down anywhere, so I want to cover some of that
work. This post focuses on the integration of parallel methods with
the binary data API. It shows how the new API approach allows users to
avoid allocation for higher efficiency.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;h3 id="methods-not-types"&gt;Methods, not types&lt;/h3&gt;
&lt;p&gt;We are moving away from a &lt;code&gt;ParallelArray&lt;/code&gt; type and into methods that
will be offered on existing array types. Current plan is to name them
things like &lt;code&gt;pmap&lt;/code&gt; (vs normal sequential &lt;code&gt;map&lt;/code&gt;). The defined semantics
are similar to the sequential version except that the order of
iterations is undefined, because iterations may occur in parallel (I
described &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/04/30/parallelizable-javascript-subset/"&gt;the subset of JS&lt;/a&gt; that we expect to parallelize in
a previous post).&lt;/p&gt;</description></item><item><title>Procedures, continued</title><link>https://smallcultfollowing.com/babysteps/blog/2013/05/14/procedures/</link><pubDate>Tue, 14 May 2013 09:20:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/05/14/procedures/</guid><description>&lt;p&gt;So, I didn&amp;rsquo;t actually &lt;em&gt;mean&lt;/em&gt; to post that previous post, I had
intended to think more on the idea. But oh well, cat&amp;rsquo;s out of the
bag. In any case, I&amp;rsquo;ve been thinking about the &amp;ldquo;closures&amp;rdquo; vs
&amp;ldquo;procedures&amp;rdquo; idea that I jotted down there and decided to try and
elaborate on it a bit more, since I find it has a lot of appeal. In
particular I think that the current collection of closure types is
addressing too many distinct use cases and the result is confusing.&lt;/p&gt;</description></item><item><title>Mutable fn alternatives</title><link>https://smallcultfollowing.com/babysteps/blog/2013/05/13/mutable-fn-alternatives/</link><pubDate>Mon, 13 May 2013 17:31:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/05/13/mutable-fn-alternatives/</guid><description>&lt;p&gt;I&amp;rsquo;ve been thinking about what I wrote in my last post regarding
closures and I am beginning to change my opinion about the correct
solution. &lt;code&gt;fn~&lt;/code&gt; just seems so unfortunate. So, besides writing &lt;code&gt;fn~&lt;/code&gt;,
what are the other options? I just thought I&amp;rsquo;d write down a few of
the other ideas I&amp;rsquo;ve come up with for later reference. Not saying any
of the ideas in this post are good yet.&lt;/p&gt;</description></item><item><title>Recurring closures and dynamically sized types</title><link>https://smallcultfollowing.com/babysteps/blog/2013/05/13/recurring-closures-and-dynamically-sized-types/</link><pubDate>Mon, 13 May 2013 10:35:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/05/13/recurring-closures-and-dynamically-sized-types/</guid><description>&lt;p&gt;I realized today that there is an unfortunate interaction between the
proposal for &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/04/30/dynamically-sized-types/"&gt;dynamically sized types&lt;/a&gt; and closure types. In
particular, in the &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/04/30/the-case-of-the-recurring-closure/"&gt;case of the recurring closure&lt;/a&gt;, I described
the soundness issues that arise in our language when closures are able
to recurse.&lt;/p&gt;
&lt;p&gt;My solution for this was to make the type system treat a &lt;code&gt;&amp;amp;fn()&lt;/code&gt; value
the same way it treats &lt;code&gt;&amp;amp;mut T&lt;/code&gt; pointers: they would be non-copyable,
and when you invoke them, that would be effectively like a &amp;ldquo;mutable
borrow&amp;rdquo;, meaning that for the duration of the call the original value
would become inaccessible. So in short the type system would guarantee
that when you call a closure, that same closure is not accessible from
any other path in the system, just as we now guarantee that when you
mutate a value, that same value is not accessible from any other path
in the system.&lt;/p&gt;</description></item><item><title>Dynamically sized types, revisited</title><link>https://smallcultfollowing.com/babysteps/blog/2013/04/30/dynamically-sized-types/</link><pubDate>Tue, 30 Apr 2013 20:06:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/04/30/dynamically-sized-types/</guid><description>&lt;p&gt;Recently, separate discussions with pnkfelix and graydon have prompted
me to think a bit about &amp;ldquo;dynamically sized types&amp;rdquo; once again. Those
who know Rust well know all about the sometimes annoying discrepancy
between a type like &lt;code&gt;~T&lt;/code&gt; (owned pointer to &lt;code&gt;T&lt;/code&gt;) and &lt;code&gt;~[S]&lt;/code&gt; (owned
vector of &lt;code&gt;S&lt;/code&gt; instances)&amp;mdash;in particular, despite the visual
similarity, there is no type &lt;code&gt;[S]&lt;/code&gt;, so &lt;code&gt;~[S]&lt;/code&gt; is not an instance of
&lt;code&gt;~T&lt;/code&gt; for any &lt;code&gt;T&lt;/code&gt;. This design was the outcome of a lot of
back-and-forth and I think it has generally served us well, but I&amp;rsquo;ve
always had this nagging feeling that we can do better. Recently it
occurred to me how we could, though it&amp;rsquo;s not without its price.&lt;/p&gt;</description></item><item><title>Parallelizable JavaScript Subset</title><link>https://smallcultfollowing.com/babysteps/blog/2013/04/30/parallelizable-javascript-subset/</link><pubDate>Tue, 30 Apr 2013 11:30:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/04/30/parallelizable-javascript-subset/</guid><description>&lt;p&gt;I want to look at an interesting topic: what subset of JavaScript do
we intend to support for parallel execution, and how long will it take
to get that working? As my dear and loyal readers already know, our
current engine supports a simple subset of JavaScript but we will want
to expand it and make the result more predictable.&lt;/p&gt;
&lt;p&gt;From my point of view, the subset below includes basically all the
JavaScript syntax that I ever use. There are two primary limitations
that I think people will encounter in practice:&lt;/p&gt;</description></item><item><title>The Case of the Recurring Closure</title><link>https://smallcultfollowing.com/babysteps/blog/2013/04/30/the-case-of-the-recurring-closure/</link><pubDate>Tue, 30 Apr 2013 10:51:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/04/30/the-case-of-the-recurring-closure/</guid><description>&lt;p&gt;Yesterday I realized that you can violate Rust&amp;rsquo;s memory safety
guarantees by using &amp;ldquo;stack closures&amp;rdquo;, meaning closures that are
allocated on the stack which have can refer to and manipulate the
local variables of the enclosing stack frame. Such closures are
ubiquitous in Rust, since every &lt;code&gt;for&lt;/code&gt; loop makes use of them (and
virtually every higher-order function). Luckily, this hole can be
fixed with (I think) very little pain&amp;mdash;in fact, I think fixing it
can also help us make other analyses a little less strict.&lt;/p&gt;</description></item><item><title>A tour of the Parallel JS implementation (Part 2)</title><link>https://smallcultfollowing.com/babysteps/blog/2013/04/04/a-tour-of-the-parallel-js-implementation-part-2/</link><pubDate>Thu, 04 Apr 2013 10:17:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/04/04/a-tour-of-the-parallel-js-implementation-part-2/</guid><description>&lt;p&gt;In my &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/03/20/a-tour-of-the-parallel-js-implementation"&gt;last post about ParallelJS&lt;/a&gt;, I discussed the &lt;code&gt;ForkJoin()&lt;/code&gt;
intrinsic and showed how it was used to implement the parallel map
operation. Today I want to write about the high-level changes to
IonMonkey that are needed to support &lt;code&gt;ForkJoin()&lt;/code&gt;. IonMonkey, of
course, is our JavaScript engine.&lt;/p&gt;
&lt;h3 id="parallel-execution-mode"&gt;Parallel execution mode&lt;/h3&gt;
&lt;p&gt;To support ParallelJS, we introduce a second mode of compilation
called &lt;em&gt;parallel execution mode&lt;/em&gt;. JavaScript compiled in this mode
produces executable code that is suitable to be run in parallel. To
accommodate this new mode, each &lt;code&gt;JSScript*&lt;/code&gt; potentially contains
pointers to two &lt;code&gt;IonScript*&lt;/code&gt; data structures, one for standard
sequential mode and one for parallel mode.&lt;/p&gt;</description></item><item><title>Nested lifetimes</title><link>https://smallcultfollowing.com/babysteps/blog/2013/04/04/nested-lifetimes/</link><pubDate>Thu, 04 Apr 2013 19:04:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/04/04/nested-lifetimes/</guid><description>&lt;p&gt;While working on &lt;a href="https://github.com/mozilla/rust/issues/5656"&gt;issue #5656&lt;/a&gt; I encountered an interesting
problem that I had not anticipated. The result is a neat little
extension to the region type system that increases its expressive
power. The change is completely internal to the type rules and
involves no user-visible syntax or anything like that, though there
are some (basically nonsensical) programs that will no longer compile.
Anyway I found it interesting and thought I would share.&lt;/p&gt;</description></item><item><title>Associated items continued</title><link>https://smallcultfollowing.com/babysteps/blog/2013/04/03/associated-items-continued/</link><pubDate>Wed, 03 Apr 2013 08:37:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/04/03/associated-items-continued/</guid><description>&lt;p&gt;I want to &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/04/02/associated-items"&gt;finish my discussion of associated items&lt;/a&gt; by taking a
look at how they are handled in Haskell, and what that might mean in
Rust.&lt;/p&gt;
&lt;p&gt;These proposals have the same descriptive power as what I described
before, but they are backwards compatible. This is nice.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;h3 id="object-oriented-style-name-resolution"&gt;Object-oriented style name resolution&lt;/h3&gt;
&lt;p&gt;In the object-oriented, C++-like version of associated items that I
introduced before, the names of associated items and methods were
resolved relative to a type. To see what I mean by this, consider a
(slightly expanded) variant the graph example I introduced before:&lt;/p&gt;</description></item><item><title>Associated items</title><link>https://smallcultfollowing.com/babysteps/blog/2013/04/02/associated-items/</link><pubDate>Tue, 02 Apr 2013 14:21:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/04/02/associated-items/</guid><description>&lt;p&gt;I&amp;rsquo;ve been doing a lot of thinking about Rust&amp;rsquo;s trait system lately.
The current system is a bit uneven: it offers a lot of power, but the
implementation is inconsistent and incomplete, and in some cases we
haven&amp;rsquo;t thought hard enough about precisely what should be allowed and
what should not. I&amp;rsquo;m going to write a series of posts looking at
various aspects of the trait system and trying to suss out what we
should be doing in each case. In particular I want to be sure that our
trait design is &lt;em&gt;forwards compatible&lt;/em&gt;: that is, I expect that we will
defer final decisions about various aspects of the trait system until
after 1.0, but we should look now and try to anticipate any future
difficulties we may encounter.&lt;/p&gt;</description></item><item><title>Guaranteeing parallel execution</title><link>https://smallcultfollowing.com/babysteps/blog/2013/03/21/guaranteeing-parallel-execution/</link><pubDate>Thu, 21 Mar 2013 10:38:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/03/21/guaranteeing-parallel-execution/</guid><description>&lt;p&gt;One common criticism of the work on ParallelJS is that the API itself
does not guarantee parallel execution. Instead, our approach has been
to offer methods whose definition makes parallel execution &lt;em&gt;possible&lt;/em&gt;,
but we have left it up to the engines to define the exact set of
JavaScript that will be safe for parallel execution.&lt;/p&gt;
&lt;p&gt;Now, I definitely think it is a good idea to clearly define the subset
of JavaScript that our engine will be able to execute in parallel. As
I wrote in my &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2013/03/20/parallel-js-lands/"&gt;preivous post&lt;/a&gt;, I want to do this both via
documentation and via developer tools that provide live feedback. In
some cases, I think, the rules will probably depend on type inference
or other dynamic analysis techniques that are subtle and hard to
explain, but live feedback should be helpful in detecting and
resolving those cases.&lt;/p&gt;</description></item><item><title>A tour of the Parallel JS implementation (Part 1)</title><link>https://smallcultfollowing.com/babysteps/blog/2013/03/20/a-tour-of-the-parallel-js-implementation/</link><pubDate>Wed, 20 Mar 2013 16:30:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/03/20/a-tour-of-the-parallel-js-implementation/</guid><description>&lt;p&gt;I am going to write a series of blog posts giving a tour of the
current Parallel JS implementation in SpiderMonkey. These posts are
intended to serve partly as documentation for the code. The plan is
to begin high level and work my way down to the nitty gritty details,
so here we go!&lt;/p&gt;
&lt;p&gt;I will start my discussion at the level of the intrinsic &lt;code&gt;ForkJoin()&lt;/code&gt;
function. As an intrinsic function, &lt;code&gt;ForkJoin()&lt;/code&gt; is not an API
intended for use by end-users. Rather, it is available only to
self-hosted code and is intended to serve as a building block for
other APIs (&lt;code&gt;ParallelArray&lt;/code&gt; among them).&lt;/p&gt;</description></item><item><title>Parallel JS lands</title><link>https://smallcultfollowing.com/babysteps/blog/2013/03/20/parallel-js-lands/</link><pubDate>Wed, 20 Mar 2013 09:56:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/03/20/parallel-js-lands/</guid><description>&lt;p&gt;The &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=829602"&gt;first version of our work on ParallelJS&lt;/a&gt; has just been
promoted to mozilla-central and thus will soon be appearing in a
Nightly Firefox build near you. I find this pretty exciting. In
honor of the occassion, I wanted to take a moment to step back and
look both at what has landed now, what we expect to land soon, and the
overall trajectory we are aiming for.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;h3 id="what-is-available-now"&gt;What is available now&lt;/h3&gt;
&lt;p&gt;Once Nightly builds are available, users will be able to run what is
essentially a &amp;ldquo;first draft&amp;rdquo; of Parallel JS. The code that will be
landing first is not really ready for general use yet. It supports a
limited set of JavaScript and there is no good feedback mechanism to
tell you whether you got parallel execution and, if not, why not.
Moreover, it is not heavily optimized, and the performance can be
uneven. Sometimes we see linear speedups and zero overhead, but in
other cases the overhead can be substantial, meaning that it takes
several cores to gain from parallelism. Nonetheless, it is pretty
exciting to see multithreaded execution landing in a JavaScript
engine. As far as I know, this is the first time that something like
this has been available (WebWorkers, with their Share Nothing, Copy
Everything architecture, do not count).&lt;/p&gt;</description></item><item><title>Splitting the PJs API</title><link>https://smallcultfollowing.com/babysteps/blog/2013/02/26/splitting-the-pjs-api/</link><pubDate>Tue, 26 Feb 2013 15:08:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/02/26/splitting-the-pjs-api/</guid><description>&lt;p&gt;Lately, I&amp;rsquo;ve been thinking about the ParallelJS API that we want to
expose. In particular, I&amp;rsquo;ve been considering offering methods on the
normal array type for basic parallel operations. I think this opens
up some interesting doors.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; To give credit where credit is due, I should note that a lot
of the ideas in this post originate with other members of the Parallel
JS team (Shu-yu Guo, Dave Herman, Felix Klock). But I don&amp;rsquo;t want to
speak for them, since we seem to each have our own opinions on the
best arrangement, so I&amp;rsquo;m writing the post from the first person
singular (&amp;ldquo;I&amp;rdquo;) and not a team perspective (&amp;ldquo;we&amp;rdquo;). This does not imply
&amp;ldquo;ownership&amp;rdquo; of the ideas within.&lt;/p&gt;</description></item><item><title>Interfacing with C functions in Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2013/02/22/interfacing-with-c-functions-in-rust/</link><pubDate>Fri, 22 Feb 2013 16:19:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/02/22/interfacing-with-c-functions-in-rust/</guid><description>&lt;p&gt;One of the things that I&amp;rsquo;ve been working on for some time now is the
proper integration of C functions. As with virtually every other
facet of the design of Rust, we&amp;rsquo;ve been slowly moving from a model
where Rust tried to hide low-level details for you to one where Rust
offers tight control over what&amp;rsquo;s going on, with the type system
intervening only as needed to prevent segfaults or other strange
behavior. This blog post details what I consider to be the best
proposal so far; some of the finer points are a bit vague, however.&lt;/p&gt;</description></item><item><title>Destructors and finalizers in Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2013/01/17/destructors-and-finalizers-in-rust/</link><pubDate>Thu, 17 Jan 2013 09:45:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/01/17/destructors-and-finalizers-in-rust/</guid><description>&lt;p&gt;Rust features destructors and, as of this moment, they are simply not
sound with respect to many other features of the language, such as
borrowed and managed pointers. The problem is that destructors are
granted unlimited access to arbitrary data, but the type system and
runtime do not take that into account. I propose to fix this by
limiting destructors to &lt;em&gt;owned&lt;/em&gt; types, meaning types that don&amp;rsquo;t contain
borrowed or managed pointers.&lt;/p&gt;</description></item><item><title>Revised for loop protocol</title><link>https://smallcultfollowing.com/babysteps/blog/2013/01/16/revised-for-loop-protocol/</link><pubDate>Wed, 16 Jan 2013 12:13:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/01/16/revised-for-loop-protocol/</guid><description>&lt;p&gt;In Rust today, there is a
&lt;a href="http://brson.github.com/rust/2012/04/05/new-for-loops/"&gt;special &lt;code&gt;for&lt;/code&gt; syntax designed to support interruptible loops&lt;/a&gt;.
Since we introduced it, this has proven to be a remarkable success.
However, I think we can improve it very slightly.&lt;/p&gt;
&lt;h3 id="current-for-protocol"&gt;Current for protocol&lt;/h3&gt;
&lt;p&gt;The current &amp;ldquo;for protocol&amp;rdquo; is best explained by giving an example of
how to implement it for slices:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;fn each&amp;lt;E&amp;gt;(v: &amp;amp;[E], f: &amp;amp;fn(&amp;amp;E) -&amp;gt; bool) {
 let mut i = 0;
 let n = v.len();
 while i &amp;lt; n {
 if !f(&amp;amp;v[i]) {
 return;
 }
 i += 1
 }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can see, the idea is that the last parameter to the &lt;code&gt;each()&lt;/code&gt;
method is a function of type &lt;code&gt;&amp;amp;fn(&amp;amp;E) -&amp;gt; bool&lt;/code&gt;, which means that it is
given a pointer to an element in the collection and it returns true or
false. The return value indicates whether we should continue
iterating.&lt;/p&gt;</description></item><item><title>Lifetime notation redux</title><link>https://smallcultfollowing.com/babysteps/blog/2013/01/15/lifetime-notation-redux/</link><pubDate>Tue, 15 Jan 2013 08:34:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/01/15/lifetime-notation-redux/</guid><description>&lt;p&gt;In a &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2012/12/30/lifetime-notation/"&gt;previous post&lt;/a&gt; I outlined some of the options for updating our
lifetime syntax. I want to revist those examples after having given
the matter more thought, and also after some discussions in the
comments and on IRC.&lt;/p&gt;
&lt;p&gt;My newest proposal is that we use &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; to designate lifetime
parameters on types and we lean on semantic analysis (the resolve
pass, more precisely) to handle the ambiguity between a lifetime name
and a type name. Before I always wanted to have the distinction
between lifetimes and types be made in the parser itself, but I think
this is untenable. This proposal has the advantage that the most
common cases are still written as they are today.&lt;/p&gt;</description></item><item><title>The case FOR deterministic results</title><link>https://smallcultfollowing.com/babysteps/blog/2013/01/03/the-case-for-deterministic-results/</link><pubDate>Thu, 03 Jan 2013 19:05:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/01/03/the-case-for-deterministic-results/</guid><description>&lt;p&gt;In my last post, I made the case against having a deterministic
semantics. I&amp;rsquo;ve gotten a fair amount of feedback saying that, for a
Web API, introducing nondeterminism is a very risky idea. Certainly
the arguments are strong. Therefore, I want to take a moment and make
the case &lt;em&gt;for&lt;/em&gt; determinism.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;h3 id="why-determinism"&gt;Why determinism?&lt;/h3&gt;
&lt;p&gt;All things being equal, it&amp;rsquo;s clear that deterministic execution
semantics are preferable. They&amp;rsquo;re easier to debug and they avoid the
question of browser incompatibilities.&lt;/p&gt;</description></item><item><title>Deterministic or not?</title><link>https://smallcultfollowing.com/babysteps/blog/2013/01/02/deterministic-or-not/</link><pubDate>Wed, 02 Jan 2013 12:30:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2013/01/02/deterministic-or-not/</guid><description>&lt;p&gt;One of the interesting questions with respect to Parallel JS is what
the semantics ought to be if you attempt a parallel operation with a
kernel function that has side-effects. There are basically three
reasonable options:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Deterministic results where possible:&lt;/em&gt; The function behaves &amp;ldquo;as
if&amp;rdquo; it executed sequentially, executing the kernel from 0 to n,
just like &lt;code&gt;Array.map&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Error:&lt;/em&gt; An exception is thrown.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Non-determinstic results:&lt;/em&gt; The function behaves &amp;ldquo;as if&amp;rdquo; it
executed sequentially, but the items were mapped in an unspecified
order.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The &lt;a href="https://github.com/syg/iontrail"&gt;branch&lt;/a&gt; currently implements option 3: I believe it is
the most consistent and will yield the best performance. However,
reasonable people can differ on this point, so I want to make my case.&lt;/p&gt;</description></item><item><title>Lifetime notation</title><link>https://smallcultfollowing.com/babysteps/blog/2012/12/30/lifetime-notation/</link><pubDate>Sun, 30 Dec 2012 16:33:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/12/30/lifetime-notation/</guid><description>&lt;p&gt;I&amp;rsquo;ve been thinking for a while that our lifetime notation has too many
defaults which can be more confusing than helpful. A recent spate of
e-mails on rust-dev brought this back to my mind. I&amp;rsquo;ve been wanting
to take a look at these defaults for a while, so I thought I&amp;rsquo;d write
up a quick exploration of the &amp;ldquo;syntactic space&amp;rdquo;. A warning: this is
not really an exciting post to read. I hope to have a few of those
coming up very soon. This one is mostly just a list of syntactic
options I wanted to document for future reference and to serve as a
starting point for discussion.&lt;/p&gt;</description></item><item><title>Improving our parallel intrinsic</title><link>https://smallcultfollowing.com/babysteps/blog/2012/12/06/improving-our-parallel-intrinsic/</link><pubDate>Thu, 06 Dec 2012 09:27:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/12/06/improving-our-parallel-intrinsic/</guid><description>&lt;p&gt;I mentioned in my previous post that we are using a single primitive
parallel operation to implement PJs. It turns out that I am not very
satisfied with what we currently have and I have been thinking about
some alternatives. In this post I&amp;rsquo;ll describe briefly how things
are setup, what problems I see, and then sketch out how I think we
could improve it.&lt;/p&gt;
&lt;h3 id="how-things-work-now-parallelbuildarray"&gt;How things work now: &lt;code&gt;%ParallelBuildArray()&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The current intrinsic is &lt;code&gt;%ParallelBuildArray(length, func, args...)&lt;/code&gt;. It
attempts to construct an array in parallel using a pool of &lt;code&gt;N&lt;/code&gt; worker
threads. Conceptually, &lt;code&gt;%ParallelBuildArray()&lt;/code&gt; allocates an array
&lt;code&gt;result&lt;/code&gt; of length &lt;code&gt;length&lt;/code&gt; and then instructs each worker thread to
invoke &lt;code&gt;func(result, id, N, warmup, ...args)&lt;/code&gt;, where:&lt;/p&gt;</description></item><item><title>Self-hosted Parallel JS</title><link>https://smallcultfollowing.com/babysteps/blog/2012/12/05/self-hosted-parallel-js/</link><pubDate>Wed, 05 Dec 2012 09:53:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/12/05/self-hosted-parallel-js/</guid><description>&lt;p&gt;The blog has been silent for a while. The reason is that I&amp;rsquo;ve been
hard at work on &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/categories/pjs"&gt;Parallel JS&lt;/a&gt;. It&amp;rsquo;s come a long way: in fact,
the goal is to land an initial version in the next couple weeks!&lt;/p&gt;
&lt;p&gt;One of the very exciting developments has been that we switched to a
&lt;em&gt;self-hosting&lt;/em&gt; implementation. Self-hosting is a very cool new
direction for the SpiderMonkey engine being introduced by
&lt;a href="http://www.tillschneidereit.de"&gt;Till Schneidereit&lt;/a&gt;. The idea is to implement large parts of
the engine itself in JavaScript, similar to projects like
&lt;a href="http://www.squeak.org/"&gt;Squeak&lt;/a&gt;, &lt;a href="http://www.research.ibm.com/jalapeno/publication.html"&gt;Jikes RVM&lt;/a&gt;, &lt;a href="http://labs.oracle.com/projects/maxine/"&gt;Maxine&lt;/a&gt;, &lt;a href="http://pypy.org/"&gt;PyPy&lt;/a&gt; and numerous
others. As an example, imagine the standard JavaScript function
&lt;code&gt;Array.map&lt;/code&gt;. In SM, this is currently implemented with approximately
&lt;a href="https://github.com/mozilla/mozilla-central/blob/7ca138ebf9ab8f0f1e981af486b9af6206fd0d15/js/src/jsarray.cpp#L2943"&gt;80 lines of C++ code&lt;/a&gt;. This function must handle all sorts of
annoying conditions, such as &lt;a href="https://github.com/mozilla/mozilla-central/blob/7ca138ebf9ab8f0f1e981af486b9af6206fd0d15/js/src/jsarray.cpp#L2948"&gt;ensuring that objects are rooted&lt;/a&gt;,
&lt;a href="https://github.com/mozilla/mozilla-central/blob/7ca138ebf9ab8f0f1e981af486b9af6206fd0d15/js/src/jsarray.cpp#L2986"&gt;checking for interrupts&lt;/a&gt;, and using an
&lt;a href="https://github.com/mozilla/mozilla-central/blob/7ca138ebf9ab8f0f1e981af486b9af6206fd0d15/js/src/jsarray.cpp#L2983"&gt;optimized call sequence to make it faster to invoke the JS code&lt;/a&gt;.
If the implementation were written in JS, however, all of these issues
would be handled automatically by the engine itself, just as they are
for any other JS function.&lt;/p&gt;</description></item><item><title>Imagine never hearing the phrase 'aliasable, mutable' again</title><link>https://smallcultfollowing.com/babysteps/blog/2012/11/18/imagine-never-hearing-the-phrase-aliasable/</link><pubDate>Sun, 18 Nov 2012 16:20:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/11/18/imagine-never-hearing-the-phrase-aliasable/</guid><description>&lt;p&gt;I&amp;rsquo;ve been thinking of a radical change we could make to the treatment
of mutability and borrowed pointers in Rust. The goal is to eliminate
all of the error messages about &amp;ldquo;aliasable, mutable data&amp;rdquo; that the
borrow checker currently issues. The idea is somewhat inspired by
writing a recent paper on Rust&amp;rsquo;s current system&amp;mdash;writing a paper on
something never fails to get me thinking about how to improve it,
though it sometimes fails to stimulate ideas which are actually
&lt;em&gt;good&lt;/em&gt;&amp;mdash;and also somewhat inspired by recent conversations on IRC and
in person.&lt;/p&gt;</description></item><item><title>Purity in Parallel JavaScript</title><link>https://smallcultfollowing.com/babysteps/blog/2012/10/24/purity-in-parallel-javascript/</link><pubDate>Wed, 24 Oct 2012 13:54:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/10/24/purity-in-parallel-javascript/</guid><description>&lt;p&gt;I can&amp;rsquo;t believe I&amp;rsquo;m saying this, but I&amp;rsquo;ve started to think that
Parallel JS (nee Rivertrail) should not demand pure callbacks to
functions like &lt;code&gt;map()&lt;/code&gt; and so forth. Rather it should just accept
arbitrary functions. Previously, I thought that it was important that
&lt;code&gt;ParallelArray&lt;/code&gt; methods should only accept functions which, at least
in a perfect world, would be safely parallelizable. But I am no
longer so sure why that is an important goal. Here is my reasoning.&lt;/p&gt;</description></item><item><title>Restrict pointers</title><link>https://smallcultfollowing.com/babysteps/blog/2012/10/24/restrict-pointers/</link><pubDate>Wed, 24 Oct 2012 21:15:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/10/24/restrict-pointers/</guid><description>&lt;p&gt;I am considering whether we should add a way to borrow something but
retain uniqueness. This would address a shortcoming of the borrowing
system that has been bothering me for some time, and it would enable a
few patterns that are difficult or awkward today.&lt;/p&gt;
&lt;!-- more --&gt;
&lt;h3 id="the-problem"&gt;The Problem&lt;/h3&gt;
&lt;p&gt;I described the problem in &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2012/09/26/type-system-for-borrowing-permissions/"&gt;this paper review I wrote&lt;/a&gt;, but I will
repeat it here, because it&amp;rsquo;s relevant, and perhaps people don&amp;rsquo;t read
and remember every single word that I write. In our system, a &lt;code&gt;~T&lt;/code&gt;
type is always owned. So if you write:&lt;/p&gt;</description></item><item><title>Function and object types</title><link>https://smallcultfollowing.com/babysteps/blog/2012/10/23/function-and-object-types/</link><pubDate>Tue, 23 Oct 2012 16:41:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/10/23/function-and-object-types/</guid><description>&lt;p&gt;My big goal for 0.5 is to straighten out our function types (&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/categories/fntypes"&gt;yet again&lt;/a&gt;). I&amp;rsquo;ve
been tossing the design for these over in my head since the summer and
I wanted to lay out my plan. This is a variation of something
that Ben Blum and I sketched out on a whiteboard.&lt;/p&gt;
&lt;h3 id="closure-type"&gt;Closure type&lt;/h3&gt;
&lt;p&gt;The closure type will be described something like so. Beware, it&amp;rsquo;s
got a lot of options. It turns out that there is a very large variety
of things one might want to use closures for, and supporting them
requires a fair number of knobs. I &lt;em&gt;believe&lt;/em&gt; that in practice there
will be a smallish set of standard forms (I&amp;rsquo;ll describe those later).
In any case, this is the closure type in its full generality, with
annotations:&lt;/p&gt;</description></item><item><title>Extending the definition of purity in Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2012/10/12/extending-the-definition-of-purity-in-rust/</link><pubDate>Fri, 12 Oct 2012 13:40:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/10/12/extending-the-definition-of-purity-in-rust/</guid><description>&lt;p&gt;In this post I propose an extension of Rust&amp;rsquo;s purity rules. The short
version is that pure functions would be allowed to mutate data owned
by their &lt;code&gt;&amp;amp;mut&lt;/code&gt; parameters. This extends the current Rust purity
rules which allow pure functions to invoke impure closures so long as
they are an argument to the function. The principle is the same: pure
functions are functions whose side-effects can be completely
determined by examining their parameters (for the more formally minded
among you, this is effectively an effect-parametric system with &lt;em&gt;very&lt;/em&gt;
lightweight notation). The rest of the post is an elaboration and
justification of this idea.&lt;/p&gt;</description></item><item><title>Rivertrail</title><link>https://smallcultfollowing.com/babysteps/blog/2012/10/10/rivertrail/</link><pubDate>Wed, 10 Oct 2012 17:36:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/10/10/rivertrail/</guid><description>&lt;p&gt;I have started work on implementing &lt;a href="https://github.com/RiverTrail/RiverTrail/"&gt;Rivertrail&lt;/a&gt;, Intel&amp;rsquo;s proposal
for data parallelism in JS. I am excited about this project, it seems
like it&amp;rsquo;s going to be great fun. The initial version that we produce
is going to be focused on Intel&amp;rsquo;s &lt;a href="http://wiki.ecmascript.org/doku.php?id=strawman:data_parallelism"&gt;specification&lt;/a&gt;, but I hope we
can eventually combine it with the more general stuff I&amp;rsquo;ve been doing
as part of PJs. There is an awful lot of overlap between the two,
though also a few minor differences that will need to be ironed out.&lt;/p&gt;</description></item><item><title>Termination of trait matching</title><link>https://smallcultfollowing.com/babysteps/blog/2012/10/05/termination-of-trait-matching/</link><pubDate>Fri, 05 Oct 2012 10:55:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/10/05/termination-of-trait-matching/</guid><description>&lt;p&gt;So, the condition that was supposed to ensure termination in my
previous post is most certainly wrong. The idea was to prevent
tautological impls like the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impl&amp;lt;A: Foo&amp;gt; A: Foo { ... }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Such impls, given a naive algorithm, would loop infinitely trying to
decide if a type &lt;code&gt;T&lt;/code&gt; implemented &lt;code&gt;Foo&lt;/code&gt;. You can imagine: it would
ask, &amp;ldquo;does &lt;code&gt;T&lt;/code&gt; implement &lt;code&gt;Foo&lt;/code&gt;? Well, if I map &lt;code&gt;A&lt;/code&gt; to &lt;code&gt;T&lt;/code&gt; then this
impl applies, but only if &lt;code&gt;T&lt;/code&gt; implements &lt;code&gt;Foo&lt;/code&gt;. Hmm. That puts me
back where I started from. Oh well, better try it again!&amp;rdquo; Obviously a
less naive algorithm could keep a stack and then fail to execute, but
it was precisely the logic of this stack that I was trying to capture
in that restriction.&lt;/p&gt;</description></item><item><title>A postscript on traits and impls</title><link>https://smallcultfollowing.com/babysteps/blog/2012/10/04/a-postscript-on-traits-and-impls/</link><pubDate>Thu, 04 Oct 2012 16:45:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/10/04/a-postscript-on-traits-and-impls/</guid><description>&lt;p&gt;I was thinking more about type classes as I walked down the street.
In my &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2012/10/04/refining-traits-slash-impls/"&gt;prior post&lt;/a&gt; I wrote that the rules I proposed resulted
in a system where traits loosely fit the following Haskell template:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; class C self a ... z | self -&amp;gt; a ... z where ...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However, I gave two caveats. The first was that due to subtyping we
cannot say that one type precisely determines another, but only that
it puts a bound. The second was that, in any given impl, the value of
&lt;code&gt;a ... z&lt;/code&gt; may be a type parameter which does not appear in the &lt;code&gt;self&lt;/code&gt;
type. I think I understated the importance of this second caveat.
For example, consider the example I gave for simulating overloading:&lt;/p&gt;</description></item><item><title>Refining traits and impls</title><link>https://smallcultfollowing.com/babysteps/blog/2012/10/04/refining-traits-slash-impls/</link><pubDate>Thu, 04 Oct 2012 09:32:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/10/04/refining-traits-slash-impls/</guid><description>&lt;p&gt;Currently, the Rust compiler accepts all manner of trait, impl, and
bound declarations. In fact, it accepts plenty of declarations that
later phases of the compiler are not sophisticated enough to handle.
In other words, the syntax is writing checks the semantics can&amp;rsquo;t cash.
(&lt;em&gt;An aside:&lt;/em&gt; I just love saying that phrase for some perverse reason.
I really wish however that checks, like rotary dial telephones, were
something that younger people vaguely understood but which no longer
had relevance in the modern era. The &lt;a href="https://www.postfinance.ch/en/biz/prod/pay/debsolution/inpay/apply.html"&gt;Swiss Einzahlungschein&lt;/a&gt; truly
opened my eyes! Anyhow.)&lt;/p&gt;</description></item><item><title>Moves based on type</title><link>https://smallcultfollowing.com/babysteps/blog/2012/10/01/moves-based-on-type/</link><pubDate>Mon, 01 Oct 2012 20:30:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/10/01/moves-based-on-type/</guid><description>&lt;p&gt;I have been trying to come up with a reasonable set of rules for
deciding when a pattern binding ought to be a move and when it ought
to be a copy and utterly failing. Simultaneously, pcwalton, brson,
and I kind of simultaneously arrived at an alternate design that tries
to simplify the copy/move distinction. I think that it also solves
the question of when to copy/move pattern bindings in a nice way.
Therefore, I wanted to write up this proposal.&lt;/p&gt;</description></item><item><title>Type system for borrowing permissions</title><link>https://smallcultfollowing.com/babysteps/blog/2012/09/26/type-system-for-borrowing-permissions/</link><pubDate>Wed, 26 Sep 2012 11:19:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/09/26/type-system-for-borrowing-permissions/</guid><description>&lt;p&gt;Well, I have not done too well with my
&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2012/04/25/permission-regions-for-race-free-parallelism/"&gt;goal of reading a research paper a day on the train&lt;/a&gt; (actually
my initial goal was two papers, but seeing as how I&amp;rsquo;ve failed so
spectacularly, I&amp;rsquo;ve dialed it back some). However, I&amp;rsquo;ve decided to
give it another go. I&amp;rsquo;ve bought a printer now so I can print papers
out (double-sided, no less!) at home (I had initially planned to buy
an iPad or something, but a decent printer is only $100, and paper is
still nicer to read and write notes on&amp;hellip;you do the math). As
additional motivation, I&amp;rsquo;m working again on the paper on Rust&amp;rsquo;s new
borrowed pointers and so I have to catch up on a lot of related work.&lt;/p&gt;</description></item><item><title>Rvalue lifetimes</title><link>https://smallcultfollowing.com/babysteps/blog/2012/09/15/rvalue-lifetimes/</link><pubDate>Sat, 15 Sep 2012 13:27:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/09/15/rvalue-lifetimes/</guid><description>&lt;p&gt;We need to clarify our story on rvalue lifetimes. This is related to
&lt;a href="https://github.com/mozilla/rust/issues/3387"&gt;issue #3387&lt;/a&gt; and also various recent and not-so-recent
discussions on IRC.&lt;/p&gt;
&lt;p&gt;The basic question is how long an rvalue lives when the program creates
pointers into it. To understand the rough issues, first consider this
program:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;let x = foo();
match x {
 Some(ref y) =&amp;gt; {...}
 None =&amp;gt; {...}
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here, the result of &lt;code&gt;foo()&lt;/code&gt; is stored into a local variable. The
&lt;code&gt;match&lt;/code&gt; clause then creates a pointer to the interior of this local
variable (i.e., into the stack) called &lt;code&gt;y&lt;/code&gt;. But what if we eliminated
the variable &lt;code&gt;x&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>Datasort refinements</title><link>https://smallcultfollowing.com/babysteps/blog/2012/08/24/datasort-refinements/</link><pubDate>Fri, 24 Aug 2012 10:24:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/08/24/datasort-refinements/</guid><description>&lt;p&gt;One of the things that is sometimes frustrating in Rust is the
inability to define a type that indicates some subset of enum
variants. For example, it is very common to have a pattern like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;match an_expr {
 expr_call(*) =&amp;gt; process_call(an_expr)
 ...
}

fn process_call(a_call_expr: @ast::expr) { ... }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But as you can see, the type of &lt;code&gt;a_call_expr&lt;/code&gt; does not reflect the
fact that this expression is a call. This is frustrating.&lt;/p&gt;</description></item><item><title>Type inference in Spidermonkey</title><link>https://smallcultfollowing.com/babysteps/blog/2012/07/30/type-inference-in-spidermonkey/</link><pubDate>Mon, 30 Jul 2012 08:21:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/07/30/type-inference-in-spidermonkey/</guid><description>&lt;p&gt;I&amp;rsquo;ve been slowly learning how &lt;a href="https://wiki.mozilla.org/TypeInference"&gt;type inference&lt;/a&gt; works in
SpiderMonkey. As I understand it, SpiderMonkey&amp;rsquo;s type inference
scheme is the brain child of one Brian &amp;ldquo;Hack-it&amp;rdquo;, coder
extraordinaire. You may have seen a &lt;a href="http://dl.acm.org/citation.cfm?id=2254094"&gt;recent PLDI publication&lt;/a&gt;
on the topic. You may, like me, have read that publication. You may,
also like me, have walked away thinking, &amp;ldquo;um, I don&amp;rsquo;t really
understand how that works.&amp;rdquo; In that case, dear reader, this blog post
is for you. Well, actually, it&amp;rsquo;s for me, to try and document what I
gleaned from a conversation or two. It it is almost certainly not
&lt;em&gt;entirely&lt;/em&gt; accurate and it may or may not be helpful.&lt;/p&gt;</description></item><item><title>Generalizing inherited mutability</title><link>https://smallcultfollowing.com/babysteps/blog/2012/07/24/generalizing-inherited-mutability/</link><pubDate>Tue, 24 Jul 2012 11:33:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/07/24/generalizing-inherited-mutability/</guid><description>&lt;p&gt;I have been working on a change to the definition of mutability in
Rust. This is a much smaller change than my &lt;a href="http://smallcultfollowing.com/babysteps/blog/2012/05/31/mutability/"&gt;previous&lt;/a&gt;
&lt;a href="http://smallcultfollowing.com/babysteps/blog/2012/05/30/mutability-idea-retracted/"&gt;thought&lt;/a&gt; &lt;a href="http://smallcultfollowing.com/babysteps/blog/2012/05/28/moving-mutability-into-the-type/"&gt;experiments&lt;/a&gt;, which were aimed at achieving better
parameterization (those are still percolating; I think the best
approach is a modified version of &lt;a href="http://smallcultfollowing.com/babysteps/blog/2012/05/31/mutability/"&gt;the latest proposal&lt;/a&gt; where not
all types have mutability but type parameters do&amp;hellip;but that&amp;rsquo;s a
problem for another day with many complications). The goal of these
changes is to enable operations like &amp;ldquo;freeze&amp;rdquo; and &amp;ldquo;thaw&amp;rdquo;.&lt;/p&gt;</description></item><item><title>Yet another tutorial on borrowed pointers</title><link>https://smallcultfollowing.com/babysteps/blog/2012/07/19/yet-another-tutorial-on-borrowed-pointers/</link><pubDate>Thu, 19 Jul 2012 09:44:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/07/19/yet-another-tutorial-on-borrowed-pointers/</guid><description>&lt;p&gt;Here is my latest stab at a tutorial on borrowed pointers. I know, I
know, enough with the borrowed pointer tutorials already! Hopefully
this will be my last post in this vein for a while. I am much happier
with this version. It is still too long to serve as a chapter in the
general Rust tutorial, but I think it&amp;rsquo;s more approachable than the
previous attempt, which was more of a reference document. As always,
feedback welcome! I have tried to incorporate what people wrote in the
comments into this version.&lt;/p&gt;</description></item><item><title>About that 'tutorial'...</title><link>https://smallcultfollowing.com/babysteps/blog/2012/07/17/about-that-tutorial-dot-dot-dot/</link><pubDate>Tue, 17 Jul 2012 19:16:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/07/17/about-that-tutorial-dot-dot-dot/</guid><description>&lt;p&gt;One thing I didn&amp;rsquo;t make clear regarding my last post: I am not
especially satisfied with the way the &amp;ldquo;tutorial&amp;rdquo; was turning out. I
use scare quotes here because I think it resembles a reference manual
more than a tutorial. Nonetheless I think there are some sections
that are quite good; and a document like it probably ought to
exist. So I figured I&amp;rsquo;d post it anyhow and I can mine it for material
later. I intend to start afresh however with something that dives at
the core ideas, which I think are relatively simple.&lt;/p&gt;</description></item><item><title>Borrowed pointer tutorial</title><link>https://smallcultfollowing.com/babysteps/blog/2012/07/17/borrowed-pointer-tutorial/</link><pubDate>Tue, 17 Jul 2012 12:26:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/07/17/borrowed-pointer-tutorial/</guid><description>&lt;p&gt;Here is a (much) more complete draft of the tutorial on borrowed
pointers. It is becoming more in-depth than I intended. I hope to
later extract a much shorter subset. But I thought I&amp;rsquo;d post what I&amp;rsquo;ve
got so far.&lt;/p&gt;
&lt;h1 id="borrowed-pointers"&gt;Borrowed pointers&lt;/h1&gt;
&lt;p&gt;Borrowed pointers are one of the more flexible and powerful tools
available in Rust. A borrowed pointer can be used to point anywhere:
into the shared and exchange heaps, into the stack, and even into the
interior of another data structure. With regard to flexibility, it is
comparable to a C pointer or C++ reference. However, unlike C and
C++, the Rust compiler includes special checks that ensure that
borrowed pointers are being used safely. Another advantage of
borrowed pointers is that they are invisible to the garbage collector,
so working with borrowed pointers helps keep things efficient.&lt;/p&gt;</description></item><item><title>Concurrent maps</title><link>https://smallcultfollowing.com/babysteps/blog/2012/07/13/concurrent-maps/</link><pubDate>Fri, 13 Jul 2012 10:30:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/07/13/concurrent-maps/</guid><description>&lt;p&gt;I had a very interesting discussion with Sriram and Terrence (of
&lt;a href="http://www.malhar.net/sriram/kilim/"&gt;Kilim&lt;/a&gt; and &lt;a href="http://www.antlr.org/"&gt;ANTLR&lt;/a&gt; fame, respectively&amp;mdash;two smart
dudes) yesterday. One of the things we talked about was adapting
shared-memory data structures like concurrent hash maps into
an actor setting.&lt;/p&gt;
&lt;p&gt;One thing we&amp;rsquo;ve found when working on Servo is that the temptation to
cheat is enormous. Most of the papers you read about things like
parallel layout just assume a shared memory setting and blithely make
use of data strutures like concurrent hash maps. There is nothing
&lt;em&gt;wrong&lt;/em&gt; with such data structures, but if we can avoid shared, mutable
memory it will go a long way towards avoiding bugs I think&amp;mdash;as well
as keeping things secure. Even if the bug is mostly correct, data
races and similar subtle errors can open holes for exploitation.&lt;/p&gt;</description></item><item><title>Fn types</title><link>https://smallcultfollowing.com/babysteps/blog/2012/07/12/fn-types/</link><pubDate>Thu, 12 Jul 2012 09:21:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/07/12/fn-types/</guid><description>&lt;p&gt;I am trying to mop up some of the remaining work for regions now. One
of the big remaining areas is dealing with function and iface types.
This proposal is certainly influenced by my previous proposals.
However, we have backed away from the idea of dynamically-sized types
for vectors and so I will do the same here.&lt;/p&gt;
&lt;h3 id="the-design"&gt;The design&lt;/h3&gt;
&lt;p&gt;My current design includes the following kinds of function types
(written as I expect them to commonly be written; some details are
omitted):&lt;/p&gt;</description></item><item><title>Borrowed Pointer Tutorial</title><link>https://smallcultfollowing.com/babysteps/blog/2012/07/10/borrowed-pointer-tutorial/</link><pubDate>Tue, 10 Jul 2012 09:04:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/07/10/borrowed-pointer-tutorial/</guid><description>&lt;p&gt;This is a draft of (the first section of) a new Rust tutorial on
borrowed pointers (the official name for &amp;ldquo;regions&amp;rdquo;). Comments
welcome.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; I added a section &amp;ldquo;Why borrowed?&amp;rdquo;&lt;/p&gt;
&lt;h1 id="borrowed-pointers"&gt;Borrowed pointers&lt;/h1&gt;
&lt;p&gt;Borrowed pointers are one of the more flexible and powerful tools
available in Rust. A borrowed pointer can be used to point anywhere:
into the shared and exchange heaps, into the stack, and even into the
interior of another data structure. With regard to flexibility, it is
comparable to a C pointer or C++ reference. However, unlike C and
C++, the Rust compiler includes special checks that ensure that
borrowed pointers are being used safely. We have done our best to
ensure that these checks mostly occur behind the scenes; but to get
the most out of the system, you will have to understand a bit about
how the compiler reasons about your program.&lt;/p&gt;</description></item><item><title>HotPar</title><link>https://smallcultfollowing.com/babysteps/blog/2012/06/11/hotpar/</link><pubDate>Mon, 11 Jun 2012 15:39:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/06/11/hotpar/</guid><description>&lt;p&gt;Last Thursday and Friday I had the good fortune of presenting a paper
of mine at &lt;a href="https://www.usenix.org/conference/hotpar12"&gt;HotPar 2012&lt;/a&gt;. The paper is called
&lt;a href="https://www.usenix.org/conference/hotpar12/parallel-closures-new-twist-old-idea"&gt;Parallel Closures: A New Twist on an Old Idea&lt;/a&gt;; it basically
describes what has evolved to become the PJs (Parallel JavaScript)
model, though it does so in the context of a static checker built in
Java.&lt;/p&gt;
&lt;p&gt;I really enjoyed the workshop: the presenters were generally very good
and the audience was lively. I also appreciate that they make an
effort to encourage good conversation; for example, at lunchtime the
tables are labeled with topics for discussion (&amp;ldquo;memory models&amp;rdquo;, say,
or, &amp;ldquo;schedulers&amp;rdquo;). It&amp;rsquo;s always hard for young folk like myself to get
connected with the older, more knowledgable people in the audience, so
everything helps. (&amp;ldquo;Hi Hans Boehm, love your work on C++ memory
models&amp;rdquo;)&lt;/p&gt;</description></item><item><title>Unifying patterns in alts and lets</title><link>https://smallcultfollowing.com/babysteps/blog/2012/06/10/unifying-patterns-in-alts-and-lets/</link><pubDate>Sun, 10 Jun 2012 05:41:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/06/10/unifying-patterns-in-alts-and-lets/</guid><description>&lt;p&gt;This is a proposal to unify the mechanics of &lt;code&gt;alt&lt;/code&gt; and destructuring
assignment. It was born out of discussion between erickt, pcwalton,
and I amidst various bugs in the bug tracker but I wanted to float it
around to a larger audience. I&amp;rsquo;d like to discuss this on Tuesday,
because one of the logical next steps for the regions work is to begin
deciding precisely what to do about the types of identifiers in alts.&lt;/p&gt;</description></item><item><title>Mutability</title><link>https://smallcultfollowing.com/babysteps/blog/2012/05/31/mutability/</link><pubDate>Thu, 31 May 2012 10:32:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/05/31/mutability/</guid><description>&lt;p&gt;OK, I&amp;rsquo;ve been thinking more about the mutability issue and I think
I have found a formulation that I am happy with. The basic idea is
that we refactor types like so:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;T = M T
 | X
 | @T
 | ~T
 | [T]
 | {(f:T)*}
 | int
 | uint
 | ...
M = mut | const | imm
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This no doubt looks similar to some of my other permutations. The key
difference is that before I separated qualified and unqualified types.
This was intended to aid with inference, but in fact it was getting me
into trouble. I realize now there is a different way to solve the
inference problem. But first let me back and explain what inference
problem I am concerned about.&lt;/p&gt;</description></item><item><title>Mutability idea retracted</title><link>https://smallcultfollowing.com/babysteps/blog/2012/05/30/mutability-idea-retracted/</link><pubDate>Wed, 30 May 2012 18:47:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/05/30/mutability-idea-retracted/</guid><description>&lt;p&gt;I have been thinking a bit more about the
&lt;a href="blog/2012/05/28/moving-mutability-into-the-type/"&gt;approach to mutability I recently discussed&lt;/a&gt;. It seemed a bit
too good to be true (too clean) and I think I&amp;rsquo;ve realized a problem.&lt;/p&gt;
&lt;p&gt;The problem derives from my definition of types:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;T = Q U
Q = mut | const | imm
U = [T]
 | @T
 | &amp;amp;T
 | { (f : T)* }
 | X
 | int
 | uint
 | ...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The interesting case is that of a type variable, denoted as &lt;code&gt;X&lt;/code&gt;. I
grouped type variables under the heading of &amp;ldquo;unqualified types&amp;rdquo;. But
this is of course incorrect, they are not unqualified types. They can
map to a qualified type (in fact, that&amp;rsquo;s the whole point of this
exercise). So really the hierarchy ought to be:&lt;/p&gt;</description></item><item><title>Simple effect system</title><link>https://smallcultfollowing.com/babysteps/blog/2012/05/29/simple-effect-system/</link><pubDate>Tue, 29 May 2012 11:15:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/05/29/simple-effect-system/</guid><description>&lt;p&gt;Currently, Rust has an effect system but refuses to admit it. In an
effort to broaden the set of things that can be safely done in the
face of extant aliases into the heap, I have been experimenting with a
lightweight extension to Rust&amp;rsquo;s system. So far I think it is
promising but also no magic bullet.&lt;/p&gt;
&lt;h3 id="background"&gt;Background&lt;/h3&gt;
&lt;p&gt;For those who aren&amp;rsquo;t familiar with the term, an &amp;ldquo;effect system&amp;rdquo; is
basically just a fancy name for tagging functions with some extra
information beyond the types of their arguments and their return type.&lt;/p&gt;</description></item><item><title>Moving mutability into the type</title><link>https://smallcultfollowing.com/babysteps/blog/2012/05/28/moving-mutability-into-the-type/</link><pubDate>Mon, 28 May 2012 15:17:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/05/28/moving-mutability-into-the-type/</guid><description>&lt;p&gt;I am dissatisfied with how mutability is treated in the Rust type
system. The current system is that a &lt;em&gt;type&lt;/em&gt; is not prefixed mutable;
rather, lvalues are. That is, a type &lt;code&gt;T&lt;/code&gt; is defined like so:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;T = [M T]
 | @ M T
 | &amp;amp; M T
 | { (M f : T)* }
 | int
 | uint
 | ...
M = mut | const | (imm)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that there is no type &lt;code&gt;mut int&lt;/code&gt; (a mutable integer). This is
logical enough; such a type has little inherent meaning: an integer is
a value, it is not mutable or immutable.&lt;/p&gt;</description></item><item><title>Vectors, slices, and functions, oh my!</title><link>https://smallcultfollowing.com/babysteps/blog/2012/05/14/vectors/</link><pubDate>Mon, 14 May 2012 06:36:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/05/14/vectors/</guid><description>&lt;p&gt;I wanted to bring together the various ideas around vectors and
function types into one post. The goals of these changes are&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;to achieve orthogonality of the pointer types, so that leading &lt;code&gt;&amp;amp;&lt;/code&gt;,
&lt;code&gt;@&lt;/code&gt;, and &lt;code&gt;~&lt;/code&gt; sigils are the only way to indicate the kind of
pointer that is in use;&lt;/li&gt;
&lt;li&gt;to help pare down on the proliferation of subtle variantions on
types, such as the 5 different function types currently available.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="the-proposal"&gt;The proposal&lt;/h2&gt;
&lt;p&gt;The Rust type system would be described by the following grammar. In
this grammar, I have included all optional portions except for region
bounds. I indicated those types which could have a lifetime bound
associated with them by writing &lt;code&gt;(/&amp;amp;r)&lt;/code&gt; in the description (a lifetime
bound indicates the lifetime of any pointers embedded within the type
itself; this is not related to the changes I am discussing here so I
won&amp;rsquo;t go into detail):&lt;/p&gt;</description></item><item><title>Iface types</title><link>https://smallcultfollowing.com/babysteps/blog/2012/05/08/iface-types/</link><pubDate>Tue, 08 May 2012 09:03:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/05/08/iface-types/</guid><description>&lt;p&gt;Yesterday I wrote about my scheme for paring down our set of function
types to one type, &lt;code&gt;fn:kind(S) -&amp;gt; T&lt;/code&gt;. When I finished writing the
post, I was feeling somewhat uncertain about the merits of the idea,
but I&amp;rsquo;m feeling somewhat better about it today. I really like the
idea that top-level items have the type &lt;code&gt;fn:kind(S) -&amp;gt; T&lt;/code&gt; and that you
therefore give them an explicit sigil to use them in an expression;
this allows us to remove the &amp;ldquo;bare function&amp;rdquo; type altogether without
any complex hacks in the inference scheme.&lt;/p&gt;</description></item><item><title>Fn types</title><link>https://smallcultfollowing.com/babysteps/blog/2012/05/07/fn-types/</link><pubDate>Mon, 07 May 2012 16:27:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/05/07/fn-types/</guid><description>&lt;p&gt;As you loyal readers know, I am on a quest to make the Rust type
system more &lt;em&gt;orthogonal&lt;/em&gt; with respect to the kind of pointer in use,
by which I mean that I want to have the three pointer sigils (&lt;code&gt;@&lt;/code&gt;,
&lt;code&gt;&amp;amp;&lt;/code&gt;, and &lt;code&gt;~&lt;/code&gt;) indicate where memory is located and the other types
indicate what value is to be found at that memory. Right now there
are a few cases where we conflate the two things into one type. The
first, vectors and slices, I discused in a recent post. This post
discusses the second case: function and interface types.&lt;/p&gt;</description></item><item><title>Borrowing errors</title><link>https://smallcultfollowing.com/babysteps/blog/2012/05/05/borrowing-errors/</link><pubDate>Sat, 05 May 2012 05:37:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/05/05/borrowing-errors/</guid><description>&lt;p&gt;I implemented a simple, non-flow-sensitive version of the reference
checker which I described in &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2012/05/01/borrowing"&gt;my previous post&lt;/a&gt;. Of course it
does not accept the Rust codebase; however, the lack of
flow-sensitivity is not the problem, but rather our extensive use of
unique vectors. I thought I&amp;rsquo;d write a post first showing the problem
that you run into and then the various options for solving it.&lt;/p&gt;
&lt;h2 id="errors"&gt;Errors&lt;/h2&gt;
&lt;p&gt;The single most common error involves &lt;code&gt;vec:len()&lt;/code&gt;. There are many
variations, but mostly it boils down to code code like this, taken
from the &lt;code&gt;io&lt;/code&gt; package:&lt;/p&gt;</description></item><item><title>Borrowing</title><link>https://smallcultfollowing.com/babysteps/blog/2012/05/01/borrowing/</link><pubDate>Tue, 01 May 2012 19:53:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/05/01/borrowing/</guid><description>&lt;p&gt;I&amp;rsquo;ve been working for the last few days on the proper safety
conditions for borrowing. I am coming into a situation where I am not
sure what would be the best approach. The question boils down to how
coarse-grained and approximate our algorithm ought to be: in
particular, ought it to be flow sensitive? But let me back up a bit, first,
and provide a bit of background.&lt;/p&gt;
&lt;h2 id="background"&gt;Background&lt;/h2&gt;
&lt;p&gt;Rust bucks the &amp;ldquo;new language&amp;rdquo; trend by not having a purely
garbage-collected model. We feature things like interior and unique
types which can be eagerly overwritten. This means that we have to be
very careful when we create temporary references to those kinds of
values that these references remain valid.&lt;/p&gt;</description></item><item><title>In favor of types of unknown size</title><link>https://smallcultfollowing.com/babysteps/blog/2012/04/27/in-favor-of-types-of-unknown-size/</link><pubDate>Fri, 27 Apr 2012 09:55:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/04/27/in-favor-of-types-of-unknown-size/</guid><description>&lt;p&gt;I&amp;rsquo;m still thinking about vector and string types in Rust and I think
I&amp;rsquo;ve decided what I feel is the best approach. I thought I&amp;rsquo;d
summarize it here and make the case for it. If you don&amp;rsquo;t know what
I&amp;rsquo;m talking about, see &lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2012/04/23/vectors-strings-and-slices"&gt;this post&lt;/a&gt; for more background. I&amp;rsquo;ll
forward this to the mailing list as well; I&amp;rsquo;m sorry if it seems like
I&amp;rsquo;m harping on this issue. I just think vectors and strings are kind
of central data structures so we want them to be as nice as possible,
both in terms of what you can do with them and in terms of the
notations we use to work with them.&lt;/p&gt;</description></item><item><title>Permission regions for race-free parallelism</title><link>https://smallcultfollowing.com/babysteps/blog/2012/04/25/permission-regions-for-race-free-parallelism/</link><pubDate>Wed, 25 Apr 2012 17:50:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/04/25/permission-regions-for-race-free-parallelism/</guid><description>&lt;p&gt;I&amp;rsquo;ve been making a point of reading academic papers on the train as I
ride home. It&amp;rsquo;s so easy to get behind with the sheer quantity of work
that is being produced. Anyway, it occurred to me that I ought to try
and summarize the papers I read on this blog so that I can I remember
my reactions to them.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll start with &amp;ldquo;Permission Regions for Race-Free Parallelism&amp;rdquo;, by
Westbrook, Zhao, Budimilic, and Sarkar. The basic idea builds off of
Habanero Java, which is a kind of fork of the X10 language that Sarkar
and his group work on. The basic idea of the paper is to add a
language construct &lt;code&gt;permit&lt;/code&gt; which looks like:&lt;/p&gt;</description></item><item><title>References</title><link>https://smallcultfollowing.com/babysteps/blog/2012/04/25/references/</link><pubDate>Wed, 25 Apr 2012 07:53:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/04/25/references/</guid><description>&lt;p&gt;I want to do an introduction to the regions system I&amp;rsquo;ve been working
on. This is work-in-progress, so some of the details are likely to
change. Also, I&amp;rsquo;m going to try some new terminology on for size:
although it has a long history in the literature, I think the term
&amp;ldquo;region&amp;rdquo; is not particularly accurate, so I am going to use the term
&amp;ldquo;lifetime&amp;rdquo; or &amp;ldquo;pointer lifetime&amp;rdquo; and see how it fits.&lt;/p&gt;</description></item><item><title>On types and type schemes</title><link>https://smallcultfollowing.com/babysteps/blog/2012/04/23/on-types-and-type-schemes/</link><pubDate>Mon, 23 Apr 2012 08:54:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/04/23/on-types-and-type-schemes/</guid><description>&lt;p&gt;After my recent dalliance in
&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2012/04/15/syntax-matters-dot-dot-dot/"&gt;Matters of a Truly Trivial Nature&lt;/a&gt;, I&amp;rsquo;d like to return to
Matters Most Deep and Profound. I&amp;rsquo;m running up against an interesting
question with regions that has to do with the nature of function types
like &lt;code&gt;fn(&amp;amp;int)&lt;/code&gt;: up until now, I&amp;rsquo;ve assumed that this refers to a
function that takes an integer pointer in some region that is
specified by the caller. That is, it is a kind of shorthand for a
type that might be written like &lt;code&gt;fn&amp;lt;r&amp;gt;(&amp;amp;r.int)&lt;/code&gt;, where the &lt;code&gt;&amp;lt;r&amp;gt;&lt;/code&gt;
indicates that the function type is &lt;em&gt;parameterized&lt;/em&gt; by the region &lt;code&gt;r&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Vectors, strings, and slices</title><link>https://smallcultfollowing.com/babysteps/blog/2012/04/23/vectors-strings-and-slices/</link><pubDate>Mon, 23 Apr 2012 14:31:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/04/23/vectors-strings-and-slices/</guid><description>&lt;p&gt;We&amp;rsquo;ve been discussing a lot about how to manage vectors and strings in
Rust. Graydon sent out an excellent proposal which allows for a great
number of use cases to be elegant handled. However, I find the syntax
somewhat misleading. I&amp;rsquo;ve proposed one alternative on the mailing
list, but I now find I don&amp;rsquo;t like it, so I thought I&amp;rsquo;d brainstorm a
bit and try to find something better.&lt;/p&gt;
&lt;p&gt;There are really three use cases:&lt;/p&gt;</description></item><item><title>Syntax matters...?</title><link>https://smallcultfollowing.com/babysteps/blog/2012/04/15/syntax-matters-dot-dot-dot/</link><pubDate>Sun, 15 Apr 2012 19:55:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/04/15/syntax-matters-dot-dot-dot/</guid><description>&lt;p&gt;For a long time, it was considered fairly obvious, I think, that
syntax didn&amp;rsquo;t really matter. It was just the surface skin over the
underlying ideas. In recent times, though, the prevailing wisdom has
reversed, and it is now quite common to hear people talk about how
&lt;a href="https://www.google.com/search?q=syntax%20matters"&gt;&amp;ldquo;syntax matters&amp;rdquo;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;While I don&amp;rsquo;t exactly disagree, I think that the importance of trivial
syntactic matters is generally overemphasized. It is not a matter of
life and death whether or not semicolons are required to end a line,
for example, or whether parentheses are required in making a call.&lt;/p&gt;</description></item><item><title>DOA: Don't overabstract</title><link>https://smallcultfollowing.com/babysteps/blog/2012/04/11/doa-dont-overabstract/</link><pubDate>Wed, 11 Apr 2012 13:21:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/04/11/doa-dont-overabstract/</guid><description>&lt;p&gt;I&amp;rsquo;d like to propose a term for code that has been &amp;ldquo;over-DRY&amp;rsquo;d&amp;rdquo;
(dessicated?). I occasionally run across some method which just seems
&lt;em&gt;horribly complex&lt;/em&gt;. Reading it closer, it usually turns out that what
happened is that two or three independent operations got collected
into one subroutine. Perhaps they started out as doing almost the
same thing&amp;mdash;but before long, they diverged, and now the subroutine
has grown a hundred parameters and has a control-flow path that
requires a whiteboard and a ultra-super-fine-point marker to follow.
But, just as often, you can tear this routine apart into two or three
routines that read just fine, even if they share a line or two of code
in common. So I&amp;rsquo;m going to start calling such routines &amp;ldquo;DOA&amp;rdquo;, though
the acronym has a bit of a &lt;a href="http://en.wikipedia.org/wiki/Dead_on_arrival"&gt;different expansion&lt;/a&gt; when used as an
adjective.&lt;/p&gt;</description></item><item><title>Declared vs duckish typing</title><link>https://smallcultfollowing.com/babysteps/blog/2012/04/10/declared-vs-duckish-typing/</link><pubDate>Tue, 10 Apr 2012 11:19:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/04/10/declared-vs-duckish-typing/</guid><description>&lt;p&gt;One of the questions in our object system is what precisely how
&amp;ldquo;declared&amp;rdquo; we want things to be when it comes to interfaces and
implementations. In a discussion on IRC, graydon suggested it&amp;rsquo;d
be nice to have terms like &amp;ldquo;duck-typing&amp;rdquo; defined more precisely in
a Rust syntax, and he is correct. So here is my effort.&lt;/p&gt;
&lt;h3 id="the-current-setup"&gt;The current setup&lt;/h3&gt;
&lt;p&gt;Currently, implementations must declare precisely what types they
implement. For example, it looks like this:&lt;/p&gt;</description></item><item><title>Rust's object system</title><link>https://smallcultfollowing.com/babysteps/blog/2012/04/09/rusts-object-system/</link><pubDate>Mon, 09 Apr 2012 10:05:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/04/09/rusts-object-system/</guid><description>&lt;p&gt;On the &lt;code&gt;rust-dev&lt;/code&gt; mailing list, someone pointed out another
&lt;a href="http://www.bitc-lang.org/pipermail/bitc-dev/2012-April/003315.html"&gt;&amp;ldquo;BitC retrospective&amp;rdquo; post by Jonathon Shapiro concerning typeclasses&lt;/a&gt;.
The Rust object system provides interesting solutions to some of the
problems he raises. We also manage to combine traditional
class-oriented OOP with Haskell&amp;rsquo;s type classes in a way that feels
seamless to me. I thought I would describe the object system as I see
it in a post. However, it turns out that this will take me far too
long to fit into a single blog post, so I&amp;rsquo;m going to do a series.
This first one just describes the basics.&lt;/p&gt;</description></item><item><title>For loops</title><link>https://smallcultfollowing.com/babysteps/blog/2012/04/06/for-loops/</link><pubDate>Fri, 06 Apr 2012 09:51:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/04/06/for-loops/</guid><description>&lt;p&gt;First off, I want to welcome &lt;a href="http://brson.github.com/"&gt;Brian Anderson&lt;/a&gt; to the Rust blog-o-sphere
(which so far consists primarily of myself). His &lt;a href="http://brson.github.com/rust/2012/04/05/new-for-loops/"&gt;first post&lt;/a&gt;
does a great job of explaining how to use the new &lt;code&gt;for&lt;/code&gt; syntax that
was recently added to Rust: this syntax allows for &lt;code&gt;break&lt;/code&gt;, &lt;code&gt;ret&lt;/code&gt;, and
&lt;code&gt;cont&lt;/code&gt; from within user-defined loops, which is very nice.&lt;/p&gt;
&lt;p&gt;Reading some of the &lt;a href="http://news.ycombinator.com/item?id=3806152"&gt;Hacker News comments&lt;/a&gt;
(&lt;a href="http://news.ycombinator.com/item?id=3807365"&gt;this one in particular&lt;/a&gt;), I wanted to clarify one thing. There
is some concern that this new syntax changes the semantics of &lt;code&gt;ret&lt;/code&gt;
when, in fact, it aims to do precisely the opposite.&lt;/p&gt;</description></item><item><title>Avoiding region explosion in Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2012/03/28/avoiding-region-explosion-in-rust/</link><pubDate>Wed, 28 Mar 2012 06:18:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/03/28/avoiding-region-explosion-in-rust/</guid><description>&lt;p&gt;pcwalton and I (but mostly pcwalton) have been hard at work
implementing regions in Rust. We are hoping to use regions to avoid a
lot of memory allocation overhead in the compiler&amp;mdash;the idea is to use
memory pools (a.k.a. arenas) so that we can cheaply allocate the data
needed to process a given function and then release it all in one
shot. It is well known that arenas are great fit for the memory
allocation patterns of a compiler, which tend to produce a lot of data
that lives for the duration of a pass but is not needed afterwards.&lt;/p&gt;</description></item><item><title>Servo design</title><link>https://smallcultfollowing.com/babysteps/blog/2012/03/28/servo-design/</link><pubDate>Wed, 28 Mar 2012 08:30:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/03/28/servo-design/</guid><description>&lt;p&gt;Yesterday we had a hackathon/meeting to discuss the overarching design
of Servo, the project to build a next-generation rendering engine. We
didn&amp;rsquo;t ultimately do much hacking (though we did a little), but mostly
we tried to hammer out the big picture so that we can actually get to
writing code. I wanted to try and write up what I understood as the
consensus (for the moment, anyway).&lt;/p&gt;
&lt;h3 id="the-big-picture"&gt;The big picture&lt;/h3&gt;
&lt;p&gt;There will be (at least) three large components. Each is basically
operating in independent tasks and the various stages are therefore
largely isolated from one another and able to execute independently
(with certain exceptions, as we shall see):&lt;/p&gt;</description></item><item><title>Progress on inlining</title><link>https://smallcultfollowing.com/babysteps/blog/2012/03/03/progress-on-inlining/</link><pubDate>Sat, 03 Mar 2012 06:44:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/03/03/progress-on-inlining/</guid><description>&lt;p&gt;Cross-crate inlining has come a long way and is now basically
functional (I have yet to write a comprehensive test suite, so I&amp;rsquo;m
sure it will fail when exercising various corners of the language).&lt;/p&gt;
&lt;p&gt;Just for fun, I did some preliminary micro-benchmarks. The results
are not that surprising: removing method call overhead makes programs
run faster! But it&amp;rsquo;s still nice to see things go faster. We&amp;rsquo;ll look
at the benchmarks, see the results, and then dive into the generated
assembly. In all cases, I found LLVM doing optimizations that rather
surprised me.&lt;/p&gt;</description></item><item><title>Serialization without type information via impls</title><link>https://smallcultfollowing.com/babysteps/blog/2012/02/25/serialization-without-type-information-via-impls/</link><pubDate>Sat, 25 Feb 2012 07:40:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/02/25/serialization-without-type-information-via-impls/</guid><description>&lt;p&gt;My current implementation of the auto-serialization code generator
requires full type information. This is a drag. First, macros and
syntax extension currently run before the type checker, so requiring
full type information prevents the auto-serialization code from being
implemented in the compiler, as it should be. At first I wanted to
change how the compiler works to provide type information, but after
numerous discussions with pcwalton and dherman, I&amp;rsquo;ve come to the
conclusion that this is a bad idea: it requires exposing an API for
the AST and for type information and introduces numerous other
complications.&lt;/p&gt;</description></item><item><title>Regions tradeoffs</title><link>https://smallcultfollowing.com/babysteps/blog/2012/02/22/regions-tradeoffs/</link><pubDate>Wed, 22 Feb 2012 17:35:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/02/22/regions-tradeoffs/</guid><description>&lt;p&gt;In the last few posts I&amp;rsquo;ve been discussing various options for
regions. I&amp;rsquo;ve come to see region support as a kind of continuum,
where the current system of reference modes lies at one end and a
full-blown region system with explicit parameterized types and
user-defined memory pools lies at the other. In between there are
various options. To better explore these tradeoffs, I wrote up a
document that
&lt;a href="https://smallcultfollowing.com/babysteps/
/rust/regions-tradeoffs"&gt;outlines various possible schemes and also details use cases that are enabled by these schemes&lt;/a&gt;.
I don&amp;rsquo;t claim this to be a comprehensive list of all possible schemes,
just the ones I&amp;rsquo;ve thought about so far. In some cases, the
descriptions are quite hand-wavy. I also think some of them don&amp;rsquo;t
hang together so well.&lt;/p&gt;</description></item><item><title>Versioning considered OK</title><link>https://smallcultfollowing.com/babysteps/blog/2012/02/18/versioning-considered-ok/</link><pubDate>Sat, 18 Feb 2012 09:59:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/02/18/versioning-considered-ok/</guid><description>&lt;p&gt;Marijn pointed out to me that our current setup should avoid the worst
of the versioning problems I was afraid of. In the snapshot, we
package up a copy of the compiler along with its associated libraries,
and use this compiler to produce the new compiler. The new compiler
can then compilers its own target libraries, thus avoiding the need to
interact with libraries produced by the snapshot.&lt;/p&gt;
&lt;p&gt;Of course, I should have known this, since I have relied on this so
that I can changed the metadata format without worrying about
backwards compatibility. That&amp;rsquo;s what I get for writing blog posts
late at night.&lt;/p&gt;</description></item><item><title>CCI and versioning</title><link>https://smallcultfollowing.com/babysteps/blog/2012/02/17/cci-and-versioning/</link><pubDate>Fri, 17 Feb 2012 21:40:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/02/17/cci-and-versioning/</guid><description>&lt;p&gt;I&amp;rsquo;ve been busily implementing the Cross-Crate Inlining stuff, but one
area I haven&amp;rsquo;t looked at much is versioning. In particular, if we are
going to be serializing the AST, we need a plan for what to do when
the AST changes. Actually, if inlining were only to be used for
performance, we wouldn&amp;rsquo;t really &lt;em&gt;need&lt;/em&gt; to have a plan: we could just
not inline when the AST appeared to be stored in some form we don&amp;rsquo;t
understand. However, if we fully monomorphize, we will not have that
luxury: without type descriptors, the only way to compile cross-crate,
generic calls will be by inlining.&lt;/p&gt;</description></item><item><title>Returning refs</title><link>https://smallcultfollowing.com/babysteps/blog/2012/02/16/returning-refs/</link><pubDate>Thu, 16 Feb 2012 08:06:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/02/16/returning-refs/</guid><description>&lt;p&gt;One commonly requested feature for regions is the ability to return
references to the inside of structures. I did not allow that in the
proposal in &lt;a href="blog/2012/02/15/regions-lite-dot-dot-dot-ish/"&gt;my previous post&lt;/a&gt; because I did not want to have any
region annotations beyond a simple &lt;code&gt;&amp;amp;&lt;/code&gt;. I think, however, that if you
want to allow returning references to the interior of a parameter, you
need a way for the user to denote region names explicitly.&lt;/p&gt;</description></item><item><title>Regions-lite...ish</title><link>https://smallcultfollowing.com/babysteps/blog/2012/02/15/regions-lite-dot-dot-dot-ish/</link><pubDate>Wed, 15 Feb 2012 09:51:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/02/15/regions-lite-dot-dot-dot-ish/</guid><description>&lt;p&gt;I was talking to brson today about the possibility of moving Rust to a
regions system. He pointed out that the complexity costs may be high.
I was trying to make a slimmer version where explicit region names
were never required. This is what I came up with. The truth is, it&amp;rsquo;s
not that different from the original: adding back region names wouldn&amp;rsquo;t
change much. But I&amp;rsquo;m posting it anyway because it includes a description
of how to handle regions in types and I think it&amp;rsquo;s the most complete and
correct proposal at the moment.&lt;/p&gt;</description></item><item><title>Using futures in the task API</title><link>https://smallcultfollowing.com/babysteps/blog/2012/02/14/using-futures-in-the-task-api/</link><pubDate>Tue, 14 Feb 2012 10:14:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/02/14/using-futures-in-the-task-api/</guid><description>&lt;p&gt;Brian pointed out to me a nice solution to the Task API problem that I
have overlooked, though it&amp;rsquo;s fairly obvious. Basically, I had
rejected a &amp;ldquo;builder&amp;rdquo; style API for tasks because there is often a need
for the child task to be able to send some data back to its parent
after it has been spawned, and a builder API cannot easily accommodate
this. Brian&amp;rsquo;s idea was to encapsulate these using futures. It&amp;rsquo;s
still not perfect but it&amp;rsquo;s better I think and more composable than my
first, limited proposal. It still requires that the actor pattern be
a separate module.&lt;/p&gt;</description></item><item><title>Task API</title><link>https://smallcultfollowing.com/babysteps/blog/2012/02/13/task-api/</link><pubDate>Mon, 13 Feb 2012 16:39:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/02/13/task-api/</guid><description>&lt;p&gt;One of the thorny API problems I&amp;rsquo;ve been thinking about lately is the
task API for Rust. I originally had in mind this fancy and very
flexible aproach based on bind. When I spelled it out I found it was
very powerful and flexible but also completely unworkable in practice.&lt;/p&gt;
&lt;p&gt;So here is a more limited proposal. There is a core task API that
looks something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;enum task = uint; // wrap the task ID or whatever
type opts = { ... };

fn default_opts() -&amp;gt; opts;

fn spawn(opts: opts, body: fn~()) -&amp;gt; task;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The options struct will let you control simple things like stack size
and so forth.&lt;/p&gt;</description></item><item><title>Auto-serialization in Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2012/02/09/auto-serialization-in-rust/</link><pubDate>Thu, 09 Feb 2012 18:34:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/02/09/auto-serialization-in-rust/</guid><description>&lt;p&gt;I&amp;rsquo;ve been working on implementing &lt;a href="https://github.com/mozilla/rust/issues/1765"&gt;Cross-Crate Inlining&lt;/a&gt;. The
major task here is to serialize the AST. This is conceptually trivial
but in practice a major pain. It&amp;rsquo;s an interesting fact that the more
tightly you type your data, the more of a pain it (generally) is to
work with in a generic fashion. Of functional-ish languages that I&amp;rsquo;ve
used, Scala actually makes things relatively easy by using a
combination of reflection and dynamic typing (interfaces like
&lt;a href="http://www.scala-lang.org/api/current/index.html#scala.Product"&gt;&lt;code&gt;Product&lt;/code&gt;&lt;/a&gt; come to mind).&lt;/p&gt;</description></item><item><title>Breaking out is hard to do</title><link>https://smallcultfollowing.com/babysteps/blog/2012/02/02/breaking-out-is-hard-to-do/</link><pubDate>Thu, 02 Feb 2012 11:23:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/02/02/breaking-out-is-hard-to-do/</guid><description>&lt;p&gt;One of the things I&amp;rsquo;d like to do for the iteration library is settle
on a convention for breaking and continuing within loops. There is a
bug on this issue (&lt;a href="https://github.com/mozilla/rust/issues/1619"&gt;#1619&lt;/a&gt;) and it seems like the general
approach is clear but some of the particulars are less so. So I
thought I&amp;rsquo;d try to enumerate how code will look under the various
alternatives and then maybe we can settle on one: they&amp;rsquo;re all fairly
similar. Who knows, maybe just writing things out will settle my
mind.&lt;/p&gt;</description></item><item><title>Cross-crate inlining</title><link>https://smallcultfollowing.com/babysteps/blog/2012/02/02/cross-crate-inlining/</link><pubDate>Thu, 02 Feb 2012 08:41:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/02/02/cross-crate-inlining/</guid><description>&lt;p&gt;Cross-crate inlining (CCI) refers to the ability to inline a function
across crate boundaries. In Rust, a &amp;ldquo;crate&amp;rdquo; is the unit of
compilation, rather than an individual file as in C or C++. A crate
basically corresponds to a single library or executable, but it may
contain any number of modules and source files internally. CCI is
important for performance due to the ubiquitous use of small methods
like &lt;code&gt;vec::iter()&lt;/code&gt; in our source code. Such methods have proven to be
a very scalable way to define iteration abstracts, but performance is
currently somewhat lacking.&lt;/p&gt;</description></item><item><title>Update</title><link>https://smallcultfollowing.com/babysteps/blog/2012/02/01/update/</link><pubDate>Wed, 01 Feb 2012 20:50:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/02/01/update/</guid><description>&lt;p&gt;It&amp;rsquo;s been a while since I wrote anything on the blog! A lot has been
going on in the meantime, both in Rust, parallel JavaScript, and
personally&amp;hellip;I hate to write a big update post but I gotta&amp;rsquo; catch up
somehow!&lt;/p&gt;
&lt;h3 id="rust"&gt;Rust&lt;/h3&gt;
&lt;p&gt;First, we made our 0.1 release, which is great. We are now planning
for 0.2. The goal is to make frequent, relatively regular releases.
We&amp;rsquo;re still in such an early phase that it doesn&amp;rsquo;t seem to make sense
to literally release every few months, but at the same time we don&amp;rsquo;t
plan to wait long.&lt;/p&gt;</description></item><item><title>Proposed JS parallelism vs actors</title><link>https://smallcultfollowing.com/babysteps/blog/2012/01/11/proposed-js-parallelism-vs-actors/</link><pubDate>Wed, 11 Jan 2012 10:38:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/01/11/proposed-js-parallelism-vs-actors/</guid><description>&lt;p&gt;In one of the comments on yesterday&amp;rsquo;s post,
&lt;a href="http://smallcultfollowing.com/babysteps/blog/2012/01/09/parallel-javascript/#comment-407714243"&gt;Tushar Pokle asked&lt;/a&gt; why I would champion my model over an
Erlang model of strict data separation. There are several answers to
this question. The simplest answer is that Web Workers already
provide an actors model, though they do not make tasks particularly
cheap (it&amp;rsquo;s possible to work around this by creating a fixed number of
workers and sending tasks for them to execute).&lt;/p&gt;</description></item><item><title>Parallel Javascript</title><link>https://smallcultfollowing.com/babysteps/blog/2012/01/09/parallel-javascript/</link><pubDate>Mon, 09 Jan 2012 16:55:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2012/01/09/parallel-javascript/</guid><description>&lt;p&gt;Lately the ideas for a parallel, shared memory JavaScript have begun
to take shape. I&amp;rsquo;ve been discussing with &lt;a href="http://calculist.org/"&gt;various&lt;/a&gt;
&lt;a href="http://blog.mozilla.com/luke/"&gt;Java&lt;/a&gt;&lt;a href="http://mozakai.blogspot.com/"&gt;Script&lt;/a&gt; &lt;a href="http://donovanpreston.blogspot.com/"&gt;luminaries&lt;/a&gt; and it seems like a
design is starting to emerge. This post serves as a documentation of
the basic ideas; I&amp;rsquo;m sure the details will change as we go along.&lt;/p&gt;
&lt;h3 id="user-model"&gt;User Model&lt;/h3&gt;
&lt;p&gt;The model is that a JavaScript worker (the &amp;ldquo;parent&amp;rdquo;) may spawn a
number of child tasks (the &amp;ldquo;children&amp;rdquo;). The parent is suspended while
the children execute, meaning that it will not process events or take
other actions. Once the children have completed the parent will be
re-awoken.&lt;/p&gt;</description></item><item><title>Block sugar in expressions</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/29/block-sugar-in-expressions/</link><pubDate>Thu, 29 Dec 2011 07:30:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/29/block-sugar-in-expressions/</guid><description>&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; I found some more complications. Updates inline.&lt;/p&gt;
&lt;p&gt;I have been working on and off on allowing block sugar to appear in
Rust expressions and not only statements. For those who do not know
what I am talking about, let me give a bit of context. At the moment,
one can write the following in Rust:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;vec::iter(v) { |e| 
 ...
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;which is sugar for the function call:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;vec::iter(v, { |e| 
 ...
})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Objectively, there isn&amp;rsquo;t much difference between the two, but somehow
pulling the &lt;code&gt;{||}&lt;/code&gt; out of the parentheses feels much lighter to me.&lt;/p&gt;</description></item><item><title>Composing blocks</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/29/composing-blocks/</link><pubDate>Thu, 29 Dec 2011 21:19:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/29/composing-blocks/</guid><description>&lt;p&gt;The original Rust design included iterators very similar to Python&amp;rsquo;s
generators. As I understand it, these were stripped out in favor of
Ruby-esque blocks, partially because nobody could agree on the best
way to implement iterators. I like blocks, but it seems like it&amp;rsquo;s
more natural to compose iterators, so I wanted to think a bit about
how one might use blocks to achieve similar things. I&amp;rsquo;m sure this is
nothing new; there must be hundreds of libraries in Haskell that do
the same things I&amp;rsquo;m talking about here.&lt;/p&gt;</description></item><item><title>Tone and criticism</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/21/tone-and-criticism/</link><pubDate>Wed, 21 Dec 2011 17:02:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/21/tone-and-criticism/</guid><description>&lt;p&gt;So, I worry that my various posts about Rust give the impression that
I&amp;rsquo;m dissatisfied with the language. It&amp;rsquo;s true that there are several
things I&amp;rsquo;d like to change&amp;mdash;and those are what I&amp;rsquo;ve focused on&amp;mdash;but I
want to clarify that I quite like Rust the way it is and I find the
overall feel of the language to be very good. When it comes to the
big decisions, I think Rust gets it right:&lt;/p&gt;</description></item><item><title>Dynamic race detection</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/20/dynamic-race-detection/</link><pubDate>Tue, 20 Dec 2011 11:19:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/20/dynamic-race-detection/</guid><description>&lt;p&gt;In the context of thinking about parallelism for Rust, I have been reminded
of an older idea I had for a lightweight, predictable dynamic race
detection monitoring system based around block-scoped parallelism. I should
think this would be suitable for (an extended version of) a dynamic
language like Python, JavaScript, or Lua. I will write in a Python-like
syntax since I know it best, but I am debating about exploring this
for JavaScript.&lt;/p&gt;</description></item><item><title>Implementing unique closures</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/16/implementing-unique-closures/</link><pubDate>Fri, 16 Dec 2011 10:32:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/16/implementing-unique-closures/</guid><description>&lt;p&gt;I landed a preliminary version of unique closures (which I am currently calling
sendable fns) on the trunk last night. I wanted to briefly document what I did
to alter the design of closures to get this working (of course there is a comment
in the code too, but who reads that?).&lt;/p&gt;
&lt;p&gt;Closures in Rust are represented as two words. The first is the function pointer
and the second is a pointer to the closure, which is the captured environment that
stores the data that was closed over. Because of how Rust is implemented, the
closure must also store any type descriptors that were in scope at the point where
the closure was created.&lt;/p&gt;</description></item><item><title>Const vs Mutable</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/13/const-vs-mutable/</link><pubDate>Tue, 13 Dec 2011 19:41:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/13/const-vs-mutable/</guid><description>&lt;p&gt;I keep thinking about parallel blocks although I know I probably
shouldn&amp;rsquo;t; but so long as I write these notes while rustc builds,
everybody wins, right?&lt;/p&gt;
&lt;p&gt;Anyhow, pcwalton and &lt;a href="http://calculist.org/"&gt;dherman&lt;/a&gt; yesterday pointed out to me
that &lt;code&gt;const&lt;/code&gt; is not exactly one of the most beloved features of C++:
&amp;ldquo;const-ification&amp;rdquo; is no fun, and if we&amp;rsquo;re not careful, Rust could walk
right down that path. To some extent my reaction is, &amp;ldquo;Well,
something&amp;rsquo;s gotta&amp;rsquo; give.&amp;rdquo; You can&amp;rsquo;t have modular static race freedom
without some way to know what function will write what. But
nonetheless they are quite correct.&lt;/p&gt;</description></item><item><title>Partially ordered unique closures</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/13/partially-ordered-unique-closures/</link><pubDate>Tue, 13 Dec 2011 10:09:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/13/partially-ordered-unique-closures/</guid><description>&lt;p&gt;On a call with other Rust developers, I realized that I was thinking about
unique closures all wrong. I had in mind a total ordering:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;fn[send] &amp;lt;: fn &amp;lt;: block
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but of course this is not necessary. What is desirable is a partial ordering:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;fn[send] &amp;lt;: block
fn &amp;lt;: block
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;just as &lt;code&gt;~&lt;/code&gt; and &lt;code&gt;@&lt;/code&gt; pointers can both be aliased using a reference.
Ironically, this is precisely what I proposed in my list of possible
solutions, but I did so using region terminology. Embarrassingly
obvious, in retrospect, particularly as that was Graydon&amp;rsquo;s original
design I believe. I think I got confused by the total ordering of
kinds into thinking that this should translate to a total ordering of
functions that close over data in those kinds. Anyhow, I will now
work on implementing unique closures in this partially ordered way,
and hopefully things will go more smoothly!&lt;/p&gt;</description></item><item><title>Challengines implementing unique closures</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/12/challengines-implementing-unique-closures/</link><pubDate>Mon, 12 Dec 2011 21:25:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/12/challengines-implementing-unique-closures/</guid><description>&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; See the recent post addressing
&lt;a href="https://smallcultfollowing.com/babysteps/
/blog/2011/12/13/partially-ordered-unique-closures/"&gt;the solution to this problem&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I have been trying to implement unique closures&amp;mdash;or sendable
functions, as I prefer to call them&amp;mdash;but I realized that there is
a fundamental problem that I hadn&amp;rsquo;t thought of before. The problem
stems from two contradictory design goals:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sendable functions should be movable to another task without copying&lt;/li&gt;
&lt;li&gt;The various function types should have a subtyping relationship&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The first requirement really demands that the sendable function&amp;rsquo;s
environment be stored with a unique pointer. Otherwise multiple
threads could share access to the same mutable state. Uncool.&lt;/p&gt;</description></item><item><title>Pure blocks</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/09/pure-blocks/</link><pubDate>Fri, 09 Dec 2011 10:05:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/09/pure-blocks/</guid><description>&lt;p&gt;I&amp;rsquo;ve been thinking a lot about &amp;ldquo;parallel blocks&amp;rdquo; recently and I am
beginning to think they can be made to work very simply. The main
thing that is needed is a type qualifier &lt;code&gt;const&lt;/code&gt; that means
&amp;ldquo;read-only&amp;rdquo;. This would be a type prefix with very low precedence,
just like &lt;code&gt;immutable&lt;/code&gt; and &lt;code&gt;shared&lt;/code&gt; in &lt;a href="http://d-programming-language.org/"&gt;D&lt;/a&gt;. The type &lt;code&gt;const T&lt;/code&gt;
would refer to an instance of &lt;code&gt;T&lt;/code&gt; that cannot be modified. This is a
deep property, so, given some record types defined like:&lt;/p&gt;</description></item><item><title>Sendable functions</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/08/sendable-functions/</link><pubDate>Thu, 08 Dec 2011 09:47:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/08/sendable-functions/</guid><description>&lt;p&gt;One of the last remaining tasks for Rust 0.1 is to find a way to
address issues #&lt;a href="https://github.com/graydon/rust/issues/1128"&gt;1128&lt;/a&gt; and #&lt;a href="https://github.com/graydon/rust/issues/1038"&gt;1038&lt;/a&gt;. The key problem is
that, right now, we can only spawn a task with a &lt;em&gt;bare function&lt;/em&gt;,
which is to say a function that carries no closure or environment.
Due to the way that Rust is implemented, this even excludes &lt;em&gt;generic
functions&lt;/em&gt;. I have been wanting to lift this restriction but have
been stymied by trying to make it accessible.&lt;/p&gt;</description></item><item><title>Why not modes?</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/08/why-not-modes/</link><pubDate>Thu, 08 Dec 2011 19:54:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/08/why-not-modes/</guid><description>&lt;p&gt;&lt;a href="http://marijnhaverbeke.nl/"&gt;Marijn&lt;/a&gt; asked me what it is that I dislike about parameter
modes. I thought I might as well explain here.&lt;/p&gt;
&lt;p&gt;For background, today in Rust a function can declare each parameter in
one of several modes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;By value (&lt;code&gt;++&lt;/code&gt;): No pointer is used but the value is not owned by the
callee. Therefore, the callee does not need to free it, for example, or
decrement a ref count.&lt;/li&gt;
&lt;li&gt;By immutable reference (&lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;): a pointer to the variable in the caller&amp;rsquo;s
stack frame is passed, but the callee cannot use it to make changes.
Can be passed an lvalue or an rvalue.&lt;/li&gt;
&lt;li&gt;By mutable reference (&lt;code&gt;&amp;amp;&lt;/code&gt;): a pointer to the variable in the caller&amp;rsquo;s
stack frame is passed, and the callee can use it to reassign the variable.
Can only be passed an lvalue.&lt;/li&gt;
&lt;li&gt;By copy (&lt;code&gt;+&lt;/code&gt;): A fresh copy of the value is created and the callee must
dispose of it.&lt;/li&gt;
&lt;li&gt;By move (&lt;code&gt;-&lt;/code&gt;): The value is moved from the caller&amp;rsquo;s stack frame and the
callee must dispose of it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So what don&amp;rsquo;t I like about modes?&lt;/p&gt;</description></item><item><title>Rust usability problems</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/07/rust-usability-problems/</link><pubDate>Wed, 07 Dec 2011 17:38:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/07/rust-usability-problems/</guid><description>&lt;p&gt;I recently implemented a new hashtable module for Rust. This was
actually the first piece of code written in Rust which I started from
scratch. I ran into some difficulties. Some of these are just things
you have to get used to; some might be worth trying to correct. Just
not entirely sure which problem falls into which category yet.&lt;/p&gt;
&lt;h4 id="cyclic-types"&gt;Cyclic types&lt;/h4&gt;
&lt;p&gt;Due to Rust&amp;rsquo;s structural types, types cannot reference themselves.
In the hashtable module I was defining, I wanted a linked list of entries.
In C I would write something like:&lt;/p&gt;</description></item><item><title>Coroutines for Rust</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/06/coroutines-for-rust/</link><pubDate>Tue, 06 Dec 2011 08:01:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/06/coroutines-for-rust/</guid><description>&lt;p&gt;I have been thinking about unique closures, one of the last blocker items
for the Rust 0.1 release. The original idea of a unique closure was
that it should be a closure that can only access uniquely owned state,
and which can therefore be sent to other tasks. However, I&amp;rsquo;ve come to
have my doubts about this idea. In particular, a unique closure, like
any closure, is a function, and can therefore be invoked many times:
but this imposes some limits on what such a closure can safely do.&lt;/p&gt;</description></item><item><title>Statement-level parallelism</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/05/statement-level-parallelism/</link><pubDate>Mon, 05 Dec 2011 09:25:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/05/statement-level-parallelism/</guid><description>&lt;p&gt;The primary means of parallel programming in Rust is tasks. Our task
support is good: as good or better than any other language I&amp;rsquo;ve seen
(good support for unique types and unique closures) but we have
virtually no support for intra-task parallelism. The classic example
is iterating over an array and processing each element in parallel.
To be fair, this is a hard problem.&lt;/p&gt;
&lt;p&gt;For my PhD, I worked on a language called
&lt;a href="http://harmonic-lang.org"&gt;Harmonic&lt;/a&gt;. Harmonic had a lot of ideas
which I&amp;mdash;naturally enough&amp;mdash;really like, but most of them are
probably not appropriate for Rust, as they leaned heavily on a
complex, dependent type system. Some of them, however, might apply.
In fact, thanks to unique pointers and interior types, it might be
possible to make the Rust version even more expressive than the
original.&lt;/p&gt;</description></item><item><title>Rust without implicit copies</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/03/rust-without-implicit-copies/</link><pubDate>Sat, 03 Dec 2011 08:50:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/03/rust-without-implicit-copies/</guid><description>&lt;p&gt;I just posted a draft of a &lt;a href="https://smallcultfollowing.com/babysteps/
/rust/no-implicit-copies"&gt;proposal for Rust that aims to eliminate
implicit copies&lt;/a&gt;. At the moment, it is not the
final version; there are some flaws I need to correct. For one thing,
I need to address implicit capturing of variables by lambdas.&lt;/p&gt;
&lt;p&gt;From the introduction:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This is a proposal for Rust whose purpose is to &lt;strong&gt;eliminate implicit
copies of aggregate types,&lt;/strong&gt; while preserving most other aspects of
the language. Secondary goals include:&lt;/p&gt;</description></item><item><title>Why case classes are better than variant types</title><link>https://smallcultfollowing.com/babysteps/blog/2011/12/02/why-case-classes-are-better-than-variant-types/</link><pubDate>Fri, 02 Dec 2011 06:57:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/blog/2011/12/02/why-case-classes-are-better-than-variant-types/</guid><description>&lt;p&gt;One of the better features from functional programming languages are
variant types (a.k.a. algebraic data types). Basically they are a way
of enumerating a small set of possibilities and then making sure that
you handle every possible case. However, in real world use variant
types tend to run into a few annoying problems. While working on the
&lt;a href="http://www.harmonic-lang.org"&gt;Harmonic compiler&lt;/a&gt;, I found that
Scala&amp;rsquo;s case classes addressed some of these shortcomings.&lt;/p&gt;
&lt;p&gt;My goal in writing Scala code was to &lt;em&gt;never&lt;/em&gt; have an &lt;code&gt;assert false&lt;/code&gt; to
cover situations I knew could not occur. I did not quite succeed, but
I got really close, much closer than I ever got in any other language.
Mostly where I failed I knew that I could refactor the types but I did
not want to spend the time to do it. In this post I want to explain
how and why the case class approach seems to work better than
traditional variant types. In later posts I&amp;rsquo;ll cover some of the
other tricks that I ended up using, particularly the approach I used
to having an AST whose shape changed over time.&lt;/p&gt;</description></item><item><title>about</title><link>https://smallcultfollowing.com/babysteps/about/</link><pubDate>Fri, 02 Dec 2011 06:59:00 +0000</pubDate><author>rust@nikomatsakis.com (Niko Matsakis)</author><guid>https://smallcultfollowing.com/babysteps/about/</guid><description>&lt;p&gt;This blog is I post up various half-baked ideas that I have. I work
on the &lt;a href="http://rust-lang.org"&gt;Rust programming language&lt;/a&gt;, so often &amp;ndash;
but not always &amp;ndash; these ideas have to do with some aspect of Rust. I
called the blog Baby Steps mostly because I couldn&amp;rsquo;t up with good
name, but also because I feel like research is a process of taking
tiny, incremental steps towards something better. If you&amp;rsquo;d like to
contact me, you can reach me at
&lt;a href="mailto:niko@alum.mit.edu"&gt;niko@alum.mit.edu&lt;/a&gt;.&lt;/p&gt;</description></item></channel></rss>