Scriptol is a human-oriented programming language
The syntax is familiar to human and easy to read and understand.
Human orientation of Scriptol compared to older programming languages
The language has been designed mainly with the goal to be near the
human thought. I had applied the Descartes' method to search for the
truth, that is asking for the reason of each feature of classical languages.
If a thing has been used only for a reason that no longer exists (the
low speed of computers for example), thus this feature is pulled out
of the language.
Contrariwise, I want not to use new syntax only to change the language, I prefer to keep what programmers are used with if this works well. For example, I have exhumed the nil keyword from the very old (40 years old!) Lisp language, because nil is just what I need, and I want not to use new words just to be different.
Number and text
Previous languages use for variables such types as float, string, char, short, etc... This matches memory fields and comes from the epoch of computer having 48 k bytes memories. Scriptol uses simply number and text, and also real or integer to distinguish numbers.
Type followed by the name
Declaring a variable in scriptol is as easy as in C:
In human language: "An integer named i". Some new programming language want be sophisticated by writing:
var i: int;
"I create a variable i of type integer." This we would express things in the same way in everyday life, that gives: "I have a home of type house". In a program, it does not really add anything more.
Pure statements: no assignment inside expressions
The statement if(x = y) in C++ lets y assigned to x and tests if x
is 0. In Scriptol, this tests is x equals y. The == double operator
is not used by Scriptol.
C, then Java, PHP and C#, allow to merge a condition and an action. Ex: if (A = B + 1) then .... In human language: "if non zero is A assigned the sum of B and 1, then... "
A such merging of ideas in not allowed in Scriptol.
Statements are expressions in C and successors, not in Scriptol.
The statement x = x + 2, is written x + 2 in Scriptol. This is the way human thinks. (Ex: "my car has moved one km", rather than: "my car has moved from the current place to the current place plus one km".)
Operators and symbols
Symbols have just one sense Scriptol and are not used for different operations, unlike other languages.
Thanks to special control structures, composite if and do case - never implemented before - Scriptol allows to structure the code in a way that transposes directly the human thought.
It has been said that a program must use semicolons because we use
such punctuation when we are writing. One doesn't put semicolons into
musical partitions however...
The real purpose of semicolons in programs, I believe, is to allow to split lines without confusing the compiler. But the modern Scriptol compiler is able to recognizes splitted lines and thus, doesn't need for another terminator when a statement is terminated by the end of the line. Scriptol needs for semis only to separate statements on a same line.
For some functions, it is obvious that they must return several values at once. For example, the components red, green, blue of a color, or the x and y coordinates of a point... And so, to match the way human thinks, it should be possible to assign several variables at a function call:
x, y = getCoordinates() red, green, blue = getRGB()
Scriptol (like some other modern scripting languages) does that.