Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Delphi 

Delphi and FreePascal (Lazerus) Aren't the Same

OK, this thread is purely to set the record straight on something. Many claim that native Delphi is portable because it compiles on Lazerus using the FreePascal compiler underneath. They also claim that Delphi .NET shouldn't be used because it's not portable outside Windows.

Both are wrong.

Delphi and FreePascal are both ObjectPascal languages (yes, there are multiple incompatible variations of ObjectPascal like Apple's Pascal), and they both implement the same interfaces for their libraries (the VCL).

But they are not the same language. Even when you switch FreePascal code to Delphi mode using the preprocessor directive, it isn't 100% compatible with Delphi code. Nor is it the 'final goal' of the FreePascal group. Thus, they are different languages. FreePascal is portable, but Delphi isn't. So if you want portable ObjectPascal code, you can't use Delphi -- But you can use FreePascal, seeing as it also works on Windows.

Delphi .NET is portable due to Mono, a very complete .NET implementation for multiple OSes. In fact, it's on Ubuntu Linux by default. As long as you stick to standard .NET libraries, that is.

So, in summery:
  • Delphi = Not Portable

  • Delphi .NET = Portable

  • FreePascal = Portable

  • Delphi =/= FreePascal


Who said that Lazerus was the same thing? I suppose I can kind of see why they would make that assumption though. Sure they have similarities but they even state on their website:
Lazerus Wrote:The class libraries and development environment for Free Pascal that emulate Delphi.

well no shit sherlock. of course they aren't exactly the same. they we never meant to be. Lazarus's goal isn't to be compatible with Delphi projects, it is to be a cross platform pascal compiler. Delphi uses Embarcadero's simplified interpretation of Object Pascal, called the Delphi Programming Language. Whereas Lazarus uses just normal Object Pascal. Two different languages.

although they aren't the same, their differences are very minor. most of the time, you'll just find yourself getting errors related to type conversion that work in Delphi but not Lazarus.
if your code is native, it is easy to convert your project to Lazarus because of its many similarities to Delphi. for instance, cheat engine 6.

(the keyword is "convert" this means that you will still need to make some effort to fix a few small compiler errors).
You two are talking about it as if it's obvious to the other people here. Most in this section seem to think Delphi code is portable because it 'is the same as Lazerus', and so it's a portable language. I was setting the record straight for those people.

This is meant to counter those who claim 'yeah, Delphi is totally portable because you can compile all Delphi code in the Lazerus IDE'. As you two point out, this simply isn't true.
(Jan 24, 2011 11:40 AM)Montage Wrote:  You two are talking about it as if it's obvious to the other people here. Most in this section seem to think Delphi code is portable because it 'is the same as Lazerus', and so it's a portable language. I was setting the record straight for those people.

This is meant to counter those who claim 'yeah, Delphi is totally portable because you can compile all Delphi code in the Lazerus IDE'. As you two point out, this simply isn't true.

One thread can not cure ignorance unfortunately.
(Jan 24, 2011 11:40 AM)Montage Wrote:  You two are talking about it as if it's obvious to the other people here. Most in this section seem to think Delphi code is portable because it 'is the same as Lazerus', and so it's a portable language. I was setting the record straight for those people.

This is meant to counter those who claim 'yeah, Delphi is totally portable because you can compile all Delphi code in the Lazerus IDE'. As you two point out, this simply isn't true.

you make it sound as if Delphi and Lazarus' language are completely different. this simply is not true either. you are making it sound as if it is impossible to compile Delphi units in Lazarus.

Depending on the depth and complexity of the project you are on the right track however, it all really depends on which components you use. if you use ONLY standard VCL components that both Delphi and Lazarus implement into their IDEs it will be relatively LITTLE changes needing to be applied. (notice i implied that you will still need to change a bit. just not too much.) however if you use a lot of Delphi only components and dom't have the source code or know how they work it can make compiling the project in Lazarus a lot more difficult.

cheat engine 5.6.1 and below was created in Delphi, and then cheat engine 6 was updated to Lazarus to support x64 system. it is a relatively large project, which enforces my point.

i understand what you are saying however, Lazarus and Delphi are not the same nor are they too different. they are SIMILAR. You are right in saying that Delphi is not portable in Lazarus but wrong in saying that the two IDEs are different. a decent pascal programmer should be able to convert his project to work in Lazarus with little trouble, in most cases.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Delphi] by VxV3n0mxVJan 4, 2018 07:37 PM 10 3,643 Jan 4, 2018 07:37 PM
Last Post: tcsh
[Delphi] by SymbioticJul 28, 2017 08:19 PM 10 1,665 Jul 28, 2017 08:19 PM
Last Post: Xogg
[Delphi] by EmirejJul 23, 2017 11:40 AM 9 1,620 Jul 23, 2017 11:40 AM
Last Post: Xogg