Scriptol Compilers: Frequently Asked Questions

The Scriptol language

Scriptol and PHP

Scriptol and C++

Extensions

Tools

Marketing and future

Can I call the constructor of the base class?

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.

A super statement was added to Scriptol 2 in 2014. It allow to pass parameters to the constructor of the upper class.

My program is not compiled (the C++ code)

I have prepared a simple file called register.sol, but when I invoke solc, I get the following errors:
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
Linking register...
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:
bcc32     or
gcc -v     or
cl /?
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\ 

Scriptol compiles into C++ but compiling C++ produces lot of error messages

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

Can we use Scriptol as a converting tool?

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++.

C++ is case-sensitive

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).

When will be the Scriptol for .Net version available?

There is now project for a .NET version in a forseeable future. A WebAssembly port will be started as soon as WebAssembly will be ready for production.

Anyone is free to port Scriptol to any platform anyway.

How to pass code either to C++ or to PHP?

 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.
 Line starting with # are C++ directives. They are just comment in PHP. The code
below includes the "header.hpp" in C++, but the conditional statements are not compiled and the code embedded is ignored by the C++ compiler.
 The PHP interpreter ignores all lines starting by # and processes the "echo" statement, or any other statement you may have inserted at this place.

~~ 
#include "header.hpp" 
#if 0
  echo "this is PHP code\n";
#endif 
~~ 

But it is useless with Scriptol 2. You can include code for the target file depending on the extension of the file:

include "forcpp.hpp"       // included only in C++ code
include "forphp.php"     // included only in PHP code

My program doesn't work

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").

Can I use OpenGL and Glue with Scriptol?

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.

Can Scriptol compile my PHP scripts?

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.

How to use PHP objects in Scriptol?

I use a PHP object with 5 methods. I use a VAR for the object, the program works perfectly but lot of errors are displayed.

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
Ex:

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

PHP: Form's variables are not recognized

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 

Redeclaration: every OO language should use local namespace

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.

for(int i=0; i<5; i++) { } 

int i; 
while(i < 5) { 
  ...
} 

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:
Example 1 (NOT ALLOWED)

int i
for x in a
  int i = 5     //     bad, i variable already in use 
  print i * x
/for
Example 2 (ALLOWED)
int i
for x in a
  int j = 5
  print j * x
/for

for x in b
  int j = 50       // good previous declaration of j no longer in use
  print j * x
/for

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).
Take note also that variables are always initialized (in the generated target code) in Scriptol.

What runtime files are required to distribute my application?

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 to websites).
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.

Using Visual Studio

Can Scriptol work with Visual Studio?

Scriptol can be integrated into the IDE as an external tool for compiling Scriptol programs as with C++ Builder (version pro).

How convert PHP to C++?

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.

Will Scriptol compiler remain free?

Scriptol compiler are free of charge and remain free forever. I would prefer to sell Scriptol tee-shirts instead :-)
The library is open source and available on GitHub..

How to convert the manual to PDF?

Just load the HTML file into LibreOffice and export as PDF.

Is the Scriptol compiler finished?

There are three levels in the Scriptol Programming Language:

  1. The procedural language,
  2. the object oriented language,
  3. reactive programming.

Plus other features that are planned or in work.
The procedural and object-oriented languages are finished.
The third is implemented in the JavaScript compiler.

A beginner with a need to learn Scriptol

2011-08-13 07:11:07

scriptol

Hello! Welcome to the site. Hope the language will help you.
2011-08-13 06:03:59

patforkin

Hello! I have today both downloaded Scriptol and joined the forum. I am not a programmer but am a writer with an understanding of what I write in English and its structure. I have built a framework to translate my texts into German. This says I know something of the syntactical differences and simmilarities between the two languages. With my framework I divide the text processing tasks into prior to translation and those in support of the translation. The whole set are related to understanding how to extract and rearrange information from text files. Why did I decide to try Scriptol? 1. It seems to have a controlled development. 2. It has a closeness to human language. 3. It has a relationship with XML. 4. It seems to have function offered for text processing tasks. 5. It offers a set of scripts for building a dictionary. When I have read the material I have acquired and tried Scriptol, then I will ask questions. Incidentally, I am publishing an eBook on the Translation Framework next week. Two weeks thereafter I will publish one on writing correct English, which has useful tutorial and explanatory material. It also has a worthwhile "notation database" describing how to write and how to correct English text. This eBook will also include an essay on writing English. I hope that I find interested members who can also help me. Regards, patforkin.

compile problem, g++ *.o No such file or directory

2011-11-08 14:29:49

min

Hello. I'm new to scriptol ,just download and when i try to compile some examples in demos folder I get some errors : I'm using MinGW Scriptol Compiler * C++ Edition 6.2 helloyou.cpp, compiled 5 lines Compiling to native... In file included from /scriptolc/scriptol/libsol.hpp:33:0, from helloyou.cpp:12: /scriptolc/scriptol\dynarr.hpp:401:16: error: extra qualification '_arr32::' on member 'slice' /scriptolc/scriptol\dynarr.hpp:407:16: error: extra qualification '_arr32::' on member 'slice' In file included from /scriptolc/scriptol/libsol.hpp:34:0, from helloyou.cpp:12: /scriptolc/scriptol\array64.hpp:378:18: error: extra qualification '_array64::' on member 'slice' /scriptolc/scriptol\array64.hpp:384:18: error: extra qualification '_array64::' on member 'slice' Linking helloyou... g++: helloyou.o: No such file or directory Not build Can someone help me.
2011-11-09 07:24:22

scriptol

Hello This seems to be a compatibility issue. You may use an older version of MingW libraries to solve it. Or use Scriptol PHP that is in line with the last version of the interpreter.

My program is not compiled (the C++ code)

2007-09-18 03:11:06

regilad

I have prepared a simple file called register.sol, but when I invoke solc, I get the following errors: 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 Linking register... 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 (...)
2007-09-18 04:56:27

scriptol

You don't need to put the path of the C++ compiler in solc.ini. Just verify that the program, is visible. Type: bcc32 or gcc -v or cl /? 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\

Windows 7 and implements the Scriptol language

2011-01-04 20:14:00

ANALYST

[color=#FF0000]Skriptol code is not running on Windows 7 x86. :([/color] -- Code: class Car int speed int power int getSpeed() return speed int getPower() return power void setSpeed(int s) speed = s return /class -- >si Car.sol >Exit code: 255
2011-01-05 13:27:24

scriptol

Hello The Scriptol interpreter works perfectly on Windows 7. But it is not finished. Classes are not implemented yet. The same program can be executed with Scriptol PHP.

Error compiling PHP

2007-09-20 15:14:37

lando

(not speaking full english) My installation in Windows XP: C:\scriptolc My scriptol not compiling, cl.exe and link.exe not command. Thank you form help me. Scriptol Compiler * C++ Edition 6.2 printhi.cpp, compiled 1 lines >Exit code: 0 >solc -be printhi.sol Scriptol Compiler * C++ Edition 6.2 printhi.cpp, compiled 1 lines Compiling to native... 'cl.exe' not command Linking printhi... 'link.exe' not command ‚ reconhecido como um comando interno ou externo, um programa oper vel ou um arquivo em lotes. Not build >Exit code: 1
2007-09-21 04:21:04

scriptol

I believe you have not installed Visual C++. If you have problem with Visual C, install either Code Gear's BCC 5.5 and copy solc.bcc over solc.ini or install MingW and copy solc.gcc over solc.ini. I am working on a better integration of solc with Visual C++ Express, that works providing you open the Visual console, not the DOS windows of Windows. This command line windows is available from Visual C++ Express >> Visual Studio Tools.

GUI for Scriptol

2007-12-04 12:55:22

aol2

Some thoughts regarding GUI development for Scriptol programs. The current options leave much to be desired. - I'm looking for Scriptol examples on how to use the wxWidgets library. Any help would be appreciated. - Just came across a graphical editor for creating GUIs for Python programs called FarPy [url=http://farpy.holev.com/]http://farpy.holev.com/[/url]); the software uses the wxWidgets library. Rather than generating Python code directly, it generates an XML-based code that can be converted to other languages (Python being one of them). I wonder if this editor can be developed as a GUI development environment for Scriptol. - Another possibility (among many) is to follow the Boo model; Boo is another simple to write object-oriented but not very well known programming language yet it is supported as one of the languages that can be directly used for writing codes in the SharpDevelop IDE.
2007-12-04 13:11:19

scriptol

Should be easier to use any GUI system with Scriptol than with Python since Scriptol can integrate any C++ libraries providing an interface is written in Scriptol for it. For the PHP version, an example is provided on the site with the [url=https://www.scriptol.com/winbinder.html]Winbinder GUI system[/url], that works well with Scriptol PHP. Due to lack of time, I have not yet tried wxWidgets but I know it for a while and I don't see any difficulty to apply it to scriptol too. The problem of Boo is different. It is implemented on .NET and can so directly make use of the classes of this framework. There is a project to implement either XUL or XAML in the same way that Winbinder. Just a matter of time!