Scriptol Compilers: Frequently Asked Questions
The Scriptol language
- Redeclaration: every OO language should use local namespace
- How to pass code either to C++ or to PHP?
- Can I call the constructor of the superclass?
Scriptol and PHP
- Can Scriptol compile my PHP Scripts?
- Can we use Scriptol as a converting tool?
- PHPp: Form's variables are not recognized
- Converting PHP to C++
- How to use PHP's objects from Scriptol?
- Scriptol compiles into C++ but compiling C++ produce lot of error messages
- My program is not compiled (the C++ code)
- C++ is case sensitive
- My program doesn't work
- Can I use OpenGL and Glue with Scriptol
- What runtime files are required to distribute my application?
- Willl Scriptol compiler remain free?
- When will be the Scriptol for .Net version available?
- Is the Scriptol Compiler finished?
|I inherit the class Car of the class Vehicle, for example. Can I call the constructor of Vehicle, from the constructor of Car? I do that in Java.|
|Java has the "super" keyword to call the
constructor of a class from the constructor of an inherited class.
There is no equivalent in Scriptol. If you call the constructor of the base class, this create a new instance of the base class. But you can assign the attributes of the base class from the constructor of the inherited class.
|I have prepared a simple file
called register.sol, but when I invoke solc, I get the following
C:\Archivos de programa\scriptol
>solc -be register.sol Scriptol Compiler * C++ Edition v02.11
register.cpp, compiled 1 lines
Compiling to native...
Comando o nombre de archivo no válido
Comando o nombre de archivo no válido
C:\Archivos de programa\scriptol
> I soght the solc.ini file should be adjusted, with the proper location of the MinGW compiler, so I did the following changes (...)
|You don't need to put the path of the C++ compiler in solc.ini.
Just verify that the program, is visible. Type:
gcc -v or
If the version is displayed, the installation is complete, otherwise you have to make the program visible, add its path to the PATH variable into AUTOEXEC.BAT or equivalent:
PATH = %PATH%;c:\bcc55\bin\
|I have been trying for 2 days now to install and run your Scriptol compilers. I go to Borland and download the BCC 5.5. I can compile scriptol programs to .CPP and .PHP, but I can't get any of them to run, even the simple demo one that was included with the archive. It seems like they need a whole bunch of libs, other compilers, include files, etc, etc,... to run. It will compile a CPP file, but when I put the C++ compiler to that, the whole thing blows up. BCC makes a lot of error messages, mainly because it can't find all the include files like math.h, iostream.h, those type files seems to be trying to call include files that don't exist. I have a project to write but so far I've spent 2 times the amount of time on the tools than it would have taken me to do my work!!|
|I usually spend more time to let external C++ programs or librairies
working, than I use on making the Scriptol compiler itself.
It seems that your Borland compiler or PHP interpreter are not correctly installed.
To know if PHP is installed, just type: PHP -v.
But for the C++ compiler it is not so easy. You have to setup two configuration files, bcc32.cfg and ilink32.cfg inside the bcc55\bin directory, with the paths of the compiler for it can locate the files to include, and win32.cfg in the bcc55 root directory.
A complete and easy to use tutorial is available from the net that can help you installing completely the compiler, look at this page
|If "we" (PHP coders) could compile PHP, that would be really good. If you help PHP coders by making a converting tool, then scriptol will become interesting. It's different if you have to recode a script or only modify it a bit after conversion.|
|Scriptol currently compiles Scriptol source to PHP or C++. No need to recode anything, just use it directly from scriptol. Include the file for PHP or the library or object file for C++.|
|You say in the manual that C++ is not case sensitive, but my compiler distinguishes"var" and "Var", for example.|
|The C++ linker may be case sensitive or not depending the setting. I use the mode that works always, both in C++, and in PHP also that is not case-sensitive, as the sources may be used with the two portages (when available).|
|The new interpreter uses its own platform. I expect it to replace
.net with more powerful features.
A .net version is planned however and will be open-source.
To include code either in the C++ target or the PHP one,
we have to use first the scriptol tags ~~ to insert target code,
not processed by the scriptol compiler.
~~ #include "header.hpp" #if 0 echo "this is PHP code\n"; #endif ~~
I have a complete configuration with the Apache server, but my scriptol PHP program displays an error. Here is the code:
<sol include("button.PHP"); ?>
|When you are used with legacy programming language you may encounter such problems. In fact, include is a keyword in Scriptol, you should write either require("button.PHP"); or include_once("button.PHP").|
|If Scriptol is compiled to PHP you have to use a PHP extension. If it is compiled to C++, you can use OpenGL as with any other C++ program. When you use functions from external librairies, you have to add the library to the solc.ini configuration file, of the configuration file of you program (xxx.cfg), and the function must be declared as in the libphp.sol header file.|
|Scriptol compilers take scriptol sources and compile them either into PHP or C++, or into binary executable. What you can do is calling your PHP Scripts from Scriptol program or include them.|
|I use a PHP object with 5 methods. I use a DYN for the object, the program works perfectly but lot of errors are displayed.|
A dyn can only be used with builtin virtual methods. It will
be unsafe if one can use methods of any PHP class without to know
its declaration. You have to declare the PHP class as extern with
all attributes and methods you use. It is recommended (but not
mandatory) to do that with simple functions also
extern class xxxx int attribute void fun(int) .... return /class /extern
Then declare the PHP objet and assign null if the class is not recognized by the PHP interpreter:
xxxx myobject = null
|When I compile a HTML page with Scriptol embedded code, the HTML variables of the forms are not handled by the PHP generated code.|
|If you have installed PHP prior the 4.2 version and
then installed newer version but not updated the PHP.ini file, a
change is required for PHP can recognize html variables. This flag
must be set on in the PHP.ini file in the Windows folder (It is
Off by default since PHP 4.2):
register_globals = On
If you prevent users from reusing short names for block level small-scope usage variables, you run the risk of creating a slew of identifiers. One single omission of an initialization, followed by a use of a variable declared in an outer scope, in an inner scope results in violation of the block sentinel.
Agreed this is a contrived example, however, the point is clear. In order you are expecting "i" being uninitialized and an error or warning be reported. If the declaration of "i" remained within the for block. If it did not, as it used to be in the older C++ standard, this led to side-effects of the loop counter being present in later code, which did not generated a "non-initialized" error/warning. Every OO language implement block-level local namespaces. Redeclarations are not CONFUSING as much as they are CLEARLY indicating that they user has wanted to use a name that exists outside without affecting it.
Here are two examples to show what Scriptol allows or not:
int i scan a int i = 5 // bad, i variable already in use print i * a /scanExample 2 (ALLOWED)
int i scan a int j = 5 print j * a /scan scan b int j = 50 // good previous declaration of j no longer in use print j * b /scan
Scriptol doesn"t allow reusing an identifier for a different
thing in an inner block. It allows to reuse a name in successive
scopes. This suppresses a source of confusing and also is required
for future control structures in the language (actions).
|What I think it's like this:
very good language, it can build .exe, it can provide GUI features...
so I can write some pretty cool applications with it (not related
But then, how I'll distribute my application? What runtime files are required?
For my kind of work is not acceptable to say to user "You need to install and configure PHP first", so this is why I'm interested to use GTK (or .NET in the future).
|If your program is not linked to any library or if it linked only
to static libraries, only the binary executable (.exe under Windows)
have to be distributed.
Static libraries have a ".lib" extension under Windows and ".a" under Unix. They must be added to the ".cfg" configuration file of your scriptol main source.
Dynamic libraries have a ".dll" extension under Windows and ".so" under Unix. When you use a dynamic library, it belongs with a ".lib" or ".a" import library that is just an interface to the ".dll" or ".so" real code. Only the ".dll" or ".so" have to be distributed with the executable you have created. No any other file is required to distribute.
|Can Scriptol work with Visual Studio 6.0 and Visual Studio.net ?|
|A library is furnished for Visual C++ 7.0, and Visual C++ is a
part of Visual Studio. The cl.exe compiler is common to the two
tools. It is also a part of the .net framework.
Scriptol can also be integrated into the IDE for compiling Scriptol programs as with C++ Builder (version pro).
|I want to convert my PHP program to a binary executable. The syntax of PHP is near that of C++, why using Scriptol rather than converting directly the PHP source to C++?|
|Learning Scriptol is a matter of hours. For a PHP program becoming executable, you have to convert the PHP library and this is a matter of years (PHP is born in 1995 and is still under development). The standard PHP library and some extensions are included into Scriptol. If you know other PHP extension compatible with C++, please, let me know...|
| Scriptol compiler are free of charge and remain free
forever. I would prefer to sell Scriptol tee-shirts instead :-)
Scriptol compilers is even partially open source now and available at Sourceforge.
|Just load the html file into Open Office 2.0 and export as PDF.|
|There are three levels in the Scriptol Programming Language:
- the procedural language,
- the object oriented language,
- the XML oriented language.
Plus other features that are planned or in work.
The procedural and object-oriented languages are finished.
The XML part is still in work, meanwhile it is currently usable, and is used by some programs (see at XML).