links: [[1. What's the scope]] --- # Compiled vs Interpreted code ## What is code compilation? *code compilation* is a process where a language compiler takes the source code on one end and produces executable programs on other end. Code compilation is a set of instructions that process the text of your code and turn into a list of instructions that computer can understand. Typically the whole source code is transformed at once, and those resulting instructions are saved as output(usually in file) that can later be executed. ## What is code interpretation? During *interpretation*, the interpreter doesn't compile source code all at once, rather source code is transformed line by line; each line or statement is executed before immediately proceeding to processing the next line of source code. There are multiple variations of interpretation: 1. Parse the source code and perform it's behavior directly 2. transform source code into some efficient **intermediate representation** and immediately executes this 3. A compiler can be added inside interpreter (ex: JavaScript JIT compiler) --- tags: #fundamentals