home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / lisp / mcl / 1284 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  3.6 KB

  1. Path: sparky!uunet!cs.utexas.edu!swrinde!sdd.hp.com!uakari.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!cambridge.apple.com!cfry@MIT.EDU
  2. From: cfry@MIT.EDU (Christopher Fry)
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: LISP FFI to C
  5. Message-ID: <9208210336.AA05926@MIT.EDU>
  6. Date: 21 Aug 92 04:37:23 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 53
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10. Original-To: moon@cambridge.apple.com (David A. Moon)
  11. Original-Cc: cfry@MIT.EDU (Christopher Fry), Bruce Lester <72110.1107@CompuServe.COM>,
  12.         info-mcl@cambridge.apple.com, kgrant@us.oracle.com, york@lucid.com,
  13.         jonl@lucid.com, swm@scrc.symbolics.com, rwk@crl.dec.com
  14.  
  15. > Date: Thu, 20 Aug 92 18:15:42 EDT
  16. > From: moon@cambridge.apple.com (David A. Moon)
  17. > To: cfry@MIT.EDU (Christopher Fry)
  18. > Subject: Re: LISP - Oracle
  19. > Cc: Bruce Lester <72110.1107@CompuServe.COM>, info-mcl@cambridge.apple.com,
  20. >         kgrant@us.oracle.com
  21. > > Date: Tue, 18 Aug 92 15:05:20 EST
  22. > > From: cfry@MIT.EDU (Christopher Fry)
  23. > > 
  24. > > Franz, Lucid, Symbolics, and Harlequin seem to be moving in this direction.
  25. > > I'm not sure what Apple's plans are but please join me in encouraging
  26. > > Apple to cooperate here. In particular, a standard FFI to C code
  27. > > might go a long way toward writing useful portable utilities like an SQL
  28. > > interface.
  29. > I will just offer my own opinion here, intended to cut the Gordian knot that I 
  30. > think prevented foreign function interface standardization in the past, which 
  31. > is that the various vendors couldn't agree on the syntax of the Lisp macro 
  32. > that declares a foreign function and specifies the types of its arguments and 
  33. > result.  The answer is, don't have a Lisp macro for this, make the Lisp 
  34. > compiler read C header files instead.  It's not very hard to implement.  This 
  35. > is more convenient for the user, too.
  36. If a C library vendor could sell their object files plus C header files to
  37. Lisp hackers and the lisp hacker could just use them with no need to write
  38. calls to def-foriegn-function, that would be a huge win because C vendors wouldn't
  39. have to know lisp and Lisp users wouldn't have to know C.
  40.  
  41. Could it be arranged such that the CL function LOAD recognized when it was passed
  42. a C object file, a C header file, or a lisp file and did the right thing?
  43.  
  44. MCL has foriegn "environments". If we just said "There's only one foriegn envirnment"
  45. and simply specified that you've got to load the C header file(s) before its corresponding
  46. object file(s), that would be pretty easy for the user.
  47.  
  48. > The vendors would still have to agree on the mapping of C names and types to 
  49. > Lisp.  I have an opinion on that, too, but it's too lengthy to include here.
  50. I imagine that whatever automatic mappings you came up with, someone would want 
  51. to override some of them. Do you believe its possible to come up with a set
  52. likely to be right 99% of the time provided the Lisp user didn't care about
  53. optimizing the types or didn't care about the function names as long as
  54. they were unique and contained within them the C fn name?
  55.  
  56. Chestnut has done Lisp-to-C automatic function name mapping. While considering
  57. the C-to-Lisp mapping problem, we should see if we could convert a Chestnut-made
  58. C function name into the Lisp name in the original Lisp source that it came from.
  59.  
  60. > Feel free to forward this message to other vendors or mailing lists if you 
  61. > wish.
  62. Done to Lucid and Symbolics. Don't have an address for Franz. or Harlequin
  63. so anyone who does, please forward this. 
  64. > These are my personal opinions, not necessarily the opinions of Apple Computer 
  65. > nor of the Macintosh Common Lisp product developers.
  66.