#1 2021-06-30 11:06:15

jonsafi
Member
Registered: 2011-07-26
Posts: 58

mORMot2: Any chance of using Delphi 2009?

Hello,

Though was able to compile the brand-new  mORMot2
with Lazarus, still miss the speed of Delphi.
Am stuck with D2009, and since mORMot2 works
with D2007, was wondering if there is any way to
make mORMot2 work with D2009.

Know that RTTI was introduced only in D2010,
but even when I set {$define NEWRTTINOTUSED},
I still get an error with unknown identifier.
in file mormot.core.rtti.delphi.inc:

 procedure TGetRttiInterface.AddMethodsFromTypeInfo(aInterface: PTypeInfo);
  Var cc: TCallConv; //  line 622 ERROR: unknown identifier

Much obliged for your comments,
Sami

Offline

#2 2021-07-01 08:23:23

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: mORMot2: Any chance of using Delphi 2009?

NEWRTTINOTUSED doesn't affect how the RTTI compiler is supported - only which RTTI is emitted.

My problem is that I don't have any Delphi 2009 IDE nor compiler binary at hand.

To be honest, I fail to find the "speed of Delphi" in respect to FPC 3.2.
Only the compilation is faster, not the executable code.

Please try https://github.com/synopse/mORMot2/comm … 10e892c9ef

Offline

#3 2021-07-01 12:40:17

jonsafi
Member
Registered: 2011-07-26
Posts: 58

Re: mORMot2: Any chance of using Delphi 2009?

Many thanks for this version, it got past the previous TCallConv problem, but is now  stopping at line 451
in the same unit, and complains about incompatible types between TRttiKind and  TTypeKind.

function TRttiInfo.IsQWord: boolean;
begin
  if @self = TypeInfo(QWord) then
    result := true
  else
    {$ifdef UNICODE}
    if Kind = tkInt64 then //error here: E2010 Incompatible types: TRttiKind and  TTypeKind.

if you find the time to come up with a solution for this too, would be grateful and happy to test it.

Yes, exactly, Lazarus's slowness is in the compilation/linking process not the executable itself.

Offline

#4 2021-07-01 12:58:05

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: mORMot2: Any chance of using Delphi 2009?

jonsafi wrote:

Yes, exactly, Lazarus's slowness is in the compilation/linking process not the executable itself.

Is this difference visible? For my project for full rebuild (on Linux) I got

343140 lines compiled, 11.4 sec

in case of incremental build result is < 1 second.
Or fpc compiler is slow on Windows?

Offline

#5 2021-07-01 14:33:51

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: mORMot2: Any chance of using Delphi 2009?

Incremental build is almost instant for sure with Lazarus and a SSD.

Please try with the latest commit.

Offline

#6 2021-07-01 15:21:55

jonsafi
Member
Registered: 2011-07-26
Posts: 58

Re: mORMot2: Any chance of using Delphi 2009?

Thanks a lot, again moved one step further, now the error is in File mormot.core.rtti.pas in line 5590:


{$ifndef HASNOSTATICRTTI}
      if (not FirstSearchByName) and
         (Info = TypeInfo(TGuid)) then // ERROR here, line 5590: E2134 Type 'TGUID' has no type info

Agree that Lazarus' s incremental compiling is neat!

Work with an external drive, which currently is no longer an SSD, should probably get one, although writing
to an SSD is still slow compared to its blazing read speed...

Offline

#7 2021-07-01 15:26:15

jonsafi
Member
Registered: 2011-07-26
Posts: 58

Re: mORMot2: Any chance of using Delphi 2009?

mpv wrote:
jonsafi wrote:

Yes, exactly, Lazarus's slowness is in the compilation/linking process not the executable itself.

Is this difference visible? For my project for full rebuild (on Linux) I got

343140 lines compiled, 11.4 sec

in case of incremental build result is < 1 second.
Or fpc compiler is slow on Windows?

That is quite fast would say, seems a bit slower on a Windows 7 (8 GBRAM), bit over 15sec.
But yes, incremental compiling does help considerably :-)

Offline

#8 2021-07-01 17:49:39

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: mORMot2: Any chance of using Delphi 2009?

Delphi 2009 has no TypeInfo(TGUID) indeed.
Should be fixed now.

Offline

#9 2021-07-02 06:49:45

jonsafi
Member
Registered: 2011-07-26
Posts: 58

Re: mORMot2: Any chance of using Delphi 2009?

Hi,
am probably missing something, but under 'core', found an update for file mormot.core.variants.pas
but unfortunately could not find one for file  mormot.core.rtti.pas where the error appeared,
so am still getting the same error..

Offline

#10 2021-07-02 08:58:06

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: mORMot2: Any chance of using Delphi 2009?

Weird.

I have sent you an email to work further on this issue.

Offline

#11 2021-07-03 12:36:24

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: mORMot2: Any chance of using Delphi 2009?

I think we got Delphi 2009 compatibility now, thanks to your help.

The regression tests do compile and pass:
https://gist.github.com/synopse/f2106df … 21a78b552e

big_smile

Offline

#12 2021-07-03 13:30:36

jonsafi
Member
Registered: 2011-07-26
Posts: 58

Re: mORMot2: Any chance of using Delphi 2009?

Thank you very much for taking the time to make it D2009 compatible!

It's wonderful to be able to make again use of the latest version of this great package!

Offline

Board footer

Powered by FluxBB