home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / lisp / 3412 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  3.6 KB

  1. Path: sparky!uunet!europa.eng.gtefsd.com!gatech!darwin.sura.net!newsserver.jvnc.net!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!julienas!corton!ilog!davis
  2. From: davis@passy.ilog.fr (Harley Davis)
  3. Newsgroups: comp.lang.lisp
  4. Subject: Re: Lisp syntax beauty? (was Re: Why Isn't Lisp a Mainstream Language?)
  5. Message-ID: <DAVIS.93Jan28185347@passy.ilog.fr>
  6. Date: 28 Jan 93 17:53:47 GMT
  7. References: <dfs.727732459@kehleyr>> <EMCOOP.93Jan22161006@bcars148.bnr.ca>
  8.     <dfs.727757157@kehleyr> <8268@skye.ed.ac.uk>
  9. Sender: news@ilog.fr
  10. Organization: ILOG S.A., Gentilly, France
  11. Lines: 62
  12. In-reply-to: jeff@aiai.ed.ac.uk's message of 27 Jan 93 13:32:00 GMT
  13.  
  14.  
  15. In article <8268@skye.ed.ac.uk> jeff@aiai.ed.ac.uk (Jeff Dalton) writes:
  16.  
  17.    >Absolutely.  But if you don't want to use a certain C function, you don't
  18.    >link it in.  Your programs have no overhead for unused functionality.
  19.    >If Common Lisp had some mechanism for this, then my criticism would not
  20.    >be valid.
  21.  
  22.    The C language has no mechanism for this.  It's the linkers that do
  23.    it.
  24.  
  25.    So, the right question is: is there something about the language
  26.    that rules out implementation strategies that omit unneeded code?
  27.    And the answer is "yes".  Almost anything could be called, eg by
  28.  
  29.       (apply (read) (read))
  30.  
  31.    So implementation either have to provide a way for the user to
  32.    say that only the functions that are directly called will be
  33.    called or else provide a way to load in functions when needed.
  34.    The latter approach has been around for a long time in the
  35.    form of "autoloading".
  36.  
  37.    However, such tricks won't work very well if programs tend to
  38.    require most of CL, perhaps because CL is so intertwined.  This
  39.    is a standard criticism of CL.  ERROR requires FORMAT, etc.
  40.    But how true is it?  Well, I think there's evidence that it's
  41.    sufficiently true to be a problem.  On the other hand, why 
  42.    should it be fatal.  What if, for instance, CL is packaged as
  43.    a shared library (as in WCL)?  It's a fairly big shared library,
  44.    but then so is X.
  45.  
  46. The problem is somewhat more complex.  Another difference between Lisp
  47. and C is that Lisp allows the creation of rather complex data at the
  48. top-level.  These data objects range from symbols to functions to data
  49. structures stored in global variables to classes, etc.  Although
  50. shared libraries help a lot in managing code size, they do not reduce
  51. data requirements.  Even modules which have completely unexecuted code
  52. still need to initialize their data; at a minimum, their symbols and
  53. most likely a number of functional objects as well.  There may be ways
  54. to put off the creation of other top-level data until the module is
  55. needed, but this requires rather complex management which has its own
  56. cost.  All this said, shared libraries are still winning.  However, it
  57. would probably be a mistake to provide *all* of Lisp as one shared
  58. library.
  59.  
  60. I should note that C++ also has this problem to some extent since it
  61. allows top-level data initialization and needs to initialize its
  62. virtual function tables and other class-related hidden objects.  In
  63. fact, I don't think many C++ compilers allow the creation of shared
  64. libraries.  For example, Sun C++ has no position independent code
  65. generation option.  This may be seen as one of the biggest changes
  66. between C and C++, and has many ominous overtones that most of C++'s
  67. advocates don't yet understand.
  68.  
  69. -- Harley Davis
  70. --
  71.  
  72. ------------------------------------------------------------------------------
  73. nom: Harley Davis            ILOG S.A.
  74. net: davis@ilog.fr            2 Avenue Gallie'ni, BP 85
  75. tel: (33 1) 46 63 66 66            94253 Gentilly Cedex, France
  76.