home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12305 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  2.4 KB

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