[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using p2c to translate Delphi to C?



On Mon, Dec 16, 2002 at 08:42:42AM -0500, Michael D. Crawford wrote:
> I am evaluating some Delphi source code for a consulting contract I might 
> do.
> 
> The project would be a port from Windows to Mac OS, which doesn't have 
> Delphi support.  Delphi appears to be a very specialized dialect of Pascal. 
> Pascal used to be popular on the Mac, but I don't think that there are 
> Pascal compilers anymore that will compile OS X native source for the Mac.
> 
> My first thought of how to deal with this was to try translating the source 
> with the p2c Pascal to C translator that is available for Woody.  But the 
> first try just barfed.  I could probably fix up the Delphi source to make 
> it work, but I worry about causing some problem because I don't have a 
> Delphi compiler.
> 
> Is there a version of p2c available anywhere (it doesn't have to be a 
> Debian package) that can translate Delphi to C?  Or any kind of Delphi to C 
> translator?

No offense, but have you actually looked into this at all?  Delphi's
programming language is a dialect of Object Pascal, which is never going
to map cleanly onto C.  You're going to have to learn Objective C and do
a proper, manual port of the code to Cocoa/OS X.

Even if there was an automatic translation tool, would you be
comfortable selling the undoubtably ugly output of p2c to a client as a
'port'?  How were you going to take into account the huge difference in
GUI toolkits; Delphi's VCL is completely different to OS X's Cocoa (do C
bindings even exist for this?).  What about the aspects of Pascal (even
neglecting the OOP bits) that can't be easily done in C?  How about the
endianness issues (PPC and x86 are different, endian-wise)?  Porting
between a proprietary Windows-based programming environment and a
proprietary Unix-based OS is a huge undertaking.  You'll end up
basically re-writing the existing app, with all the issues that entails.

> GoingWare Inc. - Expert Software Development and Consulting

Hmmm...

-rob

Attachment: pgpDHdvTKbVPb.pgp
Description: PGP signature


Reply to: