Comment by charcircuit
2 days ago
I do not want to include and compile a standard library for every file that includes it.
Why do standard library headers always have to be insane?
2 days ago
I do not want to include and compile a standard library for every file that includes it.
Why do standard library headers always have to be insane?
Have you considered compiling it into a binary of your choice? It works perfectly well as a traditional library. The only cost you pay is re-parsing the header part once per TU. Because C is so simple, this is virtually free. In any case, calling it insane makes me feel disrespected and I would prefer if you didn't do that.
>The only cost you pay is re-parsing the header part once per TU.
You are not just parsing it. The header includes the implementation too which will get compiled. Then the linker has to do extra work in order to deduplicate all of this extra code that was made.
>Because C is so simple, this is virtually free.
This is not virtually free needing to compile a standard library for every file in one's project.
>In any case, calling it insane makes me feel disrespected
I would recommend you not take it personally. Fortunately, for better or worse software ends up being pretty robust so it can tolerate a lot. Even if you have to recompile the same standard library hundreds of times, it will eventually compile.