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)
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,realand 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
dyntype (renamedvarin 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
xis writtenx + 1in statement position, notx += 1. (A compound assignment form for the union of arrays was nevertheless added in 2002.) - Conditions without parentheses.
if x < yandfor int i in 0..10need 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
solcshipped 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.
| Revision | Year | What changed |
|---|---|---|
| Scriptol 1 | 2001 | The original PHP front-end; dyn variables, embedded light-form XML, scan by, dir type, Java class imports |
| Scriptol 2 | 2014 | dyn 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 3 | 2016 | JavaScript-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
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