[fpc-devel] LLVM Backend?
samuraileumas at yahoo.com
Wed Nov 11 21:35:00 CET 2009
----- Original Message ----
> From: Jonas Maebe <jonas.maebe at elis.ugent.be>
> To: FPC developers' list <fpc-devel at lists.freepascal.org>
> Sent: Wed, November 11, 2009 1:43:08 PM
> Subject: Re: [fpc-devel] LLVM Backend?
> > That's two problems, both fairly significant (although the latter is
> definitely heavier than the former). Do you think it's too soon to divide out
> the work? Is there more that needs discussion?
> It's not entirely clear to me yet how you see the result: an FPC frontend added
> to the LLVM project, or an LLVM backend added to the FPC project. I favour the
> latter, but a lot of what you talk about seems to be about the former. Or am I
> misunderstanding things?
I think you are understanding things well. I'm looking to FPC as a means to an end where having a team member on the Mattathias BASIC team is creating some libraries in Delphi that I want ported to LLVM. The reason I haven't thought through the Pascal-specific portions of the task is that I am a C++ programmer.
The last time I programmed in Turbo Pascal, Delphi didn't even exist. My first C programming class in college back in 1994 was on Turbo C++. I've since gone on to do a lot of stuff in C and a little stuff in C++. I still have my Turbo Pascal textbook but it's so out-of-date with regards to OOP that it is useless to me. I am unable to parse half the stuff I see when I look at modern FPC source.
Perhaps rather than discuss what code we will use from which project, FPC or LLVM, we should be talking about who wants to do what. If I am to do most of the work, then the packed array of booleans will be implemented with an LLVM bitvector template class on a thin Pascal frontend accessing most of its code through C wrappers of C++. If you do it, we'll be using a Pascal array of packed booleans properly in Pascal and I wouldn't know what difference it would make. If packed arrays apply to non-boolean types, and I'd be none-the-wiser as to how it worked apart from my 1994-vintage Turbo Pascal programming knowledge and my knowledge of programming in 68020 Assembly.
As far as code-maintenance is concerned, I favor LLVM code over FPC code because as long as I watch the mailing list and rewrite portions of the code, it will be an out-of-sync version of Pascal that would do what I needed it to do in much the same way as FPC is out-of-sync with my old Amiga computer's backend. I don't plan on bringing the Amiga backend up-to-date but I do plan on writing a backend for the 680x0 series processors on LLVM for use with Mattathias BASIC.
In summary, herein lies the source of our disagreement: I want to work in C++ because it is what I know. You want to work in Pascal because it is what you know. We need to divide out the work so that we each know what is expected of us.
Does that answer your questions?
More information about the fpc-devel