home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   sci.lang      Natural languages, communication, etc      297,461 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 296,095 of 297,461   
   Aidan Kehoe to All   
   Re: "CDR down the list..."   
   13 Jul 24 08:19:50   
   
   XPost: comp.lang.lisp, alt.usage.english   
   From: kehoea@parhasard.net   
      
    Ar an t-aonú lá déag de mí Iúil, scríobh Kaz Kylheku:   
      
    > > A (the) codebase I work on has a Lisp implementation as well as a lot of   
    > > C. The Lisp data types and related functions are easily available to the C   
    > > code. Nonetheless there are loads of C structures that just incorporate   
    > > their own next pointer and roll their own linked lists that way, requiring   
    > > separate list traversal, searching, sorting, cycle detection code ...   
    >   
    > Inside a Lisp-in-C impementation, the garbage collected Lisp list are   
    > not always the most efficient thing to use, and could even cause   
    > problems in code that interacts with the memory mangement and GC.   
    > When internal structures use their own links, it's a clean separation.   
      
   The internal structures are also subject to garbage collection and protection   
   therefrom in this case.   
      
    > Another consideration is that in C we often use intrusive containers,   
    > including lists. The objects contain the link node as part of their   
    > representation, and so can be put on a list without having to allocate   
    > a list cell. This constrains them to be one one list at a time   
    > (if they have one link field) and that is actually enough in   
    > many situations.   
      
   That’s the one benefit of the current approach in this codebase, a little   
   less   
   memory for a couple of hundred fairly small objects, at the expense of a larger   
   code segment with more bugs.   
      
    > Intrusive lists and other data structures can be had in a generic way;   
    > for instance with the BSD TAILQ macros. You don't have to write   
    > multiple sort or cycle detection routines.   
      
   --   
   ‘As I sat looking up at the Guinness ad, I could never figure out /   
   How your man stayed up on the surfboard after fourteen pints of stout’   
   (C. Moore)   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca