(This is the older material - click here - for current specification content)

11. Interpreter and virtual machines

1. An interpreter will translate each line of source code into machine language and then execute that machine code directly.

An example of this is entering instructions on a BASIC interpreter command line.

2. A second type of interpreter is one that compiles source code into an intermediate level set of instructions. The intermediate instructions are then executed by the interpreter.

These intermediate codes are called 'bytecodes'.

For example, The Adobe Flash player is a 'virtual machine' sitting within your web browser.

It plays flash movies and has its own programming language called 'actionscript'. For instance YouTube movies are mostly in Flash format. We have coded our games / quizzes using actionscript.

If you can view flash files in your browser at the moment, then you have the flash player installed which is interpreting bytecode commands and translating them on-the-fly into real machine code that your CPU actually runs.

Java has a simiar approach where source code is compiled into bytecode that is then interpreted in a 'Java Virtual Machine' (JVM).

 

Flash interpreter java virtual machine python language

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: Flash and Virtual machines

 

Copyright © www.teach-ict.com