* * *

Author Topic: How to make Delphi to be compatible with Free Pascal  (Read 1024 times)

srcstorm

  • New member
  • *
  • Posts: 21
How to make Delphi to be compatible with Free Pascal
« on: April 20, 2017, 08:32:52 am »
As you know, Borland lost interest in their developer tools and passed them to another company. Meanwhile FPC progressed nicely and became popular among Pascal programmers. Free Pascal now has its own dialect (mode ObjFPC). I believe FPC team carefully worked on it to keep the language clean, and closer to Pascal tradition.

Delphi is getting nice updates from the new owner recently. It is good to see that Delphi is still alive, but I think it should be compatible with Free Pascal dialect, or at least recognize FPC code and provide a means to use FPC units.

It may be difficult to persuade authors of Delphi to directly support mode ObjFPC code. So we can follow a more formal way to make it happen.

FPC is an open source compiler and freely available for many platforms. It is also well maintained, so it will continue to be commonly used by Pascal programmers. For this reason FPC 3.0 dialect may be published as an ISO standard. After that, Delphi can recognize FPC code as ISO standard code. Of course, IDE and OS specific elements, such as published property, should be eliminated.

I think it is a good time to make an ISO standard for Object Pascal language.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5575
Re: How to make Delphi to be compatible with Free Pascal
« Reply #1 on: April 20, 2017, 04:42:26 pm »
Personally, I think the objfpc is pointless. I always use mode delphi with FPC and then the issue is moot.

The chance that Embarcadero or its current owners implement mode objfpc is also near zero, so I wouldn't bother with a standarization process, since current delphi doesn't support any standard to begin with.

Remy Lebeau

  • Sr. Member
  • ****
  • Posts: 306
    • Lebeau Software
Re: How to make Delphi to be compatible with Free Pascal
« Reply #2 on: April 20, 2017, 09:49:35 pm »
As you know, Borland lost interest in their developer tools and passed them to another company.

Several companies, actually.  Borland created CodeGear, which was bought by Embarcadero, which has now been bought by Idera.

It is good to see that Delphi is still alive, but I think it should be compatible with Free Pascal dialect, or at least recognize FPC code and provide a means to use FPC units.

Never going to happen.  There is no incentive for them to make their commercial product compatible with a competing open source product.

In the meantime, FreePascal supports Delphi language syntax, via {$Mode Delphi}, if you need to write cross-compiler code.

It may be difficult to persuade authors of Delphi to directly support mode ObjFPC code.

Try "impossible".

FPC is an open source compiler and freely available for many platforms. It is also well maintained, so it will continue to be commonly used by Pascal programmers. For this reason FPC 3.0 dialect may be published as an ISO standard. After that, Delphi can recognize FPC code as ISO standard code.

Making it an ISO standard will not guarantee that Embarcadero (or whoever owns Delphi by the time an ISO standard is released) will implement it.

Of course, IDE and OS specific elements, such as published property, should be eliminated.

Not going to happen in Delphi.  The PME model (properties/methods/events) is too important to Delphi's existing infrastructure.  Published properties, and the RTTI generated by them, are used for all kinds of technologies.

I think it is a good time to make an ISO standard for Object Pascal language.

One of Delphi's (and FreePascal's) strengths is that their Pascal dialects are NOT standardized, so the compiler vendors can freely, easily, and quickly change the language as they see fit for their needs.  Standardization makes it harder and slower to make changes when needed.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) open source project - Admin, Developer

srcstorm

  • New member
  • *
  • Posts: 21
Re: How to make Delphi to be compatible with Free Pascal
« Reply #3 on: April 21, 2017, 07:35:35 am »
The chance that Embarcadero or its current owners implement mode objfpc is also near zero, so I wouldn't bother with a standarization process, since current delphi doesn't support any standard to begin with.

Without standardization, how are we supposed to write Pascal programs? For an experienced Pascal programmer it is obvious, but what about a new programmer? Delphi has a fame, FPC is available to everyone.

FPC should step forward as the authority of Object Pascal language. FPC code is valid Pascal code. More specifically, code written in mode ObjFPC is valid Pascal code.

Quote
Personally, I think the objfpc is pointless. I always use mode delphi with FPC and then the issue is moot.

You seem to not care about it just because your code compiles. But if you wrote your program in mode Delphi, it is not a valid Pascal program. Delphi is not a Pascal programming environment, but it may choose to become so. Unless it becomes an FPC-clone, we won't bother with Delphi.

One of Delphi's (and FreePascal's) strengths is that their Pascal dialects are NOT standardized, so the compiler vendors can freely, easily, and quickly change the language as they see fit for their needs.  Standardization makes it harder and slower to make changes when needed.

How a language can change so frequently? Object Pascal is just some extensions to standard Pascal. Frameworks may change frequently, this doesn't mean that language will change. To elaborate:

Object Pascal is not TComponent
Object Pascal is TObject

Now, how much TObject can change? You can check this draft document to have an idea of how an official standard could be:
http://www.pascal-central.com/OOE-stds.html

Some compiler implementation details like RTTI, generics, anonymous methods, UTF support etc. may be omitted when preparing a specification. Then, FPC can still be seen as reference platform when comparing implementations.

There may be other compiler vendors who are willing to provide commercial Object Pascal compilers. Such a work will form a foundation for this possibility.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5575
Re: How to make Delphi to be compatible with Free Pascal
« Reply #4 on: April 21, 2017, 08:05:10 am »
The chance that Embarcadero or its current owners implement mode objfpc is also near zero, so I wouldn't bother with a standarization process, since current delphi doesn't support any standard to begin with.

Without standardization, how are we supposed to write Pascal programs?

Just as the whole world has done till now. Standardization is vastly overrated.

The C standardization e.g. is mostly because of the Unix habit of only guaranteeing a source level ABI instead of binary one (like on Windows where your old win9x binaries still work)

That rare condition caused a multi vendor effort. But that is an exception, not a rule.

Quote
For an experienced Pascal programmer it is obvious, but what about a new programmer? Delphi has a fame, FPC is available to everyone.

If you must write code, just use mode Delphi.

Quote
FPC should step forward as the authority of Object Pascal language. FPC code is valid Pascal code. More specifically, code written in mode ObjFPC is valid Pascal code.

Well, it is the lesser of the choices. The only advantage it seems to have is one corner case in procedural abstraction handling and Delphi incompatibility (which is a feature in itself for some)

Quote
You seem to not care about it just because your code compiles. But if you wrote your program in mode Delphi, it is not a valid Pascal program. Delphi is not a Pascal programming environment, but it may choose to become so. Unless it becomes an FPC-clone, we won't bother with Delphi.

I don't see why objfpc is even equally valid to Delphi. Let alone why it would be more valid. Note that I have been a freepascal user from before both these modes existed.

Quote
How a language can change so frequently? Object Pascal is just some extensions to standard Pascal. Frameworks may change frequently, this doesn't mean that language will change. To elaborate:

No. The size of current Object pascal is many times larger than the original pascal. It is more C++ than C.

Quote
Now, how much TObject can change?

Free Pascal has two tobjects actually. One TP style object pascal (in unit objects), one Delphi style in the objfpc/delphi modes.

Quote
You can check this draft document to have an idea of how an official standard could be:
http://www.pascal-central.com/OOE-stds.html

Neither Free Pascal objfpc or Delphi mode or Delphi follows that standard. It is said to be originally "inspired" by it, but that is IMHO a stretch

 

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus