Status of the DWS JavaScript CodeGen
Here is a quick summary of the current status for the DWScript JavaScript CodeGen, aka OP4JS.
(more…)
Here is a quick summary of the current status for the DWScript JavaScript CodeGen, aka OP4JS.
(more…)
Just a notice: I’ve updated the XE2 single-precision floating point article after using the (up to now) undocumented {$EXCESSPRECISION OFF} directive, thanks to Allen Bauer for chiming in!
Executive summary: this directives enables use of single-precision SSE floating point instruction by the compiler, and brings their performance in line with expectations, making Delphi XE2 64bit compiler the new King of the Delphi Hill.
In the previous episode, it appeared that Delphi XE2 64bit compiler was achieving quite good results, however, after further investigations, things may not be so clear-cut. Transcendental maths, which will be food for a another post, the subject of this one seems to be an issue with single-precision floating point maths.
Dan Bartlett spotted some GLScene source code in FireMonkey, see this thread in the Embarcadero forum for details, parts of the VectorGeometry.pas, Spline.pas and raycasting code have been identified. The code having been incorporated in closed-source code (KSDev’s, Delphi XE2) it hadn’t been spotted or reported so far (at least to my knowledge).
With XE2 now officially out, it’s time for a first look at Delphi XE2 compiler floating point performance (see previous episode).
For a first look I’ll reuse a Mandelbrot benchmark, based on this code Mandelbrot Set in HTML 5 Canvas. What it tests are double-precision floating-point basic operations (add, sub, mult) in a tight loop, there is relatively little in the way of memory accesses (or shouldn’t be, to be more accurate).
Get it from the Delphi Web Script SVN.
Both Win 32 & 64 bit targets of Delphi XE2 are supported.
MacOS target may or may not be (almost) supported at the moment, but since I don’t have a Mac, I can’t test nuthin’.
There has been two major additions to Delphi Script in the SVN.
You can now declare, implement and use pure-interfaces in DWScript.
The “implements” operator was introduced for OO purity, since “obj is interface” is somewhat of an heresy from an OO point of view, so you’re encouraged to lobby for “obj implements interface” 😉
Finally, you can also acquire a function pointer/delegate from an interface method (something that Delphi doesn’t support, as of XE).
The “unit” support which was previously mentioned as experimental can now be considered operational.
DWScript supports classic Pascal units, with “unit”, an “interface” and “implementation” section, and when compiling a unit it enforces the usual restrictions, so you also have “type” blocks, as disambiguating type declarations is not necessary within a unit.
To feed unit’s code to the compiler, you can either use the “virtual file system” approach, or just handle the new OnNeedUnit event. In that event you have a choice of providing either raw source code or “ready-made” unit in the form of an IdwsUnit.
Here is the periodic news roundup for DWScript from the SVN side:
I’ve recently been adding DWScript snippets to Rosetta Code, using them as unit tests as well.
Quite a few of Rosetta Code’s tasks consist in mathematical tasks, and I was wondering, how many math tests do you really need?
Quite busy times with Delphi XE2 news appearing all over the web!