prestidigitator wrote:BlindBanana wrote:Every system shares libraries, this has nothing to do with static or dynamic linking!
Actually it has everything to do with static and dynamic linking. What you might be getting confused with is run-time loading of dynamic libraries, where the application requests a library that was not specified at compile/link time. This is incredibly useful for plugin frameworks. It must be used with care, because you want to make absolutely sure nothing can be loaded that was not intended by the application design, but it is still invaluable.
Dynamic linking loads libs on run-time, yes. Static linking includes not the whole lib, just the pieces that are actually used.
So dynamic linking as well as static linking share libs. This has nothing to do with the problems of dynamic linking.
prestidigitator wrote:Ironically you are using a game that essentially uses unchecked, completely open run-time loading of dynamic libraries for just about everything, so arguing that it is a bad thing is a little hypocritical. Every mod we use is a library loaded at run-time. Nevermind that it is written in Lua and not C/C++.
So just because I don't like dynamic linking I'm not allowd to use software wich is dynamic linked? I don't think so.
And I would not link the included lua lib of mintest dynamic, since on (at least) some systems there will be an incompatible version.
And the execution of arbitrary code is one of the problems of dynamic linking.
prestidigitator wrote:BlindBanana wrote:When a library is statically linked to an executable only a copy of each library routine called is included.
Which btw makes deployment a lot easier.
This is where I think you are getting very confused between shared libraries and run-time loading. If the library is a shared library, your statement is false. The WHOLE shared library is absolutely loaded into memory. Period. However, the code and read-only data portions of the library can be shared between running processes (and not just ones started from the same parent process that happened to use the library; I mean ALL applications on the system that use the shared library).
Which also happens if binaries are static linked. At least the text segments are only once in memory.
prestidigitator wrote:I also disagree that statically linking using an archive library helps with deployment. If you deploy by simply providing a downloadable folder and don't want to bother thinking about library paths or launch scripts or anything, you might be right. However, anyone who has any experience deploying real applications or maintaining packages can just as easily package a shared library with an application, whether the application is installed or run in place from a download folder. You can even package a shared library with the application and manage the application execution in such a way that it is used only if the library is not already included on the system. This is whether you dynamically load the library at run-time or link to it at compile time.
Why sould I package for half a dozen different Systems with different package solutions/formats if I could just copy my static linked binary and be happy spending the saved time playing Minetest?
I don't think the debate
dynamic vs static linking ends. But it's a pleasure. ;-)
Can wep lease come back to the topic
Minetest with LuaJIT integrated?