<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <id>tag:words.steveklabnik.com,2014:/sitemap</id>
  <link rel="alternate" type="text/html" href="https://words.steveklabnik.com"/>
  <link rel="self" type="application/atom+xml" href="https://words.steveklabnik.com/sitemap.xml"/>
  <title>Steve Klabnik</title>
  <updated>2020-04-11T09:18:50-07:00</updated>
  <author>
    <name>Steve Klabnik</name>
    <uri>https://words.steveklabnik.com</uri>
    <email>steve@steveklabnik.com</email>
  </author>
  <generator>Svbtle.com</generator>
  <entry>
    <id>tag:words.steveklabnik.com,2014:Post/how-often-does-rust-change</id>
    <published>2020-04-11T09:18:50-07:00</published>
    <updated>2020-04-11T09:18:50-07:00</updated>
    <link rel="alternate" type="text/html" href="https://words.steveklabnik.com/how-often-does-rust-change"/>
    <title>How often does Rust change?</title>
    <content type="html">&lt;p&gt;I’ve been thinking a lot lately about how often Rust changes. There are some people that assert that Rust stays fairly static these days, and there are some people who say Rust is still changing far too much. In this blog post, I want to make a &lt;em&gt;data driven&lt;/em&gt; analysis of this question. First, I will present my hypothesis. Next, my methodology. Then, we’ll talk about the results. Afterward, we’ll discuss possible methodological issues, and possible directions for further research.&lt;/p&gt;

&lt;p&gt;As &lt;a href="https://twitter.com/adam_chal/status/1248705340163620866"&gt;said on twitter&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/66pLpg8EDEH5dvt5BGQ7LH0xspap.jpg"&gt;&lt;img src="https://svbtleusercontent.com/66pLpg8EDEH5dvt5BGQ7LH0xspap_small.jpg" alt="EVRK4oaWoAIio-i.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="the-hypothesis_2"&gt;The hypothesis &lt;a class="head_anchor" href="#the-hypothesis_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;My personal take on Rust changing: to me, it feels like we had more change in the past than we have today. The changes are also getting more minor. This will be my hypothesis.&lt;/p&gt;
&lt;h2 id="the-methodology_2"&gt;The methodology &lt;a class="head_anchor" href="#the-methodology_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;There are tons of different ways that we could measure the question “how often does Rust change?” So before I started collecting data, I had to decide some details.&lt;/p&gt;

&lt;p&gt;I realized that my premise here is about how people &lt;em&gt;feel&lt;/em&gt; about Rust. So, how do they tend to understand how Rust changes? Well, the primary way that we communicate change to the Rust community is through release blog posts. So I decided to start there.&lt;/p&gt;

&lt;p&gt;What I did was, I opened up every release blog post for Rust, from 1.0.0 to 1.42.0, in a new tab. For fun, I also opened the release notes for 1.43, which will come out soon.&lt;/p&gt;

&lt;p&gt;I then looked at every single change announced, and categorized them as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;adds syntax?&lt;/li&gt;
&lt;li&gt;language&lt;/li&gt;
&lt;li&gt;standard library&lt;/li&gt;
&lt;li&gt;toolchain&lt;/li&gt;
&lt;li&gt;major&lt;/li&gt;
&lt;li&gt;medium&lt;/li&gt;
&lt;li&gt;minor&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I initially included “deprecation” and “soundness” as categories too, but I ended up not including them. More on that later.&lt;/p&gt;

&lt;p&gt;From here, I had to decide what these categories &lt;em&gt;meant&lt;/em&gt;. What standard would I be using here? Here’s the easier ones:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;language&lt;/em&gt; changes mean some sort of modification to the language definition. These are additive changes, thanks to our stability policy, but they’re new additions.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;standard library&lt;/em&gt; means a change to the standard library, primarily, new functions, new types, new methods, stuff like that. This one is pretty simple as a criteria but there’s some small interesting methodological issues we’ll get into later.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;toolchain&lt;/em&gt; changes related to &lt;code class="prettyprint"&gt;cargo&lt;/code&gt;, &lt;code class="prettyprint"&gt;rustup&lt;/code&gt;, new compiler target support, stuff like that. Not part of the language proper, but part of the Rust distribution and things Rust programmers would use.&lt;/p&gt;

&lt;p&gt;Now, for the harder ones:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;major&lt;/em&gt;/&lt;em&gt;medium&lt;/em&gt;/&lt;em&gt;minor&lt;/em&gt; changes are how big of a change I think that the change is. There’s a few interesting parts to this. First of all, this is, of course, very subjective. I also decided to try and evaluate these as of today, that is, there are some changes we maybe thought were major that aren’t used all that often in practice today, so I categorized those as &lt;em&gt;medium&lt;/em&gt; rather than &lt;em&gt;major&lt;/em&gt;. This felt more consistent to me than trying to remember how I felt at the time.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;adds syntax&lt;/em&gt; changes &lt;em&gt;sound&lt;/em&gt; easy, but are actually &lt;em&gt;really&lt;/em&gt; tricky. For example, consider a feature like “&lt;a href="https://github.com/rust-lang/rfcs/blob/master/text/1492-dotdot-in-patterns.md"&gt;dotdot in patterns&lt;/a&gt;”. This does change the grammar, for example, so you could argue that it adds syntax. But as a programmer, I don’t &lt;em&gt;really&lt;/em&gt; care about the grammar. The summary of this feature is “Permit the .. pattern fragment in more contexts.” It goes on to say:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This RFC is intended to “complete” the feature and make it work in all possible list contexts, making the language a bit more convenient and consistent.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I think these kinds of changes are actually very core to this idea, and so I decided to categorize them according to my opinion: this is &lt;em&gt;not&lt;/em&gt; a new syntax change. You already had to know about &lt;code class="prettyprint"&gt;..&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I believe this may be the most controversial part of my analysis. More on this later, of course.&lt;/p&gt;

&lt;p&gt;Okay, so that’s the stuff I covered. But there’s also stuff I didn’t cover. I was doing enough work and had to draw the line somewhere. I left this stuff out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;compiler speedups. This is interesting with numbers, but that means actually compiling stuff, and I don’t have time for that. This is a whole study on its own.&lt;/li&gt;
&lt;li&gt;Documentation work. This tends to be not tracked as new features, but sometimes it appears in release notes, for bigger things. Better to just leave it out. I also don’t think that it affects my hypothesis at all.&lt;/li&gt;
&lt;li&gt;Library types implementing new traits. These can be hard to number, especially with generics involved. I decided that it would be better to leave them off.&lt;/li&gt;
&lt;li&gt;compiler internal news. We sometimes talk about things like “MIR exists now!” or “we ported the build system from make to cargo!” but similar to documentation, we talk about it very little. It’s also not a change that affects end users, or rather, it affects them more directly by stuff that is counted. MIR enabled NLL, and NLL was tracked as a language feature.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="the-results-amp-analysis_2"&gt;The results &amp;amp; analysis &lt;a class="head_anchor" href="#the-results-amp-analysis_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;I am not as good with Google Sheets as I thought, so I asked for help. Big thanks to &lt;a href="https://twitter.com/ManishEarth"&gt;Manish&lt;/a&gt; for helping me get this together. I should note that he set me up, but then I tweaked a ton of stuff, so any mistakes are mine, not his. For example, I got a little lazy and didn’t realize that the colors aren’t the same across the various charts. That’s my bad.&lt;/p&gt;

&lt;p&gt;Here’s some quick totals of how many changes and of each kind I found, with some sparklines. You can click on any of the images in this post to enlarge them:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/i84Jyi8Ku2vJ2VRGfYmyBV0xspap.png"&gt;&lt;img src="https://svbtleusercontent.com/i84Jyi8Ku2vJ2VRGfYmyBV0xspap_small.png" alt="sparklines.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here’s some charts, per release:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/oZTrBYjy26f5AKURN7z3db0xspap.png"&gt;&lt;img src="https://svbtleusercontent.com/oZTrBYjy26f5AKURN7z3db0xspap_small.png" alt="masterchart.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First of all, it is fairly clear that, at least numerically speaking, the standard library is the part of Rust that changes most often. It’s a clear outlier by volume. I find this result kind of hilarious, because Rust is well-known for having a small standard library. We’ll talk more about why I think this is in the “Issues and further research” section below.&lt;/p&gt;

&lt;p&gt;Let’s look at the chart without the standard library:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/qXu9v6Li5qzg8Ag6HV1j8p0xspap.png"&gt;&lt;img src="https://svbtleusercontent.com/qXu9v6Li5qzg8Ag6HV1j8p0xspap_small.png" alt="toolchainlanguage.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see there’s a &lt;em&gt;ton&lt;/em&gt; of toolchain changes early on. We had a lot of work to do early on, and so made a ton of changes! It’s calmed down in recent times, but toolchain changes happen almost twice as often as language changes. I should also note that this reduction in toolchain changes may be due to methodology; this is talked about later in the post.&lt;/p&gt;

&lt;p&gt;So, the core question here: it looks like the language is changing &lt;em&gt;more&lt;/em&gt;, recently, rather than less. I think it’s pretty clear that this graph is &lt;em&gt;not&lt;/em&gt; exactly what I would imagine, that is, I expected a nice gentle curve down, but that’s not what has happened. I want to dig into this a bit more, but first, let’s look at some other graphs:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/3Xa9rr1SM3atm69gAohMkM0xspap.png"&gt;&lt;img src="https://svbtleusercontent.com/3Xa9rr1SM3atm69gAohMkM0xspap_small.png" alt="addsyntax.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Changes that add syntax are a subset of language changes. There hasn’t been a whole ton of this, overall. Rust 2018 was the large bump. Half of our releases do not add syntax, though 10 out of 43 did introduce language changes. Our first 29 releases, skipping 1.26, had around one or two changes on average, but every since, it’s been between three and four. I believe this has to do with my methodology, but at the same time, this pretty resoundingly refutes my hypothesis. Very interesting!&lt;/p&gt;

&lt;p&gt;Here’s major/medium/minor:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/cm4iWVjB9XZw4qp3c5b94o0xspap.png"&gt;&lt;img src="https://svbtleusercontent.com/cm4iWVjB9XZw4qp3c5b94o0xspap_small.png" alt="majorminormedium.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s a peak around Rust 2018, and one from 1.12 to 1.19, but otherwise, it’s been pretty steady lately, in terms of overall changes. If we look at just major changes:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/N3Dud8Du3fUEC8LL8a9Fn0xspap.png"&gt;&lt;img src="https://svbtleusercontent.com/N3Dud8Du3fUEC8LL8a9Fn0xspap_small.png" alt="major.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Rust 2018 had a huge bump. After 1.0, and after Rust 2018, it calmed. I think this chart is &lt;em&gt;very&lt;/em&gt; interesting, and demonstrates the 3 year edition cycle well. We ship an edition, stuff calms down, things slowly build back up, we ship an edition, they calm down again.&lt;/p&gt;

&lt;p&gt;So, why was my hypothesis wrong? I think this conclusion is &lt;em&gt;fascinating&lt;/em&gt;. I think part of it has to do with my methodology, and that maybe, that difference explains some of the ways people feel about Rust. You see, even if we release extremely often, and a lot of releases don’t have a &lt;em&gt;ton&lt;/em&gt; of changes in them (as you can see, it’s vaguely around 8 or 10, when you exclude the standard library, on average), the very fact that we do release often and have a decent, but fairly small amount of change means that things get into the release notes that may not if we had the exact same amount of change, but did yearly releases.&lt;/p&gt;

&lt;p&gt;So for example, in 2019, we released Rust 1.32 to 1.40. That involved 35 language changes. Would I have included, say, “you can now use &lt;code class="prettyprint"&gt;#[repr(align(N))]&lt;/code&gt; on enums” if I had been writing a post about all of these changes for the whole year? Probably not. But because there were only eight total changes in that release, with half of those being language changes, it made sense to include in the 1.37 release post.&lt;/p&gt;

&lt;p&gt;Does this mean that folks who read the release posts and think Rust changes a lot are wrong? No, it does not. For those of us in the thick of it, a lot of the smaller changes kind of blur into the background. I actually initially typed “&lt;code class="prettyprint"&gt;#[repr(N)]&lt;/code&gt; on enums” when writing the above sentence, because this change isn’t relevant to me or my work, and is pretty small, and makes things more orthogonal, and so it is just kind of vague background noise to me. But to someone who isn’t as in-tune with the language, it’s harder to know what’s big and what’s small. The endless release posts with tons of stuff in them makes it &lt;em&gt;feel&lt;/em&gt; like a lot is happening. But the same amount of stuff may be happening in other languages too, you just don’t see them in release posts, because they only put out one once a year. You both see them less often, as well as see less in them.&lt;/p&gt;

&lt;p&gt;I don’t think this means that the Rust project should change its release schedule, and I’m not entirely sure if this means we should change how we write release posts. However, maybe there’s a better way to surface “these are big changes” vs “this is a small thing,” or something like that. I’m not sure. But I do think this helps me understand the disconnect a lot better.&lt;/p&gt;
&lt;h2 id="issues-and-further-research_2"&gt;Issues and further research &lt;a class="head_anchor" href="#issues-and-further-research_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;There are some big issues with this methodology. No analysis is perfect, but I want to be fair, so I’m calling out all of the stuff I can think of, at least.&lt;/p&gt;

&lt;p&gt;The first of which is, this is inherently subjective. There’s different degrees of subjectivity; for example, “total changes in the notes” is fairly objective. But not completely; folks have to decide what goes into the release notes themselves. So there’s already a layer of filtering going on, before I even started looking at the data. Doing this analysis took me two days of real time, but only a few hours of actual work. Something that analyses the git repo in an automated fashion may see other results. I argue that this level of subjectivity is okay, because we’re also testing something subjective. And I think I designed my methodology in a way that captures this appropriately. On some level, it doesn’t matter if the “real” answer is that Rust rarely changes: folks still get this info by reading the posts, and so I don’t think saying that “oh, yeah you feel that way, but this graph says your feelings are wrong” is really going to help this debate.&lt;/p&gt;

&lt;p&gt;The second problem expands on this. We sort of had three eras of release note writing: the first few posts were written by Aaron and Niko. As of Rust 1.4, I took over, and wrote &lt;em&gt;almost&lt;/em&gt; every post until 1.33. I then stepped back for a while, though I did help write the 1.42 post. The release team wrote 1.34 onward, and it was more of a collaborative effort than previous posts. This means that the person doing the filter from release notes -&amp;gt; blog post changed over time. This can mess with the numbers. For example, there are some blog posts where I would have maybe omitted a small family of features, but the folks writing that post included them all, individually. This may explain the uptick in language changes lately, and why many of them were not rated as “major.” Additionally, the people who did the filter from “list of PRs” to “release notes” &lt;em&gt;also&lt;/em&gt; changed over time, so there’s some degree of filtering change there, as well.&lt;/p&gt;

&lt;p&gt;To complicate things further, starting with Rust 1.34, Cargo lost its section in the release blog posts. Big changes in Cargo still made it into the text, but the previous posts had more robust Cargo sections, and so I feel like post-1.34, Cargo was under-counted a bit. Cargo changes are toolchain changes, and so the recent calm-ness of the toolchain numbers may be due to this. This still is okay, because again, this analysis is about folks reading the release notes, but it’s worth calling out. Likewise, I think the standards for writing the library stabilizations changed a bit over time too; it’s gone from more to less comprehensive and back again a few times.&lt;/p&gt;

&lt;p&gt;This was mentioned above a bit, but for completeness, the structure of Rust releases means there’s a variable criteria for what makes it into a release post. If it’s a smaller release, smaller changes may get featured, whereas if those same feature were in a bigger release, they may not have been. I think this aspect is a significant factor in the rejection of my hypothesis, as I mentioned above.&lt;/p&gt;

&lt;p&gt;I think there’s interesting future research to be done here. I initially tried to track deprecations and soundness fixes, but soundness fixes happened so little it wasn’t worth talking about. There were 7 in those 42 releases. This is another weakness / area for future research, because I did not include point releases, only 1.x.0 releases. This would have added a few more soundness fixes, but it also would have added a lot of random noise where not much happened in the graphs, so that’s why I left those out. They also don’t happen on the same regular schedule, so time would get a bit funny… anyway. Deprecations was also just hard to track because there weren’t a lot of them, and sometimes it was hard to say if something was deprecated because of a soundness issue vs other reasons.&lt;/p&gt;

&lt;p&gt;Is my critera for adding syntax correct? I think a reasonable person could say “no.” If you have something that’s special cased, and you’re making it more general, there’s a good argument that this is &lt;em&gt;removing&lt;/em&gt; a restriction, rather than adding a feature. But reasonable folks could also say you’ve added something. I don’t think that this part is core to my analysis, and so I think it’s fine that I’ve made this decision, but you may not care for this section of results if you disagree.&lt;/p&gt;

&lt;p&gt;This analysis doesn’t get into something that I think is a huge deal: the ecosystem vs the language itself. I only track the Rust distribution itself here, but most Rust programmers use many, many ecosystem libraries. When people talk about churn in Rust, do they really mean the ecosystem, not the language? In some sense, doing so is correct: Rust having a small standard library means that you have to use external packages a lot. If those churn a lot, is it any better than churn in the language itself?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Does&lt;/em&gt; Rust have a small standard library? There were 962 changes in 42 releases, that’s almost 23 changes per release. A lot of them are small, but still. Maybe Rust has a small, but deep standard library? Due to coherence, I would maybe think this is true. Just how big are standard libraries anyway? I’ve only seen discussion of this concept in terms of design philosophy. I’ve never seen a numerical analysis of such. Is it out there? Do you know of one? I’d love to hear about it!&lt;/p&gt;

&lt;p&gt;I think there’s a number of reasons that the standard library changes dominate the total change rate. Primarily, this section of the blog post &lt;em&gt;tends&lt;/em&gt; to be the most complete, that is, out of the total amount of changes, more standard library changes make it into blog posts than other kinds of changes. Why? Well, it’s really easy to measure: count up stuff stabilized and put it in a big list in the post. It’s also about how these changes are measured; when a method is added to every number type, that’s &lt;code class="prettyprint"&gt;u8&lt;/code&gt; + &lt;code class="prettyprint"&gt;u16&lt;/code&gt; + &lt;code class="prettyprint"&gt;u32&lt;/code&gt; + &lt;code class="prettyprint"&gt;u64&lt;/code&gt; + &lt;code class="prettyprint"&gt;u128&lt;/code&gt; = &lt;code class="prettyprint"&gt;5&lt;/code&gt; changes, even if conceptually it’s one change, in a different sense.&lt;/p&gt;

&lt;p&gt;This leads to another question about those standard library changes: what is up with that weird peak around Rust 1.33? Well, we added the &lt;code class="prettyprint"&gt;const fn&lt;/code&gt; feature in Rust 1.31. After that landed, we could &lt;code class="prettyprint"&gt;const&lt;/code&gt;-ify a number of functions in the standard library. The initial huge bulk of changes here landed in 1.33. It had 138 changes, but only 13 were not “this function is now &lt;code class="prettyprint"&gt;const&lt;/code&gt;.” And the feature continues to drive change outside of 1.33; the initial landing of &lt;code class="prettyprint"&gt;const fn&lt;/code&gt; in 1.31 was very limited, and as it expands, more functions that already existed can be made &lt;code class="prettyprint"&gt;const&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;In conclusion, even though I still believe that Rust has slowed down its rate of change a lot, I think that it makes total sense that not everyone agrees with me. By some metrics, I am just flat-out wrong.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:words.steveklabnik.com,2014:Post/c-is-how-the-computer-works-is-a-dangerous-mindset-for-c-programmers</id>
    <published>2020-03-31T06:38:27-07:00</published>
    <updated>2020-03-31T06:38:27-07:00</updated>
    <link rel="alternate" type="text/html" href="https://words.steveklabnik.com/c-is-how-the-computer-works-is-a-dangerous-mindset-for-c-programmers"/>
    <title>"C is how the computer works" is a dangerous mindset for C programmers</title>
    <content type="html">&lt;p&gt;A long time ago, I wrote &lt;a href="https://words.steveklabnik.com/should-you-learn-c-to-learn-how-the-computer-works"&gt;“Should you learn C to “learn how the computer works”?”&lt;/a&gt;. This was part 1 in a three part series. A year later, I got around to part 2, &lt;a href="https://words.steveklabnik.com/c-is-not-how-the-computer-works-can-lead-to-inefficient-code"&gt;““C is not how the computer works” can lead to inefficient code”&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It’s been five more months. I don’t think I really want to write out the third part; I expected this to be a quick series of blog posts, not something that was on my plate for a year and a half. Here’s the thesis of part 3:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Part three is going to show what happens if you make a mistake with the ideas from part two. If you incorrectly assume that C’s abstract model maps directly to hardware, you can make mistakes. This is where UB gets dangerous. While you can take advantages of some properties of the machine you’re relying on, you have to know which ones fit within C’s model and which ones don’t.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I honestly don’t feel like writing more than that, so I’m just gonna leave it there. Basically, the overall thrust of this series has been this: C is not the hardware, it’s an abstract machine. But that machine runs on real hardware, and abstractions are leaky. If you go too far into “purely only the abstract machine,” you may not be able to accomplish your tasks. If you go too far into “C runs directly on the hardware,” you may be surprised when a compiler does something that you didn’t expect.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:words.steveklabnik.com,2014:Post/a-sad-day-for-rust</id>
    <published>2020-01-17T06:25:53-08:00</published>
    <updated>2020-01-17T06:25:53-08:00</updated>
    <link rel="alternate" type="text/html" href="https://words.steveklabnik.com/a-sad-day-for-rust"/>
    <title>A sad day for Rust</title>
    <content type="html">&lt;p&gt;&lt;code class="prettyprint"&gt;actix-web&lt;/code&gt; is dead.&lt;/p&gt;

&lt;p&gt;This situation is bad, from all sides. When Rust was a tiny, tiny community, I thought to myself, “wow, I wonder how long this will last? Probably 1.0 will kill it.” Sort of playing off of &lt;a href="https://en.wikipedia.org/wiki/Eternal_September"&gt;Eternal September&lt;/a&gt;, I assumed that over time, the community would grow, and we’d encounter problems.&lt;/p&gt;

&lt;p&gt;Today is the first day where I say to myself, okay, has that happened?&lt;/p&gt;

&lt;p&gt;This story is not super clear-cut. I’m not going to link to a dozen citations, or try to prove that I’m some sort of neutral party here. I’m going to give you account of this story as I remember it and as I felt it. Because this isn’t really about playing judge. This is about thinking about the future.&lt;/p&gt;

&lt;p&gt;It’s been very clear from the beginning that the Rust project saw Rust as more than just the language. The community and the people mattered. From the earliest days, leadership explicitly took the position that it wasn’t just the code, but the people around the project were important. Of course, people are also people, and so this wasn’t perfect; we’ve made several fairly large mis-steps here over the years. But Rust has been an experiment in community building as much as an experiment in language building. Can we reject the idea of a BDFL? Can we include as many people as possible? Can we be welcoming to folks who historically have not had great representation in open source? Can we reject &lt;a href="https://blog.aurynn.com/2015/12/16-contempt-culture"&gt;contempt culture&lt;/a&gt;? Can we be inclusive of beginners?&lt;/p&gt;

&lt;p&gt;Rust has a necessary feature, &lt;code class="prettyprint"&gt;unsafe&lt;/code&gt;, that allows you to escape Rust’s guarantees. This is a really important part of Rust, but also a very dangerous one, hence the name. But one of the things that’s important about it is that, since &lt;code class="prettyprint"&gt;unsafe&lt;/code&gt; means “I have checked this code, and it upholds all of the guarantees the compiler cannot check,” you can build a safe interface with unsafe guts.&lt;/p&gt;

&lt;p&gt;Interacting with anything outside of the language, for example, using the operating system to print to the screen, or write a file, has to be &lt;code class="prettyprint"&gt;unsafe&lt;/code&gt;, and so without this property, all programs would be &lt;code class="prettyprint"&gt;unsafe&lt;/code&gt;. This premise is treated skeptically by many, but has generally been demonstrated to have worked out. Several folks are in the process of providing tooling to prove that your &lt;code class="prettyprint"&gt;unsafe&lt;/code&gt; code is correct, and provided proofs for a bunch of the standard library’s &lt;code class="prettyprint"&gt;unsafe&lt;/code&gt; code. It not only found a few places where there were bugs, but also a few places where the restrictions were too tight!&lt;/p&gt;

&lt;p&gt;But “generally” is doing a lot of work in that previous sentence. This setup creates a gnawing fear in the back of people’s minds: what if some foundational package uses &lt;code class="prettyprint"&gt;unsafe&lt;/code&gt;, but uses it incorrectly? What happens when this causes problems for every package that uses that package? This relationship between safe and unsafe is also a bit hard to understand, and so, when bugs are found around unsafe, people &lt;em&gt;outside&lt;/em&gt; of Rust often use it to suggest that all of Rust is a house of cards. While Rust has “made it” in many senses, it has not quite yet in many others, and so I think this produces a fundamental anxiety in the community.&lt;/p&gt;

&lt;p&gt;Speaking of making it, actix-web is a good web framework. It came onto the scene, and people generally liked it. It also performed extremely well. Its score on &lt;a href="https://www.techempower.com/benchmarks/"&gt;Techempower&lt;/a&gt; in particular was impressive, and got more impressive over time. Its author also works at Microsoft, and suggested that Microsoft is using actix-web in production. This was really exciting to people. This was the second project using Rust at Microsoft, and so this seemed really fantastic.&lt;/p&gt;

&lt;p&gt;But then, the anxiety.&lt;/p&gt;

&lt;p&gt;Before we get into that, though, there’s also the matter of Reddit. The team has basically rejected Reddit for said social reasons. We provide alternate forums for folks, but Reddit is a huge place. The Rust subreddit has ~87,000 subscribers, partially thanks to this. And, for a while, the Rust reddit was a decent place. I still think it’s better than most reddits, but it’s degraded much more quickly than the community at large. “Why Reddit is like this” is a whole other essay; I think it’s built into reddit’s structure itself. But the point is, while Reddit is not official, and so not linked to by any official resources, it’s still a very large group of people, and so to suggest it’s “not the Rust community” in some way is both true and very not true. For the purposes of this story, I think it has to be included in the broader community, and I think that this situation has brought new questions about the relationship of the project and Reddit, though this is already far too long.&lt;/p&gt;

&lt;p&gt;So, someone takes a peek under the covers, and it turns out actix-web is using a &lt;em&gt;lot&lt;/em&gt; of unsafe code. That’s not inherently a problem. The problem is, a lot of that unsafe code is not actually needed. This is where things start to go wrong.&lt;/p&gt;

&lt;p&gt;The author of actix-web basically says “nah it’s fine.” This is basically the perfect storm of unsafe anxiety: a big, important, visible library, a bunch of &lt;code class="prettyprint"&gt;unsafe&lt;/code&gt;, and an unresponsive author.&lt;/p&gt;

&lt;p&gt;Now, it’s important to mention that people were not just complaining: they were writing code. It is easy to frame this as a case of open source entitlement, and it still very may well be, but this isn’t just empty complaints. Patches were included, they just weren’t welcome. And that’s also not inherently wrong either; a project maintainer shouldn’t be required to accept a patch just because it exists…&lt;/p&gt;

&lt;p&gt;Reddit whips itself into a frenzy. Lots of ugly things are said. More issues are opened, and closed, and locked. Eventually, the author accepts some code that drops the total unsafe count significantly and has more sound usage of what’s left.&lt;/p&gt;

&lt;p&gt;People were not happy about how all this played out, for a variety of reasons and in a variety of ways. I haven’t spoken to actix-web’s author, but I can’t imagine that he was very happy about it either.&lt;/p&gt;

&lt;p&gt;And then it happens all over again. More unsafe, more patches rejected, more Reddit, more bad blood. I thought that at this point, the author said he was quitting, but that may be faulty memory, or maybe he changed his mind. Regardless, how responsive would you be, if you were the maintainer, after the shit-show of last time?&lt;/p&gt;

&lt;p&gt;People were not happy about how all this played out, for a variety of reasons and in a variety of ways.&lt;/p&gt;

&lt;p&gt;All was quiet for a while, and actix-web kept climbing the Techempower benchmarks, reaching the top of most of them by a &lt;em&gt;lot&lt;/em&gt;. It is wicked fast.&lt;/p&gt;

&lt;p&gt;And then, yesterday, a post titled &lt;a href="https://medium.com/@shnatsel/smoke-testing-rust-http-clients-b8f2ee5db4e6"&gt;Smoke-testing Rust HTTP clients&lt;br&gt;
&lt;/a&gt; gets published. It focuses on a, well, smoke test of Rust HTTP clients, but it also comments a lot on the complexity of each project, and the amount of &lt;code class="prettyprint"&gt;unsafe&lt;/code&gt;. The author found and filed a lot of bugs.&lt;/p&gt;

&lt;p&gt;But:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A quick glance at the dependencies reveals that it relies on actix-service, which underpins all of Actix and has a bespoke and unsound Cell implementation. For example, this method violates memory safety by handing out multiple mutable references to the same data, which can lead to e.g. a use-after-free vulnerability. I have reported the issue to the maintainers, but they have refused to investigate it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This causes the now-usual Reddit uproar. It’s extra nasty this time. Some people go far, far, far over the line.&lt;/p&gt;

&lt;p&gt;And now the maintainer has quit.&lt;/p&gt;

&lt;p&gt;This means, on some level, this situation is over: there will not be a fourth huge actix-web drama. But it’s really left a bad taste in my mouth. It’s unfortunate that a well-known project had soundness issues. It’s unfortunate that the maintainer wasn’t receptive to fixing them. At the same time, I’ve been there: being a maintainer is tough. It’s also unfortunate that there’s this &lt;em&gt;style&lt;/em&gt; of response, and kind, and volume. It &lt;em&gt;is&lt;/em&gt; true that the situation was dangerous. But did it have to be handled this way? You have to understand a lot of nuance here to even know the main points of the story. One version of this story that will certainly be told is “The Rust community says they’re nice but they will harass you if you use unsafe wrong.” Is that what we want? I, for one, do not. If you’re a part of Rust, you gotta ask yourself: are you happy with this outcome? How did your actions (or lack thereof) contribute to it? Could you have done something better?&lt;/p&gt;

&lt;p&gt;I’m not sure where we go from here, and I’m not sure what we could have done to prevent this from happening. But I feel like this is a failure, and it’s set Rust back a bit, and I’m just plain sad.&lt;/p&gt;

&lt;p&gt;EPILOGUE&lt;/p&gt;

&lt;p&gt;actix-web has new maintainers, and will now live on: &lt;a href="https://github.com/actix/actix-web/issues/1289"&gt;https://github.com/actix/actix-web/issues/1289&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:words.steveklabnik.com,2014:Post/c-is-not-how-the-computer-works-can-lead-to-inefficient-code</id>
    <published>2019-10-25T07:45:39-07:00</published>
    <updated>2019-10-25T07:45:39-07:00</updated>
    <link rel="alternate" type="text/html" href="https://words.steveklabnik.com/c-is-not-how-the-computer-works-can-lead-to-inefficient-code"/>
    <title>"C is not how the computer works" can lead to inefficient code</title>
    <content type="html">&lt;p&gt;A little over a year ago, I wrote &lt;a href="https://words.steveklabnik.com/should-you-learn-c-to-learn-how-the-computer-works"&gt;“Should you learn C to ‘learn how the computer works’”&lt;/a&gt;. It was a bit controversial. I had promised two follow-up posts. It’s taken me a year, but here’s the first one.&lt;/p&gt;

&lt;p&gt;In that post, I argued that C doesn’t “work like the computer”, but rather, by a concept called the “C abstract machine.” It happens to be close to how computers operate in some sense, but that when you write C, you’re writing for the abstract machine, not the computer itself. Here’s the trick, though: the C abstract machine doesn’t define every single aspect of how computation happens. And so sometimes, you can write code in two different ways, that the C abstract machine says are equivalent, yet are &lt;em&gt;not&lt;/em&gt; equivalent in performance. This means that, even if you buy into my original point, you still need to know the boundaries of this definition, and can exploit those boundaries in important ways.&lt;/p&gt;

&lt;p&gt;Let’s start with a made-up example, and then we’ll show how this happens in real code. Imagine that we have a very simple programming language, built on an abstract machine. It defines only the semantics for the multiplication of two 32-bit integers. It also ignores things like overflow. You could write a program like “3 * 4” and this machine would say “hey the result is 12.” Let’s also imagine we have a very simple computer: it has a single instruction, “add two numbers together.” This takes one clock cycle to execute. If we wrote a compiler for this machine, and didn’t apply any optimizations, it would execute “4 + 4”, and then take that result and add four to it. We have two add operations, and so our program takes two clock cycles.&lt;/p&gt;

&lt;p&gt;Let’s imagine a new version of our computer comes out. It adds a new instruction: multiplication. This also takes one cycle, but can multiply two numbers directly. Our compiler adds a new back-end, and when compiling our “3 * 4” program for this fancy new machine, it emits a single multiplication instruction. Our program now takes one clock cycle.&lt;/p&gt;

&lt;p&gt;Now imagine a new version of our compiler. It is able to do “constant folding”, an optimization. Our program does no computation at all, only produces a “12” directly. This now means our program takes zero cycles on both bits of hardware.&lt;/p&gt;

&lt;p&gt;Is all of this okay?&lt;/p&gt;

&lt;p&gt;Yes! The machine only defines how the &lt;code class="prettyprint"&gt;*&lt;/code&gt; operator works on numbers in a “what number comes out the other side” sense. It doesn’t specify how to actually accomplish this task. Compilers for our little language are free to implement the details in any way they choose, as long as they respect the rules of the abstract machine. Other details are fair game. As long as the program “3 * 4” produces “12”, the rest of the computational process doesn’t actually matter.&lt;/p&gt;

&lt;p&gt;This is how you can write “portable” code that is portable in one sense, but not at all in another sense. As long as you respect the rules of the abstract machine, you’ll be guaranteed (we live in a world with no compiler bugs, of course) to get the correct result. If it takes too long, or takes no time at all, that’s not the language’s concern, strictly speaking.&lt;/p&gt;

&lt;p&gt;If this idea seems silly to you, well, I can assure you it’s real. For example, let’s consider the actual C language, and some actual hardware, specifically, x86.&lt;/p&gt;

&lt;p&gt;Imagine we have an array of arrays, four by four: (markdown gives me a header even though I don’t want it, sorry about the weirdness)&lt;/p&gt;

&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;There are two naive ways to process it: row by row:&lt;/p&gt;

&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;or column by column: &lt;/p&gt;

&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Here’s a fun question: is one of these faster than the other?&lt;/p&gt;

&lt;p&gt;At this small size, probably not. But there’s a way to do this that’s faster than either of these ways, and that’s called “blocking” or “tiling”. It means that you process a sub-set, or “block”, of the array each time. Something like this:&lt;/p&gt;

&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;On x86, this is &lt;em&gt;meaningfully&lt;/em&gt; faster in many circumstances. This has to do with the way that the CPU caches information. For more, see &lt;a href="https://software.intel.com/en-us/articles/how-to-use-loop-blocking-to-optimize-memory-use-on-32-bit-intel-architecture"&gt;this page from Intel&lt;/a&gt;, including a visualization that’s probably better than mine. &lt;/p&gt;

&lt;p&gt;This raises an interesting point: is this code portable? Imagine a machine that didn’t have the cache behavior of x86 chips here. This code would run on them, but it may be 14 times slower. Strictly speaking, this program is “portable” in the sense that you’ll get the right computation in the end, but maybe this speed is part of the user requirements for this software to be successful, and so being super slow means that it “doesn’t work” according to those requirements, even though from a programming language point of view, it’s all good.&lt;/p&gt;

&lt;p&gt;Because C’s abstract machine is so thin, these kinds of details can really, really matter, as we’ve seen. And this is where the good part of the “C teaches you how the computer works” meme comes in. Because the machine is thinner, you can learn more about the details, and as long as they’re not details that the C abstract machine cares about, exploit them. And there’s a good reason I mentioned an optimizing compiler above; it’s also the job of compiler authors to realize the difference between a given computer and the C abstract machine, and then exploit the difference to make your code go as fast as possible. But this really blurs the line between abstract machine and physical machine. And that’s why we all argue online about this all the time.&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;I have a third post to wrap up this series. I hope it won’t take me another year, but no guarantees…&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:words.steveklabnik.com,2014:Post/porting-steveklabnik-com-to-workers-sites-and-zola</id>
    <published>2019-09-26T08:04:11-07:00</published>
    <updated>2019-09-26T08:04:11-07:00</updated>
    <link rel="alternate" type="text/html" href="https://words.steveklabnik.com/porting-steveklabnik-com-to-workers-sites-and-zola"/>
    <title>Porting steveklabnik.com to Workers Sites and Zola</title>
    <content type="html">&lt;p&gt;One fun thing about having a personal domain is that you can keep the contents the same forever, but take a few days every so often to port it to some new stack you want to try out.&lt;/p&gt;

&lt;p&gt;A while back, I had my site on &lt;a href="https://pages.github.com"&gt;GitHub Pages&lt;/a&gt; using &lt;a href="https://jekyllrb.com"&gt;Jekyll&lt;/a&gt;. This has long been the sort of default, go-to stack for me. At some point, I decided to simplify even further, and wrote a small script to take the few Markdown files I have and just make HTML out of them. I then used &lt;a href="https://www.netlify.com"&gt;Netlify&lt;/a&gt; to do the hosting. I wanted to try out their legendary ease of use, and it was indeed super simple.&lt;/p&gt;

&lt;p&gt;Earlier this year, I &lt;a href="https://words.steveklabnik.com/i-m-joining-cloudflare"&gt;took a job at Cloudflare&lt;/a&gt; to work on part of &lt;a href="https://workers.cloudflare.com"&gt;Cloudflare Workers&lt;/a&gt;. To get more familiar with the project I’d be working on, &lt;a href="https://www.cloudflare.com/products/workers-kv/"&gt;Workers KV&lt;/a&gt;, I came up with a plan: I’d put the Markdown files into KV, and then write a worker in Rust and WebAssembly that would generate the HTML on the fly, and run that in a Worker. This worked really well, even though it was &lt;em&gt;incredibly&lt;/em&gt; overkill for a simple static site.&lt;/p&gt;

&lt;p&gt;Today we’re launching a new product, &lt;a href="https://blog.cloudflare.com/workers-sites/"&gt;Workers Sites&lt;/a&gt;. You see, I wasn’t the only one who was interested in using Workers for static site hosting; I’d see tweets every so often where others were doing the same. But doing so was a completely manual process, you had to write the code on your own, you had to do all the setup yourself, and there was no assistance in doing so. Workers Sites changes this, and makes it easy to host your own site, if you’d like.&lt;/p&gt;

&lt;p&gt;The rest of this post is going to walk you through my porting process for &lt;a href="https://www.steveklabnik.com"&gt;steveklabnik.com&lt;/a&gt;.&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;I decided to go with &lt;a href="https://www.getzola.org"&gt;Zola&lt;/a&gt; for my static site generator, as it’s written in Rust. I’d been wanting to give Zola a try for a while, and this was a good excuse to do so.&lt;/p&gt;

&lt;p&gt;I needed these pre-requisites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Zola, instructions &lt;a href="https://www.getzola.org/documentation/getting-started/installation/"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Wrangler, instructions &lt;a href="https://github.com/cloudflare/wrangler"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;A Cloudflare Workers account, &lt;a href="https://workers.cloudflare.com"&gt;here&lt;/a&gt; if you don’t have a Cloudflare account already, and if you do, you can click the Workers tab in your dashboard to set it up.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally, you need to have a $5/month subscription to Workers, to get access to Workers KV. I want us to offer a free tier of KV in the future, but we’re not there yet. That $5/month gets you a lot more than one site, to be clear, but this isn’t a completely free solution today.&lt;/p&gt;

&lt;p&gt;From there, it was time to make a new site with Zola:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-console"&gt;&amp;gt; zola init steveklabnik.com
&amp;gt; cd steveklabnik.com
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Zola places the contents of your site in the &lt;code class="prettyprint"&gt;contents&lt;/code&gt; directory. I only have one level for my site, so I dumped my two pages in there, as well as re-named &lt;code class="prettyprint"&gt;index.md&lt;/code&gt; to &lt;code class="prettyprint"&gt;_index.md&lt;/code&gt; to follow Zola convention.&lt;/p&gt;

&lt;p&gt;I had a few YAML headers on pages, I had to convert those to Zola’s TOML format:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint"&gt;+++
title = "Deleuzional"
+++
I really like the writing of [Gilles Deleuze]. I need
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code class="prettyprint"&gt;+++&lt;/code&gt;s are like &lt;code class="prettyprint"&gt;---&lt;/code&gt; in Jekyll, and the metadata is in TOML instead of YAML. I only needed &lt;code class="prettyprint"&gt;title&lt;/code&gt; because I am keeping things very simple.&lt;/p&gt;

&lt;p&gt;I then needed to set up templates. Like most static site generators, the template forms the outer contents of the HTML on a page, and renders the Markdown into the middle somewhere. I have a slightly different template for my root than the other two pages, and Zola handles this pretty well.&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-console"&gt;&amp;gt; ls .\templates\


    Directory: C:\Users\Steve Klabnik\src\steveklabnik.com\templates


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        9/25/2019   5:28 PM           1288 index.html
-a----        9/25/2019   5:28 PM           1234 page.html
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code class="prettyprint"&gt;index.html&lt;/code&gt; is for the root page, and &lt;code class="prettyprint"&gt;page.html&lt;/code&gt; is for the other pages. This is a Zola convention.&lt;/p&gt;

&lt;p&gt;Zola templates are written in &lt;a href="https://tera.netlify.com/docs/templates/"&gt;Tera&lt;/a&gt;, which is sorta like &lt;a href="https://shopify.github.io/liquid/"&gt;Liquid&lt;/a&gt; or &lt;a href="https://jinja.palletsprojects.com/en/2.10.x/"&gt;Jinja2&lt;/a&gt;. Here’s a snippit of my template:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-tera"&gt;  &amp;lt;body&amp;gt;
      &amp;lt;h2&amp;gt;{{ page.title }}&amp;lt;/h2&amp;gt;
      {{page.content | safe}}
  &amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code class="prettyprint"&gt;| safe&lt;/code&gt; bit says that it shouldn’t escape the HTML produced by &lt;code class="prettyprint"&gt;page.content&lt;/code&gt;, which is the rendered contents of the Markdown pages.&lt;/p&gt;

&lt;p&gt;Finally, I have some static assets for the site: a CSS file, some JS, and the favicon, etc. These get dumped in the &lt;code class="prettyprint"&gt;static&lt;/code&gt; directory, and Zola will copy them over when I build the site.&lt;/p&gt;

&lt;p&gt;Previewing during this process is very useful:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-console"&gt;&amp;gt; zola serve
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It took me a bit to figure out the conventions and get everything in place, and being able to change the contents and watch my browser refresh was invaluable.&lt;/p&gt;

&lt;p&gt;Once I had my site ported to Zola, it’s time to deploy it to Workers Sites!&lt;/p&gt;

&lt;p&gt;Wrangler is the command-line tool for Cloudflare Workers. If you haven’t used it before, you’ll have to log in:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-console"&gt;&amp;gt; wrangler config
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To check that your auth is set up correctly, you should run this command:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-console"&gt;&amp;gt; wrangler whoami
  You are logged in with the email 'steve@steveklabnik.com'.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Of course, this should show your own email, not mine.&lt;/p&gt;

&lt;p&gt;Let’s add Workers Sites to our project:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-console"&gt;&amp;gt; wrangler init --site website
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This creates two main things: &lt;code class="prettyprint"&gt;wrangler.toml&lt;/code&gt;, used to configure Wrangler, and &lt;code class="prettyprint"&gt;workers-sites&lt;/code&gt;, a directory with your worker in it. I used the extra &lt;code class="prettyprint"&gt;website&lt;/code&gt; parameter to wrangler becuase it defaults to the name of the subdirectory, and the period in &lt;code class="prettyprint"&gt;steveklabnik.com&lt;/code&gt; is invalid in a worker name, so I chose &lt;code class="prettyprint"&gt;website&lt;/code&gt;. You can put whatever you’d like.&lt;/p&gt;

&lt;p&gt;We need to set up &lt;code class="prettyprint"&gt;wrangler.toml&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-console"&gt;&amp;gt; code wrangler.toml
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Mine looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-toml"&gt;account_id = "f5518bfbf88c230551a64797c221c7da"
name = "website"
type = "webpack"
route = "www.steveklabnik.com/*"
zone_id = "9359b254c46ff9f5c546203686794862"
workers_dev = false

[site]
bucket = "./public"
entry-point = "workers-site"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;All of these IDs are fine to be public; &lt;code class="prettyprint"&gt;wrangler&lt;/code&gt; stores your sensitive stuff in &lt;code class="prettyprint"&gt;~/.wrangler&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Important bits:&lt;/p&gt;

&lt;p&gt;The &lt;code class="prettyprint"&gt;route&lt;/code&gt; needs to be set up properly; this one means that the worker will serve everything on &lt;code class="prettyprint"&gt;www.steveklabnik.com&lt;/code&gt;. My account and zone IDs are needed; you can find these on the Cloudflare dashboard on the bottom right of the main page for it. &lt;code class="prettyprint"&gt;workers_dev&lt;/code&gt; is false; I’m deploying to my site, not to a subdomain of &lt;code class="prettyprint"&gt;workers.dev&lt;/code&gt;. If we did, we wouldn’t need the &lt;code class="prettyprint"&gt;zone_id&lt;/code&gt;, or &lt;code class="prettyprint"&gt;route&lt;/code&gt;. Finally, the &lt;code class="prettyprint"&gt;bucket&lt;/code&gt; setting needs to be set to whatever your site generator’s output directory is, which for Zola is &lt;code class="prettyprint"&gt;public&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And that’s it! You can test out what this looks like:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-console"&gt;&amp;gt; wrangler preview
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If that all looks good, we can deploy:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-console"&gt;&amp;gt; zola build
&amp;gt; wrangler publish
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And that’s it! And wow is it fast:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/hS1xpZgYuQ9sRhUxP1iqq20xspap.png"&gt;&lt;img src="https://svbtleusercontent.com/hS1xpZgYuQ9sRhUxP1iqq20xspap_small.png" alt="speed.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;… well, we’re &lt;em&gt;almost&lt;/em&gt; done. Right now, this means I can only publish from my laptop. I’d prefer to have GitHub deploy this. We don’t have that as a built-in feature today, so I’d have to write an Action to do so. I haven’t yet, so I can’t blog about that. Maybe next time.&lt;/p&gt;

&lt;p&gt;Additionally, there’s one more twist. Zola generates different URLs than my previous ones. I had previously had &lt;code class="prettyprint"&gt;.html&lt;/code&gt; on the ends of my pages, but Zola does not do this.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;old: &lt;a href="https://www.steveklabnik.com/deleuzional.html"&gt;https://www.steveklabnik.com/deleuzional.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;new: &lt;a href="https://www.steveklabnik.com/deleuzional/"&gt;https://www.steveklabnik.com/deleuzional/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I think I’d prefer the new style anyway, so rather than figure out how to get Zola to do this, let’s set up some redirects. This is one cool thing about using Workers for this kind of task; while it’s slightly more manual, we can also make customizations very easily. The contents of the Worker that serves up the site lives in &lt;code class="prettyprint"&gt;workers-sites/index.js&lt;/code&gt;. It’s very short.&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-js"&gt;import { getAssetFromKV } from "@cloudflare/kv-asset-handler";

addEventListener("fetch", event =&amp;gt; {
  event.respondWith(handleEvent(event));
});

async function handleEvent(event) {
  try {
    return await getAssetFromKV(event);
  } catch (e) {
    let pathname = new URL(event.request.url).pathname;
    return new Response(`"${pathname}" not found`, {
      status: 404,
      statusText: "not found"
    });
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Given that I only have two URLs, rather than doing something big and fancy, I did something dumb and straightforward:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-js"&gt;import { getAssetFromKV } from "@cloudflare/kv-asset-handler";

addEventListener("fetch", event =&amp;gt; {
  event.respondWith(handleEvent(event));
});

async function handleEvent(event) {

  // redirect some old URLs
  let pathname = new URL(event.request.url).pathname;

  if (pathname === "/security.html") {
    return Response.redirect("https://www.steveklabnik.com/security/", 301);
  } else if (pathname === "/deleuzional.html") {
    return Response.redirect("https://www.steveklabnik.com/deleuzional/", 301);
  }

  try {
    return await getAssetFromKV(event);
  } catch (e) {
    let pathname = new URL(event.request.url).pathname;
    return new Response(`"${pathname}" not found`, {
      status: 404,
      statusText: "not found"
    });
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I’m constructing &lt;code class="prettyprint"&gt;pathname&lt;/code&gt; twice here, but I just don’t care enough to bother to refactor this out. Additionally, it’s nice to purely add, rather than customize what was generated too much.&lt;/p&gt;

&lt;p&gt;But with that, and another &lt;code class="prettyprint"&gt;zola build &amp;amp;&amp;amp; wrangler publish&lt;/code&gt;, I have the redirects set up for my site.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:words.steveklabnik.com,2014:Post/i-m-joining-cloudflare</id>
    <published>2019-04-05T09:00:54-07:00</published>
    <updated>2019-04-05T09:00:54-07:00</updated>
    <link rel="alternate" type="text/html" href="https://words.steveklabnik.com/i-m-joining-cloudflare"/>
    <title>I'm joining Cloudflare</title>
    <content type="html">&lt;p&gt;&lt;a href="https://svbtleusercontent.com/jpH1brqXUvSAz1tNQ8uVKb0xspap.png"&gt;&lt;img src="https://svbtleusercontent.com/jpH1brqXUvSAz1tNQ8uVKb0xspap_small.png" alt="Cloudflare logo.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yesterday, I signed an offer letter from Cloudflare. I’ll be the product manager of Storage, which is the part of the company that’s working on data storage products for the &lt;a href="https://www.cloudflare.com/products/cloudflare-workers/"&gt;Cloudflare Workers&lt;/a&gt; platform. I’ll be starting at the end of the month.&lt;/p&gt;

&lt;p&gt;I think a lot of you will say “that makes perfect sense,” but many more will say “wait, what?”. I hope this post will make things a bit more clear.&lt;/p&gt;

&lt;p&gt;Before we start, I also want to say that I’ll still be continuing my work on Rust, though obviously in a more limited capacity. I’ll still be working on revisions to &lt;a href="https://doc.rust-lang.org/stable/book/"&gt;The Rust Programming Language&lt;/a&gt;, and doing core team work, for example.&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;Before I worked on Rust, I worked on and with Ruby on Rails. When I got out of the web application game, the hot topic was this new “platform as a service” stuff. I’ve been watching all of the latest changes from afar, and they’ve been quite interesting. I’ve always loved the web, and the people building it. In the last 18 months or so, I’ve also been extremely interested in WebAssembly. Working at Cloudflare is the intersection of four things for me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Edge compute&lt;/li&gt;
&lt;li&gt;WebAssembly&lt;/li&gt;
&lt;li&gt;Rust&lt;/li&gt;
&lt;li&gt;Personal and career growth&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="edge-compute_2"&gt;Edge Compute &lt;a class="head_anchor" href="#edge-compute_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;There’s sort of been four eras of “how do I web server”:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Physical servers (“on premise”)&lt;/li&gt;
&lt;li&gt;Infrastructure as a service&lt;/li&gt;
&lt;li&gt;Platform as a service&lt;/li&gt;
&lt;li&gt;Function as a service&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A lot of people see the relationship between these things as “what you control” vs “what does the provider control”, but I don’t think that’s quite right. But I’m getting ahead of myself.&lt;/p&gt;

&lt;p&gt;Back in the day, if you wanted a web site, you bought a physical server, and you put it in a data center somewhere. I wasn’t around for those days. The point is, you managed everything: the hardware, the software. All of it.&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://www.shapeways.com/blog/archives/305-CloudFab-Distributed-Fabrication-3D-printing,-Nick-Pinkston-interview.html"&gt;my days as a startup CTO&lt;/a&gt;, my services were deployed to a Virtual Private Server. Instead of owning servers ourselves, we rented a virtual machine, running on someone else’s servers. This is “infrastructure as a service”; I didn’t have to worry about machines, I could just ask for one, and it’d be given to me. I still had to manage the operating system and everything above it. &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Fun side note: CloudFab was a Rails application with a big C extension to do data processing that was too much for Ruby. This later informed a lot of my Rust work.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Next up came “platform as a service.” To me, Heroku was the platonic ideal of this era. Now, you didn’t even need to manage servers. You got to worry about your application, and that’s it. Maybe you’d need to set a slider to scale during times of demand.&lt;/p&gt;

&lt;p&gt;I’ve been reading a lot about “functions as a service” over the past few years. Instead of deploying an entire application, each endpoint becomes an application, basically. This is where I think the previous thinking about the relationships between these categories of service is a little wrong. The actual underlying trend here is something else: what affordances do I have to scale?&lt;/p&gt;

&lt;p&gt;In the on-premise days, if I wanted to add capacity, I’d need to buy new servers, install them, set everything up. There’s a &lt;em&gt;lot&lt;/em&gt; of latency there. And if I need to remove capacity, well, I have to sell those servers? The move to infrastructure as a service was significant, because it more clearly separated concerns. Each company didn’t need a data center; a data center provides homogeneous compute. As a user, if I need to scale, I can spin up some more virtual servers much more quickly than I can physical ones. Managing that required a lot of tooling, however.&lt;/p&gt;

&lt;p&gt;This was the insight that led to platform as a service: by managing this tooling, you could make it even easier for users to scale. There’s a reason why the slider became the ubiquitous synonym with PaaS. There’s nothing that you could do with PaaS that was impossible with IaaS, but it was much, much easier.&lt;/p&gt;

&lt;p&gt;This brings us to Functions as a Service, also known as “serverless.” The reason that this architecture matters is one very similar to previous insights. By breaking your application into multiple functions, they can scale independently. This is one of the dreams of microservice architecture, but there’s a bit of a difference. Microservice architecture focuses on how you build your system, and how you split up components internally. FaaS focuses on how people interact with your system, and splits up the components according to that. This framing is a bit more significant to your ability to scale, because it means that during times of high load, you can scale only the parts under that load. In the same way that IaaS said “let’s not force people to buy servers to scale” and PaaS said “let’s not force people to build out infrastructure to scale”, FaaS says “let’s not force people to scale their help page to scale their shopping cart.”&lt;/p&gt;

&lt;p&gt;This brings us to edge compute. Edge compute is a particular kind of FaaS, but an interesting take on it. Here’s the concept: your users are all over the world. Why do their packets need to go to &lt;code class="prettyprint"&gt;us-east-1&lt;/code&gt; and back? To which you might say, “sure, that’s why we’ve developed our application to work in multiple regions.” That’s the same relationship between IaaS and PaaS. That is, why should you have to worry about making your application be available across multiple regions? You may not be worrying about individual physical servers anymore, but you’re still worrying about data centers. And some FaaS products, like AWS Lambda, can already run easily across multiple regions, and with some setup, go between them. However, Amazon has about 20 total regions.&lt;/p&gt;

&lt;p&gt;So how is edge compute different? Well, at some point, various CDN companies realized “wait a minute. We have severs around the world. Why can’t we run compute on them as well?”&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Side note: Cloudflare is not really a CDN company, though that’s how I always thought of them. They do a lot more stuff than CDNs.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is interesting because, well, &lt;a href="https://aws.amazon.com/about-aws/global-infrastructure/"&gt;here’s those 20 Amazon regions&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/qxGa9h6TshtRrXZmh6tsRU0xspap.png"&gt;&lt;img src="https://svbtleusercontent.com/qxGa9h6TshtRrXZmh6tsRU0xspap_small.png" alt="awsregions.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Compare this with &lt;a href="https://www.fastly.com/network-map"&gt;Fastly’s network&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/ePzMAv7Q4NVLARUKambWH80xspap.jpg"&gt;&lt;img src="https://svbtleusercontent.com/ePzMAv7Q4NVLARUKambWH80xspap_small.jpg" alt="map_POP.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And finally, &lt;a href="https://www.cloudflare.com/network/"&gt;Cloudflare’s network&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/bQzn9XqBY98mw269Q1tsdH0xspap.png"&gt;&lt;img src="https://svbtleusercontent.com/bQzn9XqBY98mw269Q1tsdH0xspap_small.png" alt="cloudflarenetwork.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(the page is animated, so those highlighted ones don’t mean anything)&lt;/p&gt;

&lt;p&gt;You’re much likely to be physically closer to a Fastly or Cloudflare server than you are an AWS one. And that’s what we mean by “edge compute”, that is, you’re running your code on the edge, rather than in the data center.&lt;/p&gt;

&lt;p&gt;Now, I should also mention that there is a form of Lambda called Lambda@Edge that runs off of CloudFront locations, rather than the above map. So that looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/vwJvtVvGK7DpGZYEPcrjzW0xspap.png"&gt;&lt;img src="https://svbtleusercontent.com/vwJvtVvGK7DpGZYEPcrjzW0xspap_small.png" alt="cloudfront.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Much better! My point about regions is more applicable to “edge compute” vs more general compute, than saying something about Lambda as a particular product.&lt;/p&gt;

&lt;p&gt;CloudFlare Workers don’t require you to think about where your service is deployed: when you upload it, it’s automatically running on all 175 locations, within minutes.&lt;/p&gt;

&lt;p&gt;I think this space is interesting and significant. Cloudflare has &lt;a href="https://www.cloudflare.com/products/cloudflare-workers/"&gt;Workers&lt;/a&gt;, and Fastly has &lt;a href="https://wasm.fastlylabs.com/"&gt;Terrarium&lt;/a&gt;. Amazon has &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html"&gt;Lambda@Edge&lt;/a&gt;. These are all very interesting platforms for building high performance applications.&lt;/p&gt;

&lt;p&gt;My role as part of Storage will be to consider “what does data access and storage look like in this world?” If your code is moved to the edge, but your data is still in a central server, you don’t gain the full benefit of having the code close to the client. There’s a lot of interesting stuff in this space!&lt;/p&gt;
&lt;h2 id="webassembly_2"&gt;WebAssembly &lt;a class="head_anchor" href="#webassembly_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Both ClouldFlare Workers and Fastly’s Terrarium use &lt;a href="https://webassembly.org/"&gt;WebAssembly&lt;/a&gt; as a core part of the platform. And that’s significant:&lt;/p&gt;

&lt;blockquote class="twitter-tweet"&gt;
&lt;p lang="en" dir="ltr"&gt;If WASM+WASI existed in 2008, we wouldn’t have needed to created Docker. That’s how important it is. Webassembly on the server is the future of computing. A standardized system interface was the missing link. Let’s hope WASI is up to the task! &lt;a href="https://t.co/wnXQg4kwa4"&gt;https://t.co/wnXQg4kwa4&lt;/a&gt;&lt;/p&gt;— Solomon Hykes (@solomonstre) &lt;a href="https://twitter.com/solomonstre/status/1111004913222324225?ref_src=twsrc%5Etfw"&gt;March 27, 2019&lt;/a&gt;
&lt;/blockquote&gt;



&lt;p&gt;In order for this stuff to work, you need a runtime for WebAssembly. One interesting thing we’re seeing in this space is sort of two parallel paths emerge: do you want to support JavaScript, or not? Recently, Fastly open sourced &lt;a href="https://www.fastly.com/blog/announcing-lucet-fastly-native-webassembly-compiler-runtime"&gt;Lucet&lt;/a&gt;, the WebAssembly runtime that powers Terrarium. It’s an impressive bit of tech. There are others too, like &lt;a href="https://wasmer.io/"&gt;Wasmer&lt;/a&gt; and &lt;a href="https://github.com/CraneStation/wasmtime"&gt;Wasmtime&lt;/a&gt;. By focusing purely on WebAssembly, you can build specialized tech, and it can be really, really fast.&lt;/p&gt;

&lt;p&gt;However, you can’t compile JavaScript to WebAssembly. You can sort of do it with AssemblyScript, a TypeScript subset the compiles to wasm. But JavaScript is arguably the most popular programming language in the world. I personally believe in JavaScript, even with the rise of WebAssembly. And so Cloudflare is taking a different approach than those projects. Instead of building a wasm-only runtime, they’re building on top of Google’s V8. This means that they can support both WebAssembly and JavaScript in workers. Additionally, by leaning on V8, you can take advantage of all of the excellent engineering resources that Google pours into it, similar to how the Rust compiler gets to take advantage of people working on improving LLVM.&lt;/p&gt;

&lt;p&gt;Anyway, the point is, WebAssembly is core to this new edge compute world. And so I’m excited to be in the space. I know people that work at Fastly, wasmer, and Mozilla, and they’re all doing great work. I think there’s space for both approaches, but I’m mostly excited to be there and see how it all turns out.&lt;/p&gt;

&lt;p&gt;Oh, one other thing I wanted to say: right now, everything around Workers is closed source. Kudos to Fastly for open-sourcing Lucet. I asked about this in my interview, and Cloudflare is very interested in doing more open source work, and so I’m hoping it doesn’t take us long to catch up in this regard. We’ll see, of course, I haven’t actually started yet. But I think that this stuff needs to be open source, personally.&lt;/p&gt;
&lt;h2 id="rust_2"&gt;Rust &lt;a class="head_anchor" href="#rust_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;You may remember a little story called &lt;a href="https://en.wikipedia.org/wiki/Cloudbleed"&gt;CloudBleed&lt;/a&gt;. In short, Cloudflare had a pretty bad security bug in 2017. This bug happened because of a parser, written in Ragel. Here, &lt;a href="https://blog.cloudflare.com/incident-report-on-memory-leak-caused-by-cloudflare-parser-bug/"&gt;I’ll let Cloudflare explain it&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The Ragel code is converted into generated C code which is then compiled. The C code uses, in the classic C manner, pointers to the HTML document being parsed, and Ragel itself gives the user a lot of control of the movement of those pointers. The underlying bug occurs because of a pointer error.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;CloudBleed happened due to memory unsafety. When talking to Cloudflare today, it’s pretty clear that this bug was taken extremely seriously, to the point where it created a culture change inside the company itself. These days, it seems to me (I haven’t started yet, mind you) that you have to use a memory safe language by default, and only use a memory unsafe one if you have an extremely good justification. But Cloudflare needs to be able to have a lot of performance, and control latency, in much of their stack.&lt;/p&gt;

&lt;p&gt;Enter Rust. Cloudflare started exploring Rust after CloudBleed, and now uses a significant amount of Rust in production. They host the local Rust meetup here in Austin, and sometimes the one in San Francisco. I’m excited to help Cloudflare be successful with Rust, and to use that experience to help improve Rust too.&lt;/p&gt;

&lt;p&gt;My understanding is that I’ll be dealing with a bunch of TypeScript and possibly Go as well, which is also pretty cool.&lt;/p&gt;
&lt;h2 id="career-growth_2"&gt;Career growth &lt;a class="head_anchor" href="#career-growth_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Finally, the move to product management. I really enjoy product work, and have had several jobs that were sorta-kinda product jobs. I don’t think that management jobs are inherently better than engineer jobs, of course, but it’s a way for me to grow. My role at Balanced was sorta-kinda-PM-y, and I loved that job.&lt;/p&gt;

&lt;p&gt;I don’t have too much more to say about this, just that it’s a bit different, but something I’m really excited to do.&lt;/p&gt;
&lt;h2 id="i39m-excited-for-the-future_2"&gt;I’m excited for the future &lt;a class="head_anchor" href="#i39m-excited-for-the-future_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;So yeah, that’s my extremely long-winded explanation of what’s going on. I’m not starting until the end of the month, so I’ve got a few weeks to purely enjoy. I’ll still be playing a lot of &lt;a href="http://www.celestegame.com/"&gt;Celeste&lt;/a&gt; and Fortnite, writing blog posts, and working on some Rust open source. But then I get to get back to work. I’m pumped about all of this! New role, building some new tech with tech I already love.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:words.steveklabnik.com,2014:Post/what-comes-after-open-source</id>
    <published>2019-04-02T07:13:31-07:00</published>
    <updated>2019-04-02T07:13:31-07:00</updated>
    <link rel="alternate" type="text/html" href="https://words.steveklabnik.com/what-comes-after-open-source"/>
    <title>What comes after "open source"</title>
    <content type="html">&lt;p&gt;In &lt;a href="https://words.steveklabnik.com/the-culture-war-at-the-heart-of-open-source"&gt;a previous post&lt;/a&gt;, I discussed the history of open source, and ended with this claim:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Today’s developers have never learned about this history, or don’t care about it, or actively think it’s irrelevant. … For the same reasons that “open source” came up with a new name, I think the movement that will arise from today’s developers will also need a new name.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;We talked about the ideological history of open source, but that’s not what developers object to, really. I don’t think developers are moving back towards a world of making source code private. Instead, it’s something related to a very old discussion in free software. To quote &lt;a href="https://www.gnu.org/philosophy/free-sw.en.html"&gt;the FSF&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Free software” means software that respects users’ freedom and community. Roughly, it means that the users have the freedom to run, copy, distribute, study, change and improve the software. Thus, “free software” is a matter of liberty, not price. To understand the concept, you should think of “free” as in “free speech,” not as in “free beer”. We sometimes call it “libre software,” borrowing the French or Spanish word for “free” as in freedom, to show we do not mean the software is gratis.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In a similar fashion, I don’t think that developers are turning against the concept of “free as in free speech”. I think that they don’t believe that the current definitions of free software and open source actually produce software that is “free as in speech.”&lt;/p&gt;
&lt;h2 id="what-does-quotfreedomquot-mean-anyway_2"&gt;What does “freedom” mean anyway? &lt;a class="head_anchor" href="#what-does-quotfreedomquot-mean-anyway_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;What “free as in speech” means is itself, yet another schism between different camps in the Free Software/Open Source camp. At the root of this schism is a difference of &lt;em&gt;strategy&lt;/em&gt;. The specific tactic is straightforward: there are two kinds of licenses, and which do you choose? The two kinds are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;permissive&lt;/em&gt; licenses&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;viral&lt;/em&gt; licenses if you don’t like them, &lt;em&gt;copyleft&lt;/em&gt; licenses if you do&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open Source advocates prefer permissive licenses, and Free Software advocates prefer viral/copyleft licenses. What’s the difference? Well, that’s the topic for a different essay. Because here’s the thing: the jig is up. We’ve already hit the root problem. And you probably didn’t even notice. It took me a long, long time to notice.&lt;/p&gt;

&lt;p&gt;Before I expose the trick, a personal interlude.&lt;/p&gt;
&lt;h2 id="losing-my-religion_2"&gt;Losing my religion &lt;a class="head_anchor" href="#losing-my-religion_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;I used to be a card-carrying, passionate advocate of Free Software. I used to see Stallman lecture. I only installed Free Software on my personal computer to the fullest extent possible. I was considering buying a coreboot-compatible laptop to get rid of the rest.&lt;/p&gt;

&lt;p&gt;But then, slowly, I stopped caring. It felt really similar to when I decided to leave Catholicism. I started noticing that these beliefs weren’t really actually helpful, and were frankly, mostly harmful. Now, I’m not saying Free Software is harmful. What I am saying is that refusing to use a wifi connection on your laptop because there aren’t free drivers helps basically nobody, and only harms yourself. Even if you are the kind of person who thinks boycotts work, there just aren’t enough free software diehards to form a large enough boycott. And even then, you’d want to do the boycott &lt;em&gt;together&lt;/em&gt;, &lt;em&gt;simultaneously&lt;/em&gt;, to send the message.&lt;/p&gt;

&lt;p&gt;I realized that a lot of software I used was under a permissive license, and even though I’d prefer if it was GPL’d, the only way to actually realize the dream of improving the software thanks to the source I’d been given was to contribute back, under those terms. So I started to.&lt;/p&gt;

&lt;p&gt;And at that point, the permissive licenses were becoming more and more popular. So I found myself in a strange position: even though I was a passionate Free Software advocate, I found myself near-exclusively building Open Source software. All around me, I saw the assault on copyleft, from all sides. And copyleft was losing.&lt;/p&gt;

&lt;p&gt;At some point, I just stopped caring.&lt;/p&gt;
&lt;h2 id="free-software-and-open-source-are-about-licen_2"&gt;Free Software and Open Source are about licenses &lt;a class="head_anchor" href="#free-software-and-open-source-are-about-licen_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;With that out of the way, here’s the problem: note that I seamlessly switched above from talking about what Free Software and Open Source &lt;em&gt;are&lt;/em&gt;, to immediately talking about &lt;em&gt;licenses.&lt;/em&gt; This is because these two things are effectively synonymous. Quoting &lt;a href="https://www.gnu.org/licenses/licenses.html"&gt;the FSF again&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote class="short"&gt;
&lt;p&gt;Published software should be free software. To make it free software, you need to release it under a free software license. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The &lt;a href="https://opensource.org/osd"&gt;OSI&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote class="short"&gt;
&lt;p&gt;Open source doesn’t just mean access to the source code. The distribution terms of open-source software must comply with the following criteria:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Both Free Software and Open Source are, almost by definition, specific design constraints on software licenses. While this started with the FSF, the OSI inherited it.&lt;/p&gt;

&lt;p&gt;I think a quote from &lt;a href="https://www.gnu.org/licenses/licenses.html#WhatIsCopyleft"&gt;further down the FSF’s page&lt;/a&gt; really drives this home:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;To copyleft a program, we first state that it is copyrighted; then we add distribution terms, which are a legal instrument that gives everyone the rights to use, modify, and redistribute the program’s code or any program derived from it but only if the distribution terms are unchanged. Thus, the code and the freedoms become legally inseparable.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The FSF sees copyleft, and therefore copyright, as a legal tool to enforce software freedom. This sometimes puts Free Software advocates in a strange position. For example, they will &lt;a href="https://www.fsf.org/campaigns/drm.html"&gt;campaign passionately against Digital Rights Management&lt;/a&gt;, a software tool to protect copyrighted works, yet also &lt;a href="https://fsfe.org/news/2019/news-20190326-01.en.html"&gt;support expanding copyright in some cases&lt;/a&gt; when it can further the aims of the GPL. (Due to controversy, they’ve stepped back a bit since, as you can see.)&lt;/p&gt;
&lt;h2 id="licenses-are-not-sufficient_2"&gt;Licenses are not sufficient &lt;a class="head_anchor" href="#licenses-are-not-sufficient_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;So why is it a problem that the concepts of free software and open source are intrinsically tied to licenses? It’s that the aims and goals of both of these movements are about &lt;em&gt;distribution&lt;/em&gt; and therefore &lt;em&gt;consumption&lt;/em&gt;, but what people care about most today is about the &lt;em&gt;production&lt;/em&gt; of software. Software licences regulate &lt;em&gt;distribution&lt;/em&gt;, but cannot regulate &lt;em&gt;production&lt;/em&gt;. (technically they can, but practically, they can’t. I get into this below.) This is also the main challenge of whatever comes after open source; they cannot rely on the legal tactics of the last generation. I don’t have solutions here.&lt;/p&gt;

&lt;p&gt;Let’s talk about what developers want first, and then we’ll get into why licenses can’t accomplish this.&lt;/p&gt;
&lt;h2 id="developers-care-about-production_2"&gt;Developers care about production &lt;a class="head_anchor" href="#developers-care-about-production_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;In &lt;a href="https://words.steveklabnik.com/the-culture-war-at-the-heart-of-open-source"&gt;my previous post&lt;/a&gt;, I claimed that developers are mostly confused about open source. Here’s two concrete examples of what I mean.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Imagine a company wants to take some open source software using a permissive license and use it in their product. In the course of using it in their product, they improve it. Are they required to give anything back to the parent project, at all?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Imagine a company wants to take some free software using a copyleft license and use it in their product. In the course of using it in their product, they improve it. In order to comply with the license, they include a line in their 250 page “software license agreement” that says “Certain components of the software, and third party open source programs&lt;br&gt;
included with the software, have been or may be made available by $COMPANY on its Open Source&lt;br&gt;
web site (&lt;a href="http://www.opensource.mycompany.com/"&gt;http://www.opensource.mycompany.com/&lt;/a&gt;”. That web site contains zip files with the contents of the (heavily modified) source. Are they required to do anything more than that?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When presenting these questions to most developers today, I suspect you’d get these answers to these two questions, in order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Yes, and that’s why open source is such a mess; companies take and don’t give back.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;… that sounds extremely shady.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those of you who have been around the block a few times may recognize situation number two: it’s what Apple did with WebKit. There was a project called KHTML, which was licensed under the GPL. Apple forked it, and in order to comply with the GPL, did exactly the above. They were completely within their rights to do so. Yet, many recognized, even at this time, that this “wasn’t in the spirit of open source.” These tactics are sometimes called “source dumps” or “code bombs.” &lt;/p&gt;

&lt;p&gt;But that attitude, that this may be following the letter, &lt;em&gt;but not the spirit&lt;/em&gt;, is the crux of it here. Most developers don’t understand open source to be a particular license that certain software artifacts are in compliance with, but an attitude, an ideology. And that ideology isn’t just about the consumption of the software, but also its production. An open source project should have a public bug tracker. There should be a mailing list, for discussion. You should be able to observe, and ideally participate in, the development of the software. Focusing on the code being open is putting the cart before the horse. In fact, this is one of the reasons why there’s such derision for “source available” licenses; it’s not about the source being open. It’s that the source being open is a necessary, but not sufficient, component of being open source. Now, this is normally framed as a problem of distribution, but I think that many also understand it as a problem of production.&lt;/p&gt;

&lt;p&gt;I believe that this focus on process is why the GNU project has fallen out of favor as well. The tools that the GNU project uses to develop its Free Software are arcane, ugly, and unique to them. It’s the same with many of the old-school Open Source projects as well. If I never have to look at a Bugzilla instance again, I will die happy. This is why GitHub took off; it provided a significantly nicer developer experience for building software. You may not personally agree, but the numbers speak for themselves. The FSF didn’t move to GitHub because GitHub is proprietary, and they see that as inconsistent with their values. Most developers see that you can use it for no money, and that the software produced with it is open source. They see this as consistent with their values.&lt;/p&gt;

&lt;p&gt;When developers talk about problems they see in open source, it’s often that there are production problems. Companies don’t “give back” money or developer hours. Programmers today don’t seem to be upset that, if they’ve developed any proprietary extensions to their open source software, that those extensions are not shared back with the community. They care that the production process is impeded by additional pressure, without providing resources. If a company were to add a proprietary feature to an open source project, yet pays five employees to develop the open source part further, the FSF sees this as a tragedy. The commons has not been enriched. The new generation of open source developers sees this as a responsible company that thankfully is contributing to the development of something they use and care about.&lt;/p&gt;

&lt;p&gt;Software licenses can only restrict what people can do when they distribute the source code, and that’s it. It cannot force someone to have a bug tracker, or a code of conduct, or accept your patch. Copyleft can force an absolute minimal “contribution” back to your project, but it can’t force a good-faith one. This makes it an inadequate tool towards building something with the kinds of values that many developers care about.&lt;/p&gt;
&lt;h2 id="the-challenges_2"&gt;The challenges &lt;a class="head_anchor" href="#the-challenges_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;How would one go about building a software movement around the open &lt;em&gt;production&lt;/em&gt; of software? There are a number of challenges.&lt;/p&gt;

&lt;p&gt;First of all, do you even want the legal system to enforce such a thing? There are pros and cons. Without legal teeth, companies are unlikely to comply. That’s part of why we’re in this mess to begin with!&lt;/p&gt;

&lt;p&gt;Okay, so you want the legal system to somehow enforce this kind of control over the production of software. But how? If we look closer at the strategy used by Free Software and Open Source, they use licenses, which are a form of intellectual property law, which is modeled after property law. Earlier, I said that you can’t use licenses to regulate production, and that’s &lt;em&gt;technically&lt;/em&gt; not true. For example, say that I own a brand, like McDonalds. I own the intellectual property surrounding that brand. I can licence that intellectual property to others, contingent on them producing hamburgers (and whatever else) in a certain way, according to my specification.&lt;/p&gt;

&lt;p&gt;This doesn’t really work with the way that open source is set up. The entities are in reverse here; it’s the software developers that want to be able to dictate things, but it’s the project that sets the license terms.&lt;/p&gt;

&lt;p&gt;That got me thinking about a different pattern for doing this kind of thing. Have you ever seen one of these?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/wWhQCoC3mGGKwQ1nS6CC9H0xspap.gif"&gt;&lt;img src="https://svbtleusercontent.com/wWhQCoC3mGGKwQ1nS6CC9H0xspap_small.gif" alt="1280px-USDA_organic_seal.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This image on a product is part of a process called “certification.” The image itself is referred to as a “certification mark.” In order to use this image on your product, you apply to a “certification body”, in this case, the &lt;a href="https://www.usda.gov/"&gt;USDA&lt;/a&gt;. This body has set up some kind of tests, and if your product passes them, you gain the ability to say that you’ve passed the certification. I chose organic food on purpose here; most aspects of this certification are about the process by which the food is produced.&lt;/p&gt;

&lt;p&gt;Technology is no stranger to these kinds of processes:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/fMstP8GhZwpMhHxNdZ3aTn0xspap.png"&gt;&lt;img src="https://svbtleusercontent.com/fMstP8GhZwpMhHxNdZ3aTn0xspap_small.png" alt="windows-certified.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So in theory, one could imagine an organization that produces a different kind of document. Instead of a license for the source code, they would provide a way to say uh, let’s go with “Open Development Certified.” Projects could then submit for certification, they’d get accepted or rejected.&lt;/p&gt;

&lt;p&gt;I’m not confident this solution would work, however.&lt;/p&gt;

&lt;p&gt;For one, even though some parts of our industry have accepted certifications, I feel like software developers have a pretty big bias against them. Beyond that, there’s two other major questions: who would do this certification, and how would they determine the criteria? It’s not clear who has the moral authority to suggest that they are the arbiter of what is correct here, and that a majority of people would agree. And then they would have a big job of actually determining what those sets of rules would be. It does have a nice property of a built-in business model; you can charge for application for the certification. But that also has a host of issues. And even if you sort all of that out, it runs afoul of the same “boycott” problems that I talked about above with Free Software. This certification only makes sense if people demand that the software they use is Open Development Certified. I’m not sure that this would be the case.&lt;/p&gt;

&lt;p&gt;Another option is some sort of “Developer Union,” which would put pressure on the companies that those developers work at to contribute back to open source projects. Many developers seem &lt;em&gt;rabidly&lt;/em&gt; anti-union, and tech companies are as well. I’m not sure this is a viable path, today.&lt;/p&gt;
&lt;h2 id="so-where-do-we-go-from-here_2"&gt;So where do we go from here? &lt;a class="head_anchor" href="#so-where-do-we-go-from-here_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;I’m still, ultimately, left with more questions than answers. But I do think I’ve properly identified the problem: many developers conceive of software freedom as something larger than purely a license that kinds in on redistribution. This is the new frontier for those who are thinking about furthering the goals of the free software and open source movements. Our old tools are inadequate, and I’m not sure that the needed replacements work, or even exist.&lt;/p&gt;

&lt;p&gt;Something to think about, though.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:words.steveklabnik.com,2014:Post/rust-has-finally-outgrown-me</id>
    <published>2019-03-29T09:21:52-07:00</published>
    <updated>2019-03-29T09:21:52-07:00</updated>
    <link rel="alternate" type="text/html" href="https://words.steveklabnik.com/rust-has-finally-outgrown-me"/>
    <title>Rust has finally outgrown me</title>
    <content type="html">&lt;p&gt;Today is a very interesting day. It’s giving me a lot of feels. Today is &lt;a href="https://rustlatam.org/"&gt;Rust Latam&lt;/a&gt;, a Rust conference in Montevideo.&lt;/p&gt;

&lt;p&gt;And I’m not there.&lt;/p&gt;

&lt;p&gt;This is significant because, as far as we know, I’m the only person who has been to every Rust conference in existence so far. I went to RustCamp, all three RustConfs, all five RustFests so far, all three Rust Belt Rusts. One RustRush. Am I forgetting any? Thirteen Rust conferences in the past four years.&lt;/p&gt;

&lt;p&gt;I really wanted to attend Rust Latam. The main organizer, Santiago, has been a friend for a very long time. It’s amazing that we’re getting a new conference in this part of the world. There’s been a lot of energy with Rust there for quite a while. It would have been nice to meet all those people whose tweets I’ve seen.&lt;/p&gt;

&lt;p&gt;But in the end, I’m still between jobs (news on that soon, hopefully!), and spending that money would be irresponsible. I’m just getting settled in Austin, and it’s nice to stay in one place for a little while. I didn’t only attend Rust conferences last year, I attended many more. I missed Thanksgiving with my friends, because I was at a conference. I made five trips in October last year; Eastern Europe, then San Francisco, then Michigan, then New York (for a conf, not to stay at home), then Berlin. I did three more in November. I did about twenty conferences, and a few personal trips, last year. I am very tired.&lt;/p&gt;

&lt;p&gt;Don’t get me wrong, I love travel, and plan to do more of it in the future. But I’ve been taking a bit of a breather; I’ve only done four trips so far this year, twice to Europe, twice in the US. But it’s been nice to take a break. For now.&lt;/p&gt;

&lt;p&gt;More importantly, it’s time to let go of the pressure I felt to keep that streak up. Some of those trips really took a toll on me, mentally and physically. Nobody should ever fly from New York to Belarus for 30 hours, then immediately fly to San Francisco for three days, then back to New York. I’m not old, but I’m not as young as I once was, either.&lt;/p&gt;

&lt;p&gt;It’s also time to acknowledge that I cannot do it all on my own. This conference streak is one thing, but Rust has outgrown me in other ways. I used to be on &lt;code class="prettyprint"&gt;#rust&lt;/code&gt; every day, answering almost every question. Then it was both &lt;code class="prettyprint"&gt;#rust-beginners&lt;/code&gt; and &lt;code class="prettyprint"&gt;#rust&lt;/code&gt;. Not to mention all the other channels. I’m not even on IRC anymore. I was on the core team when the core team approved every RFC; now my team very rarely has RFCs. I used to read every single GitHub email on &lt;code class="prettyprint"&gt;rust-lang/rust&lt;/code&gt;, and then &lt;code class="prettyprint"&gt;rust-lang/cargo&lt;/code&gt;, and then all their other libraries. Now I skim &lt;code class="prettyprint"&gt;rust-lang/rust&lt;/code&gt;, and have unsubscribed from a lot of the other repos. I used to know every single production user of Rust. Those times are long gone; I’m starting to get used to hearing “oh yeah our team has been using Rust in production for a while now, it’s great.” The first time that happened, it felt &lt;em&gt;very&lt;/em&gt; strange. Exciting, but strange.&lt;/p&gt;

&lt;p&gt;Back when I first decided I wanted to devote my time to Rust, I used to submit every single blog post about Rust to Hacker News and Reddit, and then answer any question anyone had about things. I diligently did this for &lt;em&gt;years&lt;/em&gt;. I’m slowly letting go of this one, too. We’ll see.&lt;/p&gt;

&lt;p&gt;All of these things are excellent. This is the future I wanted. This is why I spent so much time over the years doing all of this stuff. I did it, mission accomplished. It feels good. But it also feels a little weird. That Rust is bigger than &lt;em&gt;me&lt;/em&gt; is an amazing, wonderful thing.&lt;/p&gt;

&lt;p&gt;I wonder what the next stage of Rust’s growth will feel like.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:words.steveklabnik.com,2014:Post/learning-ada</id>
    <published>2019-03-26T13:04:32-07:00</published>
    <updated>2019-03-26T13:04:32-07:00</updated>
    <link rel="alternate" type="text/html" href="https://words.steveklabnik.com/learning-ada"/>
    <title>Learning Ada</title>
    <content type="html">&lt;p&gt;I decided to try and learn Ada. I love programming languages. This post documents my attempt, and explains what I learned. This is pretty stream of consciousness and basically is a bunch of random notes, so if you hate that, better close the tab. I typed my thoughts up pretty raw, so I may be incorrect in places too. Let me know if you know the answer to something I don’t!&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;The first step, of course, is to google:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://svbtleusercontent.com/72NhELV1orufu8jasf5iiT0xspap.png"&gt;&lt;img src="https://svbtleusercontent.com/72NhELV1orufu8jasf5iiT0xspap_small.png" alt="ada.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Great! I know that Adacore are sort of the stewards of Ada? Vaguely, that might be wrong. Let’s look at all three of those.&lt;/p&gt;
&lt;blockquote class="short"&gt;
&lt;p&gt;Learn.adacore.com is an interactive learning platform designed to teach the Ada and SPARK programming languages.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ah, that’s awesome! No installation needed.&lt;/p&gt;

&lt;p&gt;The second one looks &lt;strong&gt;extremely&lt;/strong&gt; like spam. It does have a page of learning materials that look legit enough. I wonder if this is a low-effort attempt to make money through ads. Or maybe it’s actually good and real and feels outdated, it does have a high google ranking. Upon doing some more research, it seems like the latter. Oops…&lt;/p&gt;

&lt;p&gt;The third one is a parked domain, it apparently expired. Oops.&lt;/p&gt;

&lt;p&gt;Anyway, I’m going to pursue learn.adacore.com&lt;/p&gt;
&lt;h2 id="learnadacorecom_2"&gt;learn.adacore.com &lt;a class="head_anchor" href="#learnadacorecom_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Here’s the initial code presented:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-ada"&gt;with Ada.Text_IO; use Ada.Text_IO;

procedure Learn is

   subtype Alphabet is Character range 'A' .. 'Z';

begin

   Put_Line ("Learning Ada from " &amp;amp; Alphabet'First &amp;amp; " to " &amp;amp; Alphabet'Last);

end Learn;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Okay! This clearly has some style to it. Seems like &lt;code class="prettyprint"&gt;Pascal_Snake_Case&lt;/code&gt;. I’m not super hyped about this, but it’s fine. Syntax discussions are like the tabloids of programming language discussion. They’re fun, but they don’t really have any educational comment. One thing I will point out: are apostrophes used for method calls? Otherwise, this seems to be fairly Pascal like, which I think makes sense given what I know about Ada.&lt;/p&gt;

&lt;p&gt;I can click run and see it execute right there! Awesome.&lt;/p&gt;

&lt;p&gt;There seems to be three sections here: About, Courses, and Books. About is a single page of information that reinforces what I already know:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The Ada programming language was designed from its inception to be used in applications where safety and security are of the utmost importance.&lt;/p&gt;

&lt;p&gt;The SPARK programming language is a formally verifiable subset of the Ada language which allows developers to mathematically prove program correctness through static means. &lt;/p&gt;

&lt;p&gt;Founded in 1994, AdaCore is the leading provider of commercial and open-source software solutions for Ada&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Cool.&lt;/p&gt;

&lt;p&gt;There are two courses, introduction to Ada, and introduction to SPARK. I think SPARK is cool but I’ll learn that after I learn Ada itself. I also do like books, but let’s do that first.&lt;/p&gt;

&lt;p&gt;I’m not going to write everything about the book as I read it, but I will say that I like the basic structure here: first some history, then imperative programming stuff, then talking about types. After that it gets into packages, more type stuff, privacy, generics, exceptions, tasks, interfacing with C, the standard library, and some appendices. This feels pretty logical. Time to do some reading, I’ll jump back here at random points with notes.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The first Ada standard was issued in 1983; it was subsequently revised and enhanced in 1995, 2005 and 2012, with each revision bringing useful new features.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I heard that Ada 2020 is a thing; seems like they’re on a roughly 7-8ish year timeframe generally. Cool.&lt;/p&gt;
&lt;blockquote class="short"&gt;
&lt;p&gt;In terms of modern languages, the closest in terms of targets and level of abstraction are probably C++ and Rust.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;We got a shout-out! That’s nice.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Readability is more important than conciseness. Syntactically this shows through the fact that keywords are preferred to symbols, that no keyword is an abbreviation, etc.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is interesting; it seems to suggest that readability and verbosity are synonymous. I often find concise things easier to read, personally. This is, of course, subjective, and I wonder how I’ll feel after I learn more of the language.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Ada is a multi-paradigm language with support for object orientation and some elements of functional programming, but its core is a simple, coherent procedural/imperative language akin to C or Pascal.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This makes a lot of sense, especially given the time it was created.&lt;/p&gt;

&lt;p&gt;I’m finding it a &lt;em&gt;little&lt;/em&gt; hard to understand what &lt;code class="prettyprint"&gt;main&lt;/code&gt; is. The docs say&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Greet is a procedure, and the main entry point for our first program. Unlike in C or C++, it can be named anything you prefer. The builder will determine the entry point. In our simple example, gprbuild, GNAT’s builder, will use the file you passed as parameter.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It will use it as … parameter? Like, is the fact that we called the file &lt;code class="prettyprint"&gt;greet.adb&lt;/code&gt; the reason it calls &lt;code class="prettyprint"&gt;Greet&lt;/code&gt;? It’s not clear to me at the moment.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Integer'Image is a function that takes an Integer and converts it to a String. It is an example of a language construct known as an attribute, indicated by the “‘” syntax, which will be covered in more detail later.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ah, it’s not a method call, it’s an attribute.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In Ada, an integer type is not specified in terms of its machine representation, but rather by its range. The compiler will then choose the most appropriate representation.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Very interesting. I wonder how well-defined these mappings are, for example, if you need to call a C function, you’re gonna need to give it the correct sized type… I’m sure I’ll get to that.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Mainly for efficiency reasons, while machine level overflow always results in an exception, type level overflows will only be checked at specific boundaries, like assignment:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Okay, &lt;em&gt;this&lt;/em&gt; is the good stuff. Ranged integers are something people always say Ada is better at than Rust; I wondered if this was a static or dynamic check. It &lt;em&gt;is&lt;/em&gt; a dynamic check. Cool. I’ve always wanted to know!&lt;/p&gt;
&lt;blockquote class="short"&gt;
&lt;p&gt;As mentioned previously, every “built-in” type in Ada is defined with facilities generally available to the user.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Pretty cool!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;While unconstrained arrays in Ada might seem similar to variable length arrays in C, they are in reality much more powerful, because they’re truly first-class values in the language. You can pass them as parameters to subprograms or return them from functions, and they implicitly contain their bounds as part of their value. This means that it is useless to pass the bounds or length of an array explictly along with the array, because they are accessible via the 'First, 'Last, 'Range and 'Length attributes explained earlier.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Awesome. This is the way to do it, for sure.&lt;/p&gt;
&lt;blockquote class="short"&gt;
&lt;p&gt;Here is how the string type is defined in Ada:&lt;/p&gt;

&lt;p&gt;&lt;code class="prettyprint"&gt;type String is array (Positive range &amp;lt;&amp;gt;) of Character;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Hmm, what’s a &lt;code class="prettyprint"&gt;Character&lt;/code&gt; though? Let’s try to mess with the example:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-ada"&gt;with Ada.Text_IO; use Ada.Text_IO;

procedure Greet is
   Message : String (1 .. 2) := "😊";
   --        ^ Pre-defined array type.
   --          Component type is Character
begin
   for I in reverse Message'Range loop
      --    ^ Iterate in reverse order
      Put (Message (I));
   end loop;
   New_Line;
end Greet;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here’s the output:&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-text"&gt;Run...
greet.adb:4:04: warning: "Message" is not modified, could be declared constant
greet.adb:4:33: warning: wrong length for array of subtype of "Standard.String" defined at line 4
greet.adb:4:33: warning: "Constraint_Error" will be raised at run time
raised CONSTRAINT_ERROR : greet.adb:4 length check failed
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Hm, wrong length. What is the right length? This particular emoji is four bytes, so let’s try to set it to 5, since we start at 1. Nope that doesn’t work either. What about 4?&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-text"&gt;Run...
the machine running the examples is not responding, please try again later
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Very suspicious. Anyway, I’m guessing it’s ASCII, maybe it’ll tell me later.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;One last feature of Ada arrays that we’re going to cover is array slices. It is possible to take and use a slice of an array (a contiguous sequence of elements) as a name or a value.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Hell yeah, I love slices.&lt;/p&gt;
&lt;blockquote class="short"&gt;
&lt;p&gt;Ada has multidimensional arrays, which are not covered in this course. Slices will only work on one dimensional arrays.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ah, bummer. I guess I’ll have to read up on those separately.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Returning variable size objects in languages lacking a garbage collector is a bit complicated implementation-wise, which is why C and C++ don’t allow it, prefering to depend on explicit dynamic allocation / free from the user.&lt;/p&gt;

&lt;p&gt;The problem is that explicit storage management is unsafe as soon as you want to collect unused memory. Ada’s ability to return variable size objects will remove one use case for dynamic allocation, and hence, remove one potential source of bugs from your programs.&lt;/p&gt;

&lt;p&gt;Rust follows the C/C++ model, but with safe pointer semantics. However, dynamic allocation is still used. Ada can benefit from an eventual performance edge because it can use any model.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Hmmm, I wonder &lt;em&gt;how&lt;/em&gt; it is doing this. Doesn’t that still dynamically allocate in Ada?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Ada doesn’t have a tuple construct and does not allow returning multiple values from a subprogram (except by declaring a full-fledged record type). Hence, a way to return multiple values from a subprogram is to use out parameters.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I love tuples, oh well.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;While reading an out variable before writing to it should, ideally, trigger an error, imposing that as a rule would cause either inefficient run-time checks or complex compile-time rules. So from the user’s perspective an out parameter acts like an uninitialized variable when the subprogram is invoked.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Hmmmmmmmmmmmmmmmmmm. This seems &lt;em&gt;extremely&lt;/em&gt; against Ada’s safety focus.&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-ada"&gt;with Ada.Text_IO; use Ada.Text_IO;

procedure Outp is
   procedure Foo (A : out Integer) is
   begin
      Put_Line (Integer'Image (A));
   end Foo;
   A : Integer := 12;
begin
   Foo(A);
end Outp;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;gives&lt;/p&gt;

&lt;pre&gt;&lt;code class="prettyprint lang-text"&gt;Run...
outp.adb:4:19: warning: formal parameter "A" is read but never assigned
outp.adb:10:08: warning: "A" modified by call, but value might not be referenced
32514
2 errors.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Each time I run it, I get a different number. Seems bad?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There are two ways in which Ada helps shield programmers from the dangers of pointers:&lt;/p&gt;

&lt;p&gt;One approach, which we have already seen, is to provide alternative features so that the programmer does not need to use pointers. Parameter modes, arrays, and varying size types are all constructs that can replace typical pointer usages in C.&lt;/p&gt;

&lt;p&gt;Second, Ada has made pointers as safe and restricted as possible, but allows “escape hatches” when the programmer explicitly requests them and presumably will be exercising such features with appropriate care.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Seems great! I’m very here for this.&lt;/p&gt;

&lt;p&gt;… but they have &lt;code class="prettyprint"&gt;null&lt;/code&gt;. Of course they do, given the timeframe Ada was developed. Oh well.&lt;/p&gt;

&lt;p&gt;Okay, so &lt;code class="prettyprint"&gt;new&lt;/code&gt; is a keyword, and is in the language. But freeing is an unsafe standard library API? I guess this makes sense, similarly to how leaking memory isn’t unsafe in Rust. Feels weird, though.&lt;/p&gt;

&lt;p&gt;I guess, reading more, the idea is that you should basically never need to do this yourself. I think this is where I was getting caught up earlier with the “return an unknown type” bit too. It &lt;em&gt;is&lt;/em&gt; allocating, but since you’re not typing &lt;code class="prettyprint"&gt;new&lt;/code&gt;, you’re not responsible, and so that’s safer. That makes sense. I hope my understanding is correct here, but I’m not totally sure.&lt;/p&gt;

&lt;p&gt;This does mean that it feels like allocations exist, but are hidden from you, the user. That’s okay, but it’s very different than Rust.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Ada’s variant records are very similar to Sum types in functional languages such as OCaml or Haskell. A major difference is that the discriminant is a separate field in Ada, whereas the 'tag’ of a Sum type is kind of built in, and only accessible with pattern matching.&lt;/p&gt;

&lt;p&gt;There are other differences (you can have several discriminants in a variant record in Ada). Nevertheless, they allow the same kind of type modeling as sum types in functional languages.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is pretty cool.&lt;/p&gt;

&lt;p&gt;The “Character Types” section still does not explain to me what valid characters are. Oh well. Googling it gives me &lt;a href="https://www.adaic.org/resources/add_content/standards/05rm/html/RM-3-5-2.html"&gt;this&lt;/a&gt; which says&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The predefined type Character is a character type whose values correspond to the 256 code positions of Row 00 (also known as Latin-1) of the ISO/IEC 10646:2003 Basic Multilingual Plane (BMP). Each of the graphic characters of Row 00 of the BMP has a corresponding character_literal in Character. Each of the nongraphic positions of Row 00 (0000-001F and 007F-009F) has a corresponding language-defined name, which is not usable as an enumeration literal, but which is usable with the attributes Image, Wide_Image, Wide_Wide_Image, Value, Wide_Value, and Wide_Wide_Value; these names are given in the definition of type Character in A.1, “The Package Standard”, but are set in italics.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ah. Yeah so that’s why the emoji didn’t work. Did that crash the compiler earlier, is that what was happening?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Generic subprograms or packages can’t be used directly. Instead, they need to be instantiated, which we do using the new keyword, as shown in the following example:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Wait, is this the same &lt;code class="prettyprint"&gt;new&lt;/code&gt; keyword as before? Do generics require heap allocation? That is a reasonable design, I’m just a bit surprised.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Ada exceptions are not types, but instead objects, which may be peculiar to you if you’re used to the way Java or Python support exceptions.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I found this sentence confusing; aren’t the objects in Java or Python as well? When I was reading this sentence, halfway through, I thought to myself “oh, like the stuff I know, cool” and then the second half was “this is unlike the stuff you know”. Hrm.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A task can be thought as an application that runs concurrently with the main application. In other programming languages, a task can be called a thread, and tasking can be called multithreading.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Cool, this is a big topic I’ve been wondering about.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;As we’ve just seen, as soon as the main task starts, its subtasks also start automatically. The main task continues its processing until it has nothing more to do. At that point, however, it will not terminate. Instead, the task waits until its subtasks have finished before it allows itself to terminate. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ah interesting, this is different than Rust. Well, Rust’s standard library, anyway.&lt;/p&gt;

&lt;p&gt;I wish it explained if tasks &lt;em&gt;are&lt;/em&gt; system threads, or if they’re green threads.&lt;/p&gt;

&lt;p&gt;I did some googling, and apparently this is implementation-defined. GNAT uses system threads for some of the same reason that Rust decided to expose system threads. Seems good.&lt;/p&gt;
&lt;blockquote class="short"&gt;
&lt;p&gt;The pragma Assertion_Policy statement is used to force the compiler to generate code to check the precondition. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Design by contract works at runtime. This is something I always thought was true, but was never actually sure of. Cool.&lt;/p&gt;
&lt;blockquote class="short"&gt;
&lt;p&gt;To interface with C’s built-in types, we use the Interfaces.C package, which contains most of the type definitions we need. For example:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ah ha, this answers my question from earlier. Cool.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Object-oriented programming (OOP) is a large and ill-defined concept in programming languages and one that tends to encompass many different meanings because different languages often implement their own vision of it, with similarities and differences from the implementations in other languages.&lt;/p&gt;

&lt;p&gt;However, one model mostly “won” the battle of what object-oriented means, if only by sheer popularity. It’s the model used in the Java programming language, which is very similar to the one used by C++. Here are some defining characteristics:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Spicy! But not incorrect.&lt;/p&gt;

&lt;p&gt;Dot notation exists! But only if you’re actually using objects, er, “tagged types”.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:words.steveklabnik.com,2014:Post/the-culture-war-at-the-heart-of-open-source</id>
    <published>2019-03-26T09:11:45-07:00</published>
    <updated>2019-03-26T09:11:45-07:00</updated>
    <link rel="alternate" type="text/html" href="https://words.steveklabnik.com/the-culture-war-at-the-heart-of-open-source"/>
    <title>The culture war at the heart of open source</title>
    <content type="html">&lt;p&gt;There’s a war going on. When isn’t there a war going on? But I’m not talking about a physical war here: I’m talking about a war over meaning. This particular war is a fight over what “open source” means.&lt;/p&gt;

&lt;p&gt;Let’s take a few steps back.&lt;/p&gt;
&lt;h2 id="the-free-software-foundation_2"&gt;The Free Software Foundation &lt;a class="head_anchor" href="#the-free-software-foundation_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;People organize into groups for many reasons. This story starts with the story of an organization called the “GNU Project.” It was started in 1983, and &lt;a href="https://groups.google.com/forum/#!msg/net.unix-wizards/8twfRPM79u0/1xlglzrWrU0J"&gt;here’s the initial announcement on USENET&lt;/a&gt;. I’ve pulled out four important paragraphs:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Starting this Thanksgiving I am going to write a complete&lt;br&gt;
Unix-compatible software system called GNU (for Gnu’s Not Unix), and&lt;br&gt;
give it away free to everyone who can use it.  Contributions of time,&lt;br&gt;
money, programs and equipment are greatly needed.&lt;/p&gt;

&lt;p&gt;I consider that the golden rule requires that if I like a program I&lt;br&gt;
must share it with other people who like it.  I cannot in good&lt;br&gt;
conscience sign a nondisclosure agreement or a software license&lt;br&gt;
agreement.&lt;/p&gt;

&lt;p&gt;So that I can continue to use computers without violating my principles,&lt;br&gt;
I have decided to put together a sufficient body of free software so that&lt;br&gt;
I will be able to get along without any software that is not free.&lt;/p&gt;

&lt;p&gt;If I get donations of money, I may be able to hire a few people full or&lt;br&gt;
part time.  The salary won’t be high, but I’m looking for people for&lt;br&gt;
whom knowing they are helping humanity is as important as money.  I view&lt;br&gt;
this as a way of enabling dedicated people to devote their full energies to&lt;br&gt;
working on GNU by sparing them the need to make a living in another way.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;There’s a lot of different ways to talk about this post: it contains all sorts of interesting things. But for right now, I want to talk about the motivations here. There were two main ones: first, to produce a software artifact. The second one is the big one: the artifact needs to be produced because existing ones were not compatible with a particular set of values.&lt;/p&gt;

&lt;p&gt;The word “ideology” is a tricky one, but let’s go with this definition, which is &lt;a href="https://en.wikipedia.org/wiki/Ideology"&gt;from Wikipedia&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote class="short"&gt;
&lt;p&gt;An ideology is a collection of normative beliefs and values that an individual or group holds for other than purely epistemic reasons.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The GNU project was formed to produce software according to a particular ideology: one of sharing software. I’m not here to argue if the project has accomplished this goal, or if this goal is good or not. My point is that the origins of the GNU project were specifically motivated by a collection of normative beliefs and values.&lt;/p&gt;

&lt;p&gt;Two years later, the Free Software Foundation would be formed to support the GNU project, and promote the concept of Free Software. Free Software was software that aligns with the ideology of the GNU project, and a definition of Free Software was created and published in Feburary of 1986. Here is that definition:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The word “free” in our name does not refer to price; it refers to freedom. First, the freedom to copy a program and redistribute it to your neighbors, so that they can use it as well as you. Second, the freedom to change a program, so that you can control it instead of it controlling you; for this, the source code must be made available to you.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Since then, the Free Software Definition has expanded to four points. You can read the current definition &lt;a href="https://www.gnu.org/philosophy/free-sw.en.html"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="open-source-appears_2"&gt;Open Source appears &lt;a class="head_anchor" href="#open-source-appears_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;A decade passes, and trouble is brewing. I’ll &lt;a href="https://en.wikipedia.org/wiki/Open_source#Origins"&gt;quote wikipedia again&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[T]he modern meaning of the term “open source” was first proposed by a group of people in the free software movement who were critical of the political agenda and moral philosophy implied in the term “free software” and sought to reframe the discourse to reflect a more commercially minded position. In addition, the ambiguity of the term “free software” was seen as discouraging business adoption. The group included Christine Peterson, Todd Anderson, Larry Augustin, Jon Hall, Sam Ockman, Michael Tiemann and Eric S. Raymond. Peterson suggested “open source” at a meeting held at Palo Alto, California, in reaction to Netscape’s announcement in January 1998 of a source code release for Navigator. Linus Torvalds gave his support the following day, and Phil Hughes backed the term in Linux Journal.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here we see the creation of the open source movement. If you’d prefer a primary source, here’s &lt;a href="http://www.catb.org/%7Eesr/open-source.html"&gt;Eric S. Raymond&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Specifically, we have a problem with the term “free software”, itself, not the concept. I’ve become convinced that the term has to go.&lt;/p&gt;

&lt;p&gt;The problem with it is twofold. First, it’s confusing; the term “free” is very ambiguous (something the Free Software Foundation’s propaganda has to wrestle with constantly). Does “free” mean “no money charged?” or does it mean “free to be modified by anyone”, or something else?&lt;/p&gt;

&lt;p&gt;Second, the term makes a lot of corporate types nervous. While this does not intrinsically bother me in the least, we now have a pragmatic interest in converting these people rather than thumbing our noses at them. There’s now a chance we can make serious gains in the mainstream business world without compromising our ideals and commitment to technical excellence – so it’s time to reposition. We need a new and better label.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Shortly after, the &lt;a href="http://opensource.org"&gt;Open Source Initiative&lt;/a&gt; was founded. A sort of mirror of the FSF, the OSI would support the promotion of the term “open source,” and the ideology behind it. Like the Free Software Definition, the &lt;a href="https://opensource.org/osd"&gt;Open Source Definition&lt;/a&gt; was created, derived from Debian’s guidelines for producing Free Software.&lt;/p&gt;

&lt;p&gt;Again, we have an organization that’s created along ideological lines. But in this case, slightly different ones. &lt;a href="https://web.archive.org/web/20090413035630/https://opensource.org/history"&gt;An older version of the OSI website says&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The conferees decided it was time to dump the moralizing and&lt;br&gt;
confrontational attitude that had been associated with “free software”&lt;br&gt;
in the past and sell the idea strictly on the same pragmatic,&lt;br&gt;
business-case grounds that had motivated Netscape.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://opensource.org/history"&gt;Today’s version says&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The conferees believed the pragmatic, business-case grounds that had motivated Netscape to release their code illustrated a valuable way to engage with potential software users and developers, and convince them to create and improve source code by participating in an engaged community. The conferees also believed that it would be useful to have a single label that identified this approach and distinguished it from the philosophically- and politically-focused label “free software.” &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The idea here is plain: Free Software, but for business.&lt;/p&gt;

&lt;p&gt;For more on this topic, I recommend &lt;a href="https://thebaffler.com/salvos/the-meme-hustler"&gt;The Meme Hustler&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="moving-forward_2"&gt;Moving forward &lt;a class="head_anchor" href="#moving-forward_2"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Twenty years have passed, and a lot has changed.&lt;/p&gt;

&lt;p&gt;For ideological movements to persist, they need to re-produce their values in new membership. And for a while, the FSF and OSI did a good job of that. These two movements, Free Software and Open Source, produced a lot of software, and gained a lot of new converts. But then… something happened.&lt;/p&gt;

&lt;p&gt;I’m not sure exactly how it happened. I think the lazy answer is “GitHub!!!!”. I do think GitHub played a role, but I think the answer is more complex than that. I personally think that gender plays a huge role. But that’s a different essay. Regardless of &lt;em&gt;why&lt;/em&gt; it happened, something did happen.&lt;/p&gt;

&lt;p&gt;Somewhere along the way, Open Source ran into a problem that many movements face: the members of the movement no longer understood the ideology that created the movement in the first place.&lt;/p&gt;

&lt;p&gt;If you ask a random developer what “open source” means to them, you won’t often hear “software that follows the Open Source Definition.” If you ask them “what’s the difference between free software and open source software,” you’ll often hear “aren’t those the same thing?” or “you can charge money for open source software, it’s not always free.” You may even hear “it’s on GitHub.”&lt;/p&gt;

&lt;p&gt;In talking to developers about open source, you’ll also hear something else. Something that’s been itching in the back of my brain for a while, and the thing that led me to write this. You’ll often hear developers talk about how the relationship between businesses and open source developers is messy. Complicated. Businesses don’t “give back enough,” won’t pay people to work on open source. That it’s all take and no give. I’ve said a lot of that stuff myself.&lt;/p&gt;

&lt;p&gt;But here’s the thing: that’s why the concept of open source was created in the first place. It’s there, plain as day, if you ask the folks who actually created it. Open source was a way to make free software better for businesses. This doesn’t mean that it’s beyond critique, of course. The relationship can improve. I don’t think these developers are stupid, or hypocrites.&lt;/p&gt;

&lt;p&gt;This is where we’re at today. The Free Software movement was created, and then Open Source was created as a reaction to that. Today’s developers have never learned about this history, or don’t care about it, or actively think it’s irrelevant. And so we have a war. A war for the meaning of open source. A war fought with tweets, and blog posts, and discussions. A war between the old guard, those who created the idea originally, and the new generation, the developers who have taken the base idea and run with it.&lt;/p&gt;

&lt;p&gt;I think history will repeat itself. In the same way that the open source movement said “we’re like free software, but with these changes,” I think we’ll end up with a new movement. For the same reasons that “open source” came up with a new name, I think the movement that will arise from today’s developers will also need a new name. I’m not sure what that movement will look like, and I’ll explore why in another post. To give you a teaser: the problem is in the way that both Free Software and Open Source are formulated. The rot is in the roots, and I’m not yet sure what will replace it.&lt;/p&gt;
</content>
  </entry>
</feed>
