What is Scriptol?

During the search, I came across this . It looks interesting, but I don’t know what it is for. I like it because you can compile php, a language that I don't like a lot, which is really useful. This may be the way I can use php without touching it. The language is strange, is there anyone who has tried it?

thanks

+4
source share
2 answers

The first thing I see is that the last project change in the project was in 2007 (maybe 2008, I can’t say what third-party projects are), so it’s out of date. Scriptol compilers seem to take the Scriptol code you wrote and compile it in an executable file for that language.

I tried the solp.exe file (PHP compiler) with the Fibonacci example on the website. Here is the Scriptol fib.sol file:

int fibmax = 20 int fibonacci(int n) int u = 0 int v = 1 int t for int i in 2 .. n t = u + v u = v v = t /for return v for int x in 1..fibmax echo "fib(" , x , ") ", fibonacci(x), "\n" 

Here is the created fib.php file:

 <?php $fibmax=20; function fibonacci($n) { $u=0; $v=1; $t=0; for($i=2;$i<=$n;$i++) { $t=$u+$v; $u=$v; $v=$t; } return $v; } for($x=1;$x<=$fibmax;$x++) { echo "fib(",$x,") ",fibonacci($x),"\n"; } ?> 

It does not interact with your web server, so you must compile the scripts - in the case of PHP, instead of compiling into a .exe file, compiling the .php file to run your web server. C ++ and if they were done, .NET would compile into .exe. (I tested the C ++ compiler, but since I don't have a real C ++ compiler on my PC, it just created fib.cpp.)

This is an interesting idea, I think: create a common language that has compilers in order to turn it into another language. I do not know any language that has successfully done this. I think it would be more prudent to just learn the language you are compiling, but the idea that you could compile in several languages ​​is cool. Unfortunately, it seems that Scriptol has not been affected for years.

+1
source

Scriptol is a scripting language with object-oriented, xml-oriented, extensible, universal, uses C ++, PHP or Java API, and XUL for graphical user interface.

The scriptol file must have a .sol extension,

It is not completely in transit.

Here is the basic skeleton:

  int main() ... statements ... return 0 main() ...starting the program 

Script code embedded inside html:

 <?sol ...code... ?> 

Features http://www.scriptol.net/manual.html :

Scriptol can be defined as:

object oriented. - XML-oriented (XML-document may be a data structure in the source). - universal: used to create scripts, dynamic web pages, create executable files. - natural: the types of variables come from science, not from hardware: number, text, real ... - XML-style syntax. - Shows new and very powerful control structures. - list processing on arrays and dictionaries. - compatibility with PHP, C ++ and Java. It is an understandable language thanks to: - Simple syntax. - statements ending with the end of lines. - the same operator for ranges, slices, splices ... - the same syntax for all structures.

Case-Sensitivity on: - You cannot use a word in either lower or upper case. - The keyword must be lowercase. - Identifiers are case sensitive, but you cannot redefine the identifier with another case.

Identifiers: - Size up to 255 characters or less in accordance with the target language. - lower or upper case. - start with a letter, continue with letters, underscores or numbers.

Numbers: - int signed 32 bits. (like "int" in C). - naturals have 64 unsigned bits. - realities, numbers - 64 bits with a floating point. ("double" in C)

Cast: - casting using methods.

Garbage collector: - automatic memory management, there is no need to allocate and free memory.

Object-oriented: - primitives are objects and have methods. - literals are objects and methods. - unidirectional. - overloading methods (only in Scriptol C ++). - designers. No destructors.

XML Oriented: - XML ​​documents can be included in Scriptol sources. XML is a data structure of a language. - instances of XML documents.

0
source

Source: https://habr.com/ru/post/1312162/


All Articles