home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c++:12305 comp.lang.c:12269
- Newsgroups: comp.lang.c++,comp.lang.c
- Path: sparky!uunet!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
- From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
- Subject: Re: PL/1 ==> C/C++, arrays
- Message-ID: <1992Aug13.080010.15880@ucc.su.OZ.AU>
- Sender: news@ucc.su.OZ.AU
- Nntp-Posting-Host: extro.ucc.su.oz.au
- Organization: MAXTAL P/L C/- University Computing Centre, Sydney
- References: <1992Aug10.174059.18557@bnrmtl.bnr.ca>
- Date: Thu, 13 Aug 1992 08:00:10 GMT
- Lines: 43
-
- In article <1992Aug10.174059.18557@bnrmtl.bnr.ca> lew@bnr.ca (Pierre LEWis) writes:
- >(I'm indirectly involved in following, but find it quite fascinating)
- >
- >A group here has tens of thousands lines of PL/1 code that they are
- >considering porting to C or C++. Characteristic of this code is that it
- >makes heavy use of PL/1 arrays and all related language features. For
- >example:
- >
- >When I first met this problem, my first reaction was that C++ would be great
- >for such a challenge, and much better than C. One would simply define an
- >appropriate Pl1Array class to support all (most) needed features. But it
- >certainly wouldn't be trivial as shown by some of the above example. And
- >after a bit more thought, I'm somewhat less convinced.
- >
- >QUESTION: is anyone aware of such a class? Other comments? What about PL/1
- >to C or C++ conversion aids? Maybe that's an FAQ, but I found nothing.
- >
- >Sorry if I made some of you wince at the mention of PL/1 (esp. in such a
- >group),
- >
- Most of te PL/1 stuff can be done in C++, and better, but you
- will need to use different techniques sometimes.
-
- The biggest headache will not be arrays IMHO, but nasty
- LITTLE things, namely the automatic conversions of numeric types.
-
- The array cross section facility is only a special case
- of the DEFINED mechanism, which C++ can emulate quite nicely.
- You will find that sometimes you'll have to expand a PL/1
- expression ito a loop, or an indexed goto into a switch.
-
- All do-able...by hand. I doubt an automatic converter
- could work very well, although for some bits of code it might
- help a bit.
-
- I think you would be up for a major re-write.
- This might be faster than a slavish conversion.
-
- --
- ;----------------------------------------------------------------------
- JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
- Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
- ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
-