3 ms·
Sounds like "hide it from me" rather than "eliminate it". "Do I need to think about the link step?" to which the answer is "rarely if ever" now. Covering it wit
by h2odragon 5y ago
Sounds like "hide it from me" rather than "eliminate it". "Do I need to think about the link step?" to which the answer is "rarely if ever" now. Covering it with "make it easy for me" plating would make it harder or impossible for those cases where you do need to get into the guts of things.
I think we need more linkers, and more thoughts like this on why that step is still necessary and how we could do it better. Look at the "all static" docker images and how the Lua FFI was "faster than C"; these are effects of linking and shared libraries being Deep Magic that no one wants to think about; thus we get efforts to work around the problem.
Maybe every executable should do its own final assembly of memory image and fixups and stuff at execution? Maybe we should be executing memory dumps that include zero'd pages already... maybe we need one or the other depending on the circumstances, and no "one size fits" all solution is suitable.
- MereInterest 5y ago> Maybe every executable should do its own final assembly of memory image and fixups and stuff at execution? Sounds a lot like dynamic linking, though that does have an extra step of indirection that can result in performance issues, either directly due to the pointer hopping or indirectly due to the inability to inline a dynamic function. > Maybe we should be executing memory dumps that include zero'd pages already For global variables, C/C++ include this already. That's why the initialization of `int x;` depends on whether it's a global variable or not. For newly allocated memory, whether on the stack or on the heap, initializing to a default value that is later overwritten would have a runtime cost. (e.g. If it is immediately passed as an out parameter to a function.) However, for global memory the initial value of `int x;` can be set in the program image with no runtime cost, so it is done automatically.