←back to thread

383 points hkalbasi | 1 comments | | HN request time: 0.212s | source
Show context
kryptiskt ◴[] No.42815776[source]
What would be refreshing would be a C/C++ compiler that did away with the intermediate step of linking and built the whole program as a unit. LTO doesn't even have to be a thing if the compiler can see the entire program in the first place. It would still have to save some build products so that incremental builds are possible, but not as object files, the compiler would need metadata to know of the origin and dependencies of all the generated code so it would be able to replace the right things.

External libs are most often linked dynamically these days, so they don't need to be built from source, so eliminating the linker doesn't pose a problem for non-open source dependencies. And if that's not enough letting the compiler also consume object files could provide for legacy use cases or edge cases where you must statically link to a binary.

replies(2): >>42816272 #>>42817207 #
dapperdrake ◴[] No.42817207[source]
SQLite3 just concatenation everything together into one compilation unit. So, more people have been using this than probably know about it.

https://sqlite.org/amalgamation.html

replies(2): >>42818061 #>>42818178 #
1. dapperdrake ◴[] No.42818178[source]
*concatenates

Apologies for the typo. And now it is too late to edit the post.