I will provide a set of short and simple Pliant programs to demonstrate various Pliant language basic features. You may use the Pliant interpreter to test these.
Here is our first program:
console "Hello world" eol
Displays 'Hellow word' on the text mode console. The 'eol' parameter at the end stands for end of line (move the cursor to the beginning of the next line).
'console' instruction accepts any number of parameters. All of them will be converted to a string representation and sent to the output stream one after the other:
console "The result of the computation is: " 3+2 eol
The third sample is the same, but with a comment at then end of the line. Anything after '#' sign is ignored:
console "The result of the computation is: " 3+2 eol # this is a comment
In a procedural computing language, the simplest view of a variable is a cell that can store a value. Let's try it:
var Int i := 3 # this works only in the interpreter, the reason will be provided later
In math, the expression i=i+2 would make no sense. The reason is that math is static: you write assertions that are all true at any time and so are unordered. In a procedural computring language, you rather write instructions that are executed one after the other, so we could as well call it sequencial programming.. As a result, i := i+2 means: read the value of 'i' memory cell, add 2, then store the result back to 'i' memory cell.
Procedural (sequencial) programming is not the only possible programming paradigm. Logical programming also exists, where a variable value will be undefined then will be defined with a stable value (will not be changed) just like with math. The underlying computing model of logical programing languages is named unification and is the way to use the already defined variables to get more of them defined until all of them are which means that the problem is solved.