Thoughts on Testing
Today I was thinking about tests.
Personal website of Brandon Smith
Today I was thinking about tests.
Rust is a low-level language, and its standard library is careful to give the programmer lots of control over how things will behave and avoid implicit behavior, especially when that behavior impacts performance. But at the same time, it doesn't want to make the programmer's life harder than it needs to be. As a result, Rust's language features and standard library often give you access to really…
Hi all. It's been about five months since my last Bagel post, so I wanted to give an update for the handful of you who have been interested/following along (thank you!).
I'm stuck solving a gnarly problem right now, so I thought I'd switch gears and write about a recent win in Bagel's design/implementation that I'm really excited about.
Hooks are weird, and can be hard to reason about. They kind of (but don't actually!) establish a new domain-specific language on top of JavaScript, with its own set of rules and behaviors, and they can make it easy to lose track of what's actually really happening in your code.
It's been about four months since I last posted about Bagel, the new JavaScript-targeted programming language I've been working on. A lot has changed since then, but things are finally crystallizing and getting into a clear-enough space where I feel comfortable sharing some concrete details (and real code!).
This information probably won't be new to you if you've been writing Rust for a bit! But I'm hoping the framing will be useful anyway. It's been useful for me.
I've started working on a programming language.
Over the last year and a half I've gotten really into writing parsers and parser-adjacent things like interpreters, transpilers, etc. I've done most of these projects in JavaScript, and I've settled into a nice little pattern that I re-use across projects. I wanted to share it because I think it's neat, and it's brought me joy, and it could be an interesting or entertaining thing for others to…
Lately I've been seeing lots of anecdotes from people trying to get into Rust who get really hung up on strings (&str, String, and their relationship). Beyond Rust's usual challenges around ownership, there can be an added layer of frustration because strings are so easy in the great majority of languages. You just add them together, split them, whatever! They're primitives that you can do…
There's a well-known quote by author Michael Pollan: "Eat food. Not too much. Mostly plants." I like it because it doesn't attempt to be dogmatic: it encapsulates some basic guiding principles that get you 90% of the way there 90% of the time. Wikipedia describes the book the quote is from (emphasis mine):
I've gotten really into writing parsers lately, and Rust has turned out to be the perfect language for that. In the course of my adventures, I came up with the following:
Can you spot the problem with this piece of code?
I was reading an article the other day about some recent headway being made in type theory. It was exciting stuff; stuff that may one day make systems faster, more reliable, more expressive. It felt very important in a vague way. But it also got me thinking: is this really going to make the world a better place than it was before?
Normally when I write about something on here I take the time to fully think-out a point, make a case, address all the major sides of the issue that I can think of, etc.
In my work I've developed a mental framework related to data modeling, which has helped greatly both when coming up with a model and when making decisions down the road about how to use that model. Here I will establish three different categories of data in software: Constants, State, and Cached Values. By "data" I generally mean "variables in code", but the same principles could be applied to…
Functional programming is all the rage these days. There are piles of Medium posts out there singing its praises, preaching the good word. And for good reason! It can be a powerful paradigm for reducing code duplication and preventing sprawling side-effects.
I was at one point introduced to the recurrent laryngeal nerve. Put simply, this is a nerve that exists in several types of animals, including humans, which instead of taking a very obvious direct path from source to destination, wraps hilariously around a major artery before doubling back and getting on its way:
I decided to rebuild my website from scratch.