Est. 2001 Beginner

Scriptol

Scriptol is Denis Sureau's object-oriented, XML-aware scripting language that compiles to PHP, C++ or JavaScript rather than running on an interpreter of its own

Created by Denis Sureau (France)

Paradigm Procedural and object-oriented, with XML-oriented data structures; later versions add reactive programming and a "goal-oriented" control structure
Typing Mixed: variables may be statically declared (int, real, text, array, dict) and checked at compile time, or left dynamic (dyn, renamed var in Scriptol 2)
First Appeared 2001
Latest Version Scriptol to WebAssembly compiler 21.8 (September 2021); the language itself last revised as Scriptol 3 in 2016

Scriptol - the name is a contraction of “scriptwriter oriented language” - is a small, opinionated programming language created by the French developer Denis Sureau in 2001. Its defining choice is that it has never really been a language with a runtime of its own. Scriptol is a source-to-source language: you write .sol files, and a compiler translates them into PHP, into C++ (and from there to a native binary or, much later, to WebAssembly), or into JavaScript. The language supplies the syntax, the type checking and the abstractions; the target platform supplies the standard library, the deployment story and the speed.

That made Scriptol an unusually early example of a pattern that is now everywhere. As the author himself puts it in the History section of the project’s About page, “What Scriptol was to PHP is what languages like Dart and TypeScript are for the JavaScript language” - a typed, class-based layer sitting on top of a popular but loosely typed scripting language, compiled away before anything runs.

History and Origins

In 2001, PHP 4 was pre-installed on essentially every shared web host, which made it the path of least resistance for dynamic web pages - and also, in Sureau’s view, a language missing several things a programmer would want. It had no proper class model, no for-each loop over arrays, and no compile-time type checking. Scriptol was designed to provide those and then emit ordinary PHP that any host could run.

The paper trail is precise. The definition of the language was registered with France’s INPI (the national industrial property institute) under number 114223 on 12 October 2001, and the Scriptol Language License is dated 22 October 2001 - the same day version 1.00 of the Scriptol-to-PHP compiler, solp, was released. The licence is worth noting for what it does and does not cover: it separates the language, which is free and public and which anyone may implement, from the compilers, which were originally shareware-ish and only became open source later. Implementers were granted permission to write their own Scriptol compilers on the condition that they implement the whole language, with a carve-out for subsets targeting limited devices.

Development in the first year was rapid and incremental. Inheritance arrived in 1.1 on 11 January 2002; a week later 1.2a unified the array and dict types behind a common method set and added a function type so functions could be passed as arguments. Version 1.3 went final on 4 April 2002 with Windows and Linux builds.

Then came the twist that gave Scriptol its second life. On 28 June 2002, version 2.06 shipped the first public release of solc, a compiler that translated the same Scriptol source into C++ and on to a native executable. As Sureau explains it, the C++ compiler was added “because I thought binary executables from the same scripts could be nice.” One language, two very different deployment targets - a web script and a compiled binary - from identical source. A standalone interpreter followed as well, written, in the author’s words, “just for fun.”

Design Philosophy

Scriptol was designed against a written list of seven rules: program as you think, safety, common conventions, objectivity, no limited orientation, portability, and easy learning. In practice this produced a set of very concrete syntactic choices:

  • Types modelled on human concepts, not hardware. The primitive types are text, number, integer, real and so on - mathematical sets rather than machine word sizes.
  • Optional static typing. You may declare a variable’s type and have the compiler check assignments, or use the dynamic dyn type (renamed var in Scriptol 2) and defer to runtime. In 2001 that combination was rare in scripting languages.
  • One access symbol. No -> and no ::; a dot serves for every kind of member access, whether the target compiles to PHP or to C++.
  • No augmented assignment. The documentation states that adding one to x is written x + 1 in statement position, not x += 1. (A compound assignment form for the union of arrays was nevertheless added in 2002.)
  • Conditions without parentheses. if x < y and for int i in 0..10 need no surrounding brackets, and ranges use Pascal’s .. rather than a colon.
  • Block structures closed by a named tag. A loop ends with /for, a conditional with /if, an XML-ish symmetry that runs through the whole grammar.
  • No manual memory management. From version 3.4 in April 2003, native executables produced by solc shipped with a garbage collector.

Two of its control structures were designed as safety features rather than conveniences. The composite if merges a conditional and a switch, letting a single construct dispatch on arbitrary values and relational tests. The while let form was introduced specifically to protect against non-terminating loops.

Sureau has argued that a number of these choices were later independently adopted by mainstream languages - parenthesis-free conditions in Go and Swift, .. ranges in Rust and Swift, optional-plus-dynamic typing in Dart and TypeScript, XML literals in Scala. These are the author’s own comparisons rather than documented lines of descent, and no external source traces any of those designs back to Scriptol.

XML as a Data Structure

The feature the language was best known for - and the one Wikipedia’s stub entry singles out - is that an XML document can be declared as a class, or embedded directly in a source file. In the original 2001 language, XML written inline was parsed by the compiler into a DOM tree that Scriptol statements could then walk and modify, with libxml or expat used to load documents from disk in the C++ back end. Scriptol 2 changed the approach: XML in the source is now written in ordinary XML form and compiled into a multi-level associative array, so the whole document is reached through the ordinary dict methods, and a dict can be serialised back to XML. The same machinery handles SVG files.

The stated motivation was mundane and practical: XML makefiles, configuration files and data documents are things programs read constantly, and Scriptol wanted them to be a native data structure rather than a parsing chore.

Evolution

The language went through three numbered revisions, the compilers through many more.

RevisionYearWhat changed
Scriptol 12001The original PHP front-end; dyn variables, embedded light-form XML, scan by, dir type, Java class imports
Scriptol 22014dyn becomes var, constant becomes const, [] for arrays and {} for dicts as in JavaScript, super for superclass constructors, real XML compiled to a dict, react reactive variables; Java calls and scan by dropped
Scriptol 32016JavaScript-targeted additions only, with no changes to the core language; supported in full by the JavaScript compiler and partially by the C++ one

The 2014 revision was driven by a change of target. By the mid-2010s Sureau had concluded that a standalone interpreter was a dead end - too slow, and requiring an enormous library that would have to be written from scratch - and that compiling to JavaScript solved both problems at once, since the library already existed and the code would run in any browser or under Node.js. The Scriptol-to-JavaScript compiler was published in September 2014.

That back end also made two genuinely unusual features practical:

Reactive variables. A variable declared react recalculates itself whenever any reactive variable it depends on changes, exactly like a spreadsheet cell:

react A = B + C * 10

Assign a new value to B or C and A updates. A reactive variable can also be given an output function so that its new value is pushed into a web page element. Sureau describes Scriptol as the first procedural language to integrate reactive programming this way.

Goal orientation. The to structure states a condition, a time budget and optionally a delay, and repeats a block asynchronously until the condition is satisfied or the budget runs out:

int ai = 50
int bi = 5

to ai >= 100 for &
  ai = ai + bi
  print ai
/to

The & symbol stands for unlimited time. Multiple goals in one program interleave, because the generated JavaScript is built on setInterval and setTimeout - which the documentation is careful to describe as not real concurrency, merely something that resembles it. A synchronous variant (to ... while ...) runs goals one after another. The intended application was robotics and simulation: several independent quantities each being driven toward a target value.

Neither feature was ever implemented for the PHP or C++ back ends, which the compiler comparison page states plainly - reactive programming, goals, promises and async/await are marked as unavailable outside JavaScript.

Performance

Scriptol made no broad performance claims, and the one concrete figure in its documentation should be read carefully. The changelog for version 3.6 (June 2003) states that the typed arrays introduced in the “enterprise edition” of the C++ compiler are “100 times faster than associative arrays,” and points to a bundled demonstration program, ta_test.sol, as the measurement. That is a comparison between two of Scriptol’s own data structures - a typed array of integers or text against the general associative array - in generated C++ code, not a comparison against any other language. No methodology, hardware, compiler version or input size was published, so the figure is best treated as an illustration of the gap between the two representations rather than a reproducible benchmark.

The broader performance story is simply that Scriptol inherits whatever its target does. Compiled to C++ it produces native binaries; compiled to PHP or JavaScript it runs exactly as fast as the PHP or JavaScript it emits.

Current Relevance

Scriptol is dormant as a language. The last compiler releases were the PHP 8 back end on 1 April 2021 and the WebAssembly archive dated 2 September 2021; the JavaScript compiler’s last published build is version 2.5 of July 2018, and the C++ line ends with version 18.6 on the download page, though the last C++-specific changelog entry is 17.7 of July 2017. The core language has not changed since Scriptol 3 in 2016. The SourceForge project that hosted the open-source compilers records its last update in April 2013, and the Wikipedia article remains a three-sentence stub whose citations are to Freshmeat and HotScripts pages that no longer exist.

The compilers do remain downloadable from scriptol.com, and the wider site is still maintained - its pages carry copyright notices updated through 2025 - though the material added since is on general programming topics rather than on Scriptol. The domain history is a small archaeology puzzle of its own: the project moved from scriptol.net to scriptol.org in March 2012 and now lives at scriptol.com, with a French mirror at scriptol.fr.

It never acquired a community. A search of Rosetta Code returns nothing, and there is no package ecosystem, no known third-party implementation despite a licence that explicitly invited one, and no documented industrial deployment. Everything written in Scriptol that can be identified today appears to have been written by its author.

Why It Matters

Scriptol is worth remembering less for what it achieved than for what it anticipated. In 2001 the idea of writing a typed, class-based language that compiles down to PHP was distinctly odd; a decade later, CoffeeScript, Dart and TypeScript made the equivalent idea for JavaScript into one of the dominant patterns in web development, and PHP itself absorbed most of what Scriptol had been adding to it - real classes in PHP 5, then gradual type declarations. The language’s own trajectory tracked that shift honestly, moving its primary back end from PHP to JavaScript in 2014 and then to WebAssembly in 2021, each time following where the free runtime was.

It is also a clean example of a category that fills a large share of any encyclopedia of programming languages: the thoroughly documented, carefully designed, entirely solo language. Scriptol has a registered specification, a licence written to encourage reimplementation, a reference manual, a Wikibooks textbook, four compiler back ends and twenty years of dated changelogs - everything except users. The reasons are not mysterious. It arrived without a library of its own, without a community, and in direct competition with the very language it compiled to, whose own gaps were closing year by year. What survives is an unusually complete record of one person’s argument about how a scripting language ought to look.

Timeline

2001
Denis Sureau designs Scriptol as a front-end to PHP 4, adding what PHP then lacked: classes, a for-each loop over arrays, and type checking at compile time. The definition of the language is registered with the French INPI under number 114223 on 12 October
2001
Version 1.00 - the first release of the Scriptol-to-PHP compiler, solp - is published on 22 October, the same date carried by the Scriptol Language License. Version 1.0l follows on 28 December, adding methods on literals such as "DEMO".length()
2002
Small updates continue: 1.0m (2 January) adds Java support and chained method calls, 1.0n and 1.0p follow within the week. Version 1.1 (11 January) implements class inheritance. Version 1.2a (17 January) unifies array and dict behind a common set of methods and introduces a function type so functions can be passed as parameters. Version 1.3 goes final on 4 April, with builds for both Windows and Linux
2002
Version 2.06, dated 28 June, is the first public release of the Scriptol-to-C++ and native compiler, solc. From this point the version number encodes the release date - the year minus 2000, then the month
2003
Version 3.4 (April) adds a memory manager with a garbage collector to generated native programs. Version 3.9 (October) brings partial PHP 5 support behind a -5 option, try/catch exception handling described as an alpha feature, an import tag for declaring external Java classes, and embedded XML in Scriptol sources for the solc compiler
2004
Version 4.3 (March) introduces the Scriptet concept, implements literal arrays, and lifts the limit on array dimensions for both the PHP and C++ back ends. Version 4.7 (December) makes typed arrays of int, text and real part of the common language and adds OpenGL demos to the C++ archive
2005
Version 5.2 (May) adds the input statement and builds the common maths functions into the language; 5.3 (June) adds multi-line strings delimited by ~~ markers. On 25 July the distribution is split into two archives, one per compiler
2006
On 1 February Scriptol moves to SourceForge for its forum, mailing list and source hosting; the licence changes with version 6.0 in March, which the changelog describes as putting the Scriptol library and part of the compiler under the Mozilla Public License 1.1. PHP 5 compatible releases follow through the year, starting with 6.0 in May
2014
Scriptol 2 arrives. The Scriptol-to-PHP compiler is the first to support it on 11 September, and a new Scriptol-to-JavaScript compiler is published on 24 September. The revision renames dyn to var and constant to const, switches literal arrays to JavaScript-style [] with {} for associative arrays, adds super and the react type, changes # to the comment marker, drops Java calls, and replaces the old light-form embedded XML with real XML compiled into an associative array
2015
The JavaScript compiler becomes the only back end to implement the spreadsheet-style react variables defined in Scriptol 2, and version 1.5 (14 April) introduces the goal-oriented to ... for ... /to control structure, which repeats a block asynchronously until a condition holds or a time limit expires
2016
Scriptol 3 is defined - a JavaScript-focused revision that adds functions for generating JavaScript without further changes to the core language. The JavaScript compiler 1.8.1 supports it from 18 July; the Scriptol-to-PHP compiler gains PHP 7 support on 2 July
2017
The C++ compiler 17.6 (June) adds Scriptol 3 support and switch/case, while explicitly leaving promises, goals, async/await, reactive programming, XML-to-dict and function arguments unimplemented for that back end. Version 17.7 (July) follows with the arrayval conversion function and a library rework. The JavaScript compiler adds async/await and switch/case in versions 2.1 to 2.3
2021
Two last releases: the Scriptol-to-PHP compiler 21.4 targets PHP 8 on 1 April, and version 21.7 extends the C++ back end to emit WebAssembly via Emscripten, shipped as the Scriptol Wasm 21.8 archive dated 2 September. No later compiler release has been published

Notable Uses & Legacy

Wikibooks - Scriptol

An open textbook on Wikibooks covers the language's distinctive constructs in dedicated chapters, including "For In", "While Let", "Scan By" and "Xml or class". It is the main third-party documentation for Scriptol outside the author's own site

SourceForge Scriptol project

From February 2006 the compilers and the runtime library were hosted on SourceForge under the Mozilla Public License 1.1, described there as a "compiler and interpreter for the Scriptol programming language". The project page records its last update in April 2013

ScriptolBrowser and ScriptolCanvas

Support libraries shipped with the JavaScript compiler for driving a browser page and for drawing SVG into a canvas, alongside svgtojs.sol, a Scriptol script that converts SVG images into JavaScript objects

Scriptol to WebAssembly

The final compiler line uses the existing C++ back end as an intermediate step, passing generated C++ through Emscripten to produce WebAssembly modules for the browser or for command-line execution under Wasmer - with the documented caveat that file-system access is unavailable in that target

Software directories of the 2000s

Scriptol was distributed through the download sites of its era - a Freshmeat project entry cited as of 2003, a HotScripts listing for the C++/binary compiler in 2002, and a Softpedia page for the PHP compiler, which still lists version 18.5. Those listings are the main traces of Scriptol outside the author's own sites

Language Influence

Influenced By

Running Today

Run examples using the official Docker image:

docker pull
Last updated: