Transcript from the "ASTs and Initial Execution" Lesson
>> Steve Kinney: So our code is parsed, awesome, we've done it together, we've parsed the code. Then what? You just turn it into an abstract syntax tree, I'm gonna show you a quote from Wikipedia, even though I understand that that is like a trope of people making presentations just like quote Wikipedia, but this one is amazing and I thought we should all share it.
[00:00:22] This is Wikipedia's definition of an abstract syntax tree. In computer science, an abstract syntax tree, AST, is a tree representation of the abstract syntactic structure of source code written in a programming language. Are we all clear on what AST is now? Affectively what it is, is like we took the string of text, we made a data structure that basically shows the structure of the actual code as it's gonna be executed.
[00:00:48] So this is what an AST for an add function would be. In a simpler programming language, you'd actually only see the blue and green parts, right. Cuz you've got a function, it has a return statement, that's the first word that you saw there. Then it parses the rest of that line, it sees two identifiers, it sees the addition symbol.
[00:01:40] But then it's all browser implementation and all the rules and stuff along those lines. But I don't wanna dissuade you from reading it, cuz the first part is actually incredibly well-written.
>> Steve Kinney: So we have the AST, we have everything we need to make byte code. Great, right, let's pass it to ignition, let's do the thing.
[00:01:55] Baseline compiler takes that AST, translates it, it's this part right here. Ideally, right, the story ends, and we can't optimize it. It goes to byte code, it runs