Scriptol - Scripting, XML and Web 2.0
The Scriptol language has been created in 2001 by Denis G. Sureau.
It was defined according to seven rules: simplicity, security, conformance
to standards, objectivity, multiple orientations, portability, easy
teaching.
The scriptol code is either interpreted or compiled in Php or C++, a
scriptol program may be built as a binary executable.
Control structures are different and more powerful than in classical
languages, allowing pattern-matching and automata (DFA). Security is
one main goal of the language and variables are typed.
It is an universal language for making dynamic web pages, scripting,
prototyping or GUI based applications. It integrates XML either in the
source or from a loaded file.
Features
- Universal: suited for applications, scripts or web pages.
- Typed variables.
- Object oriented. Even primitives and constants have methods.
- XML oriented: Xml is a data structure of the language.
- Control structures are safe while .. let, for .. in, etc...
- Pattern-matching and automata easy with the do..case structure.
- Rules are easily implemented thanks to the composite if structure.
- Multiple assignments. A function can return several values.
- Indexed or associative arrays.
- Can use APIs of Php, Java or C++.
The language
Syntax
Statements are terminated by end of line.
Xml-like terminators: /if, /while, etc...
Each operator has only one usage, not several acccording the context
as in C.
Scalar types are those of the real life: text, number, real, etc...
Compound assignments have the form:
x + 1 // means for: x = x + 1
Data scructures
Scalars, xml, class.
Control structures
- if ... else, composite if
- for ... in ... step
- while ... let
- do case ... while, do case ... until
- break, continue, return
Composite if
if a
= 10: print "equal"
< 10: print "less"
else
print "more"
/if
While
The while structure has several form and the let terminator protects againt infinite loops.
while x < 10 print x let x + 1
Function definition
The header is similar to that of C but several types may be returned together. The terminator is the return statement, only the kayword if the function returns nothing.
int, text funcname(... arguments...)
...statements...
return a, b
Why to use it?
- For web pages programming: Scriptol may be compiled into PHP, thus
it is portable. The compiler detects errors before running the program.
- For script writing: This a clear and powerful language, very intuitive.
- For prototyping: test a scriptol program with the interpreter and
produce a C++ source for inclusion into a large project.
- For faster programming and source protection: use the interpreter
to debug the program, then distribute a binary executable.
- It may be used along with a RAD (Rapid Application Development)
tool as C++ Builder or Visual Studio.
- It is a front-end to XML parsers.
Sites
| Download a free and easy to install interpreter or binary compiler. Site of the language. | |
| Scriptol and PHP with a compiler. Tools and scripts for building Web 2.0 applications. | |
| Main worldwide download location for a compiler. | |
| The Scriptol project, hosted by Sourceforge. | |
| Compare Scriptol with syntax of other languages. | |
Sample code
|
Hello world!
|
print "Hello world!" |
|
Merging and displaying lists
|
listdemo = (1,2,3) + (4,5) subdemo = listdemo[1..3] scan subdemo print subdemo[] /scan >>> should print: 2 3 4 |
|
Embedding code
into html page |
<?sol print "code embedded inside html"; ?> |
| Compare the syntax of Scriptol and other programming languages. |
