Programing Language and Their Computational Model
as years go by, i get more insights about programing languages. for computation to happen, you need: ① a machine. ② instruction set. (this is the programing language) ③ recipe, using the lang (this is your code/script)
because lang needs a machine, and machine can be very different. e.g. • cpu/chipset • abacus (japanese, chinese, number of columns, or 2 piles of stones on sand) • cellular automata • molecules (dna comp) • traditional axiomatic math. the lang can be quite diff.
On the surface, diff langs are similar. e.g. perl python ruby. All have function, variable, list, hashtable. But often they are really quite diff. BECAUSE, they are for different machines. A high level abstract ideal machine, we say “computational model”.
For example, both perl and python have object as in OOP. However, “object” is a core concept of python, but does not exist in perl. Rather, perl has concept of reference, from which, programer notion of oop object is based on.
in lisp, object of oop sense does not exist in the lisp language model. The lang does have concept of object, but it means roughly compiled code. The programer sense of oop object, is done as so-called multi-dispatch system or “common lisp object system”.
in lisp and Mathematica, these lang have a concept of symbols, often said to be symbolic languages. It is a core element of the lang. It means, the whole lang, is based on processing sequence of symbols (for non-lispers, it roughly mean manipulating tokens identifiers keywords.)
It's most easy to see language's model (i.e. The machine it is designed for), by looking at assembly languages. Here, we don't even speak of “computational model” anymore. Because, their model is directly a machine, a specific cpu chip.
ok. the point of this thread so far, is that: ① the 3 things computation needs. ② specifically, each language has a associated machine it's designed for. ③ the machine of a high level langs, are often called its “computational model”
most programing language don't have any explicit notion nor exact spec of their computational model, because, most just grew out of practice. e.g. perl came from shell script. php came from perl scripts. Ruby's conceived as improving perl. almost no high level lang began with a model.
now let's look at some lang specs.
- perl http://perldoc.perl.org/index-language.html
- python https://docs.python.org/3/reference/index.html
- scheme https://schemers.org/Documents/Standards/R5RS/HTML/
- racketlang https://docs.racket-lang.org/reference/index.html
- golang https://golang.org/ref/spec
- and here's java lang spec https://docs.oracle.com/javase/specs/jls/se10/html/index.html
Note that they are bewilderingly different in what they seems to cover. You'd think they all high level languages in about the same field so that their spec should have the same structure/topics that only differ in detail.
If you have a question, put $5 at patreon and message me.