Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-04

Announcement: Free Pascal Compiler Delphi XE Port Project

22 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Skybuck Flying

Hello,

I have finished with Phase 1 of the Free Pascal Compiler Delphi XE Port Project:

http://www.skybuck.org/FreePascalCompilerDelphiXEPortProject/

All code with porting issue's have been disabled by me.

(The RTL is not used, instead small portions of it where copied to unit_skybuck_types.pas for the time being).

By disabling/commenting all code porting issue's it's now possible to fully compile the free pascal compiler in Delphi XE which should be a great help to programmers all over the world that want to help with this new project !

Programmers should now be able to fix any bug in any file, they can all working in parallel.

This project is open to anybody skilled enough at fixing porting issue's... these are probably/hopefully little issue's like... fixing pascal-array features which are not supported in Delphi. (How to exactly fix these issue's could be further discussed perhaps via e-mail, a forum, newsgroups... not sure yet where we could discuss this... I'll probably setup a nice little forum for us to communicate via the website... )

I also hope that the original developers of free pascal might take a little peak and perhaps help out at fixing their own compiler so it becomes "portable" again.

You should have and/or install a latest version of Delphi... (Delphi XE preferably) that would be great... then you have all the advanced tools that you need to fix this code ! ;) =D

Perhaps your code might even benefit from this. Perhaps it's also easier to navigate to certain things.

Do see SkybuckChanges.txt to see what I did to source code...

I shall also paste a link to the source code right here so you don't have to wrestly through that somewhat whacky/messy website ;):

http://www.skybuck.org/FreePascalCompilerDelphiXEPortProject/fpcbuild-2.4.2-delphi-xe-port-version-002-do-not-use-free-pascal-rtl.rar

Good luck to all and may the force be with you ! ;) =D

Bye,
Skybuck.

Reply by email

Juha (gmail
to Skybuck Flying

Skybuck Flying kirjoitti perjantai, 8. huhtikuuta 2011 12:40:24:

I have finished with Phase 1 of the Free Pascal Compiler Delphi XE Port Project:

Interesting!

Show quoted text 5 lines
I shall also paste a link to the source code right here so you don't have to wrestly through that somewhat whacky/messy website ;): http://www.skybuck.org/FreePascalCompilerDelphiXEPortProject/fpcbuild-2.4.2 -delphi-xe-port-version-002-do-not-use-free-pascal-rtl.rar

You should put your code under a revision control system. It will be more manageable for you and for others.

Good luck to all and may the force be with you ! ;) =D

May the Source be with You ! :-)

Juha

Reply by email

Skybuck Flying
to Juha (gmail

The short story so far:

Hello,

This project is about "porting" the Free Pascal Compiler to Delphi XE.

More information can be found on this little blog:

http://www.skybuck.org/FreePascalCompilerDelphiXEPortProject/

A subversion server has been setup here:

https://free-pascal-compiler-delphi-port.googlecode.com/svn/

The latest release/distribution is here:

http://www.skybuck.org/FreePascalCompilerDelphiXEPortProject/fpcbuild-2.4.2-delphi-xe-port-version-004-make-fixes.rar

The source code compiles, however little sections of code have been disabled as follows:

// *** Skybuck: Fix Needed ***

These sections are slight free pascal language incompatibilities with Delphi and need to be fixed...

There are about 700 of them. (Many duplicates here and there though).

Will you help fixing these issue's ?

If so you can either help by using subversion or simply working via e-mail and selecting a file to fix.

Me e-mail is:

After the compiler is fixed it can be extended to support new hardware/platforms and virtual machines, perhaps even converters... like opencl/cuda/ptx/php/java/.net/c/c++... pretty much anything can become possible afterwards. It's good to have an open-source delphi alternative, if you agree with that then help out and together we rock the cradle ! ;) =D

Bye,
Skybuck.

Reply by email

Matt Emson
to Skybuck Flying: I gave google code a try but it doesn't have all the features I want, so I am switching…
Skybuck Flying wrote 8 lines
Ok, I gave google code a try but it doesn't have all the features I want, so I am switching to sourceforge: https://sourceforge.net/projects/fpcfordelphi/ (I especially like/want the bugtracker ! ;) =D)

Google Code has a bug tracker and it is way, way simpler to use/manage than Sourceforge - believe me, I've done both! When the hosting site takes more than 15 minutes to configure, it is wasting my time ;-)

M

Reply by email

Matt Emson
to Felipe Monteiro de Carvalho: I am curious: What is the use for this? Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
On Sun, Apr 10, 2011 at 4:46 PM, Skybuck Flying wrote: > This project is about "porting" the Free Pascal Compiler to Delphi XE. I am curious: What is the use for this?

This is what Mr Flying does - pops up, attempts to do something without really any good reason. He's not been on an FPC list in a while though. I remember when he was trying to reverse engineer 64bit exe files in.. wow.. 2007? He says a lot, listens a little and generates lots of content with little or no sense. He has been accused of trolling before, but the jury is out on this one...

M

Reply by email

Mark Morgan Lloyd
to Matt Emson: This is what Mr Flying does - pops up, attempts to do something without really any good…
Matt Emson wrote 12 lines
On 11/04/2011 12:49, Felipe Monteiro de Carvalho wrote: > On Sun, Apr 10, 2011 at 4:46 PM, Skybuck > Flying wrote: >> This project is about "porting" the Free Pascal Compiler to Delphi XE. > I am curious: What is the use for this? This is what Mr Flying does - pops up, attempts to do something without really any good reason. He's not been on an FPC list in a while though. I remember when he was trying to reverse engineer 64bit exe files in.. wow.. 2007? He says a lot, listens a little and generates lots of content with little or no sense. He has been accused of trolling before, but the jury is out on this one...

Let's judge him by results. However, I must admit that I'm asking "why" as well: why would one want to recompile a portable free compiler with a non-portable non-free one?

Now if he'd instead devised a way of bootstrapping FPC using GCC I think that everybody would be unreservedly enthusiastic.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Adem
to Felipe Monteiro de Carvalho: I am curious: What is the use for this? Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
On Sun, Apr 10, 2011 at 4:46 PM, Skybuck Flying wrote: > This project is about "porting" the Free Pascal Compiler to Delphi XE. I am curious: What is the use for this?

The last time (a year or so ago) I played with the compiler code (under Windows), I was surprised to find out that AQTime [ http://smartbear.com/products/development-tools/performance-profiling/ ] didn't support FPC or executables produced by FPC.

So, with this port, you could, for example, use tools such as AQTime or similar to see what's happening when you run the compiler executable (performance profiling) and that may turn out to help optimize the compiler code.

Reply by email

Matt Emson
to Adem

Sent from my iPhone 4

Adem wrote
The last time (a year or so ago) I played with the compiler code (under Windows), I was surprised to find out that AQTime [ http://smartbear.com/products/development-tools/performance-profiling/ ] didn't support FPC or executables produced by FPC.

Last time I used AQTime (circa 2004?) it relied on debug info being present and expected it to be in a Borland/Windows specific format. I'd put it to you that fixing the lack of FPC support for that format would be far more worthwhile in general, with regards to solving this issue. The described venture Mr Flying suggests would only get you as far as the compiler - as Delphi does not use an external assembler/linker (to use with the "new" compiler version) AFAIR and compiling the compiler with Delphi alone will not miraculously change the nature of the compiler's output to be Delphi XE compatible. So, unless I'm mistaken, does zero to help get closer to "general" AQTime compatibility, which would be far more useful in general.

M

Reply by email

Mark Morgan Lloyd
to Skybuck Flying: The short story so far: This project is about "porting" the Free Pascal Compiler to…
Skybuck Flying wrote 9 lines
The source code compiles, however little sections of code have been disabled as follows: // *** Skybuck: Fix Needed *** These sections are slight free pascal language incompatibilities with Delphi and need to be fixed... There are about 700 of them. (Many duplicates here and there though).

Are you saying that you have identified these and inserted about 700 comments or conditional-compilation directives manually? That's a respectable amount of work...

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Skybuck Flying
to Mark Morgan Lloyd

----- Original Message -----

Earlier message 72 lines
From: "Mark Morgan Lloyd" To: Sent: Wednesday, 13 April, 2011 10:13 AM Subject: Re: [fpc-devel] Announcement: Free Pascal Compiler Delphi XEPortProject > Skybuck Flying wrote: > >> The source code compiles, however little sections of code have been >> disabled as follows: >> >> // *** Skybuck: Fix Needed *** >> >> These sections are slight free pascal language incompatibilities with >> Delphi and need to be fixed... >> >> There are about 700 of them. (Many duplicates here and there though). > > Are you saying that you have identified these and inserted about 700 > comments or conditional-compilation directives manually? That's a > respectable amount of work... Yeah :) Meanwhile I have run into a little ansi string vs unicode string issue in ccharset.pas. According to some previous correspondence and also looking at code in units/conditionals this unit might actually not be necessary ? But I am still confused about that. (Perhaps it's either charset.pas or ccharset.pas so I guess either will do (?)) It's a small little unit which apperently (I guess) handles conversion from ansi to unicode... or some kind of unicode mapping. This requires a little bit deeper inspection of the code, since char which was ansichar is now an unicode char. So perhaps that code needs to be changed a little from Parameter : char; to Parameter : AnsiChar; (Or perhaps this unit is not necessary at all ?) These little issue's are at porting issue 28 and 29 perhaps 25 to 29 or so needs to be looked at. For now I postpone it because it might not be that important... or it just might be... because the alternative charset.pas probably not being used and might not be available or could be added. Anyway if somebody could take a look at all of this and make some sense of it that would be great/nice, saves me some time and could clear some confusion (?) ;) Bye, Skybuck. > > -- > Mark Morgan Lloyd > markMLl .AT. telemetry.co .DOT. uk > > [Opinions above are the author's, not those of his employers or > colleagues] > _______________________________________________ > fpc-devel maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-devel >

Reply by email

Hans-Peter Diettrich
to Skybuck Flying: ----- Original Message ----- From: "Mark Morgan Lloyd" To: Sent: Wednesday, 13 April,…
Anyway if somebody could take a look at all of this and make some sense of it that would be great/nice, saves me some time and could clear some confusion (?) ;)

Before looking at your code, I'd know the role that your project plays at all. Is it only about making the FPC code compilable by Delphi, as the first stage in the FPC bootstrap?

In this case it would be easier to use an older Delphi commandline compiler, from the time before the Ansi-To-Unicode move, or simply an legacy FPC. You also could try to make the FPC sources compile by gcc - but I'd delay any such attempts to the time, when there doesn't exist any immediately applicable compiler any more.

DoDi

Reply by email

Skybuck Flying
to Hans-Peter Diettrich

----- Original Message -----

Earlier message 127 lines
From: "Hans-Peter Diettrich" To: "FPC developers' list" Sent: Thursday, 14 April, 2011 15:12 PM Subject: Re: [fpc-devel] Announcement: Free Pascal CompilerDelphi XEPortProject > Skybuck Flying schrieb: > >> Anyway if somebody could take a look at all of this and make some sense >> of it that would be great/nice, saves me some time and could clear some >> confusion (?) ;) > > Before looking at your code, I'd know the role that your project plays at > all. Is it only about making the FPC code compilable by Delphi, as the > first stage in the FPC bootstrap? Yes. Plan is as follows: 1. Compile free pascal compiler sources without free pascal rtl and instead use a "bootstrapping rtl". The bootstrapping rtl is a mix of Delphi's own RTL (which is implicitly present and doesn't require any additional files/sources) and any RTL inconsistencies/extensions placed in my own "mini extension RTL" which is currently simply called unit_skybuck_types.pas LOL. 2. Once free pascal compiler is compiled towards an executable by Delphi it should then be possible to compile Free Pascal's own RTL with Free Pascal. An alternative idea could be to start working on compiling the Free Pascal RTL with Delphi as well. This would be possible by renaming all conflicting files, so at least no unit name conflicts like system.pas. However if this would work is doubtfull because of potential "type conflicts" but perhaps Delphi allows types to be "overriden" or "redeclared" or "overloaded". That in itself could actually be an interesting language feature/extension. (I shall post this idea later on on usenet as well) Such a language feature would be nice to solve unit type conflicts, for example some unit defined TSomething and now another unit wants to define TSomething as well, however because the unit scope is in affect this is not an issue... For other units it's also not an issue because they could simply write: unit1.TSomething and unit2.TSomething however that does require putting the unit name in front of it. Perhaps a type override could specify which TSomething to prevail for example: uses unit1; unit2; type TSomething = unit2.TSomething; override; Then in the rest of the unit TSomething from unit2 would be used without having to write Unit2.TSomething all the time. It could also have written the following: TSomething = SomethingElse; override; This will override the type from unit1 and unit2 so that unit3 can use that namespace/type for itself. 3. Once the RTL is compiled use the original RTL sources and/or RTL binaries to recompile the free pascal compiler so it's fully self-hosting and self-compiling. (Etc) (I am a little bit exciting about this potential new language feature so I am cutting this short, but this is basically the plan ;) =D). > In this case it would be easier to use an older Delphi commandline > compiler, from the time before the Ansi-To-Unicode move, or simply an I don't do command line compiling, I hate it, working with the command line is freaking slow. I don't think ansi will be much of a problem, it's kinda cool to have a unicode compiler... Perhaps it will be the first in the world, or perhaps not... who knows (for real lol) ? > legacy FPC. You also could try to make the FPC sources compile by gcc - The whole idea is to not require FPC to do any development, all development done on/in Delphi IDE and then final stage compile with FPC for non-supported-delphi-platforms. GNU Compilers are slow, furthermore they are not object-oriented as far as I know/last time I checked so they totally out-of-the-question. The least I would want is record with properties support, not yet sure if Free Pascal has that record-language-feature but if not then Tobject could be used for that. And thus oo needed. Furthermore class support is nice. > but I'd delay any such attempts to the time, when there doesn't exist any > immediately applicable compiler any more. Let me know if there is a "pascal to c" converter or "object pascal to c converter" or "object/pascal to cuda/opencl/glsl/cg converter" because as far as I know it don't exist or it's really shitty (delphi to c converter). In other words the time for me has already come to attempt it ;) =D and thus this project came to be ! ;) =D and ofcourse it will be most handy for the future. And now I go post that language/type override idea ;) Bye, Skybuck.

Reply by email

Mark Morgan Lloyd
to Hans-Peter Diettrich: Before looking at your code, I'd know the role that your project plays at all. Is it only…
Hans-Peter Diettrich wrote 15 lines
Skybuck Flying schrieb: > Anyway if somebody could take a look at all of this and make some > sense of it that would be great/nice, saves me some time and could > clear some confusion (?) ;) Before looking at your code, I'd know the role that your project plays at all. Is it only about making the FPC code compilable by Delphi, as the first stage in the FPC bootstrap? In this case it would be easier to use an older Delphi commandline compiler, from the time before the Ansi-To-Unicode move, or simply an legacy FPC. You also could try to make the FPC sources compile by gcc - but I'd delay any such attempts to the time, when there doesn't exist any immediately applicable compiler any more.

I think that's very wise advice. I'd also throw in that there's a few things in the compiler etc. that I'm interested in looking at, but that I'm trying to build up a sound base of experience actually /using/ it first. The community has put up with me for six years or so, I still consider myself an inexperienced beginner, and I'd be very reluctant to make any suggestion that the developers had overlooked something significant.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Marco van de Voort
to Hans-Peter Diettrich: Okay, so far. This can be accomplished already, without any modifications to the FPC…

In our previous episode, Hans-Peter Diettrich said:

Show quoted text 14 lines
Development can be done in whatever IDE you like. This is absolutely independent from the compilation and linking of the developed code. When you want to use FPC as an alternative compiler for Delphi, then you'll have to make it output binaries in a way that the Delphi linker can use. In order to make use of further targets, as already supported by FPC but not by Delphi, you'll have to update the Delphi RTL accordingly, and you must add linkers, debuggers etc. for all these targets. Here the Delphi license gets into the way, so that you'll have to implement a new Delphi-compatible RTL from scratch. This suggests to me that your approach means much work without any practical use, you better create that RTL first, so that it can be used already in the compilation of FPC itself.

IMHO you'll describing problems he'll never reach. After he gets a Delphi compiled FPC, he still needs to make the resulting product _work_.

If I understood it correctly, this (making the Delphi compiled FPC work stable enough) was the problem with earlier attempts, and the unicode version won't make it any easier.

It could be bugs in Delphi, it could be bugs or assumptions in the FPC code that only surface with Delphi, but either way, this has to be examined, and that is way more difficult then cobbling up a bit of replacement code here and there for places that Delphi can't yet compile.

Reply by email

Hans-Peter Diettrich
to Skybuck Flying: ----- Original Message ----- From: "Hans-Peter Diettrich" To: "FPC developers' list"…
Show quoted text 5 lines
> Before looking at your code, I'd know the role that your project plays > at all. Is it only about making the FPC code compilable by Delphi, as > the first stage in the FPC bootstrap? Yes.

Okay, so far.

3. Once the RTL is compiled use the original RTL sources and/or RTL binaries to recompile the free pascal compiler so it's fully self-hosting and self-compiling.

This can be accomplished already, without any modifications to the FPC code, by using FPC instead of an Delphi compiler.

The whole idea is to not require FPC to do any development, all development done on/in Delphi IDE and then final stage compile with FPC for non-supported-delphi-platforms.

Development can be done in whatever IDE you like. This is absolutely independent from the compilation and linking of the developed code.

When you want to use FPC as an alternative compiler for Delphi, then you'll have to make it output binaries in a way that the Delphi linker can use. In order to make use of further targets, as already supported by FPC but not by Delphi, you'll have to update the Delphi RTL accordingly, and you must add linkers, debuggers etc. for all these targets. Here the Delphi license gets into the way, so that you'll have to implement a new Delphi-compatible RTL from scratch.

This suggests to me that your approach means much work without any practical use, you better create that RTL first, so that it can be used already in the compilation of FPC itself.

DoDi

Reply by email

Hans-Peter Diettrich
to Marco van de Voort: In our previous episode, Hans-Peter Diettrich said: IMHO you'll describing problems he'll…
Show quoted text 14 lines
> When you want to use FPC as an alternative compiler for Delphi, then > you'll have to make it output binaries in a way that the Delphi linker > can use. In order to make use of further targets, as already supported > by FPC but not by Delphi, you'll have to update the Delphi RTL > accordingly, and you must add linkers, debuggers etc. for all these > targets. Here the Delphi license gets into the way, so that you'll have > to implement a new Delphi-compatible RTL from scratch. > > This suggests to me that your approach means much work without any > practical use, you better create that RTL first, so that it can be used > already in the compilation of FPC itself. IMHO you'll describing problems he'll never reach. After he gets a Delphi compiled FPC, he still needs to make the resulting product _work_.

That's exactly my impression, as outlined before. It may be easier to start a project from the easy side, but chances are high that it will never reach the goal, when the difficulties increase with every futher step.

DoDi

Reply by email

Matt Emson
to Skybuck Flying: ----- Original Message ----- From: "Hans-Peter Diettrich" To: "FPC developers' list"…
Skybuck Flying wrote 13 lines
> >> Anyway if somebody could take a look at all of this and make some >> sense of it that would be great/nice, saves me some time and could >> clear some confusion (?) ;) > > Before looking at your code, I'd know the role that your project > it only about making the FPC code compilable by > Delphi, as the first stage in the FPC bootstrap? Skybuck Flying schrieb: Yes. Plan is as follows:

<snip>

2. Once free pascal compiler is compiled towards an executable by Delphi it should then be possible to compile Free Pascal's own RTL with Free Pascal.

Why? Free Pascal already compiles its own RTL - why do you need to do this? What advantage would there be in tying FreePascal to a Windows only compiler, when it is already cross platform - the RTL already compiling on multiple platforms?

An alternative idea could be to start working on compiling the Free Pascal RTL with Delphi as well.

Why? What advantage would this have? The FreePascal RTL is not radically different from Delphi in many ways, so what advantage would this give? And we are not talking about GUI here at all - we are talking about fundamental types and such. GUI is a completely different subject, as the toolkits API would be built with the basic building blocks for each target.

3. Once the RTL is compiled use the original RTL sources and/or RTL binaries to recompile the free pascal compiler so it's fully self-hosting and self-compiling.

???? It already is. Am I missing something here?

Show quoted text 5 lines
> legacy FPC. You also could try to make the FPC sources compile by gcc - The whole idea is to not require FPC to do any development, all development done on/in Delphi IDE and then final stage compile with FPC for non-supported-delphi-platforms.

There was a Delphi IDE plug-in that did this - would that just not be, you know, simpler?

GNU Compilers are slow, furthermore they are not object-oriented as far as I know/last time I checked so they totally out-of-the-question.

What does that have to do with anything? The compiler being OO has nothing to do with the capability of the compiler to compile OO code.

Honestly, even the explanation isn't making what you are trying to do make any more sense than it did before you started. So, can you please explain exactly what you are doing - without digressing and assuming we already understand? Because, really, I don't think we really do - at least not all of us ;-)

Reply by email

Skybuck Flying
to Marco van de Voort: In our previous episode, Hans-Peter Diettrich said: IMHO you'll describing problems he'll…
Show quoted text 6 lines
IMHO you'll describing problems he'll never reach. After he gets a Delphi compiled FPC, he still needs to make the resulting product _work_. If I understood it correctly, this (making the Delphi compiled FPC work stable enough) was the problem with earlier attempts, and the unicode version won't make it any easier.

Earlier attempts seem to have used BDS2006 which was the worst Delphi version ever.

I plan to use Delphi XE which has many bug fixes, thus it's worthy of a new attempt ! ;) =D

Show quoted text 6 lines
It could be bugs in Delphi, it could be bugs or assumptions in the FPC code that only surface with Delphi, but either way, this has to be examined, and that is way more difficult then cobbling up a bit of replacement code here and there for places that Delphi can't yet compile.

We'll see if there are any issues.

So far I am not counting on any issues but if you know of any existing Delphi XE bugs which might be a problem don't hesitate to post an example of such a bug here ;) =D

Otherwise I will assume that everything will go just fine/nicely ! ;) =D

Bye,
Skybuck ;) :)

Reply by email