DWScript status update
DWScript SVN repository has been fleshed out during the last days:
- there are now several samples, an half-decent collection of unit tests, and the “classes” library module which offers basic containers.
- code should be compatible with from Delphi 2009 to Delphi XE.
- some more optimizations got enabled.
- timeouts for script execution are now specified in milliseconds (used to be seconds).
A 7zip snapshot of the SVN is available here and will serve as preview.
On a side note, I re-ran the informal performance tests: they are now running about twice faster than during my previous post. Also, one of the demos is used as a floating-point benchmark, and renders a Mandelbrot fractal (once with Delphi, once with DWS). It’ll serve as reference for future progress and help detect performance regressions.
Things on the radar for DWS
Or a roadmap of sorts. The basic idea is to maintain forward compatibility for the “external” aspects: the language and the components. At the same time, the internals of DWS will be subject to evolution, incremental Darwinian evolution, rather than a straight break into some next-gen architecture.
DWScript first bits now available
They are released in the SVN source repository on google code, at
http://code.google.com/p/dwscript/
The core compiler and some internal libraries are there, along with a few unit tests, but no demos just yet. It’s compatible with Delphi 2009 (and 2010?) only at this point.
Informal DelphiWebScript performance tests
I’ve made some informal performance tests on DWS vs PascalScript vs Delphi.
The PascalScript version was downloaded yesterday, though when compiling, I got many warnings hinting its code hasn’t been fully upgraded to Unicode and D2009, so maybe it wasn’t the latest version? I’m not a user of PascalScript, so if anyone want to chime in, feel free!
The script I used for testing was something like
var s, i: Integer; for i:=1 to 1000000 do s:=s+i;
with only minimal syntax adaptations to get it running and compiling in the various environments. For PascalScript, I tweaked the “sample1” project to run the script, so maybe there were some optimization options not active? If so, let me know!
The result timings on my machine were (including compilation and execution, except for Delphi):
Delphi: <1 msec (using 32bit integers), 1.5 msec (using 64bit integers)
DWS2 revival: 150 60 msec in D2009 (using 64bit integers)
DWS2 vanilla: 420 msec in D7 (using 32bit integers)
PascalScript: 1860 msec in D2009, 1490 msec in D7 (using 32bit integers)
Note that in DWS2 revival, integers are 64bit integers (more on that and other changes later).
I then redid the test using a double precision float for the “s” variable: Delphi goes up to 15 msec, DWS2 revival increases to 180 95 ms (vs 670 ms for vanilla), PascalScript results were unchanged.
Last test consisted in moving the “s:=s+i” to a function, to measure the call overhead. Delphi laughed at me and stayed with roughly the same figures, PascalScript went up to 3000 msec, and DWS2 revival took a hit to 1000 msec. Function calls are indeed a DWS area with still some simplifications and optimizations potential 😉
As for the re-release time-frame, I’m waiting to hear from the original maintainers, as well as removing a few dependencies to make it into a standalone library (currently the compiler itself is standalone, but the DWS library equivalents of system & sysutils units aren’t).
edit 2010-09-01: following a round of cleanup and optimizations, figures for DWS revival are now 60 and 95 msec for 64bit integers and floats respectively.
DelphiWebScript Revival
I’m planning a mini resurrection of former DelphiWebScript (by Matthias Ackermann) which has been dormant for a few years already.
DWS is a 100% Delphi-based Delphi-language script engines, that supports a fairly large subset of the Delphi language (including objects), with a performance high enough for use in real-time scenarios (simulators, game engine scripting…).
We’ve been making use of the library at work for years now, with it receiving updates covering a variety of things from Delphi compatibility, to language enhancements to speed or memory usage optimizations. On the other hand, the parts we didn’t use fell significantly behind (to the point of deprecation), and wouldn’t be part of the revival (unless some extra hands join in for the update).
However, most emails and websites from back then have gone the way of the Dodo, so this post is mostly a call to former DWS2 maintainers, contributors and users to make themselves known if they are interested… if they are still using DWS2 in some form or another, or if they are merely just still around to share memories of a bygone era 😉