Linux Today: Linux News On Internet Time.

More on LinuxToday

Adding support for if, while, and do while, to a simple compiler and virtual machine written in Php

Jan 09, 2012, 20:01 (0 Talkback[s])

[ Thanks to Erik for this link. ]

"In order to obtain a turing-complete programming language, that is, a language in which we can implement and execute any arbitrary algorithm, that is, that other turing-complete machines can execute too, we now need to add a way of (conditionally) branching, that is, the IF statement, and at least one way of repeating statements, that is the WHILE or the DO WHILE statements.

"If you carefully look at real CPU machine code, besides storing and retrieving values in memory, looping and branching is pretty much all that a contemporary Von Neumann CPU can do. Therefore, a programming language is turing-complete, if it can do the same."

Complete Story

Related Stories: