Crank-‘em Out

For a time, I tried to cultivate an interest in Go. Not this Go, but this Go. The interest didn’t last long – like chess, I had a hard time getting up to even a fairly basic level of competence. And I quickly developed another enthusiastic interest to replace it – sometimes, an interest just doesn’t work out, and it’s nobody’s fault, and you have to just move on and not get too sad, because there’s plenty of fish in the sea.

The Good Ol' Days of QBasic Nibbles

Let’s talk about an ancient programming language! I think we can all learn things from history, and it gives us grounding to realize that our time is just one time among many, to see what people in the past did differently, what they got wrong that we would never do now, and also to see what they got right. Do you remember MS-DOS? Do you remember that it came with an interpreted programming language?

Warnings and Linter Errors: The Awkward Middle Children

What is “bad” Rust? When we say that a snippet of code is “bad” Rust, it’s ambiguous. We might on the one hand mean that it is “invalid” Rust, like the following function (standing on its own in a module): fn foo(bar: u32) -> u32 { bar + baz // but baz is never declared... } In this situation, a rule of the programming language has been violated. The compiler stops compiling and does not output a binary.

Haskell Error Messages: Come on!

I am a big fan of strongly typed languages, and my favorite GC’d language is Haskell. And I want you, the reader, to keep that in mind today. What I am writing is some commentary about a language I deeply love, some loving criticism. So here’s what happened: A few days ago, I was showing off some Haskell for a friend who primarily programs in Python. The stakes were high – could I demonstrate that this strange language was worth some investigation?

Mortgages are Interesting

I just bought a house, and it came with a mortgage. I bought the house and committed to the mortgage all in one ceremony, in a cute little office where I signed enough papers that the sellers were able to solemnly hand me the keys to my new castle. In the lead-up to this, I was told how early payments, mortgage insurance, and refinancing works, and it’s – I think very reasonably – been on my mind since.

Burying the Lede

Imagine you don’t know who Napoleon was. You know he’s a figure from history, but you don’t even know he has to do with France. And imagine, when you read the Wikipedia article, for some reason you skip the opening paragraphs above the fold, and you’re reading about his upbringing in Corsica as a petty Italian noble under French rule. And you just want to know, why’s this guy important, what’s his deal, why do people keep talking about him (something military, it seems?

Being Fair about Memory Safety and Performance

For this next iteration in my series comparing Rust to C++, I want to talk about something I’ve been avoiding so far: memory safety. I’ve been avoiding this topic so far because I think it is the most discussed difference between C++ and Rust, and therefore I felt I’d have relatively little to add to the conversation. I’ve also been avoiding it because I wanted to draw attention to all the other little ways in which Rust is a better-designed programming language, to say that even if you concede to the C++ people that Rust isn’t “truly memory safe” or “memory safe enough,” Rust still wins.

In Defense of Async: Function Colors Are Rusty

Finally in 2019, Rust stabilized the async feature, which supports asynchronous operations in a way that doesn’t require multiple operating system threads. This feature was so anticipated and hyped and in demand that there was a website whose sole purpose was to announce its stabilization. async was controversial from its inception; it’s still controversial today; and in this post I am throwing my own 2 cents into this controversy, in defense of the feature.

Endianness, API Design, and Polymorphism in Rust

I have been working on a serialization project recently that involves endianness (also known as byte order), and it caused me to explore parts of the Rust standard library that deals with endianness, and share my thoughts about how endianness should be represented in a programming language and its standard library, as I think this is also something that Rust does better than C++, and also makes for a good case study to talk about API design and polymorphism in Rust.

C++ Move Semantics Considered Harmful (Rust is better)

This post is part of my series comparing C++ to Rust, which I introduced with a discussion of C++ and Rust syntax. In this post, I discuss move semantics. This post is framed around the way moves are implemented in C++, and the fundamental problem with that implementation, With that context, I shall then explain how Rust implements the same feature. I know that move semantics in Rust are often confusing to new Rustaceans – though not as confusing as move semantics in C++ – and I think an exploration of how move semantics work in C++ can be helpful in understanding why Rust is designed the way it is, and why Rust is a better alternative to C++.