3 ms·
.h and .c separation is important for shared libraries (you know, that thing that you can't really do in Go). I would like it if headers had some stronger requi
by cyphar 11y ago
.h and .c separation is important for shared libraries (you know, that thing that you can't really do in Go). I would like it if headers had some stronger requirements (since you can put any code in a header, which is quite bad).
- pcwalton 11y ago> .h and .c separation is important for shared libraries (you know, that thing that you can't really do in Go). Why are header files necessary for dynamic linking? To name one of dozens of examples, Java has dynamic linking and has no header files.
- xenadu02 11y ago> .h and .c separation is important for shared libraries No it isn't. That's a completely orthogonal issue. The compiler is perfectly capable of generating the equivalent of a public header if the implementation has a way to specify visibility.
- nly 11y agoIt's a bit more than that. You'd have to compile a lot of fluff in to the ELF. We'd be talking something closer to Windows COM, which allows extracting IDL from a type library.