Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!execu!sequoia!rpp386!jfh From: jfh@rpp386.cactus.org (John F Haugh II) Newsgroups: comp.unix.internals Subject: Re: Shared Lib Question (ISC) Message-ID: <19314@rpp386.cactus.org> Date: 19 May 91 17:52:29 GMT References: <19255@rpp386.cactus.org> <162950@felix.UUCP> <19311@rpp386.cactus.org> <23997:May1901:27:0891@kramden.acf.nyu.edu> Reply-To: jfh@rpp386.cactus.org (John F Haugh II) Followup-To: alt.flame Organization: Lone Star Cat Emporium and BBQ Grill Lines: 45 X-Clever-Slogan: Help Prevent Robbery. Tax the IRS. In article <23997:May1901:27:0891@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: >Okay. Do you agree, then, that global variables (or at least static >variables) can be part of a well-designed, well-programmed library? Sure. But you can't get to the rest of your argument by this point. > In >other words, do you agree that there are well-designed, well-programmed >libraries (like malloc() or stdio) which cannot be put into a ``pure'' >shared library without some work? Nope. Define "some work". I don't know what the hell your agenda is, but I really resent this notion that the implementations that _do_ exist somehow _don't_ exist. > In other words, do you agree that >``pure'' shared libraries restrict a good programmer, by forcing him to >do extra work to make some of his libraries sharable? In other words, do >you agree that the feature of ``impure'' shared libraries is indeed >beneficial in some cases? No. Pure code has its own rewards, in particular, it can be used for purposes which the author originally did not imagine. For example, if malloc() took the address of a structure describing 1) the arena in some abstract terms, 2) the address of a function to get more memory, and 3) the address of a function to return unneeded memory, the standard malloc() function could be adapted to work with kernel virtual memory, local static memory, mapped file memory, etc. Instead, it is married to the user application and memory in the data segment only. Sounds like quite the well-designed piece of code to me. The more you pin down with hidden state the less you are free to adapt the code to your own uses. As just one example, what is the difference between DBM and NDBM? DBM uses a global data structure and supports at most one open database at a time. NDBM takes a handle to the open database and supports multiple open databases. Is this a coincidence? >Good. Glad we settled that. In your mind, Dan. In your mind. -- John F. Haugh II | Distribution to | UUCP: ...!cs.utexas.edu!rpp386!jfh Ma Bell: (512) 255-8251 | GEnie PROHIBITED :-) | Domain: jfh@rpp386.cactus.org "If liberals interpreted the 2nd Amendment the same way they interpret the rest of the Constitution, gun ownership would be mandatory."