1. Static linking takes up lots of space and makes binaries much
bigger than they need to be. Sure, disk is cheap, but it's not free,
and these things just seem embarrassingly large.
2. But all of that static linkage becomes 1000 times more expensive
when it's in RAM. If I'm running dozens of Go processes I could be
saving all the copies in memory of "fmt" and the other basic runtime
parts.
3. And almost as a side effect of dynamic runtime linkage you get the
ability to prorgammatically load libraries and use them as plugins.
Cool.
> I _could_ work on implementing shared libraries for Go. It'd be more
> interesting if there were good community interest in seeing this
> happen. If the maintainers want it to happen they'll be more likely to
> accept patches (and this would be a pretty big project with a pretty
> big set of patches). If the community wants it to happen, the
> maintainers might be more likely to want it to happen.
> But, I got replies basically indicating that the vocal part of the Go
> community _doesn't_ care about shared libraries, and one comment I
> think implying that shared libraries may be a bad idea just not so bad
> that it shouldn't be done anyway. The thing Archos linked was actually
> kinda interesting. I'm curious about why shared libraries apparently
> turned out to not save as much disk/ram as they might in theory.
I think it's desirable for 6g to support shared libraries. There are
some complexities. One of the advantages of Go is a simple
initialization mechanism (as compared to, e.g., C++). Initialization is
harder to understand when shared libraries are involved.
Note that gccgo already supports shared libraries, but it's not as clean
as it should be as I'm basically ignoring the complexities.
Ian