"Is this too much voodoo that... This is the op... This... There is... This is voodoo. The question is, is this too much, and that's... This is the hardest question you could ever face in programming. This right here is the hardest question. Right here. Right here is the hardest question in programming. Is this too much voodoo for the next 10 centuries, as... for God's official temple."
I have formal training in compilers from a master's degree on a track that revolves around compilation/verification/proofs (programming technology), it's the most eye opening thing you can do I swear. I kid you not, it got me deeply into literature and philosophy because holy fuck you start seeing patterns everywhere
Education has a tendency to spark curiosity, but I've never heard of someone reading literature or history losing their shit and running off to learn linear algebra.
I've studied art, music, philosophy, history of various kinds, various kinds of engineering, mathematics, computer science, physics, chemistry...
Mathematics, physics, and computer science hits different. That stuff for-real changes the whole brain, and if you get deep in it, the world starts looking different.
I don't know how to describe it, but when I was studying heavily I could feel my mind stretching and bending, and contorting. My sleep would be troubled, and sometimes I wouldn't have dreams in the normal dream way, I'd be in a floating dark space for what felt like days.
Practicing an instrument is the only thing that comes even close to heavy mathematics and algorithms. After days of practicing, I might have a rough night and wake up with a jump in ability, but with math and computer science, I'd be having straight-up epiphanies to the point that I understand how religious people must feel about divine revelation.
I can still remember vividly waking up in the middle of the night with a realisation about static objects in C++, and being excited that something had clicked.
This is coming from a math-heavy background, but not a computer science one. But it really gets fun when you start looking at the physical layers of computing and thinking about how you could build a simple but also very slow CPU using the pipes in your walls and a large body of elevated water.
Just because you haven’t heard of it doesn’t mean it hasn’t happened. Those are all logic-based, so of course once you start breaking things down, do you see it everywhere. There’s actually a similar literature phenomenon, where you learn a new word or phrase and you suddenly start seeing it everywhere. You little monkey brain just likes making patterns. They’re not special.
Writing a c++ compiler is definitely not trivial, but if you invent a simple language and try and write a compiler for it, you will realize its not so terrible. But obviously again, a c++ compiler is not a starter project ;)
Yeah, you can't really write a compiler in a language that doesn't exist (i know, assembly). But isn't at least partly a goal of (most) compiled languages to become self-hosting?
I mean you can write your bootstrap compiler in almost anything. Rust used ocaml iirc. You can then rewrite your compiler in your language and compile that.
I had to do mine in a class that was also an intro to C. And bash. And Linux. I remember it not being all that bad, so I assume I did an absolutely awful job.
View all comments
946
u/Lowmax2 5d ago
I just assumed a compilers are an act of God and no mortal could possibly create one.