DEV Community

A Deeper Inspection Into Compilation And Interpretation

Vaidehi Joshi on December 13, 2017

A deeper inspection into compilation vs. interpretation There is perhaps nothing more satisfying than seeing the pieces of a puzzle come together....
Collapse
 
alephnaught2tog profile image
Max Cerrina

This is such a random question (and I lovelovelove these posts) but I have been wondering about this ever since I read it: how'd you decide to make the compiler a hexagon and the interpreter a square?

Collapse
 
vaidehijoshi profile image
Vaidehi Joshi

I already used a rectangle, square, and circle for the scanner, tokenizer, and parser in a compiler...and I was running out of shapes 😛

Collapse
 
ben profile image
Ben Halpern

Damn this was a brilliant read. And I'd just been thinking about this subject, I even made a thread about it:

dev.to/ben/explain-interpreted-pro...

computers didn’t understand English

Anything a computer "doesn't do" has to be thought of as a pretty temporary state of things me thinks.

Collapse
 
vaidehijoshi profile image
Vaidehi Joshi

Yay!! I'm so glad you liked it. 💛

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

Nice article.

This lays out the specturm of compilers and interpreters, which are kind of the two ideal forms. For people who wish to get into details, realize it is a kind of spectrum that modern languages use.

For example, compilation is done over many phases, producing intermediate results. Any of these could in theory be run on a virtual machine, or interpreter, or they could be compiled to machine code as needed.

It's even possible to interpret machine code, as Intel did with some of their Intel based Android tablets (since the machine code was expecting an Arm processor). The Valgrind toolset is also an interpreter, and really amazing profiler, for machine code.

What's important, and Vaidehi does a good job explaining this, are the different possibilities. Understand what transformations code goes through, and how it is run.

Collapse
 
pbouillon profile image
Pierre Bouillon

Awesome article ! I wanted to discover more about compilation and interpretation and this just answered so much question I asked myself, thanks !

Collapse
 
stefannibrasil profile image
Stefanni Brasil

Amazing reading, thanks for this! =D

Collapse
 
ravinderrikhi profile image
Ravinder Rikhi

Can someone explain me if we take an example of nodejs(an interpreting lang). A simple REST API code , each time a request on a route is made, the whole API code is interpreted and executed using the values passed on the route payload,headers,etc ???