Object Pascal has evolved considerably over the years, and while Delphi has always maintained a strong emphasis on readability and backward compatibility, recent releases have introduced many welcome improvements. Some of these changes are particularly relevant when modernising legacy applications.
This article explores a selection of improvements introduced since Delphi 10, through to Delphi 13.2, along with some longstanding platform differences. It is divided into three parts:
Part 1 — Modern Object Pascal
Language features and syntax improvements.Part 2 — Compiler Evolution and Cross-Platform Compatibility
Compiler behaviour, platform differences and new compiler targets.Part 3 — Developer Productivity and Modern Frameworks
Improvements to the RTL, application frameworks, IDE and development tools.
Efforts to unify language behaviour, memory management and calling conventions across platforms have brought greater consistency, but can also expose assumptions in existing code.
Understanding these differences is important when migrating older projects, particularly where code relies on platform-specific behaviour or low-level implementation details.
Part 1 — Modern Object Pascal
Multiline String Literals
Delphi now supports multiline string literals using three consecutive single quotes.
This is particularly useful when embedding SQL, JSON, HTML and other structured text, without the need for string concatenation or explicit line breaks.
const
SQL = '''
SELECT
CustomerID,
CustomerName
FROM Customers
WHERE Active = 1
ORDER BY CustomerName
''';
The compiler handles indentation relative to the closing delimiter.
The previous 255-character restriction on string literals has also been removed.
Binary Literals and Digit Separators
Binary integer literals use the % prefix, complementing Delphi's existing decimal and hexadecimal notation. Underscores can also be used as digit separators:
const
Flags = %1010_1100;
Mask = $FF_00_FF_00;
FileSize = 1_048_576;
The separators have no effect on the underlying value and are ignored by the compiler.
This is particularly useful when working with bit masks, binary protocols and low-level code.
Inline Variable Declarations
Variables can now be declared directly within a block, closer to where they are used.
begin
var Count := 10;
var Message := 'Hello, Delphi';
for var I := 0 to Count - 1 do
WriteLn(I, ': ', Message);
end;
The compiler can infer a variable's type from its initial value, reducing unnecessary declarations. You can always provide the type explicitly:
var i: integer := GetCounter();
Inline variables also have more limited scope than traditional procedure-level variables, helping to make code easier to reason about.
Conditional Expressions
Modern Delphi supports conditional expressions using Pascal-style if, then and else syntax.
var Status := if IsConnected then 'Online' else 'Offline';
This is similar in purpose to the ternary operator found in C-derived languages, but retains Object Pascal's familiar syntax. Conditional expressions can also be used directly as arguments:
ShowMessage(if Count > 0 then 'Items found' else 'No items');
For simple decisions, this avoids the need for a separate conditional statement.
Unlike the RTL IfThen function, a conditional expression is only evaluated on demand.
The NameOf Intrinsic
The NameOf intrinsic provides the name of an identifier as a string.
type
TCustomer = class
end;
begin
WriteLn(NameOf(TCustomer));
end;
This is useful for logging, diagnostics and situations where symbol names would otherwise be hard-coded as string literals.
Additional Language Operators
The is not and not in operators allow negative conditions to be expressed more naturally.
if Sender is not TButton then
Exit;
if Status not in [1, 2, 3] then
Exit;
These small additions can improve readability by avoiding additional parentheses and negation.
Custom Managed Records
Custom managed records are one of the more significant additions to Object Pascal.
Records can define Initialize, Finalize and Assign operators, allowing the compiler to manage initialization, cleanup and copying automatically.
In modern Delphi, Initialize and Finalize can use an implicit Self parameter.
type
TManagedValue = record
private
FValue: Integer;
public
class operator Initialize;
class operator Finalize;
end;
class operator TManagedValue.Initialize;
begin
FValue := 42;
end;
class operator TManagedValue.Finalize;
begin
FValue := 0;
end;
The compiler invokes the appropriate operators as managed records are initialized and finalized, including during exception unwinding.
This introduces useful possibilities for deterministic resource management, particularly when wrapping memory, handles or other resources requiring explicit cleanup.
Managed Record Copy Semantics
Managed records can also provide a custom Assign operator, allowing developers to control how record values are copied.
This is particularly important for records that own resources. A simple field-by-field copy may not be appropriate when a record contains an operating system handle, allocated memory or another resource with ownership requirements.
Passing managed records by value, returning them from functions or storing them in generic collections may involve additional initialization, assignment and finalization operations.
There is also an interoperability consideration: custom managed records should not be exposed directly through interfaces intended for C++Builder without carefully accounting for the differences between the compilers' record lifetime models.
Generic Constraints
Delphi's support for generic constraints has also evolved, allowing generic types and methods to express more precise requirements:
type
TRepository<T: class, constructor> = class
public
function CreateItem: T;
end;
function TRepository<T>.CreateItem: T;
begin
Result := T.Create;
end;
While generic constraints themselves are not new to Delphi 10, refinements to the compiler and its handling of generic types have improved their usefulness and reliability.
Nullable Types
Delphi 13 introduced native nullable value types via generic records in the System unit:
Nullable<T: nonnull>UnwrappableNullable<T>
These allow developers to distinguish between an absent value and a type's default value, without relying on third-party libraries.
Additional Compiler Language Features
Delphi 13 introduced the noreturn procedure directive, allowing developers to indicate that a procedure never returns normally, for example because it always raises an exception. This helps the compiler avoid misleading warnings about unassigned function results and can enable further code optimisation.
TErrorHandler = class
public
// It is appended directly to the signature in the interface section
class procedure RaiseFatal(const Msg: string); static; noreturn;
// If combining with calling conventions, place it at the end
procedure HardExit; stdcall; noreturn;
end;
Generic constraints have also been extended with additional rules, including interface, unmanaged and nonnull. These provide greater control over the types accepted by generic declarations, particularly where interface types, memory management and low-level data representations are concerned.
Here's an example of applying the nonnull constraint:
type
Nullable<T: nonnull> = record
// ...
end;
Part 2 — Compiler Evolution and Cross-Platform Compatibility
Some of Delphi's most important improvements are less visible than changes to language syntax.
Compiler behaviour, memory management, calling conventions and platform consistency have all evolved, and these changes deserve particular attention when migrating legacy applications. Compiler reliability has also improved, including fixes for cases where class constructors were not called as expected.
Consistent String Indexing
Delphi 10.4 unified native string indexing across supported platforms, restoring the traditional Pascal convention of 1-based indexing.
Previously, Delphi's mobile compilers used zero-based indexing, while desktop compilers continued to use one-based indexing. This could introduce subtle problems when sharing code between platforms, particularly in FireMonkey applications.
There is, however, an important distinction: TStringHelper continues to use zero-based indexing.
var S := 'Delphi';
WriteLn(S[1]); // D
WriteLn(S.Chars[0]); // D
WriteLn(S.IndexOf('p')); // 3
Both indexing conventions are valid, but mixing them without understanding the difference can introduce off-by-one errors.
The Chars[] property is also read-only, whereas the native string indexer allows individual characters to be modified.
When working with native strings, using Low and High can help avoid hard-coded assumptions about indexing bounds:
for var I := Low(S) to High(S) do
S[I] := Char.ToLower(S[I]);
Although the ZEROBASEDSTRINGS directive remains available, it is generally preferable to make the intended indexing convention explicit rather than changing compiler behaviour to accommodate existing assumptions.
This is a good example of how Delphi's efforts to improve cross-platform consistency can still expose subtle issues in legacy code.
Unified Memory Management
Delphi has returned to a consistent object lifetime management model across supported platforms.
Earlier mobile compilers used Automatic Reference Counting (ARC) for class instances, while desktop compilers used explicit object lifetime management.
With ARC removed in Delphi 10.4, ordinary class instances now follow the traditional Delphi ownership model on all platforms.
var Customer := TCustomer.Create;
try
Customer.Process;
finally
Customer.Free;
end;
Strings, interfaces and other compiler-managed types continue to use their own automatic lifetime management.
The removal of ARC reduces platform-specific behaviour and simplifies the sharing of code between desktop, mobile and server applications. However, older mobile applications may contain assumptions about automatic object destruction that require attention during migration.
Legacy Compiler Symbols: NEXTGEN and AUTOREFCOUNT
The unification of Delphi's compiler models also affected conditional compilation.
Older cross-platform applications may contain code such as:
{$IFDEF NEXTGEN}
// Alternative mobile implementation
{$ELSE}
// Traditional implementation
{$ENDIF}
The NEXTGEN and AUTOREFCOUNT conditional symbols were associated with Delphi's alternative mobile compiler and memory management models.
These symbols are no longer predefined by modern Delphi compilers.
Consequently, conditional compilation blocks that previously selected different implementations may now follow different code paths.
When modernising legacy projects, these directives are worth searching for and reviewing rather than simply removing them.
This is particularly important where the conditional code contains assumptions about object ownership, string indexing or platform-specific behaviour.
Constant Parameters and ABI Compatibility
Delphi 10.3 Rio introduced important changes to parameter passing conventions, improving Application Binary Interface (ABI) compatibility and interoperability between Delphi and C++Builder.
One particularly important detail concerns the const modifier.
Although const prevents a parameter from being modified directly, it does not guarantee that the parameter is passed by reference.
For the relevant Delphi calling conventions, records of 1, 2 or 4 bytes are passed by value, regardless of whether const is specified.
Consider a record containing two 32-bit integers:
type
TPoint = record
X, Y: LongInt;
end;
At 8 bytes, this record can be passed by reference when declared as a const parameter.
However, a smaller record containing two 16-bit integers occupies only 4 bytes:
type
TSmallPoint = record
X, Y: SmallInt;
end;
This record is passed by value, even when const is used.
To explicitly request pass-by-reference semantics, Delphi provides the [ref] attribute:
function Test(const [ref] APoint: TSmallPoint): TSmallPoint;
Unlike an ordinary const parameter, const [ref] explicitly requests pass-by-reference semantics while preserving read-only access through the parameter.
Why This Matters
If a record is passed by reference, changes to the original variable can be visible through the parameter during the method call. If it is passed by value, the method works with a copy.
This means that assumptions about parameter passing can affect observable behaviour, not just performance.
The Delphi 10.3 ABI changes also addressed differences in how certain records, particularly those between 5 and 8 bytes, were passed between Win32 and Win64.
These improvements helped align the Delphi and C++Builder compilers, reducing interoperability problems caused by differing assumptions about parameter passing.
When modernising legacy applications, particularly those involving binary interfaces or low-level code, it is important to understand the applicable calling convention rather than assuming that const always means pass-by-reference.
Integer Sizes Across Platforms
Not all Delphi integer types have the same size on every platform.
For example, LongInt and LongWord are 32-bit types on Windows, including Win64, but are 64-bit on 64-bit POSIX platforms, including Linux, macOS, iOS and Android. NativeInt and NativeUInt follow the native pointer size of the platform.
These differences can affect record layouts, binary file formats, pointer arithmetic and interoperability with external APIs. When a specific binary representation is required, explicitly sized integer types such as Int32, UInt32, Int64 and UInt64 are preferable:
type
TPacketHeader = packed record
Identifier: UInt32;
Length: UInt32;
Flags: UInt16;
end;
Using fixed-width types makes the intended representation clearer and avoids accidental changes in field size between platforms.
Of course, binary compatibility may also depend on packing, alignment and byte order. These differences predate Delphi 10, but they're worth keeping in mind when modernising older applications.
Extended Floating-Point Precision
The Extended floating-point type is another area where platform behaviour can differ.
Historically, Win32 applications could use 80-bit extended floating-point precision.
On Win64 and several other platforms, Extended uses the same representation and precision as Double.
This distinction can affect numerical algorithms that depend on the additional precision available in 32-bit builds. The compiler can report warning W1066, indicating that extended floating-point precision has been reduced to double precision.
When migrating mathematical or scientific applications, it is worth reviewing any reliance on Extended, particularly where rounding behaviour or numerical precision is important.
As with integer sizes, this is not a new Delphi 13 feature, but an existing platform difference that deserves attention during migration.
Compiler Directives and Diagnostics
Delphi has also introduced improvements to compiler directives and diagnostics.
Compiler options can be saved and restored locally:
{$PUSHOPT}
{$RANGECHECKS ON}
// Code requiring range checking
{$POPOPT}
Recent compilers also provide more detailed diagnostics and stricter validation of certain constructs.
For example, newer Delphi releases enforce additional restrictions on units using WEAKPACKAGEUNIT, potentially exposing code that previously compiled successfully.
Additional warnings for data casting can help identify potentially unsafe operations.
These changes are particularly relevant when modernising legacy projects, where compiler warnings may have accumulated over many years.
Windows on ARM
Delphi 13.1 introduced a new LLVM-based compiler targeting Windows on ARM through Arm64EC. This allows Delphi applications to run natively on supported ARM-based Windows devices rather than relying on x64 emulation. The compiler supports both VCL and FireMonkey, with Delphi 13.2 extending support to dynamic runtime packages.
A Modern LLVM Compiler for Linux
Delphi 13.2 introduces a substantially modernised Linux64 compiler, upgrading its LLVM backend from version 3.3 to LLVM 20.1.8. The updated toolchain includes a modern linker, improved debugging information and additional compiler optimisations. The compiler is now a 64-bit executable, integrating with the 64-bit RAD Studio development environment.
Fast Just Got Faster
Interestingly, the Linux64 and Windows Arm64EC compilers now support parallel code generation, potentially reducing build times for larger projects. Embarcadero has also reported further compilation performance improvements, particularly for codebases making extensive use of generics.
Part 3 — Developer Productivity and Modern Frameworks
Beyond language and compiler changes, recent Delphi releases have introduced substantial improvements to the RTL, application frameworks and development environment. These range from new platform capabilities and visual controls to enhancements in the IDE and its supporting tools.
Parallel Programming and Thread Pool Improvements
Delphi's Parallel Programming Library (PPL), introduced in XE7, provides TTask, ITask and TParallel through the System.Threading unit. These APIs simplify task-based concurrency and parallel processing without requiring developers to manage individual threads.
Although the core APIs predate Delphi 10, the underlying thread-pool infrastructure has continued to evolve. Delphi 12 introduced several improvements to TThreadPool, including InitializeCOM and InitializeCOMFlags for COM initialisation in worker threads, OnThreadStart and OnThreadTerminate events, and UnlimitedWorkerThreadsWhenBlocked for controlling thread-pool behaviour when workers are blocked.
When modernising legacy applications, however, replacing existing TThread implementations with TTask or TParallel is not necessarily a straightforward improvement. Thread safety, synchronisation, cancellation, exception handling and shared state still require careful consideration.
The PPL also does not provide non-blocking asynchronous I/O. Tasks execute on worker threads, so synchronous operations still block the executing thread. Delphi does not currently support async/await or an equivalent language-level asynchronous I/O model. Moving a blocking operation to a task can keep the calling thread responsive, but it does not make the underlying operation non-blocking.
Thread Synchronisation Improvements
Delphi 10.4.1 introduced TLightweightMREW in System.SyncObjs, a lightweight, cross-platform
reader-writer lock. Implemented as a managed record, it provides shared access for multiple readers and exclusive access for
writers, with lower overhead than the older TMultiReadExclusiveWriteSynchronizer.
The following example uses TLightweightMREW to maintain a cached snapshot of a subscriber collection. Multiple threads can retrieve an up-to-date snapshot concurrently, while an exclusive write lock protects the snapshot when it needs rebuilding.
The declaration:
TMulticast<T> = class
private
fLock: TLightweightMREW;
// ....
end;
If the cached snapshot is up to date, we can return it under a shared read lock:
fLock.BeginRead;
try
if fSnapshotVersion = fVersion then
begin
Result := fSnapshot;
exit;
end;
finally
fLock.EndRead;
end;
Otherwise, we release the read lock and acquire an exclusive write lock. The version is checked again in case another thread has already rebuilt the snapshot:
fLock.BeginWrite;
try
if fSnapshotVersion <> fVersion then
begin
fSnapshot := fSubscribers.ToArray;
fSnapshotVersion := fVersion;
end;
Result := fSnapshot;
finally
fLock.EndWrite;
end;
The 64-bit IDE
Another significant development is the introduction of a native 64-bit RAD Studio IDE. Initially introduced in Delphi 12.3 and substantially expanded in Delphi 13, it provides a 64-bit development environment with support for compiling and debugging Win64 applications. This is particularly welcome for larger projects, where the memory limitations of a 32-bit IDE can become restrictive.
The 64-bit IDE is still evolving and does not yet support every target platform available in the traditional 32-bit IDE. Nevertheless, it represents a substantial improvement to Delphi's development environment.
KAI — AI-Assisted Development
Embarcadero introduced KAI in 2026 as an AI-assisted development platform for RAD Studio, Delphi and C++Builder. Integrated into the IDE, KAI provides code completion, contextual suggestions and an agentic chat interface capable of working with project files, generating code and user interfaces, compiling projects and helping resolve compiler errors.
KAI supports multiple AI providers and local models, allowing developers to choose between cloud-based services and locally hosted solutions. Its agentic capabilities use the Model Context Protocol (MCP) to interact with the IDE and external tools. KAI 1.1 further expanded integration options through the Agent Client Protocol (ACP) registry.
FireMonkey and Skia
FireMonkey continues to evolve, with improved rendering through Skia and the introduction of a new FireMonkey Style Designer in Delphi 13.1. The designer takes a more visual, design-oriented approach to creating application styles, with further enhancements and IDE integration arriving in Delphi 13.2.
These developments bode well for Delphi's cross-platform UI capabilities, including mobile development and Linux desktop applications using FMXLinux.
Continued RTL, VCL and IDE Improvements
Delphi's evolution extends beyond the Object Pascal language and compiler. The RTL and VCL frameworks continue to receive improvements, alongside ongoing enhancements to the IDE, debugging tools and development experience. The GetIt Package Manager also provides access to a growing collection of useful libraries, components and IDE extensions, including many high-quality third-party offerings.
The broader Delphi ecosystem also includes projects such as Python4Delphi, an established open-source library—also available through GetIt. It provides bidirectional integration between Delphi and Python, allowing Delphi applications to execute Python scripts and use Python libraries, while also exposing Delphi functionality to Python. This can be particularly useful for scripting, automation and integration with Python's extensive library ecosystem.
The introduction and continued development of the Language Server Protocol (LSP)-based Code Insight infrastructure has improved the foundation for code navigation, completion and analysis.
RTL performance has also improved across several releases. Delphi 10.3 introduced optimisations to collection growth, string handling and streaming, while Delphi 11 brought further improvements to array searching and record finalisation. Delphi 11.3 optimised the fundamental System.Move routine, with reported performance gains of two to five times depending on the processor and target platform. More recent releases have continued this work, including faster UTF-8 validation and parallel array operations.
Other notable RTL, VCL and framework improvements include:
VCL UI Automation:Improved accessibility and compatibility with automated UI testing tools.Modern VCL navigation:NewTTabViewandTNavigationViewcontrols in Delphi 13.2, supporting contemporary tabbed interfaces and collapsible sidebar navigation.VCL presentation and styling:Continued high-DPI and Windows 11 improvements, enhanced custom title bars with VCL Styles support, and updates toTControlList,TFormTabsBarandTEdgeBrowser.JSON processing:Additional serialisation options, including greater control over default values and field output.XML Mapper:Updated in 2020 with a modernised interface, bug fixes and improved XML Schema support, followed by further compatibility improvements for modern XML and XSD files in 2023.HTTP and networking:HTTP/3 client support, Server-Sent Events for HTTP clients and servers, and improvements to OAuth authentication.WebBroker:Improved session management, logging and web-server integration, including Nginx support.WebStencils:Server-side HTML templating integrated with WebBroker and RAD Server, supporting modern CSS and JavaScript-based web applications.Modern Windows API integration:Expanded and updated Win32/Win64 and WinRT API declarations, including WinMD-generated bindings available through GetIt, alongside improved support for Windows 11 features and Microsoft's WebView2.RTL and runtime performance:Optimisations to string searching, generic collections, record and array finalisation, object initialisation and memory management, alongside improvements to compiler-generated code on newer platforms.IDE usability and visual designers:Quick Edit and Quick Configuration tools for common component properties, improved VCL and FireMonkey form designers, enhanced code editing, and better search and filtering throughout the IDE.Application Styling:Modern styles are avaialble for both VCL and FMX throughGetIt.
Despite these substantial improvements, one sorely missed feature is the built-in refactoring functionality, which was removed in RAD Studio 13. Hopefully, the recent investment in IDE tooling for AI integration will also pave the way for improved refactoring capabilities—the menu item's presence is an encouraging sign.
Final Thoughts
Object Pascal has retained its renowned clarity and structure, whilst evolving to meet the needs of modern developers. Features such as inline variables, multiline strings and conditional expressions reduce boilerplate, while custom managed records introduce capabilities that go beyond simple syntactic convenience.
Equally important are the less visible changes to the compiler and runtime. Unifying memory management and string indexing across platforms, improving ABI compatibility and modernising compiler toolchains all help make Delphi development more consistent.
These considerations are particularly relevant when modernising legacy applications, especially with AI-assisted development tools. Compiler changes can also affect third-party component libraries, sometimes requiring updated versions even between minor Delphi releases. Automated refactoring can be valuable, but changes to established codebases still require an understanding of compiler behaviour, platform differences, third-party dependencies and the assumptions built into the original implementation.