Day 25 — A thing I didn't know about Unix13 September 2020 · recurse-center Tweet
Welcome to my blog. ICYMI, I'm using it to post about how I spend each day at RC, so that I can look back upon the things I learned, and the interactions I had, things that can otherwise be so ephemeral!
This post got some replies on Zulip, which means I got to add more links to my ever-growing list of things to learn! It started with Mark joking about how the original plan was for the compiler to use a different default output filename each month, and since the feature was first implemented in August 1972, the default filename was chosen to be “Août”, which is French for August. Since the character “û” was unavailable,
a.out was chosen as an approximate representation. It should have been
ao.ut but Dennis Ritchie (not a Francophone) misspelled it. Mark pointed the joke out later as I didn't get it at first!
But this story sounded so interesting that it got me wondering if there's a way to look at how C is implemented, and how it evolved! (like Python) Mark pointed out that VCS systems developed later, but old Unix code survived (on old backup tapes and so forth) and it's archived at The Unix Heritage Society! Ori mentioned that Ken Thompson still posts on the
The Unix Heritage Society mailing list!
Nathan said that one way to start might be to look at the source code for a C compiler, and that something like
tcc might be easier to read the
gcc. Ori pointed out that
tcc is probably not the best option (since it started out as an obfuscated C contest entry!), and that cproc (which compiles to assembly via QBE) and 9cc are worth a look. There's also qc which is implemented in Myrddin a language written by Ori!
Later in the day I stumbled upon this awesome podcast episode with Brian Kernighan, and learned that Unix was not open-source, and that it was in fact very proprietary. I'd assumed it was open-source from the start! There are many other things that I don't know about it yet.
It was pragmatically pretty open though, as it was freely licensed to universities in source code form for many years. And people in these large universities could talk to people in other large universities who had the license. I guess the whole idea of something being "open-source" started many years after Unix!
Brian Kernighan also mentioned that generations of university students (and faculty) grew up knowing about Unix. This built enough expertise in the community that it became possible for people to go off in their own direction and build something that was Unix-like. The Berkeley version of Unix started with the original licensed code, and gradually picked up enough contributions (notably from people like Bill Joy) that it eventually became free of any AT&T code. By 1991, Linus Torvalds also decided that he was going to build a Unix-like operating system, and was able to leverage the existing knowledge out there about the Unix system call interface and so on. And so he built an operating system, that at this point when you say Unix, in many cases what you're really referring to is Linux.
I also went to the Rust learning group meeting where we started to think about writing a simple game in Rust, and compile it to WebAssembly so that we can run it in our browsers. We might try to build upon the snake game that Julia Evans wrote using Rust! I also found this basic tutorial on using Rust and WebAssembly to render water.
SPOILER: It doesn't look very basic to me.
After that, I continued on my quest from yesterday (of trying to use Airflow on
microk8s to run workflows). But my pods didn't have internet access! Looks like some other people have also faced this issue.
$ microk8s kubectl logs -f pod/airflow-web-f49c69b44-wtswk -n airflow -c airflow-web *** installing requirements... Collecting papermill (from -r requirements.txt (line 1))VerifiedHTTPSConnection object at 0x7f7dfad9e400>: Failed to establish a new connection: [Errno 111] Connection refused',)': /simple/papermill/ Could not find a version that satisfies the requirement papermill (from -r requirements.txt (line 1)) (from versions: ) No matching distribution found for papermill (from -r requirements.txt (line 1))
I edited the coredns config to make it print some logs for each request that is trying to go through. After the edit, I
execd into the problematic pod (to make requests, while tailing logs from the
coredns pod) and got logs for some successful and failed requests. I literally don't know what they mean :( I'm just gonna put them here so that I can come back later and try to understand them. Why does
ping succeed while
$ curl -X GET "http://httpbin.org/get" -H "accept: application/json" <failed>
[INFO] 10.1.80.1:33576 - 27444 "AAAA IN httpbin.org.default.svc.cluster.local. udp 55 false 512" NXDOMAIN qr,aa,rd 148 0.000533846s [INFO] 10.1.80.1:33576 - 26408 "A IN httpbin.org.default.svc.cluster.local. udp 55 false 512" NXDOMAIN qr,aa,rd 148 0.000727807s [INFO] 10.1.80.1:51124 - 3769 "AAAA IN httpbin.org.svc.cluster.local. udp 47 false 512" NXDOMAIN qr,aa,rd 140 0.000469608s [INFO] 10.1.80.1:51124 - 2894 "A IN httpbin.org.svc.cluster.local. udp 47 false 512" NXDOMAIN qr,aa,rd 140 0.00065397s [INFO] 10.1.80.1:53571 - 38081 "AAAA IN httpbin.org.cluster.local. udp 43 false 512" NXDOMAIN qr,aa,rd 136 0.000361267s [INFO] 10.1.80.1:53571 - 37292 "A IN httpbin.org.cluster.local. udp 43 false 512" NXDOMAIN qr,aa,rd 136 0.000580427s [INFO] 10.1.80.1:39070 - 16854 "A IN httpbin.org.domain.name. udp 41 false 512" NOERROR qr,rd,ra 124 0.034454338s [INFO] 10.1.80.1:39070 - 19104 "AAAA IN httpbin.org.domain.name. udp 41 false 512" NOERROR qr,rd,ra 172 0.757763142s
$ ping -c 3 www.google.com <succeeded>
[INFO] 10.1.80.1:36341 - 37264 "A IN www.google.com.default.svc.cluster.local. udp 58 false 512" NXDOMAIN qr,aa,rd 151 0.000159094s [INFO] 10.1.80.1:36341 - 37549 "AAAA IN www.google.com.default.svc.cluster.local. udp 58 false 512" NXDOMAIN qr,aa,rd 151 0.000207102s [INFO] 10.1.80.1:41823 - 47005 "AAAA IN www.google.com.svc.cluster.local. udp 50 false 512" NXDOMAIN qr,aa,rd 143 0.000084896s [INFO] 10.1.80.1:41823 - 46726 "A IN www.google.com.svc.cluster.local. udp 50 false 512" NXDOMAIN qr,aa,rd 143 0.000082328s [INFO] 10.1.80.1:37963 - 41840 "AAAA IN www.google.com.cluster.local. udp 46 false 512" NXDOMAIN qr,aa,rd 139 0.000099443s [INFO] 10.1.80.1:37963 - 41531 "A IN www.google.com.cluster.local. udp 46 false 512" NXDOMAIN qr,aa,rd 139 0.000137366s [INFO] 10.1.80.1:35316 - 5309 "A IN www.google.com.domain.name. udp 44 false 512" NXDOMAIN qr,rd,ra 131 0.009628497s [INFO] 10.1.80.1:35316 - 5531 "AAAA IN www.google.com.domain.name. udp 44 false 512" NXDOMAIN qr,rd,ra 131 0.010244411s [INFO] 10.1.80.1:35553 - 40062 "AAAA IN www.google.com. udp 32 false 512" NOERROR qr,rd,ra 74 0.009757134s [INFO] 10.1.80.1:35553 - 39854 "A IN www.google.com. udp 32 false 512" NOERROR qr,rd,ra 62 0.011154362s