DWXScript is an object-oriented scripting engine for Delphi, inspired by the Delphi language and extended with features from other Pascal dialects such as Free Pascal and Prism.
It also introduces several modern Pascal extensions of its own, designed to make scripting more flexible, powerful, and intuitive.
DWXScript is forked from DWScript by delphitools.info and has been enhanced for cross-platform compatibility across:
- 🪟 Windows
- 🍎 macOS
- 🐧 Linux
including full support for the Lazarus IDE.
- Fully object-oriented Pascal scripting engine.
- Compatible with Delphi and Lazarus environments.
- Cross-platform: works seamlessly on Windows, macOS, and Linux.
- Extensible architecture for integrating custom classes, functions, and libraries.
- Support for Unicode strings, records, dynamic arrays, RTTI, and class helpers.
- Easy integration with Delphi or Lazarus applications.
- Lightweight runtime with optional JIT compilation.
- Built-in debugging and expression evaluation support.
The primary goal of DWXScript is to extend the reach of DWScript to all major desktop platforms while maintaining compatibility with both Delphi and Free Pascal (FPC) environments.
It aims to provide a unified scripting solution for developers building modern cross-platform applications in Object Pascal.
Key objectives include:
- ✅ Cross-platform support through FPC and Lazarus.
- ✅ Improved modularity for embedding in desktop and server applications.
- ✅ Enhanced performance and runtime stability.
- ✅ Modernized language extensions inspired by newer Pascal dialects.
To build and use DWXScript, you need one of the following:
- Delphi 11+ (Windows)
- Lazarus IDE 3.0+ (Windows, macOS, Linux)
- Free Pascal Compiler (FPC) 3.2.2+
-
Clone this repository:
git clone https://github.com/<yourusername>/dwxscript.git cd dwxscript
-
Open the project in Delphi or Lazarus:
- In Delphi: open
DWXScript.dproj - In Lazarus: open
DWXScript.lpi
- In Delphi: open
-
Build the library or demo project for your platform.
-
Include the compiled units or library in your application.
Here’s a simple example showing how to use DWXScript in a Delphi or Lazarus application:
uses
dwsCompiler, dwsExprs, dwsComp;
procedure RunScript;
var
Compiler: TdwsCompiler;
ProgramObj: IdwsProgram;
Exec: IdwsProgramExecution;
begin
Compiler := TdwsCompiler.Create(nil);
try
ProgramObj := Compiler.Compile('PrintLn("Hello from DWXScript!");');
Exec := ProgramObj.Execute;
finally
Compiler.Free;
end;
end;DWXScript builds natively with Delphi or Lazarus on Windows.
Ensure your project uses Unicode mode and that the required runtime units are in your search path.
DWXScript supports Free Pascal and Lazarus for full native compilation.
Use the following compiler options for best compatibility:
-fPIC -dFPC -dUSE_LINUXWhen building shared libraries, ensure you link dynamically against system libraries.
- Complete FPC/Lazarus integration for all units.
- Add CEF-based (Chromium) sample showing DWXScript in a hybrid GUI app.
- Integrate DWXScript into Docker-based build pipelines.
- Implement modern RTTI reflection for dynamic types.
- Add WebAssembly backend exploration.
DWXScript is released under the Mozilla Public License 1.1 (MPL 1.1).
In summary, this means:
- You may freely use DWXScript in open-source or commercial projects.
- Any application using or compiled with DWXScript must prominently credit DWXScript (e.g., in your “About” screen or documentation) and include or link to the DWXScript source.
- Any modifications to DWXScript’s source must be made public under the same license.
If you cannot or prefer not to meet these requirements, contact the maintainers to discuss alternative licensing options.
Contributions are welcome!
To contribute:
- Fork the repository.
- Create a new branch (
feature/my-new-feature). - Commit and push your changes.
- Submit a Pull Request.
Please ensure your changes include appropriate tests and documentation.
DWXScript is based on the original DWScript project by Eric Grange and the DelphiTools team.
This fork extends compatibility and modernizes the build environment for multi-platform use.
© 2025 DWXScript Contributors. All rights reserved.