What Is DWS (DWScript) and What Can You Do With It?

DWS stands for Delphi Web Script (DWScript), a scripting engine and language for Pascal/Delphi. It lets you add a scriptable layer to a Delphi application: you embed the engine, feed it Pascal-like script source, and the host program executes that script at runtime. It is one of the tools grouped under DelphiTools.info, alongside the SamplingProfiler and other Pascal developer utilities. If you are building a Delphi application and want end users or integrators to extend behavior without recompiling the host, DWScript is the relevant tool.

What DWScript actually is

DWScript is a scripting language plus compiler and runtime written in Delphi. The language deliberately resembles Object Pascal, so Delphi developers can read and write it without learning a new syntax family. The engine compiles script text and executes it inside your process, which means scripts can call into host-provided functionality and the host can expose objects, functions, and types to the script side.

The practical consequence: your compiled Delphi binary stays fixed, while the behavior expressed in scripts can change. That is the core value proposition of any embedded scripting engine, and DWScript delivers it in a Pascal-native form rather than forcing you to adopt Lua, JavaScript, or Python.

What you can do with it

  • Embed user-editable logic — expose a defined set of host functions and let scripts compose them into workflows, rules, or calculations.
  • Add extension points — ship a stable application and let scripts fill in custom behavior at known hooks.
  • Run Pascal-like code at runtime — reuse existing Delphi knowledge instead of maintaining a second language skill set.
  • Keep a single-language toolchain — the host and the script share a Pascal lineage, which simplifies debugging and onboarding for a Delphi team.

A concrete scenario: a Delphi desktop application needs customer-specific validation rules. Instead of branching the compiled code per customer, you expose a validation context to DWScript and let each customer's script express its own rules. The host controls what the script can touch; the script controls the logic.

How DWS relates to the other DelphiTools

DelphiTools.info hosts several Pascal-oriented utilities. The SamplingProfiler is a profiler — it samples a running program to find performance bottlenecks. DWScript is a scripting engine — it adds runtime programmability. They solve different problems and are not alternatives to each other.

They can, however, meet in the same project. If you embed DWScript and script execution becomes a performance concern, a sampling profiler is the kind of tool you would reach for to see where time is spent. The site also carries other Pascal developer tooling and coding/optimization tips, so DWScript is best understood as one component in a broader set of Delphi development aids rather than a standalone product.

Where to start

The site is the entry point for documentation and examples. Because DWScript is a Delphi library, expect the usual integration path: obtain the source, add it to your project, instantiate the engine, register the host symbols you want to expose, then compile and execute script text. The exact API surface and supported language features are defined by the project's own documentation, so consult that rather than assuming parity with full Object Pascal — a scripting engine typically implements a deliberate subset.

If your goal is simply to find performance bottlenecks, DWScript is not the tool you want; look at the SamplingProfiler instead. If your goal is to let a Delphi application be extended or configured through Pascal-like scripts at runtime, DWScript is the fit.

delphitools.info
Home of SamplingProfiler, a free code profiler for Delphi, DWScript (Delphi Web Script) and other Pascal developer tools, optimization and coding tip…