CoRecursive: Coding Stories cover image

Tech Talk: Crafting Interpreters With Bob Nystrom

CoRecursive: Coding Stories

00:00

Order of Declarations in Language Implementation

In building a compiler or an interpreter, the order of declarations is crucial to determine the type and proper usage of variables. Declarations need to come before variable usage, especially in statically typed languages, to access or interpret variables correctly. While using local variables, the value isn't available if used before declaration, so the language forbids it. However, with function calls, like with recursion, the challenge arises when function A calls function B and B may call back to A. Language implementations like JavaScript, Python, and Java manage this complexity seamlessly, allowing methods within a class to appear in any order without causing issues.

Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner