Here is a quick summary of recent additions to DWScript [1]:
- exit, break and continue are now reserved keyword (and highlighted as such), previously they weren’t (as in Delphi), but having variables or functions named that way just “breaks” (pun intended) those language features (as it does in Delphi)
- new TdwsRTTIEnvironment, fields and properties of a class exposed this way are directly accessible in scripts, more details on that one in a future post.
- support passing constant arrays to dynamic array parameters (automatic conversion).
- improved the language documentation [2].
- added ability for custom extension of Abs() special function (now supported by TComplex).
- added Clamp() floating-point function.
- added Gcd(), Lcm(), IsPrime() and LeastFactor() integer functions.
- fixed an issue that prevented conditional directives from being supported in all portions of the code, they can now properly be used anywhere.
- JavaScript codegen optimization for variable symbol lookup.
- minor tokenizer speedup, compile speed should now be close to 200k LOC/sec*.
- more test cases, minor fixes.
*: FWIW since the old benchmark [3], compile and execution performance almost tripled and memory requirements were cut by approx 30%. At the same time the language became quite a bit richer [4].