home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 20649 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  5.4 KB

  1. Xref: sparky comp.sys.mac.programmer:20649 comp.sys.atari.st.tech:6473
  2. Newsgroups: comp.sys.mac.programmer,comp.sys.atari.st.tech
  3. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!usc!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!cs.yale.edu!flint.geology.yale.edu!bobf
  4. From: bobf@flint.geology.yale.edu (Bob Fischer)
  5. Subject: Re: Sozobon (or other free C's): would this strategy work?
  6. Message-ID: <1993Jan5.023237.18823@cs.yale.edu>
  7. Sender: news@cs.yale.edu (Usenet News)
  8. Nntp-Posting-Host: flint.geology.yale.edu
  9. Organization: Yale University, Department of Computer Science, New Haven, CT
  10. X-Newsreader: TIN [version 1.1 PL6]
  11. References: <29879@castle.ed.ac.uk>
  12. Distribution: comp
  13. Date: Tue, 5 Jan 1993 02:32:37 GMT
  14. Lines: 87
  15.  
  16. J R Evans (ngse18@castle.ed.ac.uk) wrote:
  17. : I week or so back, I offered the suggestion that it might be a
  18. : reasonably modest task to convert Sozobon C (a fairly small K&R C for
  19. : the Atari) to work on the Mac.  There has been some follow-up
  20. : discussion....
  21. : Sink (author of Harvest C) and Brad Pickering.  Eric and I have had an
  22. : interesting discussion by email, and I have received helpful comment
  23. : from a number of others.  My thanks to all who have corresponded, and
  24. : particularly to Eric.
  25. : I have given the possibility quite a bit of thought, read some relevant
  26. : documentation, and come up with a strategy which I would like to
  27. : share with you, by which this might be achieved reasonably rapidly.
  28. : I invite your comments.  Although I discuss the strategy in terms of
  29. : Sozobon C as the target for transport, it could also be used with any
  30.  
  31. The outlined strategy may work, but I'm not so sure it's a good idea.
  32. If I were going to port a C to the Mac, I'd do GNU C, and port it "the
  33. right way".  Sure it's huge, but as you said, memory on the Mac isn't
  34. such a big deal anymore.  The smallest Mac you can buy nowadays is 2
  35. Mbytes, more than adequate for GCC.  My reasons for this assessment
  36. follow:
  37.  
  38. * GCC is a full (even extended) ANSI C language, and was carefully
  39. written to conform to the ANSI standard.  Since ANSI C is the
  40. standard, programs, especially ones written in the future, are liable
  41. to not compile on K&R compilers.  I write all my code in ANSI C,
  42. because it's a big improvement over K&R and it makes my life easier.
  43.  
  44. * GCC is a very good compiler.  GCC version 2 optimizes as well as the
  45. best commercial optimizing compilers (much better than the compiler
  46. distributed with SPARCstations only 2 years ago, and much better than
  47. any other Atari compiler).
  48.  
  49. * GCC runs on many systems, including a zillion flavors of UNIX,
  50. MS-DOS, and the Atari ST.  Therefore, a program written in GCC is more
  51. likely to work on other systems than a program developed with _any_
  52. other C compiler (like, say, SUN's compiler, or Mark Williams C).  A program
  53. written with one GCC need only be compiled by another GCC to provide an
  54. easy port.  Potential problems of hidden compiler incompatibilities
  55. between systems are eliminated.
  56.  
  57. * GCC is backed by the Free Software Foundation.  This is not a
  58. program which will lose support when one or two people taking care of
  59. it decide to do something else.  (I know.  I wrote The Vault, and now
  60. that I don't feel like supporting it anymore, no one is supporting
  61. it.)  The FSF, headed by Richard Stallman, under the guise of the GNU
  62. project, is dedicated to bringing a full UNIX-compatible system to
  63. everyone, and GCC is part of that.  (Incidentally, while the FSF tries
  64. to write programs which compile with other people's C compilers, the
  65. GNU project compiles most reliably with GCC.  This includes re-makes
  66. of programs like make, yacc, lex, sh, to name a few.  GNU project
  67. programs not part of standard UNIX include a full PostScript
  68. interpreter.)
  69.  
  70. * Finally, the most compelling reason is that I think that GCC would
  71. be the easiest to port!  GCC was written in a modular way, so that it
  72. can be ported to any system, running any instruction set.  What
  73. porting it consists of is describing, in GCC's machine-description
  74. language, the properties of your computer's instruction set.  The code
  75. generators and optimizers use this information to generate code for
  76. your computer.  Adding a new machine description to GCC does does not
  77. eliminate the possibilities for GCC to generate code for other
  78. machines.  (This means that GCC can be easily used as a cross-compiler
  79. --- build the standard distribution to run on one system, but to
  80. produce code for another.)  Since someone has already described the
  81. 68000 instruction set to GCC, you would just have to modify the
  82. description, to make it work with the Mac quirks (like the special
  83. status of A5).  To encourage people to port GCC, Richard Stallman
  84. (author of GCC) has written a 190-page manual describing in detail how
  85. to port GCC.  I don't believe any other program comes with such
  86. carefully written porting instructions.
  87.  
  88. * And last but not least, GCC is not just a C compiler.  It consists of
  89. a front end, to parse programs, and a back end, to generate code.  GCC
  90. version 2 includes C++.  The FSF is working on implementations of
  91. FORTRAN and other languages, all which use the GCC back end.  So the
  92. effort into porting GCC results in two languages ported today and
  93. potentially many in the future.
  94.  
  95. I hope that GCC will see the light of day on the Mac.  Since the Mac
  96. is not really a hacker's computer, few people have shown an interest
  97. in porting it.  But I think a lot of people would benefit from a port,
  98. given the large numbers of Mac users.
  99.  
  100. --- Bob Fische
  101.