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

  1. Xref: sparky comp.sys.mac.programmer:20678 comp.sys.atari.st.tech:6489
  2. Path: sparky!uunet!cs.utexas.edu!rutgers!cmcl2!panix!spencer
  3. From: spencer@panix.com (David Spencer)
  4. Newsgroups: comp.sys.mac.programmer,comp.sys.atari.st.tech
  5. Subject: Re: Sozobon (or other free C's): would this strategy work?
  6. Message-ID: <1993Jan5.133455.9714@panix.com>
  7. Date: 5 Jan 93 13:34:55 GMT
  8. References: <29879@castle.ed.ac.uk> <1993Jan5.023237.18823@cs.yale.edu>
  9. Distribution: comp
  10. Organization: PANIX Public Access Unix, NYC
  11. Lines: 80
  12.  
  13. J R Evans (ngse18@castle.ed.ac.uk) proposes to port Sozobon C to the
  14. Mac:
  15.  
  16. bobf@flint.geology.yale.edu (Bob Fischer) writes:
  17.  
  18. >If I were going to port a C to the Mac, I'd do GNU C, and port it "the
  19. >right way".
  20.  
  21. ...
  22.  
  23. >* GCC is a full (even extended) ANSI C language, ...
  24.  
  25. >* GCC is a very good compiler. ...
  26.  
  27. True; the 2.* versions are outstanding.
  28.  
  29. >* GCC runs on many systems
  30.  
  31. Everything I know of *except the Mac*.
  32.  
  33. >* GCC is backed by the Free Software Foundation.
  34.  
  35. However, a Mac port would get no support, and a lot of flames, from
  36. the FSF. FSF expressly (and loudly) objects to Macs because of the
  37. look-and-feel lawsuit. I personally think their stance is perverse
  38. (Leninists deny the efficacy of the market, too, and look where it got
  39. them).
  40.  
  41. So don't expect any help from FSF if you mention a Mac.
  42.  
  43. On the other hand, gcc has been ported to a/ux, so FSF's objections to
  44. Macs are not an insuperable hurdle.
  45.  
  46. >* Finally, the most compelling reason is that I think that GCC would
  47. >be the easiest to port!  GCC was written in a modular way, so that it
  48. >can be ported to any system, running any instruction set.
  49.  
  50. >...  Since someone has already described the
  51. >68000 instruction set to GCC, you would just have to modify the
  52. >description, to make it work with the Mac quirks (like the special
  53. >status of A5).
  54.  
  55. Indeed, you could start with the diffs for the a/ux port, which are
  56. available at wuarchive.wustl.edu in systems/aux/gnu. Note that you'd
  57. have to work around a number of nice unix features that MacOS lacks.
  58. However, if gcc can be ported to something as braindead as ms/dos or
  59. as Byzantine as vms, it has to be portable to Macs.
  60.  
  61. You'd have to build a new set of libraries, or figure out how to link
  62. the MPW libs (and make users buy the MPW libs). If you have Think C,
  63. you might be able to use the source that comes with it, although I
  64. doubt Symantec would let you distribute their source or an object file
  65. built from their source.
  66.  
  67. There is gnu source for a standard C library. Although it's for a
  68. unix-based system, much of it is in (relatively) portable C and I
  69. believe there is m68k-specific code. Of course, you'd have to roll
  70. your own system-specific code, like memory allocation and stdio.
  71.  
  72. You also have to figure out how to make MacOS system calls. They use a
  73. different (Pascalish) calling sequence. You've got to tell the
  74. compiler how to set up the calls, and warn it with a "pascal" (or
  75. similar) keyword.
  76.  
  77. Of course, you'd have to build or figure out how to link a library if
  78. you ported any compiler, not just gcc.
  79.  
  80. >  To encourage people to port GCC, Richard Stallman
  81. >(author of GCC) has written a 190-page manual describing in detail how
  82. >to port GCC.  I don't believe any other program comes with such
  83. >carefully written porting instructions.
  84.  
  85. A very nice book on practical compiler theory. Unfortunately (unless
  86. I'm out of date), the manual is not up to date. The latest version of
  87. the manual describes version 1.38, I think; the current version of the
  88. compiler is 2.3. Because the basic theory of the compiler hasn't
  89. changed, it should be adequate, though.
  90.  
  91.  
  92. dhs   spencer@panix.com
  93.