Transcript from the "Compilers & Interpreters Overview" Lesson
[00:01:05] And so it's just from one language to another language in a lot of cases. Source code is meant to be human readable, right? And so it's the compiler's job to figure that out, right? And so there's a lot of languages, like this lovely one here whose name I won't mention cuz it has a bad word in it.
[00:01:23] Mark told me I was allowed to use the word, but I'm not going to [LAUGH].
>> Speaker 2: Brain f.
>> Steve Kinney: Brain f, so yeah, this kind of breaks the rule of a high-level language into a lower-level language. It's basically shifting bits around to do things. This console logs hello world, in case you're wondering.
[00:01:42] And yes, I did spend the time to pull it into a repl, transpile it into this to make this slide, you're welcome. So yeah, this kinda breaks the role of a higher-level language that gets transpiled into a lower-level language because it's kinda the opposite, but I think it makes a general point.
[00:01:59] So really, a compiler is just a bunch of smaller programs that are running. We're gonna actually play with both a little bit. We're gonna stick one toe into playing around with compilers. We'll stick one toe into playing around with an interpreter, right, the thing that actually runs our code.
[00:02:32] But the parts of a compiler, effectively, you've got parsing, transformation, and generation, right? Parsing is, your source code, at the end of the day, is just a big old string of text, [LAUGH] that you could read off the file system you can pull in from the network, so on and so forth.
[00:02:50] And you've got to make some kind of sense of that, right? And parsing, we'll see, has effectively two parts, right? First of all, breaking it into what we call tokens, right, the little tiny pieces, what is a word, okay, that's a for, that's an if, right, so on and so forth, right?
[00:03:08] And then once we have all those little tokens, right, then we can go ahead and figure out, all right, what dpes it all mean, right, so there's kinda two stages there. Once we've figured out what the code is and what it means, to get it to that, whether it's a lower-level language or, in Brain f's case, a higher-level one, right, we have to go and transform it into that target, right?
[00:03:53] And when we're transforming it, we're trying to figure out how to put that in the logic that the target language can understand. And then we kind of generate that language out, right? And what we're gonna do in this course is effectively take one or two small, little examples, and basically use it so that we can basically turn the tree into a tree that Babel's generator just understands.