DWScript is an object-oriented Delphi scripting language for Delphi, despite its name, it is general purpose and not limited to websites.
An extensive unit tests suite ensures high quality and robustness.
DWS allows to use as well as define whole classes (with polymorphism, meta-class and interfaces support, etc.). The scripting language is based on Delphi, but also supports syntax and features similar to Prism and FreePascal, as well as various language extensions.
- supports classes, interfaces, records
- supports static and dynamic arrays
- sandboxed, automatic memory management
- strong typing
- type inference
- full support for meta-classes
- support function & methods pointers
- generalized helpers
- generalized “case of” and “in [...]” syntax
- scoped, inline variable declaration
- operator overloading
- compound assignment operators
- extensive exposure, declaration, inspection & debugging features
- inline implementations of class methods
- partial classes
- property expressions
- Automated exposure of Delphi types via RTTI
- Optional COM/OLE capability (via COM Connector)
- Optional RTTI direct connectivity (via RTTI Connector)
- Optional asm capability (32 bits, via NASM)
type THelloWorld = class procedure Put; // you can also implement out of line begin PrintLn('Hello, World!'); end end; var HelloWorld := new THelloWorld; // strong typing, inferred HelloWorld.Put; // no need to release objects thanks to automatic memory management
Much of your Pascal or Delphi knowledge will apply, for general information and news, see the blog. There is also a work in progress documentation wiki. Rosetta Code holds many DWS examples, which can be quickly compared with other languages and other Pascal dialects.
DWScript is released under Mozilla Public License 1.1 which, in short, means that it’s free to use in open or closed source projects, free or commercial, provided you honor the following requirements:
- any application that makes use of DWScript, or is compiled by DWScript should “conspicuously” include a reference to DWScript in its credits, and include or link to the DWScript source files.
- modification to the source have to be made public under MPL.
If you can’t or don’t want to satisfy the above requirements, contact me for use under other license schemes.