Weeknotes 2022 W24: Near-infinite

June 13​–​19, 2022
1100 words

This week has been rather quiet!

I wanted to participate in the ADFC-Sternfahrt but ended up skipping. I looked into it rather last-minute and couldn’t find people to go with, and I suspect it’s not too much fun by yourself. Hopefully, I’ll remember to plan ahead for the 2023 Sternfahrt. Anyone fancy coming along?

I’m still very happy with my Brompton foldable bike. It wasn’t cheap, but it’s by far the best bike I’ve ever owned. When I make large expenses, I typically have a slight bit of regret (“was this really worth it?”) but definitely not with the Brompton.


I have something extremely pedantic to complain about! Specifically, the term “near-infinite.” It has been bothering me lately. Let’s go:

The term “near-infinite” is nonsense! Nothing is near-infinite!

Literally all numbers are closer to zero than to infinity. The biggest number you can think of? Not even remotely close to infinite. Practically zero, in fact, in the grander scheme of things.

The estimated number of stars in the entire observable universe is 200 sextillion stars. A number so large it is beyond human comprehension. Wow, that sure sounds like a near-infinite amount, right? Not so much! That number is closer to zero than to infinity.

What about the number of particles in the universe? That number is estimated to be 10⁸⁰. Yes, that number is very, very, veryveryvery large. That’s a hundred quinvigintillion, Wikipedia tells me. Wild! Is it near-infinite though? Not quite: it’s still closer to zero than to infinity.

Look, I’m not suggesting that we replace uses of “near-infinite” with “near-zero,” even though it would absolutely be more correct. From a marketing perspective, it wouldn’t be the best idea to describe, for example, a highly customizable blogging platform as offering “near-zero personalization options.” That would be technically correct, just not very useful.

All right. That’s enough pedantry. For now.


There’s some progress in my programming language implementation. I’ve tentatively called it Gex, because:

In last week’s week­notes, Week­notes 2022 W23: Gardening leave, I wondered whether “[compiling to machine code is] the road I want to go down” — and guess what, I have started playing around with LLVM.

Oof. Compiling a language, even to a high-level assembly language like the one LLVM provides, is tough.

So far, I’ve gotten to the point where I can compile a simple fib program:

fn fib(a: Int32) -> Int32 {
  if (a < 2) {
    return 1;
  }

  return fib(a - 1) + fib (a - 2);
}

fn main() {
  println_int32(fib(35));
}

That one compiles and runs in ~150ms. The Ruby equivalent takes ~1100ms. This is because RUBY IS SLOW AND BAD AND DOESN’T SCALE!!!

Haha, just kidding. Gex and Ruby are in such vastly different classes of programming languages that comparing them by execution speed alone is simply nonsensical.

As you can see in the example above, I had to add explicit type annotations for every value. That’s pretty much unavoidable for a language that doesn’t run on a high-level VM. Also, each type has its own dedicated print function, because functions can (for now) only accept one type. This isn’t reasonable in the long term, but hey, baby steps.

Also, as you might recall from Week­notes 2022 W22: Resignation, my intention is to have no global variables, including stdout. That means that I intend to get rid of functions like println_int32, but for now, that’s what we’re stuck with. Again, baby steps!


I started preparing a talk titled A language built with third-party code reuse in mind, which deals with the universe idea, outlined in Week­notes 2022 W22: Resignation.

I found a better way to describe this idea: it is the total removal of ambient authority. The term “ambient authority” describes the effects a piece of code can have, without explicitly being granted the authority to cause those effects. For example, in typical programming languages, a module doesn’t need to be explicitly given access to the filesystem, and can use ambient authority to access the filesystem instead.

The idea of restricting or even removing ambient authority is not new. In fact, it’s older than myself. Related concepts are the Principle of least privilege (PoLP) and capability-based security (including the object-capability model). It touches on the ideas behind effect systems, too.

My intention is to give this talk at RUG::B, the Ruby User Group Berlin, in the next couple of months. If the past is an indication, I’ll push off making the slides until someone asks “hey can you give the talk next week” and then say yes and mildly panic and get it done anyway.

This will be the first talk I’ve given since early 2020!


In terms of entertainment:


Links:

You can reply to this weeknotes entry by email. I’d love to hear your thoughts!
If you like what I write, stick your email address below and subscribe. I send out my weeknotes every Sunday morning. Alternatively, you can subscribe to the web feed.