strugee.net

Posts categorized as "musings"

Shell script is one of the purest forms of human expression

While I was at the Recurse Center, I came up with an interesting theory, and today I thought I'd finally formally write about it on my blog. Here it is: shell script is one of the purest forms of human expression, at least as far as technology is concerned.

Why? Well, shell script is this weird mix of actual programming language things and macro expansions, and even the programming things tend to be... odd, to put it politely. As a trivial example, did you know that this:

$ echo {1..10}

results in this output:

1 2 3 4 5 6 7 8 9 10

Shell scripts[1] know how to expand number sequences; it's just built-in to them. Variables work with substitution too, and you can even build commands with them:

PAGER=less
$PAGER longfile.txt

The key thing to note here is that the second line is replacing $PAGER with the literal text less, and then running the resulting command line. The "variable access" is basically just an inline macro expansion, and the shell doesn't really handle it very intelligently. (This is also why you often need to quote variables when you access them - if they have whitespace in them, the shell will interpret the variable as more than one word.)

Or take the type system of the shell: it has none[2]. For example, what does 0 mean? It could represent any one of these things:

  1. The number 0
  2. The string "0"
  3. A binary we're invoking (well, trying to invoke) called 0
  4. An argument to a binary
  5. File descriptor 0 (stdin)
  6. A file named 0

All of these things combine to make the shell incredibly flexible and powerful - you can often express a lot in shell script with very little characters by writing "macros" in the right way.

It's also what makes shell such a god-awful programming language.

Think about it - as programmers, much of what we do seeks to impose order on our systems. We lint our code and run it through style checkers. I personally like to turn up my linter settings to maximum. And we use the concept of types to help organize our code - sure, there's disagreement on how much order types should impose, but we all pretty much agree that there should be some concept of types and type safety. Hell, for the languages whose type systems are basically "wtf are types", we make tools to impose additional safety on top of that - take TypeScript and Flow, for example. We also love to (hate to) write tests to ensure that our code fulfills some interface or behavior contract. (Even the idea of an interface seeks to organize and compartmentalize complexity in the system.)

Humans are inherently messy. We're scatterbrained and easily distracted, and our thoughts (or at least, my thoughts) tend to jump all over the place. Shell script is an amazing way to express your ideas because it lets you get directly to the goal so quickly, in a way that matches that messiness that defines us as a species. But since so much of our work as programmers is about trying to counteract our messiness, shell script is a terrible way to write real programs, for the exact. Same. Reason.

Footnotes:

[1]: Those written in bash, at least.

[2]: Note that this is different from having a type system of "wtf are types?? wat" - JavaScript is a good example of a language with such a type system, as is (to my understanding) PHP. The shell, on the other hand, has no type system at all.


Graduation 2017: reflections on 365 days of gap yearing

Tonight marks the end of the high school careers for everyone in Seattle Academy's Class of 2017. Congratulations to everyone who graduated tonight - you deserve it, seriously. To my friends in particular, I'm so proud of you guys! You're completely amazing, you've done such incredible things and I love you very much.

Attending the Class of 2017's graduation was super strange for me too, honestly, because I'm such a radically different person than back when I was on that stage.

This year I put out several major releases (and a couple minor ones too) of pump.io, the decentralized social networking software I maintain; I became an Invited Expert at the World Wide Web Consortium and I wrote the software that powers this blog - Stratic - from scratch. I spoke at some major technical conferences on pump.io and Stratic, too. But mostly what I was thinking about tonight was all the personal development I went through. As some who are close to me in real life know (particularly those who were there), a year ago I was relatively seriously depressed. There were actually a lot of reasons for this, but one of the most important was the trouble I had dealing with change - the biggest change, of course, being leaving high school: somewhere familiar, somewhere with friends.

I vividly remember sitting in the seats just under the stage in McCaw Hall the day of graduation as the SAAS people running the show showed us where to walk and what to do. I leaned over to my friend and said, "I don't think I'll understand what's happening here for a very long time," to which she said, "what, like where we walk and stuff?" I chuckled and said nevermind, because what I was really referring to was what was happening in a grander sense - what this event really meant and was for, on the scale of years and decades (I couldn't find words for this at the time).

I don't really know what it felt like to walk out on stage for other people (both this year and last year) but for me, it seemed almost trivial, like a non-event. It didn't feel nearly as momentous as it seemed like it should. Based on my description my therapist would later refer to it as a foregone conclusion, a description that stuck with me given how accurately it seemed to verbalize what I was feeling. It just didn't feel big, but I knew that it was. In the grand sense, I just really didn't understand what was happening.

Tonight, watching the Class of 2017, I think I started to get it. The crux of my personal development was being at the Recurse Center. In fact, applying to and attending the Recurse Center was without a shadow of a doubt the highlight of not just my year but my entire life. I love my friends and teachers at SAAS very deeply, and I still think going to SAAS was a great choice. But at the Recurse Center, I felt at home, like I belonged, in a way I just never felt in high school. Plus, it felt pretty great to live on my own in New York City, feeling like I knew my way around the subway system[1], how to get food for myself (whether at the supermarket to cook or from nearby restaurants), and just what it felt like to live in such an amazing place.

There was a moment in senior year, in Jason's English class, when I was thinking about my then-sophomore friends and wondering if I'd see them in ten or even twenty years. After all, they'd probably have separate class reunions. And right as I started to wonder what we'd all even be like then, it hit me that the idea of "growing up" is bullshit. No one is ever truly "grown up"; people just slide along a scale from toddler to wise elder. Every human always will be and always has been a work in progress - always growing, always changing. I am incredibly proud of all the technical work I did this year. I am unbelievably grateful and happy to have made so many amazing friends at the Recurse Center, and I feel very lucky to have such good mental health - mentally I'm probably in the best place I've ever been in my whole life. But even with all that, I know I'm still young. I still have lots of room to grow and there are more exciting opportunities ahead of me than ever.

When everyone's in the middle of something, I think they get lost in the moment. In my senior year, my whole life was structured around being in senior year; at the Recurse Center, my whole life revolved around the Recurse Center. Essentially, I'm describing the act of putting your head down and concentrating on something. So maybe what graduation (and important events like it) is really about is a chance to suspend time; to not be lost in the moment. A chance to, just for a second, not have your life revolve around anything in particular and instead, look at yourself and the way you've changed and continue to change over your lifetime. Like a character arc. It really is amazing, and in a way, isn't that implicitly what graduation's saying anyway? Graduation is an event designed to celebrate everything that the people on stage have accomplished - and in order to celebrate something, you have to sit back and look at it.

It was honestly wild to watch the people on stage talk about each other and their lives for the past four years, recalling both the time when I felt the exact same way they do now as well as just how much I, and my perspective, have changed. To the Class of 2017, as someone who was in your shoes a year ago - I know I sound stupid and clichéd, but your world is about to become so much bigger than you can imagine. SAAS, which once seemed like such a monumental, immovable part of your life, will instead become small (though still important). At least, that's what happened to me. I hope it does for you, too. And I'm really excited for you guys.

Congratulations once again. You guys freaking did it.

Footnotes:

[1]: the operative word being "feeling", because I almost certainly didn't know my way around nearly as well as I felt I did


Gender representation at RC

So I want to talk (real quick) about gender representation in tech. Specifically, the fact that it's abysmal. Women[1] usually account for, at most, 30% of the employees in a company and that number is often much lower. Even at the companies where it's 30%, that number is misleading because it doesn't adress management positions which are often much lower. (For reference, women accounted for about 59% of the overall workforce as of 2015, when the article I pulled those numbers from was published.) Here's an article that says that on average, women leave the industry within 7 years of being in it. Let me repeat that, because I didn't say they leave their jobs, or take a break. They completely leave the entire technology industry. And unfortunately it makes sense, since incidents of sexism in tech are rampant.

Unlike (most of) the rest of the tech world, the Recurse Center is mostly (completely?) gender-balanced. I want to point out that while for years I've believed in diversity, it didn't become clear to me how much implicit bias I held until I joined RC. I find that, having previously spent significant amounts of time in environments that were predominantly white, cis and male, I find myself needing to self-correct discriminatory and gender-based unconscious assumptions significantly less frequently at RC. In other words, my subconscious is making less incorrect, gender-based suggestions about what people are like that I then have to consciously reject. I would attribute this almost 100% to the fact that at RC I'm surrounded by lots of people who are a) super talented and know their shit and b) aren't male.

If I have a point to this blog post (and I'm not sure that I do), it'd be to underscore what many have said before me: representation and role models are important. Advocating for gender equality is good and important, but in the end what really matters is what's actually in people's heads. That's mostly influenced by what they see in their immediate lives, and that's why representation is so important - believing in equality is great, but presenting actual evidence to your subconscious that its biases are incorrect is a much more powerful way to improve the way you perceive the world.

If folks have any comments or different perspectives, I'd love to hear them privately or via WebMention.

[1]: I'm focusing on women here because I'm not aware of any statistics about non-binary people in tech. But it's worth noting that it's a huge problem for them, too.

Update February 22nd: the lovely Rachel Vincent from RC faculty says this about RC's gender-balancing:

Of the folks who are currently in-batch (Winter 2's and Spring 1's), ~36% identify as women. It's roughly the same for the community as a whole (~33%), though we don't have super accurate numbers because we don't update information on folks' gender. The most gender balanced batches were a little over 40% women. We're always pushing for 50/50, though. 😊 Our overall strategy is to try to get an applicant pool that is as gender balanced as possible, and we don't do any kind of balancing during the admissions process itself.


Surveillance priorities

For several years now I've been really interested in technology policy - things like security, privacy and censorship, and especially how those things relate to both mass surveillance and freedom-respecting software. That's why I follow organizations like Fight for the Future and the EFF, and why I e.g. participated in the movement to stop SOPA and PIPA, the internet censorship bills.

But a week or so ago I had a realization: I'm not interested in surveillance law anymore.

It's clear to me that Congress is completely busted. The 113th Congress came very, very close to being the least productive Congress in modern history. Our current Congress isn't particularly good either, although they are (as far as I know) not as bad as the 113th - but they're still not good enough that I'm confident in their ability to actually, you know, pass laws. Even if we could get Congress to pass laws at all, it's unclear whether we could actually get them to pass laws curtailing mass surveillance. Over and over again we see Congress trying to pass misguided laws that weaken encryption, damage the DNS, and do all sorts of other seriously nasty (and hacky!) things - it just doesn't seem very reasonable to me to assume that they'd change their minds and decide to do (what we think is) the right thing[1].

This is why I'm not interested in surveillance law anymore. I find it to be a waste of time. Instead, I've shifted my focus towards systems that are fundamentally designed to resist surveillance and censorship. That's why I advocate for Signal and why I work on pump.io: because these are both systems designed from the ground up to, among other things, essentially be unaffected by surveillance law. Who cares if Congress passes a law that says they can surveil pump.io users? Congress saying a bunch of words doesn't change the fact that technically speaking, that's quite hard to do. Certainly it's more difficult than surveilling e.g. Facebook.

As Moxie Marlinspike puts it in this talk on PKI's flaws and an alternative system called Convergence:

And, you know, with this legislation that's been coming up recently like COICA and PROTECT IP and this kind of thing, you know - to me the real lesson here isn't whether this passes or not because there's been, you know, some kind of heroic efforts to prevent this legislation from going through. But I think, you know, the thing to take away from this is that they're trying. To pass regulation that messes with this stuff. And maybe one day they'll succeed.

Trying to make Congress do the right thing is, I feel, akin to an endless arms race: they don't seem to be getting the message and it's doubtful that they'll stop in the near- or medium-term future.

A much better solution is this: implement secure-by-default, freedom-respecting, encrypted and/or federated systems, and be done. Forever.

[1]: honestly, I think a big problem with this is that a lot of Congress is old white guys. Emphasis on old. The problem of people in the legal sphere not understanding technology, especially technology relating to security, privacy and encryption, has cropped up before. Consider, for example, the judge who ruled that a Tor user had "no reasonable expectation of privacy" because he literally could not wrap his head around how Tor worked and what the FBI did.


Where we're headed (a.k.a. I'm worried)

(These are some thoughts I've had after reading To Combat Trump, Democrats Ready a G.O.P. Tactic: Lawsuits in the New York Times.)

I'm worried.

I'm worried about my country.

Believe it or not, I'm not talking about Trump. Of course he's horrible, and he's something to be seriously worried about, but I think he's really only a symptom of a much deeper issue in America, which is this: we are in an arms race with ourselves. (One might also describe it as civil war.)

I mean, think about it. Republicans (I'll get to Democrats in just a sec) have spent the last 8 years creating and perfecting tools to block legislation from going through. Government is about compromise, and they refuse to compromise. They shut down the government for cheap political points[1], continually and covertly passed almost-but-not-quite-unconstitutional antiabortion laws, and topped it all off with a taxpayer-funded lawsuit againt President Obama - just to name a few malicious maneuvers they've used.

Now that Republicans control both Congress and the White House, Democrats are gearing up to use those exact same tactics against Republicans. It's shameful behavior, and it's unbefitting for a democracy. This country is supposed to be about elected officials finding ways to compromise with each other so that everyone's as happy as possible, but instead it's turned into a situation where everyone is laser-focused on pushing through their full political agenda, no matter how unproductive it is and no matter what the cost.

Here's the big problem: I may think it's shameful behavior, but that doesn't mean I don't support the Dems. I completely support it, because the incoming administration's agenda is completely horrific to me. I support the Democrats' intent to utilize lawsuits because I don't think politics is just a game; it's life-or-death. Somewhere out there, there's a kid who's dying because conversion therapy has pushed them to the brink of suicide. It's a glaring human rights abuse, and Mike Pence wants to fund it.

Republicans may have invented the do-nothing Congress, but now they can't put the genie back in the bottle. The Democrats and the Republicans are now stuck in a legal arms race, and neither of them can turn back because then the other side would destroy them. And that makes me very worried, because if we're in an arms race, that begs the question: what's the breaking point? And what happens when we hit it?

I don't have the answer to these questions. I don't know how to stop us from reaching that breaking point. I dunno, maybe if we were all just... more patient? But sadly, that seems extremely unlikely. Sometimes I wonder if there simply isn't anything to be done - if America is the great experiment in democracy, maybe this is just the inevitable failure of that experiment.

All I really know is that we need to do something, and soon. Because if we don't, we will grind ourselves out of existence.

Footnotes:

[1]: we actually know for a fact - from staff present at an early meeting - that none of those orchestrating the shutdown believed it would accomplish anything. They just wanted to score points with their base. This is fact.


~