Blog
All Blog Posts | Next Post | Previous Post
TMS Scripter 8 drops legacy Delphi support
Today
TMS Scripter 8.0 the scripting engine that lets Delphi applications execute Pascal and Basic scripts at runtime is coming soon, and it will be the first release to require Delphi XE2 or later. Delphi 7, Delphi 2007, Delphi 2010, and Delphi XE are no longer in the supported range.
TMS Diagram Studio, TMS Workflow Studio, and TMS Query Studio will make the same change in their own upcoming releases.
A Long-Running Commitment
TMS Scripter has supported Delphi 7 since day one the library was born in that era, and the compatibility was maintained for roughly twenty-five years. Many TMS customers run production applications on legacy Delphi versions that cannot be easily migrated, and keeping them supported was always a deliberate choice.
But that chapter is now closed. The time has come to move forward.
Why We Are Dropping Support
Delphi 7 predates two of the most important additions to the Object Pascal language: generics and anonymous methods, both introduced in Delphi 2009. Every line of code in TMS Scripter had to be written as if those features did not exist, which created real and lasting constraints:
- Untyped collections everywhere. Without generics, lists of objects use untyped
TListwith manual typecasts at every access site. Code that would naturally beTList<TScript>must instead work with raw pointers and explicit casts throughout. - Callback boilerplate. Registering Delphi methods for use in scripts requires separate named wrapper procedures for each one. Anonymous methods would allow the logic to be co-located with its registration, but that was not an option.
- No advanced RTTI. The
System.Rttiunit which allows full runtime inspection of classes, methods, properties, and their types arrived in Delphi 2010. It is unavailable on Delphi 7 entirely, which means a scripting engine cannot use it to automatically discover and register Delphi classes. Everything has to be done manually. - API surface limited by the lowest common denominator. Public APIs that would benefit from typed generics or procedure references had to fall back to
TObject,Pointer, or method-of-object types.
This is not a criticism of Delphi 7. It had its time, and it served its users well. But maintaining compatibility with a compiler from 2002 while trying to build a modern, maintainable library is a genuine tension, and it has accumulated over the years.
What This Opens Up
TMS Scripter 8.0 itself does not yet take full advantage of the new baseline this is the first step, not the finished product. We want to see how the community reacts before committing to deeper API changes.
What the change does is remove a hard constraint. Going forward, the codebase can evolve toward:
Generics. Internal collections can become properly typed. TList<T> instead of TList. Fewer typecasts, stronger compile-time checks, better IDE code completion.
Advanced RTTI. The System.Rtti unit gives a program full runtime knowledge of any class its methods, parameters, return types, properties, and attributes. For a scripting engine, this is particularly powerful: instead of manually writing a wrapper procedure for every method you want to expose to scripts, the engine can potentially walk the RTTI of a class and register everything automatically. This is the kind of capability that can dramatically reduce the boilerplate burden on users and make Scripter integration with arbitrary Delphi classes much more seamless.
Anonymous methods. Callback types can be changed from method-of-object references to reference to procedure. To illustrate the kind of improvement this enables today, registering a Delphi class method for use in a script looks like this:
// Current approach: a dedicated class with one wrapper method per Delphi method
type
TMyLibrary = class(TatScripterLibrary)
protected
procedure CalculateProc(AMachine: TatVirtualMachine);
procedure Init; override;
end;
procedure TMyLibrary.Init;
begin
with Scripter.AddDelphiClass(TMyCalculator) do
DefineMethod('Calculate', 1, tkInteger, nil, CalculateProc);
end;
procedure TMyLibrary.CalculateProc(AMachine: TatVirtualMachine);
begin
with AMachine do
ReturnOutputArg(TMyCalculator(CurrentObject).Calculate(GetInputArgAsInteger(0)));
end;Once the callback type supports procedure references, the same registration can be written inline:
// Future direction: registration and implementation in one place
with Scripter.AddDelphiClass(TMyCalculator) do
DefineMethod('Calculate', 1, tkInteger, nil,
procedure(AMachine: TatVirtualMachine)
begin
AMachine.ReturnOutputArg(
TMyCalculator(AMachine.CurrentObject).Calculate(
AMachine.GetInputArgAsInteger(0)));
end);None of this was possible while the library had to compile on Delphi 7. Now it is.
You Are Not Stranded: TMS Smart Setup Versioning
If you are still on Delphi 7, or on one of the other versions now leaving the support window, you are not left without options.
TMS Smart Setup the TMS Software installer and package manager includes a versioned installation feature designed exactly for this situation. When you use Smart Setup to install TMS Scripter, it detects which Delphi version you have and serves you the last release that supports it automatically, without you having to track which archive corresponds to which compiler.
The end of active compatibility maintenance does not mean the last supported version disappears.
What About the Other Products?
TMS Scripter gets the headline, but it is not the only product affected.
TMS Diagram Studio the framework for building diagram and flowchart editors in Delphi VCL applications will drop the same set of legacy versions in an upcoming release.
TMS Workflow Studio a workflow engine for defining and executing business processes within Delphi applications follows the same path.
TMS Query Studio the visual query builder component for building complex queries at runtime likewise.
All four products share the same compatibility floor going forward: Delphi XE2 or later.
What This Means for You
If you are on Delphi XE2 or later: you are in the supported range. TMS Scripter 8.0 will install and work as usual when it releases.
If you are on Delphi 7, 2007, 2010, or XE: the last version of each product that supported your compiler remains fully functional. Use Smart Setup to install it cleanly it will continue to work exactly as it always has.
Links
- TMS Scripter product page
- TMS Scripter documentation
- TMS Smart Setup
- Smart Setup version compatibility guide
Wagner Landgraf
This blog post has not received any comments yet.
All Blog Posts | Next Post | Previous Post