Recent

Author Topic: Delphi adopted FPC?  (Read 45219 times)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Delphi adopted FPC?
« Reply #15 on: November 18, 2014, 11:59:17 am »
Don't be naive, look at FPC bugtracker or language/RTL features (advanced RTTI, custom attributes, overloadable default properties, anonymous methods, or simple thing as ObjectInvoke). FPC cannot compile code a compile at Delphi 2006 (http://bugs.freepascal.org/view.php?id=26075, http://bugs.freepascal.org/view.php?id=25011).
Worry not, FPC is on its way. At least some of them are already in the separate branch.

kazalex

  • New Member
  • *
  • Posts: 29
Re: Delphi adopted FPC?
« Reply #16 on: November 18, 2014, 12:25:45 pm »
Worry not, FPC is on its way. At least some of them are already in the separate branch.
I looked branches but... FPC develops very slowly, monstrous slowly. And even based functionality don't worked as designed: ManagedObjects := {$IF Declared(vmtArcOffset) And (vmtArcOffset <> Integer(0))}Succ{$IFEND}(False);  - It's simple expression compiled by Delphi 2006, but not by FPC 2.7.1. 2014 - 2005 = 9 year. How many years still to wait?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12641
  • FPC developer.
Re: Delphi adopted FPC?
« Reply #17 on: November 18, 2014, 12:30:21 pm »
Don't be naive, look at FPC bugtracker or language/RTL features (advanced RTTI, custom attributes, overloadable default properties, anonymous methods, or simple thing as ObjectInvoke). FPC cannot compile code a compile at Delphi 2006 (http://bugs.freepascal.org/view.php?id=26075, http://bugs.freepascal.org/view.php?id=25011).

Mantis 25011: extreme corner case. Could be considered a Delphi bug.
Mantis 26075: casts internal (typeinfo) information to an own record type. Doubt if code is legal at all.

D2009+ support is not complete, but people have been making Delphi programs a decade before D2009.

Let's give an counter example, without even going into the obvious, like platform support:

Try to make a generic in Delphi that adds two numbers together. Specialize it once with integer, and once with single.

Shouldn't be that hard? Just have the addition in the base class, and add them up, like the next example.

Code: [Select]

type generic TMybase<t>= class
                      a,b:T;
                      function add:T;
                    end;


     TMyInteger=specialize TMybase<integer>;
     TMySingle = specialize TMybase<single>;

function TMybase.add:T;
begin
  result:=a+b;
end;

var i:TMyInteger;
    s:TMySingle;
begin
  i:=TMyInteger.create;
  i.a:=1;
  i.b:=2;
  writeln('int ',i.add);
  s:=TMySingle.create;
  s.a:=2.0;
  s.b:=3.0;
  writeln('single',s.add);
end.




marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12641
  • FPC developer.
Re: Delphi adopted FPC?
« Reply #18 on: November 18, 2014, 12:44:59 pm »
  It's simple expression compiled by Delphi 2006, but not by FPC 2.7.1. 2014 - 2005 = 9 year. How many years still to wait?

It's shorter than Kylix people are waiting on Embarcadero to resurrect Linux support (despite having put it prominently on the roadmap in DXE/DXE2 time), so I guess Delphians should be used to waiting.

fredbrastux

  • New Member
  • *
  • Posts: 12
Re: Delphi adopted FPC?
« Reply #19 on: November 18, 2014, 01:02:57 pm »
Do you remember about Pas4Mobile (www.pas4mobile.com) ? The link is out , but I had tested the trial version and with fpc 2.7.xxx and Lazarus you could make iOS complex aplications. The license was about only US$ 190. I don't Know why they have stopped the project ? Should be market interference from Embarcadero ? It was the last e-mail received from pas4mobile.com :(

pas4ios Version 1.42


The installation can be downloaded under http://pas4mobile.com/download/.
Required Lazarus Intern 4.1 or higher.

What’s new in pas4ios Version 1.42

New Features/Changes

·       New Lazarus and Free Pascal Version Intern 4.1


·        Works with IOS 8 Beta


·        Zeos components updated


·      Threading with GCD (Grand Central Dispatch) upgraded.
procedure dispatch_sync(aQueue: dispatch_queue_t; aBlock: Dispatch_block_t);
procedure dispatch_async(aQueue: dispatch_queue_t; aBlock: Dispatch_block_t);
procedure dispatch_barrier_async(aQueue: dispatch_queue_t; aBlock: Dispatch_block_t);
function  dispatch_queue_create(aLabel: pchar): dispatch_object_t;
procedure dispatch_apply(aIterations: size_t; aQueue: dispatch_queue_t; aBlock: Dispatch_block_t);
function  dispatch_get_main_queue: Dispatch_object_t;

(e.g. Example ThreadDispatch)


 

Bug fixes

·          TpmSlidingViewController
Controls on a shifted TopViewController can be changed.

·          TpmWYPopoverController
Don’t show the Popover if you use this method:
fController.PresentPopoverAsDialogAnimated(true); 

x2nie

  • Hero Member
  • *****
  • Posts: 515
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Delphi adopted FPC?
« Reply #20 on: November 18, 2014, 01:54:24 pm »
D2009+ support is not complete, but people have been making Delphi programs a decade before D2009.

Let's give an counter example, without even going into the obvious, like platform support:

Try to make a generic in Delphi that adds two numbers together. Specialize it once with integer, and once with single.

Shouldn't be that hard? Just have the addition in the base class, and add them up, like the next example.

Code: [Select]

type generic TMybase<t>= class
                      a,b:T;
                      function add:T;
                    end;


     TMyInteger=specialize TMybase<integer>;
     TMySingle = specialize TMybase<single>;

function TMybase.add:T;
begin
  result:=a+b;
end;

var i:TMyInteger;
    s:TMySingle;
begin
  i:=TMyInteger.create;
  i.a:=1;
  i.b:=2;
  writeln('int ',i.add);
  s:=TMySingle.create;
  s.a:=2.0;
  s.b:=3.0;
  writeln('single',s.add);
end.


Wow..! it seem Delphi (the "modern"?) couln't do it.  8-)  ha ha haaa
When you were logged in, you can see attachments.
Lazarus Github @ UbuntuCinnamon-v22.04.1 + LinuxMintDebianEdition5

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Delphi adopted FPC?
« Reply #21 on: November 18, 2014, 05:11:26 pm »
I looked branches but... FPC develops very slowly, monstrous slowly. And even based functionality don't worked as designed: ManagedObjects := {$IF Declared(vmtArcOffset) And (vmtArcOffset <> Integer(0))}Succ{$IFEND}(False);  - It's simple expression compiled by Delphi 2006, but not by FPC 2.7.1. 2014 - 2005 = 9 year. How many years still to wait?
The developers are not paid for doing that. Many are not compiler specialist as well. If you expect them to work as fast as Embarcadero compiler specialist employees, Embarcadero will go bankrupt. I just had a look at svn log, there are a lot of commits and I don't think it's slow. The priority is just different from what you want.

Anyway, removing Integer cast works in 2.7.1.
« Last Edit: November 18, 2014, 05:18:23 pm by Leledumbo »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Delphi adopted FPC?
« Reply #22 on: November 18, 2014, 06:19:05 pm »
I looked branches but... FPC develops very slowly, monstrous slowly. And even based functionality don't worked as designed: ManagedObjects := {$IF Declared(vmtArcOffset) And (vmtArcOffset <> Integer(0))}Succ{$IFEND}(False);  - It's simple expression compiled by Delphi 2006, but not by FPC 2.7.1. 2014 - 2005 = 9 year. How many years still to wait?
Yes! let's flame!

I looked at branches and I must say FPC develops too fast, while developers (tools users) quality drops even faster, monstrous faster.

A lot of new features added to the compiler has less technical values.  I must say here "new features" I'm specifically referring to sugar-syntax features, not new compiler targets (in OS or CPUs). Any task could be implemented without having them using regular pascal language.

However having a language with tons of sugar syntax is mandatory for "modern developers", rather than having means to resolve tasks. People (typically new ones) tend to complain about missing stuff from a language they had experience with (most commonly delphi). Rather than contributing to the language, not in form of patches / money, but rather in form of user-end applications, libraries and components.

But it's very likely this kind of contribution won't happen, because... well... the language doesn't have all these latest features. Bad workman always blames his tools.
« Last Edit: November 18, 2014, 06:23:22 pm by skalogryz »

minesadorada

  • Sr. Member
  • ****
  • Posts: 453
  • Retired
Re: Delphi adopted FPC?
« Reply #23 on: November 18, 2014, 07:04:30 pm »
Just my 2euro:

I don't really care of Lazarus keeps Delphi compatibility, and I suspect this requirement retards otherwise worthy refinements and additions to ObjectPascal as implemented by FPC/Lazarus.

I left Delphi behind at version 5 and wouldn't want to go back.
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

sam707

  • Guest
Re: Delphi adopted FPC?
« Reply #24 on: November 18, 2014, 07:12:47 pm »
I read someone wanting proof

Ok you can download 30 days trial version of XE7 (version 15) of embarcadero studio
but as I'am cool I attach here a picture that proofs it =

A search for "freepascal_" files'n' folder inside my installation!



kazalex

  • New Member
  • *
  • Posts: 29
Re: Delphi adopted FPC?
« Reply #25 on: November 18, 2014, 09:14:46 pm »
Mantis 25011: extreme corner case. Could be considered a Delphi bug.

No-no. Look at more details:

Change condition on {$if defined(platform)}...{$ifend} It's compiled, i.e. compiler know about identifier in this place. But if we try read of identifier member... Error with waste message about AnsiString. Also if in expression {$if defined(ns1.platform)} we will use fully qualified identifier name - error.  %)

Mantis 26075: casts internal (typeinfo) information to an own record type. Doubt if code is legal at all.
Casting a pointer. Let programmer solve about interpretation result of casting.

D2009+ support is not complete, but people have been making Delphi programs a decade before D2009.
All my reported bugs, it's many earlier than D2009, it's D2006.

Try to make a generic in Delphi that adds two numbers together. Specialize it once with integer, and once with single.
Delphi has stupid generics implementation and it's not secret. x2nie can rub one's hands with joy.

It's shorter than Kylix people are waiting on Embarcadero to resurrect Linux support
Embarcadero buy Delphi in 2009. Linux servers in roadmap on 2015. Six years. Not bad, if to remember about iOS and Android.

I just had a look at svn log, there are a lot of commits and I don't think it's slow.
I look at unassigned bugs in bugtracker. More than 480 always.

while developers (tools users) quality drops even faster, monstrous faster.
Self-criticism in cabinet of own psychologist, please.

Any task could be implemented without having them using regular pascal language.
Then wherefore advanced records, operators overloading, type helpers and other Delphi-features? Go to Delphi 7 dialect! Hardcore and pain. Pain but hardcore.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Delphi adopted FPC?
« Reply #26 on: November 18, 2014, 09:28:36 pm »
Any task could be implemented without having them using regular pascal language.
Then wherefore advanced records, operators overloading, type helpers and other Delphi-features? Go to Delphi 7 dialect! Hardcore and pain. Pain but hardcore.
That's what I'm doing. No pain, predictable and cross compiler friendly code. Consumed by all delphi and fpc versions. Compatible and robust.

Never ran into a task where I'd need to have an advanced record, operator overloading or type helpers.

sam707

  • Guest
Re: Delphi adopted FPC?
« Reply #27 on: November 18, 2014, 09:32:00 pm »
SO!!!

FPC/Lazarus tries to be Delphi compat, Delphi tries to adopt/clobber/be compat with FPC...

is this a perverted never ending "snake biting its tail" loop?

Okay, ac(h)cording a violin with a guitar won't push the music out of the Art!

But my opinion is = Delphi and FPC/Laz should stop running each after the other and begin a separate life

Why I Still PREFER LAZARUS! =>

1) totally crossplatform
2) Pascal dialect compiler 100% writen in Pascal (Delphi is from C++ writen compiler)
3) better port of Professor Wirth (inventor of pascal) concepts
« Last Edit: November 18, 2014, 09:58:14 pm by sam707 »

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Delphi adopted FPC?
« Reply #28 on: November 18, 2014, 10:08:11 pm »
The love hate relationship of freepascal and delphi is required at this stage of development. Hopefully in a few more years lazarus and lcl will have enough customers to stand to its own feet.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

kazalex

  • New Member
  • *
  • Posts: 29
Re: Delphi adopted FPC?
« Reply #29 on: November 18, 2014, 10:16:48 pm »
Never ran into a task where I'd need to have an advanced record, operator overloading or type helpers.
I have other experience with advanced records and operators overloading. These features allow to make custom types nearly (nearly because not all needed operators can be overloaded) first class citizens, what in one's part make code more simple, readable and humane.

 

TinyPortal © 2005-2018