Home Syntax and semantics Variables and data types If- and switch-statements For- and while-loops Functions Programming product SQL

Syntax and semantics

To do:

Everything you need to know is in the two videos.
Take some time to watch them and familiarize yourselves with the concepts mentioned above.
Then try to explain the different concepts in your own terms, preferably on your "studiewebs".

Compiler and interpreters

Compiler and interpreters are programs that takes source code and turns it into machine code.
The difference between the two of them is how they do it.

Compiler

The Compiler scans the entire program and translates it as a whole, into machine code.
Although it can take a long time to analyze the source code,
but the overall performance speed is faster than the interpreter
because the translation is done ahead of time.
Games and operating systems are typically written in compiled languages.

Examples of compiled languages are:

  1. Java

  2. Scala

  3. C++

Interpreter

An interpreter translates one statement at a time,
it takes less amount of time to scan and translate the code,
but the program runs slower because it has to translate,
then execute one statement, then translate and so on.
Interpreters are better for programs that doesn’t need to execute as fast,
like helper scripts on your laptop or programs that require frequent changes.
Both approaches have pros and cons, so most professional programmers
know at least one interpreted language and one compiled language.

Examples of interpreted languages are:

  1. Python

  2. JavaScript

  3. Perl