POV-Ray : Newsgroups : povray.off-topic : Found the dynamic optimization things... : Re: Found the dynamic optimization things... Server Time
30 Sep 2024 13:18:20 EDT (-0400)
  Re: Found the dynamic optimization things...  
From: Warp
Date: 23 Sep 2008 13:49:01
Message: <48d92c0d@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> http://steve-yegge.blogspot.com/2008/05/dynamic-languages-strike-back.html

  With all the talk about fancy new languages which are so super-efficient
and so super-fast and so super-secure and whatever, I not seen too much
discussion about one thing: What about dynamically loadable libraries?

  Most of these people boast how their favorite programming language is
able to create cold fusion and solve world hunger in 0.1 seconds, yet
they usually are running their programs written in that language on an
OS which is completely based on libc and dynamically loadable libraries
to do the low-level stuff efficiently.

  Most of what I have seen of these languages, especially the dynamic
ones, seems to be completely incompatible with DLLs.

  It seems to me that everybody has completely forgotten or, more probably,
misunderstood the idea behind DLLs. When someone sees the acronym "DLL"
the only thing he can think of is the so-called "DLL hell" in Windows,
where your system directories are completely bloated with DLL files, with
all their dependency problems and such. In the unix side of the world,
with the DLL equivalents, ie. the .so files, it's more like they sit
there and that's it. They are not a bother, but nobody thinks why they
exist in the first place either.

  DLL files in Windows don't exist because Microsoft got some fancy but
braindead idea and decided to impose it on everyone. .so files in unix
systems don't exist just because of the fun of it. They have a purpose.

  The idea behind DLL files is to save memory: The vast majority of
programs use the exact same libraries. For example in linux almost 100%
of programs (regardless of the language they are written in) use libc,
plus a bunch of others. In Windows the figure is probably something
similar.

  The amount of programs running at any given time can be counted in
the hundreds. The OS starts all kinds of processes and services just to
boot up. Every single one of them uses the exact same libc library, plus
a bunch of other common libraries. Given that libc is rather large, it
would be an enormous waste of memory if each single process would load
it for itself. If I'm not mistaken, libc is something like 2MB in size.
Multiply that by a couple hundred of processes.

  The idea with dynamically loadable libraries is that they are loaded
only *once* into memory, and every running program which needs that
library uses that *one* instance of it. This means that even if you
have a couple hundred of processes running, libc is still only loaded
once into memory, requiring only that 2MB of RAM. Every single process
uses that one single libc instance.

  Programming languages which have absolutely no support for dynamically
loadable libraries are riding on libc and the other libraries which the
OS directly supports. Without this system they would be hopeless memory
hogs. You wouldn't be able to build and entire OS created with that
programming language only. You *need* dynamically loadable libraries
for the system to work.

  It just feels that people who advocate fancy languages just ignore
this fact: They are dependent on an efficient dynamically loadable
library system (almost always created with C), but they completely
ignore the fact, and instead diss C as if it was a pestilence. They
completely fail to explain how the system could work if they did not
have that pestilent C system below, running the system.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.