Virtual Machines Explained

  Some parts of this page/site are currently incomplete & will be updated asap
  Other parts will change continually so use “Refresh” in your browser !!
  There is extensive use of “Tooltips” text to support learning which do not seem to render on a Smartphone. This site is best viewed via a computer’s HD monitor


Previous Page: figForth's Dictionary

It is “an abstract computing architecture or computational engine that is independent of any particular hardware or operating system…“ (Taivalsaari 2003, p. 8)

A virtual machine can be extremely powerful. It need only exist in somebody‟s mind… The classic VM is the product of one of computing science’s greatest minds; Alan Turing’s 1936 thought experiment, now known as the “Turing Machine” (Turing 1936)

Image#1: A modern online Java representation/implementation of a Turing Machine
(Husband 2020), based on (Schweller 2003)

“A Turing machine is a mathematical model of computation that defines an abstract machine that manipulates symbols on a strip of tape according to a table of rules. Despite the model’s simplicity, given any computer algorithm, a Turing machine capable of implementing that algorithm’s logic can be constructed”   Source: Wikipedia

“The machine operates on an infinite memory tape divided into discrete “cells”. The machine positions its “head” over a cell and “reads” or “scans” the symbol there. Then, based on the symbol and the machine’s own present state in a “finite table” of user-specified instructions, the machine first writes a symbol (e.g., a digit or a letter from a finite alphabet) in the cell (some models allow symbol erasure or no writing), then either moves the tape one cell left or right (some models allow no motion, some models move the head), then, based on the observed symbol and the machine’s own state in the table, either proceeds to another instruction or halts computation”
Source: Wikipedia

“The Turing machine was invented in 1936 by Alan Turing, who called it an “a-machine” (automatic machine). With this model, Turing was able to answer two questions in the negative:”

  • “Does a machine exist that can determine whether any arbitrary machine on its tape is “circular” (e.g., freezes, or fails to continue its computational task)?”
  • “Does a machine exist that can determine whether any arbitrary machine on its tape ever prints a given symbol?”
    Source: Wikipedia

“Thus by providing a mathematical description of a very simple device capable of arbitrary computations, he was able to prove properties of computation in general — and in particular, the uncomputability of the Entscheidungsproblem (‘decision problem’)” Source: Wikipedia

Turing machine gallery

Moving forward in time to 1968, legendary computer scientist, Donald Knuth published the seminal series of books called “The Art of Computer Programming”

His work featured an imaginary virtual machine called “MIX” and its accompanying MIX assembly language 1

Image#2: Knuth’s MIX Virtual Machine   (Knuth 1997, p. 126)

Subsequently a number of high-level languages have employed a VM internally to avoid platform dependence and to isolate programs from hardware details. There are other reasons

(Taivalsaari 2003, p. 10) discusses VMs insightfully, showing a typical high-level VM architecture. I have modified it to show how an embedded Forth system is the application, the virtual machine and the operating system. Note how the Virtual Machine is shown sitting on top of the Operating System which is sitting on top of the hardware. This is how a typical high-level VM works

Image#3: How Forth is more than a Virtual Machine.   (Husband 2011), based on (Taivalsaari 2003, p. 10)

Elizabeth Rather & Charles Moore discuss The Forth Approach to Operating Systems
(Rather and Moore 1976)

The figForth Virtual Machine

A number of high-level languages have employed a VM internally to avoid platform dependence and to isolate programs from hardware details

Image#4: Languages that use Virtual Machines   (Taivalsaari 2003, p. 13)

Image#5: Forth is an “interesting” VM…   (Taivalsaari 2003, p. 30)

As Taivalsaari points out above, the Forth VM is very simple; 2

Next Page: figForth’s Virtual Machine Explained

References:

Husband, D., 2011. M.Sc in IT (Software Engineering). Master’s thesis. University of Liverpool.

Husband, D., 2020. The New Forth Hardware Model. Baremetal Engineer Extraordinaire [online]. Available from: Http://baremetal.engineer/baremetal.software.engineer.pdf.

Knuth, D. E., 1997. The Art of Computer Programming - Vol 1 - Fundamental Algorithms - 3rd Ed.

Rather, E. D. and Moore, C. H., 1976. The Forth Approach to Operating Systems. ACM ’76: Proceedings of the 1976 annual conference. October 1976, Pages 233–240, https://doi.org/10.1145/800191.805586 [online]. Available from: Http://figforth.org.uk/library/p233-rather_The.Forth.Approach.to.Operating.Systems.pdf.

Schweller, K. G., 2003. Turing Machine. Available from: http://web.bvu.edu/faculty/schweller/Turing/Turing.html.

Taivalsaari, A., 2003. Virtual Machine Design. Available from: http://figforth.org.uk/library/VMDesign1.pdf.

Ting, C. H., 2013. Systems Guide to fig-Forth [online]. 3rd ed. San Mateo, CA 94402, USA: Offete Enterprises, Inc. Available from: http://figforth.org.uk/library/Systems.Guide.to.figForth.pdf.

Turing, A., 1936. The Turing Machine. Available from: http://introcs.cs.princeton.edu/java/52turing/.

  1. A man not afraid to use assembly language… 

  2. Surprise, surprise ! 


Updated: 4th March 2022 by David Husband
© 2021 David Husband, a.k.a. Baremetal Engineer Extraordinaire
All Rights Reserved – All Trademarks & Copyrights Acknowledged
All personal information is subject to the Data Protection Act 2018 & the UK GDPR
“ad auxilium aliis ad auxilium sibi”