> _In physics, if there's something you don't understand, you can always hide behind the uncharted depths of nature. You can always blame God. You didn't make it so complex yourself. But if your program doesn't work, there's no one to hide behind. A 0 is a 0, a 1 is a 1._
> -Edsger Dijkstra
---
0: Once upon a time,
1: Is this a programming story or---
0: Not long after hello world.
1: Ok got it, programming story.
0: Once hello world had been finished, by giving it a name.
1: Are we gonna do more than just hello world eventu---
0: Armed with the power of names, the people became powerful.
![[babel-story-01.jpg]]
1: Nevermind, not programming.
0: Despite their limited technology, they had harnessed a great power.
The power of names.
By giving code a name, others could use it too, simply by typing the name.
Armed with the power of names, the people became powerful.
Though many languages had by this time been created, the people with their power had achieved another great feat.
Through their work, the whole world was now of one language and one speech.
![[babel-story-02.jpg]]
1: Why are we reading the bib---
0: The whole world was of one language, thanks to a powerful entity called `ld`.
1: The lynamic dinker, apparently.
0: Though no human had the capacity to learn every language, they learned to compile their code to something called object files.
1: Ok this feels slightly true again.
0: Any language could be spoken, and compiled to an object file. And object files from any language could be bound together and united by the power of `ld`.
1: This is the strangest programming lesso---
0: In those days, the people often spoke in "Go to."
![[babel-story-03.jpg]]
1: Is that actually in the bible?
0: Fueled by their ambition, they said "Go to, let us build a big thing."
![[babel-story-04.jpg]]
1: Damn they said it again.
0: And let us name ourselves, because names give us power.
1: What's the grammatical function of "Go to" in that sentence? Is this really in the bible? Is god a programmer? Is the whole universe a big joke actually?
0: And the L||D said...
![[babel-story-05.jpg]]
1: Why did we suddenly switch from saying `ld` to saying L||D?
0: Good question.
1: Hey you are listening to me!
0: In those days, the linker was not yet known as `ld`.
1: Was it `dl`? Please tell me---
0: It was called by many names. The first linker was created by Grace, and was known as [A-0](https://en.wikipedia.org/wiki/A-0_System).
1: Grace Hopper! Ok I know this part.
0: Many uncivilized peoples gave their linkers uncivilized names, like IEWFETCH and ntdll.dll.
1: Why do I feel like you're not completely making this up?
0: Though it was called by many names, the disparate names and manifestations of `ld` all referred to the same aspiration, the same idea within the people. It is for this reason that we use the term L||D.
1: Are you just bullshitting this story into existence in real time?
0: The L||D was at the center of all things. It represented the belief that out of many may come one. Out of disunity, we may create unity. Out of many native languages, we may create a world with one speech.
![[linker.png]]
0: Through the power of L||D, the "Go to" people had achieved their goals. It now appeared they had no adversary who could rival them.
1: Why do I get the feeling this isn't gonna end well?
0: So the L||D said "Go to"
1: Uh oh...
![[babel-story-06.jpg]]
0: "Go to"
1: Harmful incoming.
0: "Let us go down."
1: _Us?_
0: "And confuse the people."
1: Why?
![[babel-story-07.jpg]]
0: So the L||D scattered the people all across the earth, into different language communities. Different cultures. Different tribes.
1: What's the moral of this story?
0: The people lost the ability to understand each other. To work together. And they no longer had the ability to build the big thing.
![[begat-lists-1.jpg]]
1: Is there a programming lesson in all this?
0: Of course. Was that not clear?
1: I'm pretty sure there was no programming in there.
0: If you read carefully, you'll understand the less---
1: Are you actually a programming teacher or is this just a big scam?
0: Would you prefer a version of the story that feels more like programming?
1: I'd prefer anything that feels more like programming.
0: If you insist...
_(Narrator: 0 types some commands into a shell.)_
1: What are you doi---
0: Here.
## babel
1: What's this?
0: See for yourself.
1: _(Looks to see what 0 just did.)_
![[babel-ls.png]]
![[babel-git-status.png]]
0: It's a git repo.
1: Thanks, I can see that.
![[babel-readme.png]]
1: Really?
0: What's the question?
1: What's the point of this code?
0: Same as the story.
1: In what sense?
0: Read the code. You're a developer.
1: Ok, the main function is written in C.
![[babel-main.png]]
1: Looks like it just calls a bunch of functions in a row.
0: What do the functions do?
![[babel-c.png]]
1: The C function just multiplies a number by two.
![[babel-rust.png]]
1: The rust function does the same thing.
![[babel-cython.png]]
1: What's cython?
0: It's a compiled version of python.
1: Ok, looks like it does the same thing as the others.
![[babel-asm.png]]
1: Holy f---
0: It's not as bad as it looks.
1: Man, assembly is rough.
0: About a third of it is just saving and restoring some registers so as not to confuse the other functions.
1: Can I safely assume---
0: Yeah, it's the same as the others. Just multiplying a number by two.
1: Ok, now what?
0: Build it and run it.
1: There's no documentation.
0: Just type `make`.
![[babel-make.png]]
1: So I just run `./babel`?
0: That's what the code seems to be saying.
![[babel-output-1.png]]
1: Is that it?
0: Seems to be.
1: This is the most boring code ever.
0: Is it?
1: Yeah it's just multiplying a number by two.
0: What language is it written in?
1: Like four of them.
0: So?
1: Well I guess it's pretty cool that you can write something in four different languages and link them all together.
0: Why is that cool?
1: I mean it sort of gets rid of the boundaries between languages.
0: Why might that be useful?
1: Well one of the first things you ever said to me was that languages are a scam. This part.
> 0: Not just the languages. Language communities. Language conferences. Language dot org. How to install our Language. Language files full of Language code. Dot lang files. Language commands like `Pumpkin install` or whatever the f$@k you kids do these days. Languages, 1. It's all a scam. We've got the only language we need right here.
1: Then you went off on a long sermon about the shell.
0: Do you feel like you've learned anything about languages since then?
1: Kind of, but if anything it's the opposite of what you said.
0: How so?
1: I mean if we can write code in any language we want and then link it together with code from any other language and the machine can't tell because it's all machine code at the bottom anyway, then programming languages are great.
0: In what way?
1: Well then everyone can speak in their own favorite dialect. The more the merrier.
0: Any downsides?
1: Not if you use the linker like this babel repo did. Bunch of people in a company are building a big thing together. One person likes C, another likes Rust, another likes Haskell or Go or whatever, it doesn't matter. Just write how you want and link it all together.
0: It does seem like a pretty great way to share code.
1: Pretty great? It's amazing. What's the point of executables? Why not just make everything object files? Download some object files and link it with your thing. I'm starting to see what you mean about languages being a scam. I mean sure it's great to be able to write in your favorite language, but it's all just object files at the end of the day. Y'know I didn't know why you were ranting about the linker before, but this is actually pretty cool. I've already got some ideas of new things I want to try. Do you know any good books about linkers?
0: There's one. Maybe two, one day. But not yet.
1: What? That's insane. These things deserve more credit. It's like a universal translator for code but without actually requiring you to read stuff in languages you don't know. Ok I definitely get the point of this repo now. Got to admit I was pretty confused at first.
0: One question.
1: What?
0: What happens when you pipe the output of a command into `cat`?
1: What? Why?
0: Just want to see if you know.
1: Um, it shouldn't do anything.
0: So if pipes are function composition, cat is...
1: The identity function?
0: Correct!
1: What's the point?
0: The point is you're correct. That's the right answer.
1: So?
0: So, what does `./babel | cat` do?
1: Um...
![[babel-output-2.png]]
1: Was this all a trick?
0: No. Check the code.
1: Why's it doing that?
0: You tell me.
![[babel-output-1.png]]
1: Ok...
![[babel-output-2.png]]
1: How did you do this?
0: Read the code.
1: Is there a hidden `isatty` call somewhere?
0: No.
1: Promise you're not hiding any tricks in the assembly?
0: I promise.
1: So why's it?...
![[babel-output.png]]
1: Ok what's the answer?
0: Answer to what?
1: Like what's the point?
0: To get us here.
1: Where?
0: Where we are now.
0: Anyways, picking up where we left off.
![[begat-lists-1.jpg]]
_(Narrator: 1 continues frowning and re-running the code.)_
1: It's even in the same order every time. But it's wrong. How on earth---
0: That's enough.
1: Just let me figure out wh---
0: We're done with babel.
1: I'm not.
0: I promise the next part will make more sense.
1: Why don't I trust---
![[begat-lists-2.jpg]]
_(Narrator: 1 looks up from the computer.)_
1: What's with all the begats?
_(Narrator: 0 continues.)_
![[begat-lists-3.jpg]]
1: This is the worst book ever.
0: Quiet please, we're almost at Ken.
1: Who's Ken?
0: Ken Thompson. He's our Abraham.
1: Why are you---
_(Narrator: 0 continues.)_
![[begat-lists-transition-to-abraham-1.jpg]]
1: How long---
0: Almost there.
![[begat-lists-transition-to-abraham-2.jpg]]
0: Ok there we are. Good place to pause. Did you have a question before?
1: Lots of them.
0: Such as?
1: Well I'm still confused about the babel code. Also confused about why we're reading the bible.
0: Did you have a question?
1: You're not gonna explain either of those things are you.
0: No. Any other questions?
1: What's with the begats?
0: What about them?
1: Well like the genre of this book is totally weird. Like there was this story about all the humans cooperating to build a big thing, then the L||D character went and confused them on purpose which was like "Why exactly?" Then without warning the book just suddenly turns into a spreadsheet about who begat who. Whoever wrote this book must have been schizophrenic or something.
0: How do you think a book ends up like that?
1: Like what?
0: Suddenly switching genres and writing styles from one line to the next.
1: Schizophrenia?
0: Could be. In this case it's more of a codebase thing though.
1: What codebase thing?
0: Here, I'll show you.
goto: [[bbl1.o]]