Delphi RTL

Delphi RTL is a Delphi-compatible RTL and non-visual VCL implementation for the Elements compiler (and more specifically, the Oxygene language).


The goal of this project is to reproduce a reasonable subset of standard Delphi APIs used by a large percentage of Delphi code bases, in order to facilitate and ease the porting of such code bases to Oxygene to re-use business logic in .NET, Cocoa, Java/Android or Island applications.

The goal is most decidedly not to get existing Delphi projects or applications to just recompile out of the box. The differences between the platforms are too significant, and there is only so much abstraction a library such as this can provide; some changes to exiting code will continue to be required for it to build in Oxygene, and some paradigms need to be rethought to fit in well with the platforms.


The scope of this project is purposely limited to simple APIs, commonly used low-level helper functions (such as SysUtils.pas) and simple classes (such as TStringList), as well as to make core types such as Object and String more compatible with Delphi code. For some platforms, rudimentary support for VCL forms and .DFMs is provided, as well.

Decidedly out of scope are advanced UI level libraries such as the complete VCL or FMX, Delphi's TDataSet-based database layer, or anything on that level.


This library is implemented fully from scratch, without referencing or reusing any of Delphi's or FPCs implementation of the same functionality. Merely the outward-facing API is kept identical and compatible with Delphi's version of the RTL/VCL.

Where possible, the library is targeted to work well for code coming from both older (ca. Delphi 6/7) and more recent Delphi versions; while it does/will support AnsiStrings, it does strongly favor UTF-16 unicode strings (aka WideStrings), as used both by newer Delphi versions and all of Elements' target platforms.

Classes and Types

This library is a work in progress; all functionality presented is useable now, and it will be expanded and grown over time. Contributions on GitHub are more than welcome.

Currently, the following major types are supported/implemented. Unless otherwise noted, all parts of Elements RTL are available across all platforms, including Island.






  • arrayofT<T> = array of T
  • BYTEBOOL = Boolean
    • UInt32  .NET, .NET Core 2.2, .NET Standard 2.0, Island, Toffee
    • Cardinal  Cooper
  • HResult = Int64
  • IEnumerable<T>
  • PAnsiChar = ^AnsiChar  .NET, .NET Core 2.2, .NET Standard 2.0, Island, Toffee
  • PByte = ^Byte  .NET, .NET Core 2.2, .NET Standard 2.0, Island, Toffee
  • PChar = ^Char  .NET, .NET Core 2.2, .NET Standard 2.0, Island, Toffee
  • PInterfaceEntry = Pointer
  • PInterfaceTable = Pointer
  • PlatformString
    • String  .NET, .NET Core 2.2, .NET Standard 2.0, Cooper, Island
    • NSString  Toffee
  • Pointer
    • ^void  .NET, .NET Core 2.2, .NET Standard 2.0, Island, Toffee
    • Integer  Cooper
  • PropertyInfo = Property  Toffee-macOS
  • RTL2String = String
  • ShortString = String
  • String = DelphiString
  • TArray<T> = array of T
  • TBytes = array of Byte
  • TCharArray
    • array of Char  .NET, .NET Core 2.2, .NET Standard 2.0, Island
    • array of Character  Cooper
    • array of __ElementsBoxedChar  Toffee
  • TClass
    • Type  .NET, .NET Standard 2.0, Island, Toffee
    • Type  .NET Core 2.2, Cooper
  • TCollectionItemClass
    • Type  .NET, .NET Core 2.2, .NET Standard 2.0, Cooper
    • Type  Island
    • Type  Toffee
  • TColor = Int32  .NET, Island-WebAssembly-wasm32, Island-Windows, Toffee-macOS
  • TCompareOptions
    • set of TCompareOption  .NET, .NET Core 2.2, .NET Standard 2.0, Island, Toffee
    • set of TCompareOption  Cooper
  • TComponentClass
    • Type  .NET
    • Type  Island-WebAssembly-wasm32, Island-Windows
    • id  Toffee-macOS
  • TComponentState = set of TComponentStateEnum  .NET, Island-WebAssembly-wasm32, Island-Windows, Toffee-macOS
  • TCustomAttribute
    • Attribute  .NET, .NET Core 2.2, .NET Standard 2.0, Toffee
    • Attribute  Island
  • TCustomData
  • TDate = TDateTime
  • TDateTime = Double
  • TDayTable
    • array [0..11] of UInt16  .NET, .NET Core 2.2, .NET Standard 2.0, Island, Toffee
    • array [0..11] of Word  Cooper
  • TEncoding
    • Encoding  .NET, .NET Standard 2.0, Island, Toffee
    • Encoding  .NET Core 2.2, Cooper
  • TFontCharset = Int32  .NET, Island-WebAssembly-wasm32, Island-Windows, Toffee-macOS
  • TFontStyles = set of TFontStyle  .NET, Island-WebAssembly-wasm32, Island-Windows, Toffee-macOS
    • Guid  .NET, .NET Standard 2.0, Island, Toffee
    • Guid  .NET Core 2.2, Cooper
  • THandle = Int64
  • TImageIndex = Int32  .NET, Island-Windows, Toffee-macOS
  • TIniSectionsPair
  • TInternalItem
  • TListColumnClass
    • Type  .NET
    • Type  Island-Windows
    • Type  Toffee-macOS
  • TLocaleID
    • Locale  .NET, .NET Standard 2.0, Island, Toffee
    • Locale  .NET Core 2.2, Cooper
  • TMarginSize = UInt32  .NET, Island-WebAssembly-wasm32, Island-Windows, Toffee-macOS
  • TMessageTable = List<KeyValuePair<UInt32, MethodInfo>>  Island-Windows
  • TMultiSelectStyle = set of TMultiSelectStyles  .NET, Island-Windows, Toffee-macOS
  • TObject = Object
  • TPair<T,U>
  • TPlatformHandle
    • Control  .NET
    • dynamic  Island-WebAssembly-wasm32
    • HWND  Island-Windows
    • NSResponder  Toffee-macOS
  • TPlatformNodeHandle
    • TreeViewItem  .NET
    • HTREEITEM  Island-Windows
    • Object  Toffee-macOS
  • TReplaceFlags
    • set of TReplaceFlag  .NET, .NET Core 2.2, .NET Standard 2.0, Island, Toffee
    • set of TReplaceFlag  Cooper
  • TResourceId
    • Object  .NET, Island-WebAssembly-wasm32, Toffee-macOS
    • ^void  Island-Windows
  • TShiftState = set of TShiftStateValues  .NET, Island-WebAssembly-wasm32, Island-Windows, Toffee-macOS
  • TStringsOptions
    • set of TStringsOption  .NET, .NET Core 2.2, .NET Standard 2.0, Island, Toffee
    • set of TStringsOption  Cooper
  • TTime = TDateTime
  • TTreeNodeClass
    • MetaClass  .NET
    • ????metaclass TTreeNode  Toffee-macOS
  • TValueRelationship
    • Int32  .NET, .NET Core 2.2, .NET Standard 2.0, Island, Toffee
    • Integer  Cooper
  • TWidth = Int32  .NET, Island-Windows, Toffee-macOS
  • TWinControl = TNativeControl  Island-Windows
  • WideString = DelphiString


See Also

Version Notes

The Delphi RTL is new as preview in Elements 9.0