Hello,
Merlijn is a softwaredeveloper for administrative software for the
Macintosh. From the beginning we have relied on CodeWarrior and have
over the years developed a very large codebase and several elaborate
projects.
Since the release of Mac OS Jaguar we have looked for a way to switch to
a new language, because new versions of CodeWarrior don't have official
support for Pascal. The Pascal plugin has helped us to extend our use of
the Pascal codebase we have, but with recent versions even that seems
out of the question.
Now we have two questions :
- is there anywhere a reliable Pascal developmentsystem for the Mac, we
could use for the next years ?
- What can we do to migrate to a new language? C or C++ ? Also we would
like to be Cocoa native this time, and not rely on the Carbon stuff anymore.
We tried some P2c solutions a few years ago, but none of then worked real
good.
As we are a small developer we would like to avoid long conversion times
as much as we can. Are there any other tools that would help us convert our
Pascal Code to say, C code?
Any suggestions/ help/ comments are more than welcome.
Kind regards,
Peter Haas
Merlijn Automatisering B.V. The Netherlands.
David Phillip Oster - 25 Jun 2004 05:58 GMT
> We tried some P2c solutions a few years ago, but none of then worked real
> good.
>
> As we are a small developer we would like to avoid long conversion times
> as much as we can. Are there any other tools that would help us convert our
> Pascal Code to say, C code?
I'm sorry. I don't understand. What is the big deal? Sure you have to
run all your source code through a program like MPW's Canon to
canonicalize all the spelling, but then, for each construct in the
Pascal language there is a similar construct in C, and C++ is even
easier, since VAR parameters translate to C++ References.
Yes, you'll have to expand out WITH statements, and yes, since C/C++
doesn't support nested functions you'll need to group local variables in
the outer function into a struct, then explicitly pass a pointer to this
as a new parameter to nested functions, and if those nested functions
themselves have nested functions, then you'll have to copy that pointer
into a new field of the inner local struct, simulating the Pascal
compiler's own frame pointer implementation. You'll also need automatic
renaming so that the inner function names don't conflict with similarly
named functions in the global context.
But none of this is hard. None of this is even as hard as writing a
compiler, which is a sophmore computer science project. Why, when you
can start with p2c is there any problem?
Jonathan Hoyle - 25 Jun 2004 16:35 GMT
> Now we have two questions :
> - is there anywhere a reliable Pascal developmentsystem for the Mac, we
> could use for the next years ?
This has been a long standing problem, I'm sorry to say. Pascal is a
great language, but unfortunately, it is so similar to C that people
have simply moved onto that...not necessarily because C is better (it
certainly is in some things, not in others), but because the
marketshare for C has been so dominant. 10 years ago, when Symantec
was pocket-vetoing Think Pascal, Metrowerks came to the rescue and
continued to support it. Now they have found that the market doesn't
seem to bear it out any longer.
Since I too have since kicked the Pascal habit, I have not had any
experience with it, but the only one I am aware of is GNU Pascal for
Mac OS X: http://www.microbizz.nl/gpc.html .
> - What can we do to migrate to a new language? C or C++ ? Also we would
> like to be Cocoa native this time, and not rely on the Carbon stuff anymore.
Cocoa would require you to switch to Objective-C. A much easier
transition (so it would seem to me) is Carbon using C. However, if
you are ready to make a clean break to a brand new API and a brand new
language all at the same time, then the entire Mac development world
is open to you.
I would strongly urge you to consider RealBasic. It is very powerful,
easy to use and cross-platform. hard to beat that combination.
> We tried some P2c solutions a few years ago, but none of then worked real
> good.
[quoted text clipped - 4 lines]
>
> Any suggestions/ help/ comments are more than welcome.
If p2c didn't work for you, I would recommend simply making the
conversion from Pascal to C manually. 80% of your Pascal code will
have a 1 to 1 line conversion going to C. Certain data types, such as
sets, will require more work (usually converted to bit flags in C),
but your Carbon calls will remain essentially the same.
How many lines of code are we talking about here?
Jonathan Hoyle
Gene Codes Corporation
Adriaan van Os - 25 Jun 2004 23:16 GMT
> Since I too have since kicked the Pascal habit, I have not had any
> experience with it, but the only one I am aware of is GNU Pascal for
> Mac OS X: http://www.microbizz.nl/gpc.html .
Thursday, I released version 1 of GNU Pascal plugins for CodeWarrior.
You can download the plugins with a free 30-day trial license from
<http://www.microbizz.nl/gpccwlink.html>. This is a temporary download
location (I now started working on changes to the website and I still
have to add the commercial stuff). You may also have a look at
<http://www.microbizz.nl/gpccw.html>.
I will be pleased to give more information. The best place to ask for
technical support is the MacPascal mailing list, hosted by Pascal
Central, see <http://www.pascal-central.com/maillist.html>.
Regards,
Adriaan van Os
gpc@microbizz.nl
B. Gehre - 19 Jul 2004 23:47 GMT
> Hello,
>
[quoted text clipped - 12 lines]
> - is there anywhere a reliable Pascal developmentsystem for the Mac, we
> could use for the next years ?
http://pascal-central.com/
A great resource for all Mac Pascal-Programmers who use older or more
recent versions of the Metrowerks CodeWarrior Development Studio.
> - What can we do to migrate to a new language? C or C++ ? Also we would
> like to be Cocoa native this time, and not rely on the Carbon stuff anymore.
Cocoa is a moving target. If you never want to port your applications
to other platforms, then use Cocoa/Obj-C. Otherwise use C/C++ and
Carbon/Cocoa.
Details:
http://developer.apple.com/documentation/Cocoa/Conceptual/CarbonCocoaDoc/CocoaCa
rbonDoc.html
> We tried some P2c solutions a few years ago, but none of then worked real
> good.
Yeah, you should forget that very fast. ;)
> As we are a small developer we would like to avoid long conversion times
> as much as we can. Are there any other tools that would help us convert our
> Pascal Code to say, C code?
> Peter Haas
> Merlijn Automatisering B.V. The Netherlands.
Bruce Gehre,
PPC Assembly Programmer
e-mail: bruce at gehre dot org
M_O_D - 29 Jul 2004 14:20 GMT
>> Hello,
>>
[quoted text clipped - 17 lines]
> A great resource for all Mac Pascal-Programmers who use older or more
> recent versions of the Metrowerks CodeWarrior Development Studio.
Thanx
>> - What can we do to migrate to a new language? C or C++ ? Also we would
>> like to be Cocoa native this time, and not rely on the Carbon stuff
[quoted text clipped - 7 lines]
> http://developer.apple.com/documentation/Cocoa/Conceptual/CarbonCocoaDoc/Coco
> aCarbonDoc.html
Ok, thats true, only we have about 1,500,000 lines of pascal and thats a lot
............
>> We tried some P2c solutions a few years ago, but none of then worked real
>> good.
[quoted text clipped - 13 lines]
>
> e-mail: bruce at gehre dot org