Skip to content

Commit

Permalink
Add recomended changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreVRibeiro committed Oct 20, 2024
1 parent a1a31c6 commit 8d30025
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,25 @@
<!-- END TITLE -->

<!-- BEGIN BODY -->
Before we can run our Python or C++ code on the computer, it first needs to be translated into machine code. This is where, depending on the language used, compilers and interpreters come into play:
Before we can run our JavaScript or C++ code on the computer, it first needs to be translated into machine code. This is where, depending on the language used, compilers and interpreters come into play:

**Compilers** take the entire code (e.g., in C++) and convert it into machine code **all at once** before running the program. This means that once the code is compiled, the computer can run it directly. While compiled programs tend to run fast, they need to be recompiled each time changes are made to the code.

**Interpreters**, on the other hand, translate and run the code (e.g., in Python) **line by line**. This makes it very easy to test code quickly, but it can be slower than compiled code because the translation happens during execution.
**Interpreters**, on the other hand, translate and run the code (e.g., in JavaScript) **line by line**. This makes it very easy to test code quickly, but it can be slower than compiled code because the translation happens during execution.

We can compare this to doing laundry: a compiler is like using a washing machine, handling all the clothes at once, while an interpreter is like washing clothes by hand, one piece at a time.
<!-- END BODY -->


<img src="../article-drafts-20240926/figures/image-1-1-compilers_vs_interpreters.png">
![compilers_vs_interpreters.png](../compilers-vs-interpreters/compilers_vs_interpreters.png)


## Authors
<!-- BEGIN AUTHOR -->
Evrim Firatli & André Vieira Ribeiro
<!-- END AUTHOR -->





Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit 8d30025

Please sign in to comment.