Embedded

View Original

452: Numbers on Computers Are Weird

Transcript from 452: Numbers on Computers Are Weird with Julia Evans, Christopher White, and Elecia White.

EW (00:00:06):

Hello and welcome to Embedded. I am Elecia White, here with Christopher White. This week we have Julia Evans, creator of Wizard Zines, to talk to us all about a lot of things, internet careers, and how numbers are represented.

(00:00:22):

Before we talk to Julia, I have an open job req. Well, three of them actually, from Volta Labs, an MIT spin-off that is developing a novel lab automation platform for genome sequencing. They have raised $20 million as part of the Series-A funding, and are hiring for several roles related to embedded software.

(00:00:46):

All roles are full-time, 100% onsite in Boston, and require the ability to thrive in an early-stage startup. You could be a Senior Firmware Engineer, ARM-based microcontrollers, C and C++, RTOS, all those things. Or, Tech Lead of Instrument Software, requires prior experience as a tech lead, and strong programming in Python or Linux. Or Tech Lead, Electrical and Embedded Systems, lead design and development of electrical systems and firmware. If you are interested in one of these jobs, check out Volta Labs. There will be a link in the show notes.

CW (00:01:26):

Hi, Julia. Welcome back.

JE (00:01:27):

Hello. Thanks for having me again.

EW (00:01:30):

It has been quite a while. What have you been up to?

JE (00:01:34):

I have- How long has it been? I do not even know.

CW (00:01:37):

Years.

JE (00:01:37):

Years.

EW (00:01:39):

Last time we talked to you had a normal job. I think doing Django, but I am not sure.

JE (00:01:47):

Mm. It might have been machine learning. Maybe I was doing machine learning then.

CW (00:01:52):

That sounds right.

JE (00:01:53):

There is no way to know <laugh>.

CW (00:01:55):

<laugh>

EW (00:01:55):

<laugh>

JE (00:01:58):

Now I spend a lot more time writing about programming, and about things that I think are cool. Like computer networking, and right now, numbers and how computers represent numbers.

CW (00:02:13):

Badly.

EW (00:02:13):

Yeah.

JE (00:02:16):

<laugh> They do their best.

EW (00:02:19):

All right. So we are going to talk more about computer representation of numbers, and also how you have changed your career, and all of the other things you have been working on. But first we want to do lightning round, where we ask short questions. We want short answers, until we say how and why and all the things we do. And we misbehave. Are you ready?

JE (00:02:40):

Yes.

CW (00:02:41):

What is your favorite number?

JE (00:02:44):

42.

CW (00:02:46):

Hmm.

EW (00:02:47):

What is your favorite floating point number?

JE (00:02:49):

Maybe 1.0.

CW (00:02:52):

How many bytes do we really need?

JE (00:02:55):

64. No, eight.

EW (00:02:59):

Do you complete one project, or start a dozen?

JE (00:03:04):

Both.

EW (00:03:06):

<laugh>

CW (00:03:07):

What comics did you or do you read, that inspire your zine work?

JE (00:03:13):

"Understanding Comics."

CW (00:03:16):

Oh, that is a great book. I have that book.

EW (00:03:19):

Yeah. Any others?

JE (00:03:20):

I just read "Ducks" by Kate Beaton, which was great. Everyone I think is inspired by "xkcd."

CW (00:03:28):

Yeah. <laugh>

EW (00:03:31):

If you could teach a college course, what would you want to teach?

JE (00:03:35):

An intro to Linux and C programming.

CW (00:03:39):

And the question we always have to ask, what is your favorite fictional robot? And it does not have to be the same as last time.

JE (00:03:44):

I am going to go with WALL-E, because that is the one I saw most recently.

EW (00:03:50):

All right, so you create zines, which is not a word.

JE (00:03:57):

<laugh>

CW (00:03:57):

It is part of a word.

JE (00:04:00):

It is a word.

EW (00:04:01):

What are zines?

JE (00:04:06):

They are- I think of them maybe as tiny self-published books. Mine are usually 28 pages, often with low production values, and which no one can stop you from making.

EW (00:04:23):

And this is your career now.

JE (00:04:25):

That is right. Now it is. Which is a weird thing.

EW (00:04:30):

Were you surprised that you ended up here?

JE (00:04:34):

Yeah. I did not expect it. It is something that happened. Yeah. It is definitely something that happened, that I did not know was going to happen.

EW (00:04:46):

Which of your zines are the most popular?

JE (00:04:50):

I do not keep track. I think in general, usually, I have- Most of them are about specific technical topics, like how DNS works, or how containers work. A couple of them are about more general topics that could apply to anyone. Like " Help! I have a manager!" or about debugging. I think the ones that are not about a specific topic tend to be maybe a little more popular, because they could be for anyone.

EW (00:05:16):

You have zines that are longer, and then you have comics, which are like one page.

JE (00:05:22):

That is right.

EW (00:05:23):

Are these pages of the zine, or are they separate?

JE (00:05:26):

They are usually pages of the zine. Sometimes they are not. Sometimes I will just write something that is a one-off. And often they change, I will edit them, but they are usually pages of the zine.

EW (00:05:43):

I saw the one on how to have a one-on-one with your manager, which was pretty amusing, because it is so often people think that having a one-on-one is your manager telling you what to do. And if it is, then you are doing it wrong.

JE (00:05:57):

That is right. <laugh>

EW (00:05:59):

That is your opportunity to ask all your questions.

JE (00:06:02):

Yeah. I feel like it is really something that you should be driving. And it is also not a status report, right? It is not like, "Here is a list of all the things I did."

EW (00:06:14):

Yeah. I mean, sometimes that is part of it, but-

JE (00:06:17):

That is true.

EW (00:06:18):

That is one of the smaller pieces.

JE (00:06:21):

Yeah. Definitely.

EW (00:06:24):

And you are working on a zine now about number representation.

JE (00:06:27):

Yeah. And about how the way that computers do math is kind of weird. Not how you would intuitively expect, especially with decimal numbers. It has been a bit surprising to write it, because I think when I started I was like, "Oh, math on computers is not that weird."

EW (00:06:45):

It is just math.

JE (00:06:46):

And then the more- It is okay. And then the more I wrote about it, I was like, "Oh yeah, this is quite weird." No one I think would- You would not reasonably expect that it works this way.

CW (00:06:59):

How hard could it be? All computers can do is add, and well add, basically.

JE (00:07:03):

Yeah.

CW (00:07:03):

<laugh>

JE (00:07:03):

Yeah. They can divide <laugh> too.

CW (00:07:08):

Well, given enough time.

JE (00:07:12):

But yeah, it is actually real. And especially with floating point numbers, with decimal numbers, which I think are known to be very weird. Like when you add like the 0.1 and 0.2, you get like 0.30000004. I do not remember the exact number of zeros, but you do not get 0.3, you know? And I think that is very upsetting to people when they first learn about it.

EW (00:07:37):

Okay. So why? I mean, why would you not get- I mean, if I have it in integers, and I add one plus two, I get integer three.

JE (00:07:48):

You do. Yeah. So the way that I like to think about it, is that you have 64 bits, or maybe 32, but let us say 64 bits, for your floating point number, right? You can kind of think of these- So you have two to the power of 64 numbers, and then you have all of the numbers from negative infinity to infinity. And so you have to think about those two to the 64 numbers kind of scattered, right, somehow, along the number line. And there are only so many of them, and so they have little spaces between them, right? You have say 1.0 and then after 1.0 you have another number, which is a little bit more than 1.0. But it is not- You are missing almost all the numbers, right?

EW (00:08:34):

Well, wait a minute. If I have an infinite number line, negative infinity to positive infinity.

JE (00:08:41):

Yeah.

EW (00:08:41):

And I have 64 bits, which I am not going to name the string of numbers that results to 64 bits.

JE (00:08:50):

Yeah.

EW (00:08:50):

But could I not have two to the 64, to the 64 numbers? And then each one would effectively be integers. But that is valid, because-

CW (00:09:01):

What?

EW (00:09:02):

Okay, so I have an infinite number line.

JE (00:09:06):

Yeah.

CW (00:09:07):

Yeah. Or you have just the real numbers between zero and one, which is also a problem.

JE (00:09:11):

Yeah.

EW (00:09:12):

Let us go with the infinite number line. Because I am going to multiply some big numbers.

CW (00:09:14):

Okay.

EW (00:09:14):

And I have two to the 64 as the total samples of the number line I can have.

JE (00:09:24):

That is right.

CW (00:09:25):

Okay.

EW (00:09:26):

If I want to cover the value, the number two to the 64.

JE (00:09:31):

Mm-hmm. <affirmative>

EW (00:09:33):

Then I want to also cover four to the 64.

JE (00:09:37):

Mm-hmm. <affirmative>

EW (00:09:39):

I can generate numbers. It is infinite. I can generate so many numbers that-

CW (00:09:45):

<laugh> Title.

EW (00:09:49):

You cannot represent it, because infinity means I can have-

CW (00:09:53):

Yes.

EW (00:09:53):

An infinite number. I guess that is really-

CW (00:09:57):

That is- <laugh>

EW (00:09:58):

Yeah, technology. Okay. So I do think about it as sampling on the number line.

JE (00:10:07):

Yeah. We are picking certain numbers that we are like, "Okay, these are the ones that we are going to work with."

CW (00:10:12):

And it is not evenly distributed, right?

JE (00:10:14):

That is right.

EW (00:10:15):

That is what I was headed for. It is not evenly distributed.

JE (00:10:16):

They are not evenly distributed, right. There are spaces between these numbers, and the bigger the numbers get, the bigger the spaces are. So between-

CW (00:10:25):

Because who needs those? <laugh>

JE (00:10:27):

<laugh> Well, I think it is a little bit intuitive, right? If we are talking about- The reason we invented the floating point was for science, right? And if we are talking about the weight of an electron, or if we are talking about the distance to the nearest star or something, you do not need- If you are talking about something that is two billion light years away, you do not need so much accuracy.

CW (00:10:51):

Right.

JE (00:10:51):

Right? It is reasonable that the distance between however much two billion light years is in meters, and the next number is quite large. Whereas if you are talking-

EW (00:11:00):

No, it is two billion light years and three centimeters.

CW (00:11:04):

Right. <laugh>

JE (00:11:05):

Yeah <laugh>. For those two quantities, you want different- You want more accuracy around three centimeters, right, than around two billion light years.

CW (00:11:16):

Right.

JE (00:11:16):

So you want the gaps between your numbers to be smaller.

EW (00:11:19):

And so the value between zero and one is well-represented.

JE (00:11:27):

Right. Well, so between zero and one, there is actually- There are as many numbers between zero and one, as there are between one and infinity. Which is kind of interesting.

EW (00:11:36):

I mean, mentally just-

JE (00:11:38):

I mean in floating point. <laugh>

EW (00:11:39):

Yes. No, yes, of course. But that is...

JE (00:11:45):

It is a weird thing.

EW (00:11:46):

It is weird.

JE (00:11:46):

Yeah, so between every successive pair of powers of two- Let us say between one and two, you have two to the power of 52 numbers. And then between 0.5 and one, you also have two to the power of 52 numbers. And then between a quarter and a half, you also have two to the power of 52 numbers. So you have these little, like windows between every power of two, and every one of those windows has the same number of floating point numbers in it. Does that make sense?

CW (00:12:12):

Yeah. As you get closer to zero, like you said, you want-

EW (00:12:16):

More granularity.

CW (00:12:17):

Those are places you are going to be working with smaller and smaller differences between numbers, and you-

JE (00:12:23):

Yeah.

CW (00:12:23):

I guess the choice was to make those more and more densely populated as you got closer to zero.

JE (00:12:29):

Right. Like if you are reaching two to the minus 57 and two to the minus 58, you also want to have a lot of granularity there. So there are the same amount of numbers between two to the minus 57 and two to the minus 58, as there are between one and two.

CW (00:12:42):

That seems like it fell out of a natural way to represent numbers in binary too, right? Because-

JE (00:12:49):

Right.

CW (00:12:49):

The way it is split- Can you describe how it is split up? Because I am...

JE (00:12:53):

How it is split up in binary?

CW (00:12:54):

Yeah.

JE (00:12:54):

Totally. So there are 64 bits. One bit is the sign, plus or minus, really simple. And then the other ones- So I talked about how you have these windows, right, between like one and two. So 11 of those bits tell you which window that you are in. So they tell you like, "Okay, you are between one and two," or "You are between two and four," or "You are between four and eight." We call that the exponent. It is which power of two you are at, right? Or you are between like two to the 57 and two to 58.

(00:13:24):

So those 11 bits give you the exponent, and that number is between- It is basically between two to the minus 1,023 and two to the plus 1,023. So it is a very, very large range. And two to the 1,023- I was calculating this and I was like, "Well, I think maybe two to the 128 is the distance, like a very far away galaxy." So two to the 1,023 is a really shocking number. I am not really sure if there is anything that is useful to us that is that big. Similarly, two to minus 1,023 I think is a really shockingly small number, that is smaller than anything that I could figure out.

(00:13:59):

But anyway, so 11 of the bits tells you what range you are in, right? It is like, "Okay, you are between like 16 and 32," and then the rest of the bits, the remaining 52 bits, tell you where you are inside that range. Basically the way it works is, let us say you are between 16 and 32, you have two to the power of 52 steps, right, in between 16 and 32. And so it is just how many of those steps are you taking? So if it is zero, it is going to be 16. And then if it is like two to the 52 minus one, you are going to be like almost at 32, but not quite, like one tiny step before that.

EW (00:14:39):

Okay. So one of the important things you said was two to the 1,024.

JE (00:14:43):

Yeah.

EW (00:14:43):

And 1,024 is ten bits. And then you mentioned two to the 52.

JE (00:14:52):

Yeah.

EW (00:14:53):

So now I have ten plus 52, so now I am up to 62.

(00:14:58):

Yeah.

(00:14:58):

And then plus or minus is one, so that is 63.

JE (00:15:04):

Right. The other bit is- It is 1,024 to minus 1,024. So it is actually, 2,048. So it is 11 bits.

EW (00:15:12):

Oh, right. You have to add those. Oh, okay. Cool.

JE (00:15:17):

Yeah.

CW (00:15:17):

And all of this explains why when you include floating point printf in your embedded code-

JE (00:15:22):

<laugh>

EW (00:15:22):

<laugh>

CW (00:15:22):

Your code size explodes. Because to figure out how to print any of these things is probably quite a bit of code.

JE (00:15:30):

Yeah. The printing out of floating point numbers is a misstep thing, which is kind of weird, because you think of printing as being easy. But the thing is- Well the weird thing about printing, whoa- Let us say you have the number 0.1, right? Floating point is all binary, and 0.1 is not an exact number in- The floating point number that is closest to 0.1 is let us say like, I do not know, let us say it is like 0.10001257. It is something that is not 0.1, right?

(00:16:08):

But no one- Like if you print out 0.1, people do not want to see that, you know <laugh>. I think they probably want to see 0.1, even though it is a lie. Well, it is not a lie, it is rounded, right? So people want the computer to round to the right number.

(00:16:24):

But also you cannot round to a- If you just round to eight decimal places or something, you are going to get the wrong- You can get misleading answers, because they are- Like 64-bit floating point numbers give you about 16 decimal places of precision. So if you round to let us say eight decimal places, you could have two different numbers that print out as the same thing. Does that make sense?

CW (00:16:49):

Yes.

EW (00:16:49):

But they are not equal.

JE (00:16:51):

But they are not equal. So what you want is, you want your printing algorithm to only print numbers the same if they are actually the same number, right? But you also want to make them as short as possible. And then it turns out that actually doing that, there are academic papers about it. Which is why it is a lot of code <laugh>.

CW (00:17:09):

And this also brings up a common mistake that people make with unit tests and stuff.

JE (00:17:13):

Mm.

CW (00:17:13):

Or tests for anything. It is like, "Oh, are these floating point- I am doing something in floating point. Are these equal?"

EW (00:17:20):

Does x equal 3.1?

CW (00:17:21):

Right. Or does x equal y? And it is like, "Well, maybe they never quote equal each other." And so that test is never going to work. You have to have some tolerance, because-

EW (00:17:30):

You have to have the epsilon. Does it equal this within epsilon? Which is just so ugly.

JE (00:17:34):

Yeah. And then probably what you want to choose for epsilon is- If you think about what is the gap between that floating point number and the next one, you probably want to scale your epsilon relative to that gap. Right?

CW (00:17:45):

Oh, that is a good point. I think I always just choose something stupid <laugh>.

JE (00:17:49):

I honestly would also choose something stupid. But if I were to do something smart-

EW (00:17:54):

You have to know where you are in those floating point windows.

JE (00:17:57):

Right. Yeah, exactly. So it depends on the size of the number, probably what epsilon you want to choose.

EW (00:18:03):

You already talked about this, but I am looking at the zine, and I had a- I had not- Okay, <laugh>. Two to the minus 1,023.

JE (00:18:17):

Yes.

EW (00:18:18):

A hydrogen atom weighs two to the minus 76 grams.

JE (00:18:24):

Right.

EW (00:18:24):

What are the scientists doing that they need two to the 1,023? Two to the minus 1,023?

JE (00:18:33):

I think they do.

EW (00:18:35):

That is not even an angstrom.

JE (00:18:37):

Yeah. Actually I have no idea.

CW (00:18:40):

I think the Planck length is much, yeah, larger.

JE (00:18:42):

Yeah. I think the Plank length is much, much larger than that.

CW (00:18:45):

<laugh>

JE (00:18:46):

I think it is less about the absolute sizes of the numbers that you can represent, and more about wanting more accuracy. The reason you go for a 64-bit float, instead of a 32-bit float, is not to get more range. But it is to get- So I said that with 64-bit floats, you get about 16 digits of accuracy. With 32-bit floats, you get eight digits.

(00:19:07):

Which if you think about it- Let us say you are trying to represent an integer, which people sometimes do with floats, and that is okay. That means once you get to ten million, let us say, ten million is about eight digits, then ten million plus one is going to be like ten million and two.

CW (00:19:22):

Right.

JE (00:19:25):

You start- Well, I guess it is really going to be- The number after- I think for ten million, that is not true, but maybe like 90 million is true. Like the number after 90 million is 90 million and two. So you start right, until there are some very severe accuracy problems.

EW (00:19:42):

So you literally add one to a number.

JE (00:19:45):

Yeah.

EW (00:19:45):

X plus one.

JE (00:19:47):

Yeah.

EW (00:19:47):

And then you check, and it has plussed two.

JE (00:19:52):

Yeah. Or worse, it has plus zero <laugh>, and you have not gotten anywhere.

EW (00:20:00):

The biggest window, the 1,024.

JE (00:20:01):

Yeah.

EW (00:20:01):

Two to the 1,024. You compared it to the furthest galaxy we know is about two to the 90 meters away.

JE (00:20:11):

Right.

EW (00:20:12):

So we can measure the distance to the furthest galaxy in...

CW (00:20:19):

Whatever.

EW (00:20:20):

Angstroms? <laugh>

JE (00:20:20):

<laugh>

EW (00:20:20):

But we cannot- We can represent it, but we cannot represent it accurately, because we do not have the resolution. It goes back to ten billion and three centimeters.

CW (00:20:34):

Definition of accurate. Probably within, you know...

JE (00:20:36):

But if it is- You probably have enough accuracy.

EW (00:20:41):

But it is fake accuracy, because-

CW (00:20:43):

It is real accuracy. It is just not accurate accuracy. <laugh>

EW (00:20:47):

It is real resolution.

JE (00:20:50):

But I think this is how scientific measurements usually work, right? You always talk about significant figures, and I think- I am not a scientist, but my understanding is that you very rarely have 16 significant figures, for any measurement. It is really more than you would ever reasonably have. Though I am sure some scientist is listening to this and is like, "You are-"

CW (00:21:15):

I remember getting yelled at in physics lab for, you know, you plug stuff into a calculator and do your- Or physics homework as well. Where there was stuff where there were numbers involved, everyone would do it on a calculator these days, or on computer. And the computer or Excel spits out a billion significant figures. Yeah, that was a common mark off is like, "Nope, you do not- These are not real." <laugh>

JE (00:21:38):

Yeah. In science, we do not have unlimited precision, right. It does not exist in science.

EW (00:21:45):

So you mentioned that 32 bits only has eight bits of precision, and-

JE (00:21:50):

Eight decimal places.

EW (00:21:52):

Eight decimal places.

JE (00:21:54):

Yeah. About.

EW (00:21:56):

Right. Not eight bits. That is different. Eight decimal places of precision. And that is- Yeah. Okay. I saw on Mastodon <laugh> that you asked, "Why would anybody want to use 32-bit floats?"

JE (00:22:13):

Mm.

EW (00:22:14):

And some people mentioned that they still did?

JE (00:22:17):

Mm-hmm. <affirmative>

EW (00:22:18):

<laugh>

CW (00:22:20):

I use 16-bit floats.

EW (00:22:21):

Oh yeah, no, 16.

CW (00:22:22):

That is true. 16-bit floats-

(00:22:23):

I use quite commonly.

JE (00:22:24):

I have heard are very popular. Especially in machine learning now.

CW (00:22:27):

Yep.

EW (00:22:27):

Exactly.

JE (00:22:28):

Yeah. I think I usually work in a- I do not do a lot of super high performance computing, so for me I am like, "Well, I have one float or two, so I might as well make them 64 bits."

CW (00:22:41):

Right.

JE (00:22:41):

Because I am not- I would rather have the extra accuracy.

EW (00:22:47):

What kind of pushback did you get for the 32-bit comment?

JE (00:22:50):

Wow. I do not remember.

EW (00:22:54):

Oh.

JE (00:22:55):

Sorry. I would need to look it up.

EW (00:22:57):

I hardly remember. I do not remember. I did not look at the thread. I only saw the comment, and then later the retraction <laugh>.

CW (00:23:04):

<laugh>

JE (00:23:07):

Oh no, this was about integers. It was not about floats.

EW (00:23:12):

Oh, really?

JE (00:23:13):

I think. If it was recent.

EW (00:23:15):

Oh, who needs more than two to the 32 integers. That is just silly.

JE (00:23:19):

It was about integers. Well, okay. We could talk about integers though.

EW (00:23:26):

Sure.

JE (00:23:26):

So I can tell you what I was saying. I made what I thought was a funny comment <laugh>, and then the people did not like it, because it was not true. Which, well, it was not true <laugh>. So it is very fair. Let us see. So, we are talking about how 32 bits is not a lot, and we were just talking about how for floats, you only get eight decimal digits of accuracy. And how that is sort of not very much.

(00:23:51):

But for integers- So the biggest 32-bit integer is, well it is two to the power of 32 minus one, which is about four billion. Right? It is just a little more than four billion. And it turns out that four billion is not that big of a number a lot of the time. For example, IPv4 addresses are 32 bits, and it turns out we have more than 32 billion computers on the internet. Right.

CW (00:24:22):

We ran out of those in 1999.

JE (00:24:23):

We ran out of those in 1999. And I am sure people thought that four billion was plenty.

EW (00:24:28):

Well we have more than four billion humans on the planet.

JE (00:24:31):

Well exactly. Right. Or registers. Like the way we store our memory addresses in registers used to be 32 bits, right? We used to have 32-bit computers, which could only have up to 32 billion bytes of memory, but- Sorry, up to four billion bytes of memory. Which is four gigabytes. You cannot live with four gigabytes of memory anymore, on your laptop, I think.

EW (00:24:54):

You and I live in a very different world.

JE (00:24:56):

<laugh> I do.

CW (00:24:57):

Your computer has.

EW (00:24:59):

I know.

CW (00:24:59):

The things you work on may not.

EW (00:25:01):

The things I think about...

CW (00:25:02):

<laugh>

EW (00:25:03):

Are all 32-bit.

JE (00:25:05):

Yeah. But on our computers, we want more than that. Or like Unix timestamps, right?

CW (00:25:13):

<laugh>

EW (00:25:16):

Ahh, yes, I am looking forward to that.

JE (00:25:19):

Are actually signed integers a lot of the time. So you only get two billion seconds after 1970, is going to be in 2038. I am sure people thought that that was plenty, like two billion seconds. But then two billion seconds it turns out, I guess is what? Like 68 years.

CW (00:25:34):

To be fair, when people wrote that code, they were not thinking people would be using it a hundred years later. That is just wrong. Nobody should be using my code in 50 years. Or five.

EW (00:25:47):

And yet I am looking forward to learning Fortran, to help some folks fix that bug.

CW (00:25:54):

Fortran?

EW (00:25:55):

And COBOL.

CW (00:25:56):

You think it is all COBOL?

EW (00:25:58):

Well, I think it is primarily C. But I think once we start an industry of fixing that bug, it will-

CW (00:26:03):

And then everybody will just be Rust people. We will be the old crusty C people who know how to fix it.

EW (00:26:08):

We are already the old crusty C people. Okay. Sorry.

JE (00:26:14):

What I wanted to say, was that people should just be wary of using 32-bit integers by accident. Because a lot of older systems, like for example, in MySQL integers are 32 bits. So you do not- You want to be careful using the default integer, in case it is 32 bits and that is not what you want.

EW (00:26:33):

It is not just seconds since 1970. A lot of times in an embedded system, you have milliseconds since boot.

JE (00:26:47):

Mmm.

EW (00:26:51):

Okay, milliseconds since boot, that is a lot of milliseconds, it does not matter. Until your system starts having 49 day issues.

CW (00:27:01):

Why would you have anything on for 49 days?

JE (00:27:03):

<laugh>

EW (00:27:04):

Exactly. But on day 49 something weird happens and your system reboots, which is fine because now everything is perfect. But then on day 98 something weird happens. And so this 32-bit thing is- It is not a theoretical future one second since 1970 problem. It is a very common embedded system problem. What made you decide that this was the subject for a zine?

JE (00:27:37):

Hmm. I wanted to write about- So I am always interested in topics that are very fundamental and that do not change. Right? So I was thinking about- It was very meaningful to me when I learned about how things were represented in binary on my computer, about what all the bits meant.

(00:27:59):

So I wanted to write about what do all the bits mean in your computer's memory. And then I started writing about how numbers work, how integers and floats work. And then I found out that that was the whole zine. There was not space for anything else.

CW (00:28:16):

Yeah.

EW (00:28:17):

<laugh>

JE (00:28:18):

So then I renamed it to "How integers and floats work."

EW (00:28:21):

You do cover hex, decimal and bases and binary operations.

JE (00:28:29):

Yeah. I do.

EW (00:28:32):

How do you decide what goes in?

JE (00:28:34):

Mm. I try to put things in that were not obvious to me, when I was starting out. Or that I think people get confused by. Like hexadecimal I think can be really a bit off-putting at first, because you are like, "Why are there these letters in my numbers? 6F surely is not a number <laugh>." I wanted to explain why we use hexadecimal, because I think often that is not made clear.

(00:29:03):

People are like, "Oh, we do this." But why do we do it? With hexadecimal, I would say it is because- Let us say you are looking at a number in binary, like a series of bits, and you want to write them down for a human to read. You could write them as bits, like 0 1 0 1, you know? That is sort of intuitive. I think actually people have a pretty- I feel like people feel better about binary, than they do about hexadecimal, is what I found with the beta readers. They are more comfortable with it, which I think is interesting.

(00:29:39):

But binary is sort of too big, right? And after there are more than like eight zeros or ones in a row, your eyes glaze over and it is too much. And then if you write some bits in decimal, that is cool. It is very human readable. And if it is an integer, that is great. But then you have no idea what that corresponds to, in terms of bits. Right. But then in hexadecimal, four bits is one hexadecimal digit. So there is this really beautiful correspondence, where it is very easy to tell what is going on.

EW (00:30:10):

I think the real reason we work with hexadecimal is because there are bytes. And if we do four bits, we can call them nibbles. And it is always fun to think of nibbles.

JE (00:30:21):

It is so cute.

CW (00:30:22):

It is funny because the four bits corresponding to a digit thing, did not occur to me until I had been a professional for an embarrassingly long time.

JE (00:30:34):

Mm. Yeah.

CW (00:30:35):

Once I got that, it was like, "Oh, this is not that big a deal." But that little bit of knowledge sinking in was what- Because I could always work with hexadecimal, but it was like, "Oh, I will throw this at a calculator or something," instead of being able to in my head do some things.

JE (00:30:57):

Yeah. And I think it is so important to tell people the why, because then you can just think about the thing.

EW (00:31:02):

Yeah. I guess I discovered that because I tend to write out registers in binary, and then hex, and so with hex you- In binary, I can write them real small, and then I will put a hex digit over them. And then I can map them. But it is obvious when you write it out a lot.

JE (00:31:25):

If you are doing the conversion by hand, then it is very clear what is going on.

EW (00:31:28):

Yes.

JE (00:31:29):

Yeah.

CW (00:31:30):

Yeah. I did not encounter that that much in my early career, when I was doing internet protocol stuff. Because everything was like, "Well, who needs to break down a byte of a IPv4 address-"

JE (00:31:42):

Yeah, that makes sense.

CW (00:31:43):

"Into nibbles?" Does not matter.

EW (00:31:45):

And yet IPv4 and color display are both areas where hexadecimal is something you see a lot. Not a huge amount, but we mask the IPv6 numbers-

JE (00:32:01):

Mm-hmm. <affirmative>

EW (00:32:02):

You know, ff.ff.ff.0.

CW (00:32:05):

Yeah. They were always masked on either byte-wide boundaries, or something horribly not byte-wide. So it was never...

JE (00:32:13):

Yeah. And we see them in colors all the time.

EW (00:32:15):

Yeah. RGB. And then you get FF00FF, and you are like, "Oh look, there is a color."

JE (00:32:22):

Yeah.

CW (00:32:23):

Yeah. HTML made designers have to learn that stuff. Because that is...

EW (00:32:29):

Talk about cruel and unusual punishments.

CW (00:32:30):

# whatever.

JE (00:32:32):

But I do not think anyone- Are people bothered by hex colors? My impression is that people feel fine about hex colors.

CW (00:32:40):

I am bothered by two things about hex colors. 16-bit color.

JE (00:32:45):

Mm.

EW (00:32:45):

<laugh>

CW (00:32:45):

Which is five, six, five. Five bits of red, five bits of green, five bits of blue. Or, five bits of green, six bits of, God. Five red, six green, five blue.

JE (00:32:59):

Oh wow.

CW (00:33:00):

Usually. That is a nightmare. Especially when you are trying to convert back and forth between 24 bits of color to 16. And then byte ordering is a pain in the butt.

EW (00:33:13):

Mm-hmm.

(00:33:13):

Mm-hmm.

CW (00:33:15):

Sometimes some stuff will be BGR instead of RGB, or...

JE (00:33:18):

Yeah.

EW (00:33:18):

And that always hits me in machine learning application. That there is something about TensorFlow and...

CW (00:33:23):

You trained on BGR in something. <laugh>

EW (00:33:25):

C, ah...

CW (00:33:27):

OpenCV.

EW (00:33:28):

OpenCV. And I always get bitten by that one.

JE (00:33:32):

Do they use 16-bit colors a lot in machine learning?

EW (00:33:38):

No, but they use different encodings.

CW (00:33:38):

Byte order.

JE (00:33:41):

Different byte orders. I see. That is interesting. I wonder why.

EW (00:33:47):

I think with the HTML colors, people just learn the...

CW (00:33:54):

The numbers.

EW (00:33:54):

Fifteen they need.

CW (00:33:57):

Yeah <laugh>. I think it is easier now than it was.

EW (00:33:58):

Yeah.

CW (00:33:58):

Like in VSCode, if you type one of those, and it knows you are in HTML, it will color the- If you type #665111 whatever, it will change that string to the color you have typed in.

EW (00:34:11):

Really?

CW (00:34:12):

Yeah. You should try it.

EW (00:34:13):

Oh <laugh>. Julia, where did you learn the things you were putting into the zine? Is this a Wikipedia troll, or a book, or something else?

CW (00:34:24):

Crowdsourced?

JE (00:34:25):

Definitely some crowdsourcing. For example, when I was trying to understand- I was trying to think about signed and unsigned integers. I asked, "Do you really need to know how signed integer work?" And I actually did not really know how they worked at the time.

(00:34:45):

And then someone, actually it was Stefan Karpinski, who co-created the Julia programming language, and who was the person who taught me how floating point worked. He gave a talk that I saw ten years ago. Tweeted at me and explained in one tweet how signed integers work <laugh>. And I was like, "Oh wow. I get it now. Thank you <laugh>."

EW (00:35:06):

Wait, did the tweet include how two's complement works? Because-

JE (00:35:11):

It did <laugh>.

EW (00:35:13):

Ooh. I need to see that.

JE (00:35:14):

It was a good tweet. We could talk about two's complement.

EW (00:35:22):

Sure. Tell me about two's complement. I will remember it for approximately 12 minutes.

JE (00:35:27):

All right.

EW (00:35:28):

And then we can talk about it all over again.

JE (00:35:30):

Let us see if we can get anywhere in two's complement. I really felt the same way, but now I feel better about it post this tweet. So let us see. Okay, so let us talk about our 8-bit integers, that go from zero to 255. Because they are small <laugh> and easy to think about.

EW (00:35:48):

Yes. It will be easy.

JE (00:35:51):

So when you add- Let us say you add one to 255, right? The way that generally works, like if you run the x86 "add" instruction, it is 255 plus one is zero, right? It will roll back around to zero.

EW (00:36:09):

Right. And if you are lucky, you get a register that says you had a carryover.

JE (00:36:12):

That is right. Which you could either, in your code, you could choose to notice or ignore or whatever your code wants to do. And different programming languages will take different approaches to that. But all that aside, let us say it just rolls over. So if 255 plus one is zero, another way to think about that is that 255 is equal to minus one. Right? Because minus one plus one is zero.

CW (00:36:39):

Okay. I like this.

JE (00:36:42):

Because of that, 255 and minus one are represented the same way, as numbers, right? So in unsigned integers, 255, like the bytes FF are 255. And then if it is signed, those same bytes mean minus one. Because those two numbers act the same way, when you add them together.

EW (00:37:05):

I am liking this, because I understand how a processor can not care about this.

JE (00:37:13):

Right. Because it does not know what you mean by the bytes FF, it is just...

EW (00:37:19):

No, it just adds one, and it does not care whether you have 255 or minus one.

JE (00:37:25):

Right. Because those are actually the same. So that is two's complement. And then 254 is the same as minus two, 253 is the same as minus three, et cetera. Until you get back to, I think 128 becomes minus 128. So the numbers above 128 become negative, when you think about them as signed. And the smaller numbers from zero to 127 stay positive. If that makes sense.

CW (00:38:00):

I have to think about this.

EW (00:38:02):

This actually really works. Mind-bendingly works.

JE (00:38:06):

<laugh> It is weird. But I think it is nice to think about it as a way to make your computer's math really efficient, right? So that you only need to implement one set of hardware for adding positive and negative numbers.

CW (00:38:24):

Right. Huh!

EW (00:38:25):

That is not in your zine.

JE (00:38:27):

It is.

EW (00:38:29):

It is? And I just have not seen it.

JE (00:38:30):

It is on page eight.

EW (00:38:32):

Ooh, unsigned versus signed integers. Oh, and there is a little circle.

JE (00:38:36):

Mm-hmm. <affirmative> There is a little circle.

EW (00:38:38):

Oh, it is a good representation. Yeah. Okay. So let us go back to the business of zines, and get away from numbers for a few minutes, while my brain tries to deal with its new form of two's complement. You sell these.

JE (00:38:54):

I do. That is right.

EW (00:38:57):

How much do they usually cost?

JE (00:38:59):

They are at $12 for the PDF, and $16 if you want a printed copy.

EW (00:39:06):

How did you decide on the price, and that you were going to sell them, instead of just giving them away for free?

JE (00:39:16):

I think the price was a little bit, I do not know, I picked something and seemed fine. <laugh> I do not know.

EW (00:39:22):

<laugh>

CW (00:39:24):

Are the prices working?

JE (00:39:29):

In terms of selling them. That was a bit hard for me. But I guess...

EW (00:39:37):

Because you did not initially. Initially you gave away a few.

JE (00:39:40):

I did. I gave them all away. And then I started saying, "Okay, you can buy them. You can get like an early access version. You can pay for early access, and then afterwards I will make them free." And then I thought, "What if I just did not make them free, and I just charged for them?" And I felt bad about doing that, but actually it was fine. And I do not know, it was just fine. That is what happened.

EW (00:40:06):

<laugh>

CW (00:40:09):

Do you know what sorts of people are buying them? Are they people who are educators, or people who are students themselves? Do you have any sense of who is most interested in buying them?

JE (00:40:26):

I write them for people who are working programmers. I think students and educators do buy them, but that is not who I write them for. Or that is not who I have in mind, if that makes sense. I write them for anyone who wants them.

(00:40:40):

A lot of the time I assume that people have been using, and working with, these things already, now that they are reading about it, if that makes sense. I assume that you have used an integer, maybe you have noticed something weird about it. You have been using floating point numbers, and now you are like, "Okay, what is going on with this?" Right?

(00:41:05):

My previous zine was about DNS, and my assumption when writing that zine is that you have used it, DNS, you have set up a website with it, and now you want to know what is actually going on behind the scenes. So that is who I think of, when I think of who I am writing for.

EW (00:41:21):

And you do have some free ones. I actually think that this "Profiling & tracing with perf" may have been the one we talked about when you were on the show.

JE (00:41:30):

Oh, yeah.

EW (00:41:30):

300 episodes ago.

JE (00:41:33):

<laugh> That is possible. That one is free. Yeah, all of my earlier ones are free. I think the first six or seven that I published are free. And then the ones after that are not free. That is how it works.

EW (00:41:44):

Your art style is disarmingly simple.

JE (00:41:52):

<laugh> It is also the pinnacle of my artistic abilities. I just do my best to draw, and that is my best.

EW (00:42:02):

As you work on this full-time, do you think more about, "I am going to do more fancy art"? Some of your covers are much fancier than the insides, which I totally- I am not saying that is a bad thing.

JE (00:42:16):

<laugh>The covers I pay an illustrator to draw, which is why they are- I do not draw them.

EW (00:42:23):

Okay.

JE (00:42:24):

<laugh> That is why they contain art skills.

EW (00:42:28):

Do you feel the pressure to improve your art skills, or is this approachability the way you want it to be?

JE (00:42:36):

I do not feel the pressure to improve my art skills. It is not something that I am super interested in. I feel a lot of pressure to improve my explanatory skills. I think what I worry about is if someone reads a zine, and it is like, "I do not understand this." That stresses me out. I definitely feel pressure to make things more clear.

(00:42:59):

I also feel pressure to improve my design skills. Because design is really important to clarity, right? So there are questions of how I lay out the page, how I lay out a diagram, how to make sure that it is clear, and it is easy to read. But no, I do not think about my art skills, I would say almost at all. And I do not think that they have improved. I think my design skills have improved a lot, but not my art skills, if that makes sense.

EW (00:43:28):

I would disagree a little bit. I think art skills have gotten a bit better, but I will-

JE (00:43:31):

<laugh> That is fair.

EW (00:43:33):

I do not think that that is critical, because there is an- Like xkcd, there is an advantage to making it clear and simple, and not trying to make it lifelike. Because what you are trying to do is pull out the information that is useful, not trying to pull out all the information.

CW (00:43:55):

Well, you also do not want something that is going to- You want something that is immediately- The simple art style suggests this is understandable before anything happens. And I think that is appropriate.

JE (00:44:09):

Yeah. I am happy it works. I think the best compliment I ever got on my art is someone said, "It looks like you know how to draw, and you have chosen not to," which I really appreciated because that is not the case. <laugh>

EW (00:44:24):

Let us see, you also do have your comics for free. So people can look up pages on CSS variables, or cURL or, ooh, floating point.

JE (00:44:37):

<laugh>

EW (00:44:39):

That is different than what you have now.

CW (00:44:40):

The thing I like about these is you can both learn from them. And if you already understand the concept, the way you have explained a lot of these things, is from a different angle than people have learned them.

JE (00:44:51):

Mm-hmm. <affirmative>.

CW (00:44:51):

And they are also great references to go back to like, "Oh, I cannot really remember how the two's complement thing..." <laugh>

JE (00:44:58):

<laugh>

CW (00:44:58):

Which I, like Elecia said, I am constantly forgetting how that works, even though I implemented a complete CPU emulator at one point for work. And had to know it backwards and forwards. After five years of not working with it closely, it is like, "Oh that thing again."

(00:45:11):

But having these be simple and fun to read, and quick to look at, rekindles knowledge I used to have about the networking stuff too. Because I used to do a ton of networking, and reading your networking zines has been great, because it is like, "Oh yeah, right, okay. This is how TCP works." Or the basics of TCP, and stuff like that. So I think they are useful in a variety of ways, which is really cool.

JE (00:45:38):

Yeah.

EW (00:45:40):

I am looking at the "top" comic, and I am like, "I remember the last time I had to really use top, for more than just which..."

CW (00:45:47):

Which process is blowing up your computer.

EW (00:45:48):

"Which process is dead." <laugh> Yes. Yeah, okay. This was the information I needed, and it took me like 20 minutes with the man page <laugh>.

JE (00:45:57):

That is the dream. <laugh>

CW (00:46:00):

They should replace man pages with these.

JE (00:46:04):

I do not know. They leave out a lot.

CW (00:46:07):

Yes, that is true.<laugh>

EW (00:46:09):

In the outline that I send most guests, there is a Misc section at the bottom, that we almost never get to. Like, "How did you get to this career?" And there is one that says, "What do you want to be when you grow up?" I almost never ask it, and you crossed it out as something you did not want to have asked.

JE (00:46:28):

<laugh>

EW (00:46:31):

So it would be incredibly rude of me to ask you, "What do you want to be when you grow up?" So I think I am going to switch it to, "Is this what you want to do? Is this your plan? Are you formulating an evil lair with all kinds of other taking-over-the-world prospects? And this is just your sideline?"

JE (00:46:57):

The reason I crossed it out is I do not really have plans. I have never made plans that were long term. And so it is not something that I have thought about. At some point my plan was like, "Oh, I want to work in machine learning," and then I did that. And then I was like, "Oh, maybe it would be fun to work in networking," and then I did that. And then I started doing this, and this is what I am doing. I do not know, I think I do not- Not a very big brain person <laugh> or something <laugh>.

CW (00:47:30):

I do not think that is the case.

EW (00:47:31):

I do not think that is the case.

JE (00:47:32):

All right. But I just do not-

CW (00:47:33):

Your career sounds like mine in reverse, without comics, which maybe I should start.

JE (00:47:39):

<laugh> Oh, you went from somewhere, to networking, to machine learning?

CW (00:47:44):

Yes. I did.

JE (00:47:44):

That is cool.

CW (00:47:45):

Networking, and then embedded, and then machine learning. And then I am going back to machine learning.

JE (00:47:51):

Nice.

CW (00:47:52):

<laugh>. But yeah, no, I think- My problem is everything is exciting for a while, and then something else is exciting.

JE (00:48:03):

Yeah.

CW (00:48:04):

And then I do not- Yeah, getting stuck on stuff for a long time does not appeal to me. So making plans, you do not know what is going to appeal to you, so how could you make a plan?

JE (00:48:15):

Yeah. That is very much how I feel.

EW (00:48:17):

That is fair. Is there a dream job that somebody could call you up and say, "Okay Julia, we are going to do machine learning on networking in space, and we want you to be the person to do it."

CW (00:48:31):

<laugh>

JE (00:48:33):

No.

EW (00:48:34):

Would you? Okay. So you are not looking. This is what you want to be doing, at least for right now.

JE (00:48:39):

Yeah. I always felt like I should have a dream job, if that makes sense. Sometimes I will look at what jobs my friends have, or what jobs other maybe fancy people out there have, and I am like, "Oh, do I want to have that job?" But the answer it turns out is usually, "No." I do not know <laugh>. I think I found it surprisingly hard to find a dream job, if that makes sense. I definitely do not have one.

EW (00:49:05):

How did you decide it was safe to quit your engineering job?

JE (00:49:09):

Well, I was making enough money with the zines, that that was enough for me to live on. So it seemed pretty simple. I think people often think about running a business as being a risky thing, but I am not a risk taker. I was just like, "This is working, so I guess I could do this."

EW (00:49:29):

Was it a lot of fun to quit, with that as the reason?

JE (00:49:34):

No <laugh>. It is a weird answer. It was fine.

EW (00:49:38):

It was not a take this job and shove it moment, huh?

JE (00:49:41):

<laugh> Well, I had been working there for a while, so I was a bit tired <laugh>. I think I was more just a bit tired at that point.

EW (00:49:52):

You have also kept up your blog, which is often quite detailed.

JE (00:49:57):

Mm. Yeah.

EW (00:49:57):

Is that part of writing the comics? I mean that is free, so that is...

JE (00:50:03):

It is part of it. I think a lot of the time I will work out things that I am trying to think about, in the blog, and I can write- The problem with the comics is there is not room for a lot of words. So blogging is easier, because I could write more words, right, to talk about a thing. I am not limited to like 200 words. I can go off on tangents. I find it a fun way to write about something that- Even that sometimes tangential-

(00:50:31):

What did I write about? I wrote about what is weird about floating point numbers. I have a page in the zine that talks about what can go wrong when using floating point numbers. And I also wrote it- Which is like 200 words. And then I also wrote maybe a 1,500 word blog post about it. That then I later condensed, right? And I was like, "Okay, how can we talk about this very briefly?" So yeah, I often expand on things.

(00:50:56):

And sometimes I write about things on the blog, that do not make it into the zine at all. Like I talked about why a byte is eight bits on the blog, which is not in zine at all.

EW (00:51:09):

Why are there eight bits in a byte?

JE (00:51:12):

What I gathered- There is a lot of history, and I am not really a computer history person, I have got to admit. But I think the very short version is that it is about text processing. So let us say you want an English character. I think it is also important here that you are American, right? So let us say you are working at IBM, and you are American, and the English alphabet has 26 characters. Then you have the uppercase one. So you are at 52.

EW (00:51:48):

And the numbers and the punctuation. So you get to like 93 or 96.

JE (00:51:52):

You get to like 93, right? So you need at least seven bits. But it is probably weird to have an odd number of bits in your byte. So then I guess you do eight. I do not think that is totally historical, but they did talk a lot about how they wanted to prioritize text processing, and having a byte size that made sense for text processing.

(00:52:14):

Also, you do not want your bytes to be too big, because at some point you are going to be wasting space, right? Yeah. So that is how I think about it. The blog post is longer than that.

EW (00:52:26):

It really is.

JE (00:52:27):

That is the summary.

EW (00:52:28):

Binary-coded decimal too.

JE (00:52:30):

Oh my God.

CW (00:52:30):

Oh God. Not binary-coded decimal.

JE (00:52:32):

No, not binary-coded decimal <laugh>. We do not need to talk about that. <laugh>.

CW (00:52:38):

When you had a full-time job, were you finding topics for zines and blog posts, based on stuff you were doing? Is the finding of topics different now that you do not have that job, or maybe not encountering stuff in the same way?

JE (00:52:55):

Yeah, it is different. What did I write about? For example, I wrote "Help! I have a manager!" because I felt confused about how to have a manager. And then I figured some things out. Well, I had a very good manager, and then I learned some things from him, and so I wrote a zine about that. What else did I write about?

(00:53:14):

Now I think I work on different things. I wrote a zine about CSS more recently, maybe a couple of years ago. Because I started making more websites, to go with the zines. And then I was working with someone who was extremely good at CSS, and I learned from her that it is possible to write CSS, and it is possible to understand it <laugh>.

EW (00:53:38):

<laugh>

CW (00:53:38):

Right.

JE (00:53:39):

Which is something that I-

EW (00:53:40):

It is not a black box.

JE (00:53:41):

It is not a black box. It is simply quite hard <laugh>.

EW (00:53:47):

<laugh>

CW (00:53:47):

<laugh>

JE (00:53:48):

Actually a lot of things are quite hard, and you can learn all of them. That was huge for me. So I wrote about that. I forget what else I wrote about when I had a job. I do not know. And then-

CW (00:54:07):

Probably for the best. You can forget all about it, yeah?

JE (00:54:09):

<laugh> Now I think I also have more space to go back to more fundamental topics. Like, it is quite hard for me to write about how floating point works. Because it is something that I learned a long time ago. It is easier for me to write about things I learned more recently.

(00:54:27):

I learned about floating point maybe ten years ago at this point. So it is hard to go back and be like, "Okay, how can I explain this to someone who is coming to it for the first time, and how can I make it really clear?" I think it is something I did not have the time or space to do when I had a job. And now I do have the time to do that.

CW (00:54:44):

Do you take requests?

EW (00:54:44):

<laugh>

JE (00:54:46):

I take suggestions, yeah. I do not know. I am always interested to hear what people want. I almost never listen. Or, I almost never do them, but I always love to hear them. <laugh>

EW (00:54:57):

What do you want Christopher?

CW (00:54:59):

Public key encryption.

JE (00:54:59):

Oh.

CW (00:54:59):

Unless you have already done that.

JE (00:55:02):

No, I have not. It is funny, I was thinking about that this morning, for some reason <laugh>. It might- You never know. That is another math one, right?

CW (00:55:11):

Yes.

JE (00:55:12):

Yeah, math ones are always hard for me, but I am getting better at it. Because I did a math degree, and so I always want to give an extremely math jargony explanation. I am like, "Well, you know <laugh>." It takes a lot of work for me to write about math stuff in a way that is accessible to everyone.

CW (00:55:32):

Could have gotten into countable and uncountable infinities, and <laugh> floating point cardinality.

JE (00:55:39):

Yeah. But public key encryption, it could be cool. It is pretty important.

EW (00:55:45):

And it depends on whether you are writing from a "I want to understand this, because I have to implement something," or "I want to understand this, because I want to be able to use it effectively."

JE (00:55:55):

Yeah.

CW (00:55:56):

Or to understand when people write about it, what they are talking about. Yeah.

JE (00:56:00):

Yeah. I am always looking for ways. I feel like with public key encryption, what would be tricky for me is people often use- When people are trying to not get too mathy with it, they often use metaphors. I do not know, I do not really know what the metaphors are, but they always feel a little bit off to me, or a bit confusing to me.

(00:56:19):

So I always want to figure out how to talk about the thing in a more direct way. To talk about what it actually is, instead of saying like, "Oh, this is something that it is like." But without requiring too much prior knowledge or jargon. So it is tricky.

EW (00:56:35):

Metaphors are hard.

JE (00:56:37):

Yeah, they are very hard.

CW (00:56:39):

They are like- Sorry.

JE (00:56:41):

<laugh>

EW (00:56:41):

<laugh> That is a simile. Your blog covers more than a decade. Do you ever reread the old ones?

JE (00:56:52):

I do sometimes. I think I actually feel very positive about my past work almost all the time. I will look at something I wrote, and I am like, "Wow, that is cool." <laugh>

EW (00:57:01):

Does it ever feel like somebody else wrote it?

JE (00:57:04):

No. I remember that person. <laugh>

EW (00:57:08):

I am working on a second edition of my book, and I swear somebody else wrote many of these jokes, because I was never that funny.

JE (00:57:17):

<laugh> I do often think I am not that funny <laugh>. True. I always feel like someone who is a little funnier than me wrote them.

CW (00:57:28):

I have a mundane, boring process question to ask you, but I am curious, so I am going to ask it.

JE (00:57:33):

Yeah?

CW (00:57:35):

How do you draw? What do you use to draw your zines? Do you write them on paper, and then scan them in? Or do you have a tablet and pen and Photoshop? Or?

JE (00:57:46):

I use an iPad.

CW (00:57:47):

Okay.

JE (00:57:49):

I use this app called Affinity Designer, which is a vector drawing app. It is maybe a bit complicated. I definitely grew into it. I started out using much simpler apps, and then ended up deciding to use something more complicated.

EW (00:58:06):

You can use Affinity to do what you have done? <laugh>

JE (00:58:09):

Yeah.

EW (00:58:09):

I use Affinity a little bit, but it is all vector things as I am working on origami, and it is super frustrating. <laugh>

JE (00:58:18):

Well, I use the pencil tool. I just draw.

EW (00:58:22):

All right. I should try that.

JE (00:58:22):

I do not use the- I do not look at the Bezier curves or anything <laugh>. I just use the pencil tool.

EW (00:58:28):

Fair. Okay.

CW (00:58:29):

Yeah. It just makes a list of millions and millions of curves. It can do it.

JE (00:58:33):

It does. It does make a list of millions and millions of curves.

EW (00:58:36):

One of the other things I saw on your website were playgrounds.

JE (00:58:41):

That is right.

EW (00:58:42):

Could you describe those?

CW (00:58:43):

Oh, yeah.

JE (00:58:44):

Oh yeah. I write these zines, right? But the way that you learn about computers, the way that I learn about computers, is not to read about them. You know <laugh>. The way we we learn about computers is to use them, and to poke at them, and to break them. I have gotten really into making these interactive playgrounds to go with the zines, where you can play around with the thing.

(00:59:10):

I think my favorite one is for the DNS zine. I was talking to people about DNS, and people were like, "I do not want to just mess around with my website's DNS. I am going to break it." <laugh> And I was like, "Oh yeah." Because I do mess around with my website. I do not know. I think because I understand DNS pretty well, I am not scared I am going to break it, so I will just do whatever. I will make some subdomain, like asdf.jvns.ca. I will just play around.

(00:59:36):

But obviously it is reasonable that people are scared about messing with their DNS. So I was like, "Well, I will make a website." It is called messwithdns.com, where people could mess with my website's DNS <laugh>.

CW (00:59:49):

<laugh>

JE (00:59:51):

And do experiments and play around. This zine has a playground called Memory Spy, where you can write a little C program, which has maybe some integers or some floats. You can click on the code and see what is in memory. You will put the program in the web interface, and then it will run it. And then it will put it through a C debugger, and then it will show you what is in memory in that program.

(01:00:17):

It is basically GDB. It is GDB behind the scenes. But GDB, as you probably know, can be intimidating if you are not used to it. So I made it cute, and, I do not know, not so confusing. So that is called Memory Spy.

CW (01:00:37):

I wish these things existed when I was learning <laugh>. Then there was just books, and the Apple II ROM monitor.

JE (01:00:46):

<laugh>

CW (01:00:49):

Did not have ways of seeing floating point easily <laugh>.

JE (01:00:53):

Yeah. There is also this website which I did not make, called float.exposed, which shows you all the little pieces of a floating point number, which I reference in the zine, because it is incredible.

EW (01:01:08):

I see that Memory Spy was in the zine, along with a couple other things, float.exposed and integer.exposed.

JE (01:01:16):

Yeah.

EW (01:01:18):

But I had actually been playing with the playgrounds that were under your Experiments! tab.

JE (01:01:24):

Oh yeah, that is right. Those are the- Yeah.

EW (01:01:27):

These are the free ones that you expose for people to play with.

JE (01:01:34):

Those are for other zines, I guess.

EW (01:01:36):

Oh, okay.

JE (01:01:38):

I have not put these ones up yet. They are all free, but I just have not got around to updating that section of the website.

EW (01:01:48):

What are you going to work on after you finish floating points?

JE (01:01:50):

I do not know. I never know what I am going to work on next. When I think I do, I am usually wrong. So I can tell you what I think I might work on, and then it will be wrong. So that is fine. I was thinking about- So I am not a C programmer, unlike you folks. I have never written a real C program, but I love C in a way. I feel like knowing a little bit of C teaches you so much about how your computer works. And it has been so important for me to understand just a little bit of C.

(01:02:25):

So I want to write a guide to C, maybe for people who never intend to write C in their lives. So that you can do things like maybe compile C programs. Or implement bindings to a C program, in the programming language you actually want to use. Or understand Linux system calls and what interface to those is. That is something I am thinking about.

EW (01:02:50):

What about one that is just about pointers?

JE (01:02:53):

Mm. I do not know...

CW (01:02:54):

Always trying to get people to do pointers?

EW (01:02:57):

Because people get so confused by them.

JE (01:03:01):

Yeah. I probably need to think about- I do not know if I have anything. I do not know what is confusing about pointers yet. I think I probably need to think about that for a long time, to see if I can say anything about pointers that is useful.

CW (01:03:20):

I think pointers as an abstract concept are not difficult. Pointers in C can be quite difficult, because of the way C does things.

JE (01:03:31):

Yeah.

EW (01:03:31):

Just have little star guys.

JE (01:03:32):

<laugh>

CW (01:03:33):

You have the little star guys, but what happens when you plus one of that?

EW (01:03:38):

Well, it is not like you can just-

CW (01:03:39):

Do you move by a byte, or four bytes, or eight bytes, or 32 bytes, or?

EW (01:03:43):

Depends on where you put the parenthesis.

CW (01:03:45):

Exactly. <laugh>

JE (01:03:45):

<laugh> Yeah. And I feel like that is the kind of thing that I probably would not. I feel like that is only relevant when you are really writing C programs, if that makes sense.

CW (01:03:56):

Yeah.

JE (01:03:59):

Which obviously is very important for people who write C programs. But that is not me.

EW (01:04:05):

But it is not for everyone. You had a question for us that you put into the notes. Do you want to ask it?

JE (01:04:12):

I would love to ask it. Let me remind myself of what it was. I was curious about what issues you run into with math on embedded systems. Do you have systems which do not have floating point numbers?

EW (01:04:33):

Yes.

CW (01:04:33):

Yes. But less frequently.

JE (01:04:35):

Less frequently?

EW (01:04:38):

Well, the super low power.

CW (01:04:39):

Starting with the Cortex-M. The M0s do not.

EW (01:04:42):

Right.

CW (01:04:45):

So the low power ones do not. But the M4 sort of took over where the M3 was, and the M4 has good floating point. But just because you do not have floating point, does not mean you cannot use floating point.

EW (01:04:56):

<laugh>

JE (01:04:56):

Mmm.

CW (01:04:56):

It just means you have to pull in a library that is very slow.

EW (01:05:00):

And you do it all in software.

CW (01:05:01):

Yeah.

JE (01:05:01):

Right.

EW (01:05:01):

And there is this thing called Q numbers, which are basically floating point implementation in software, but you do it with knowledge of what is happening. You do not let the compiler hide what is happening. If you want to add two Q numbers together, you know that there is an exponent, and that there are`` the regular digits.

CW (01:05:27):

It is fixed point.

JE (01:05:29):

Mmm. Fixed one.

EW (01:05:30):

It is fixed point-

CW (01:05:31):

You multiply it up by whatever precision you want to have, and then you know when you have to divide it back down, to print it or something like that.

EW (01:05:40):

But Q numbers will actually let you change where your fixed point is.

CW (01:05:44):

Yeah, but I rarely do <laugh>, I rarely do the honestly. When I need to use fixed point, it is like, "Okay, I have this range of things." Like I am doing some- Where I mostly encounter with graphics, I do not have floating point, or I do not want to use- Even floating point on a chip with an FPU is sometimes pretty slow.

(01:06:02):

So if I want stuff to go fast, but I still need kind of decimal numbers, then multiply up by 16 or something like that. And that gives me the precision I need for some stupid pixel operation, like drawing a circle or something.

EW (01:06:18):

And so you multiply all your numbers by 16, and now you have a lot more granularity. Instead of just having between zero and one, you have-

CW (01:06:29):

16 numbers. <laugh>

EW (01:06:30):

One number, usually in an integer. But if you multiply by 16, then you have a whole bunch of numbers between zero and one.

JE (01:06:39):

Yeah. And fixed point is really important outside embedded too. If you are representing money, I think a lot of the time, you want to use fixed point and be like, "Okay, we are going to have an integer number of cents." Or micro cents or something.

CW (01:06:54):

Yeah. It was big issues with people using Excel for financial stuff.

JE (01:06:58):

Right.

CW (01:06:58):

And does floating point by default, or something. Money just kind of disappears or appears. It does not exist because of the issues we talked about with floating point.

JE (01:07:08):

Yeah. Because of the random integers.

EW (01:07:09):

Was not Superman-

CW (01:07:12):

That is Superman IV. Three?

EW (01:07:14):

And we will just take all of the extra tenths of pennies, and rule the worlds from ATM machines.

CW (01:07:22):

I do not remember the actual scheme, but yes. <laugh>

EW (01:07:24):

I just remember that a few years after that movie came out, I came out with that as an idea myself, not realizing I was referencing-

CW (01:07:32):

I think it was also the plan in office space.

EW (01:07:34):

Yeah. Okay. Anyway.

CW (01:07:35):

<laugh>

EW (01:07:35):

Yes. That does not work, because other people have thought of it. And yet it does kind of work, because so many people do still use Excel for financial things.

JE (01:07:47):

Mm-hmm.

EW (01:07:48):

Let us see, the other part of your question is are there operations that are slow?

JE (01:07:53):

Oh yeah. Is division slow? That was my question.

CW (01:07:56):

Yeah.

EW (01:07:57):

So slow.

CW (01:07:59):

So you want to avoid that too. Which can be helped by...

EW (01:08:03):

Multiplying by-

CW (01:08:04):

Multiplying by 16. <laugh>

EW (01:08:06):

Need to divide by eight? Okay, we can do that. Need to divide by nine?

JE (01:08:11):

Mmm. Not so nice.

EW (01:08:11):

How about we divide by eight, and then wave our magic wand.

CW (01:08:16):

Yeah. Division is a big problem. Modular also, because it is division. Unless you are doing a power of two, which is fast. But yeah, those little chips, they have gotten a lot better, but there is still a lot of...

EW (01:08:29):

And the C libraries that support floating point, have gotten a lot better than they used to be.

JE (01:08:34):

Oh, interesting.

CW (01:08:34):

It is still terrible.

EW (01:08:36):

But it is still terrible <laugh>. Yes.

JE (01:08:38):

Something that I think is interesting about software implementations of floating point, is that we have those outside of embedded too. There are decimal floating point- Like Python has a decimal floating point implementation that is in software, that uses a base ten floating point. That is better for money, which is interesting.

CW (01:08:58):

Huh! I will have to look for that. Not that I would use it, but I want to look at it <laugh>.

JE (01:09:01):

Yeah. I have not looked at it closely.

EW (01:09:05):

What are the ramifications for that? Maybe I do not understand.

JE (01:09:08):

So it is that the numbers that are representable exactly in floating point, are things that are powers of two, right? So you get like a half or three quarters. Three quarters? Yeah. You can represent exactly in floating point. But you cannot represent like one tenth exactly. Right? Because that is not something that is representable exactly in base two. It is like a repeating decimal. But you can have a decimal floating point, where things that are even like one tenth are representable exactly. It is a different way to structure which samples you take of the-

EW (01:09:50):

Log base ten.

CW (01:09:51):

That is how bases work. Yes.

EW (01:09:54):

I know, but as we are talking about this, we do not necessarily go back to logarithms.

JE (01:10:02):

Yeah.

CW (01:10:04):

The solution of course is to switch our money to hexadecimal money.

EW (01:10:08):

Base two?

JE (01:10:08):

To base two? <laugh>

CW (01:10:10):

Give me F dollars.

JE (01:10:13):

Yeah. <laugh>

EW (01:10:16):

I do not think Julia is going for this. <laugh>

JE (01:10:20):

It is a thought.

EW (01:10:22):

Well, I think we should be letting you go. Do you have any thoughts you would like to leave us with, Julia?

JE (01:10:29):

What I thought was fun about being on this podcast, is the way we all relate to- For example, numbers is so different based on our work. I feel like the relationship you have with floating point, and what size of number is reasonable, is so different in embedded, than it is in my experience of computers. And I just think that that is fun.

EW (01:10:53):

Our guest has been Julia Evans, creator of Wizard Zines. That is wizardzines.com.

CW (01:11:01):

Thanks Julia.

JE (01:11:03):

Thanks so much for having me. This has been so fun.

EW (01:11:05):

Thank you to Christopher for producing and co-hosting. Thank you to our Patreon listener Slack group for some of their questions. And thank you for listening. Do not forget that Volta Labs has a job opening for you. Check out the show notes for that.

(01:11:21):

And now a thought to leave you with. 30 centimeters of wire. These wires represent the distance an electrical signal travels in a nanosecond. One billionth of a second. And Admiral Grace Murray Hopper started distributing them in the late sixties, to demonstrate how designing smaller components would produce faster computers. Go carry a nanosecond around with you.