home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / lisp / mcl / 1683 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  4.8 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!ames!data.nas.nasa.gov!taligent!apple!cambridge.apple.com!cartier@math.uqam.ca
  2. From: cartier@math.uqam.ca (Guillaume Cartier)
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: Re: ffi to MCL
  5. Message-ID: <9211232044.AA20716@mipsmath.math.uqam.ca>
  6. Date: 23 Nov 92 20:44:58 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 95
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10.  
  11. <---
  12. | >Date: Thu, 19 Nov 92 17:24:03 EST
  13. | >From: staley@carnap.srl.ford.com (Scott M. Staley)
  14. | >To: bill@cambridge.apple.com
  15. | >Subject: Re: ffi to MCL
  16. | >
  17. | >> From bill@cambridge.apple.com Thu Nov 19 13:35:20 1992
  18. | >> Date: Thu, 19 Nov 1992 13:41:52 -0600
  19. | >> To: staley@carnap.srl.ford.com (Scott M. Staley)
  20. | >> From: bill@cambridge.apple.com (Bill St. Clair)
  21. | >> Sender: bill@cambridge.apple.com (Unverified)
  22. | >> Subject: Re: ffi to MCL
  23. | >> Cc: bill@cambridge.apple.com
  24. | >> Content-Length: 1178
  25. | >> 
  26. | >> >Bill.
  27. | >> >
  28. | >> >I posted a question to the info-mcl a while back and got no takers so 
  29. | >> >I thought I would try you direct. I am looking to get a C compiler to
  30. | >> >write c code to link with mcl. There is something in the MCL manual about
  31. | >> >c compiler must generate mpw compatible .o files. What does that entail?
  32. | >> >
  33. | >> >Does it mean the mpw is the only C I can use the ffi with, or could 
  34. | >> >Think C or others be used. What do you recommend to write C code for MCL.
  35. | >> >
  36. | >> >I have no desire to but a c compiler to write plain c. My only purpose is
  37. | >> >to hook to MCL.
  38. | >> 
  39. | >> I have heard that Think Pascal is able to import Think C projects and
  40. | >> write MPW compatible libraries, but I have never done it. I know of no
  41. | >> other way to make Think C generate object files that MCL's FFI knows
  42. | >> how to parse.
  43. | >> 
  44. | >> One other way to run Think C generated code from MCL is to create a
  45. | >> code resource. Guillaume Cartier has written some code to simplify finding
  46. | >> entry points in this code resource. His code is on the MCL 2.0 CD in
  47. | >> the folder:
  48. | >> 
  49. | >>    MCL 2.0 CD:User Contributed Code:Think C Interface:
  50. | >> 
  51. | >> It is also available for anonymous FTP from cambridge.apple.com in the file:
  52. | >> 
  53. | >>   /pub/mcl2/contrib/Cartiers-Contribs-1.2.sea.hqx
  54. | >> 
  55. | >> 
  56. | >
  57. | >Bill.
  58. | >
  59. | >Thanks for the come back. Can you say what is the minimimum mpw C stuff I
  60. | >should buy to do the above. Also I might mention that the C code I hope
  61. | >to integrate is in ANSI C.
  62. | I know very little about developing C on the Macintosh. I used Think C
  63. | two or three years ago to do a small project, and have used MPW a little
  64. | bit to assemble MCL's kernel, but that is the extent of my experience.
  65. | >From looking at the November, 1992 APDA catalog, I would guess that you would
  66. | need to get the MPW C Bundle, which was listed for $425. The description of
  67. | the MPW C compiler version 3.2.4 says "The MPW C compiler supports K&R C,
  68. | as well as many ANSI extensions to C, including function prototypes and strong type checking. It includes a standard C library that offers the functions
  69. | described in the ANSI C standard." I do not know if "many ANSI extensions"
  70. | means that it will have problems with your "ANSI C", nor do I know if
  71. | Think C is closer to the ANSI standard (or if that will matter for your
  72. | code), or how the effort involved in building Think C stubs using Guillaume
  73. | Cartier's package compares to writing DEFFCFUN stubs to interface to MPW C.
  74. | Can someone else help out?
  75. --->
  76.  
  77. My Think C interface was originaly created so I could write the floating
  78. point routines of my 3D viewing package in C (MCL's compiler doesn't
  79. recognize floating point declarations and so generates inneficient code
  80. relative to both speed and memory allocation) (note that this is not a
  81. problem anymore since we now have Erann Gat's wonderful FPC package).
  82.  
  83. With that in mind, my interface was thought out for fast development
  84. (changing your C code, compiling the resource, testing it in MCL, etc...).
  85.  
  86. On the other hand, using it to interface a big package of C code already
  87. writen is more complex. The biggest problem is that my interface doesn't
  88. understand everything type a C routine can pass or be passed. For instance,
  89. if you want to pass a structure via a pointer, no problem; but if you
  90. want to pass the structure itself... that is not done.
  91.  
  92. Hope this clarifies things a bit,
  93. Guillaume.
  94.  
  95. PS: If you have more specific question about my Think C interface,
  96.     write to me directly and I will try to help.
  97.  
  98. *********************************************************************
  99. * Guillaume Cartier                 (514) 844-5294 (maison)         *
  100. * L.A.C.I.M.                        (514) 987-4290 (bureau)         *
  101. * Universite du Quebec a Montreal   (514) 987-8477 (telecopieur)    *
  102. * Montreal, Quebec, Canada          cartier@math.uqam.ca (internet) *
  103. *********************************************************************
  104.