[Lazarus] Please define "delphi compatibility"

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Oct 4 03:06:08 CEST 2012


Chavoux Luyt schrieb:
> I would also like some clarification on this question. I think
> personally that it should be a one-way conversion process... i.e. it
> should be possible to port/import any Delphi project into Lazarus
> without problems, but not necessarily the other way round.
> 
> One possible way to implement it is to create the exact same "base
> class" for all the Delphi components and then have the Lazarus (LCL)
> components inherit from these base classes.The descendent classes can
> then have all the nice-to-have feature like extra properties etc. that
> we want in Lazarus (or just be an exact copy of its parent class if no
> change is required). In this case it might even be possible to port
> back from Lazarus to Delphi, as long as you only use the "base class"
> components and not the LCL inherited classes.

That's problematic, since already LCL TControl has some more properties 
than in the VCL. Some modifications are required for widgetset 
compatibility, so that even the Win32 widgetset does not implement 
everything as in the VCL.

For best portability, in both directions, I'd suggest an *true* 
Windows/VCL widgetset, which may not be (fully) available on other 
platforms.

And of course the LCL will never include the new Delphi/RadStudio 
cross-platform widgetset, which now exists in parallel to the VCL. I'm 
not sure whether Lazarus can ever support such an LCL-incompatible 
widgetset.


> But I think FPC might have a similar problem with the Delphi language
> that has already changed a bit from the original. What is the the
> situation on that side?

Most FPC incompatibilities result from a mix of features from different 
Delphi versions, so that it's impossible to maintain compatibility with 
one specific Delphi version. Most boring is the {$mode} compiler option, 
which exists only in FPC, along with other syntax incompatibilities. But 
these can be made somewhat compatible by {$IFDEF FPC} directives. A 
really breaking change will be the UnicodeString, introduced in 
D2009[?], once it will replace the previous generic/default string type 
(AnsiString).

It may or may not be possible to use older FPC versions for true 
compatibility with older Delphi versions. But since the LCL requires the 
latest FPC release version, it will be impossible to create a VCL 
compatible LCL now, fully compatible with older Delphi versions.

DoDi





More information about the Lazarus mailing list