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

  1. Path: sparky!uunet!opl.com!hri.com!spool.mu.edu!enterpoop.mit.edu!eru.mt.luth.se!kth.se!dront.nada.kth.se!d88-jwa
  2. From: d88-jwa@dront.nada.kth.se (Jon Wtte)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Sozobon (or other free C's): would this strategy work?
  5. Message-ID: <1993Jan5.100929.6175@kth.se>
  6. Date: 5 Jan 93 10:09:29 GMT
  7. References: <29879@castle.ed.ac.uk>
  8. Sender: usenet@kth.se (Usenet)
  9. Distribution: comp
  10. Organization: Royal Institute of Technology, Stockholm, Sweden
  11. Lines: 70
  12. Nntp-Posting-Host: dront.nada.kth.se
  13.  
  14. In <29879@castle.ed.ac.uk> ngse18@castle.ed.ac.uk (J R Evans) writes:
  15.  
  16. >programming is understanding what those times are).  Fortunately,
  17. >even in the Mac world, some things have to stay constant, and there
  18. >are ways to pin things down in memory.  Doing so is considered Bad
  19. >Form in Cupertino, and what I am going to propose involves locking
  20.  
  21. Not necessarily; if you start locking a LOT of things down, you
  22. will start fragmenting the heap (much as you fragment a hard disk)
  23. which leads to bad performance and you run out of contiguous space.
  24. If you lock down, say, two large blocks, MoveHHi-ed, at the start
  25. of execution (before any memory is allocated) you won't burn in
  26. hell, only get a few years in purgatory.
  27.  
  28. >time.h etc.  Life is even easier if we are only planning to implement
  29. >a K&R compiler!  In the first instance we need build afresh only the
  30.  
  31. People using this compiler would be beginners mainly, and they go
  32. out and buy a "learn C" book. Almost all of them use ANSI style
  33. functino prototypes.
  34.  
  35. >Support for A5 globals (particularly those needed by QuickDraw and 
  36. >friends) is probably the messiest part of all this; hopefully, the
  37. >original application A5 could be stored by the loader in a well known
  38.  
  39. Better would be to just tell the compiler to leave A5 alone. Since
  40. it probably already does that with A6 and A7, do the same for A5.
  41. Then have the CODE 0 resource contain a pre-defined quickdraw globals
  42. area, and you should be all set, and avoid a LOT of messiness. What
  43. would you, for instance, do about callbacks else?
  44.  
  45. >of execution!  Even worse, in the simple scheme presented above, the 
  46. >relocation information is left lying around uselessly, trapped within
  47. >the CODE 2 resource locked in memory.  
  48.  
  49. That's no problem; if the relocation information is at the end
  50. of the area, just SetHandleSize() it away (before locking the
  51. block)
  52.  
  53. Or make the compiler emit the relocation information separately.
  54. Or just have the "mac-linker" divide it out into another resource.
  55.  
  56. >Mac extensions are likely to cause some grief, but again I'm not
  57. >convinced that that will be insufferably great.  Things like the \p
  58. >pattern for Pascal strings could be a bit of a nuisance, and I don't
  59.  
  60. \p is important, but even more so is the pascal calling keyword.
  61. It is used for callbacks from the toolbox (for things like modal
  62. dialog filters, file filters, AppleEvent handlers, ...) as well
  63. as used by the headers - and it requires the compiler to push the
  64. arguments the other way around!
  65.  
  66. >Finally, for the moment at least, Sozobon does not emit MacsBug symbols.
  67. >This will be a pain for the initial implementors, but I can't believe
  68. >that it would be any kind of big deal to fix up.
  69.  
  70. macsBug symbols are really Very Easy(tm). Just trap emitting an
  71. RTS and add the data for the symbol.
  72.  
  73. However, this looks like something that would take a talented
  74. hacker a year to do. You had better get started...
  75.  
  76. Cheers,
  77.  
  78.                             / h+
  79.  
  80. -- 
  81.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  82.  
  83.    Cookie Jar: Vanilla Yoghurt with Crushed Oreos.
  84.