←back to thread

383 points hkalbasi | 1 comments | | HN request time: 0.206s | source
Show context
devit ◴[] No.42814926[source]
I think the optimal approach for development would be to not produce a traditional linked executable at all, but instead just place the object files in memory, and then produce a loader executable that hooks page faults in those memory areas and on-demand mmaps the relevant object elsewhere, applies relocations to it, and then moves it in place with mremap.

Symbols would be resolved based on an index where only updated object files are reindexed. It could also eagerly relocate in the background, in order depending on previous usage data.

This would basically make a copyless lazy incremental linker.

replies(9): >>42815042 #>>42815180 #>>42815279 #>>42815434 #>>42815474 #>>42815621 #>>42815660 #>>42815894 #>>42815895 #
jjmarr ◴[] No.42815660[source]
Isn't this how dynamic linking works? If you really want to reduce build times, you should be making your hot path in the build a shared library, so you don't have to relink so long as you're not changing the interface.
replies(1): >>42816581 #
hinkley ◴[] No.42816581[source]
But do rust’s invariants work across dynamic links?

I thought a lot of its proofs were done at compile time not link time.

replies(2): >>42818056 #>>42818263 #
1. pas ◴[] No.42818056[source]
The proof can be done on the whole code (in memory, incremental, etc), and then the modules emitted as dynamically loadable objects.