3 ms·
But even C doesn't really have header files from language viewpoint. The compiler doesn't make distinction between code coming from a .h file or a .c file. Heck
by zokier 5y ago
But even C doesn't really have header files from language viewpoint. The compiler doesn't make distinction between code coming from a .h file or a .c file. Heck, I can't name a single language off-hand that would have explicit header-file like mechanism.
Edit: I suppose JavaScript + WebIDL would fit? Although nobody uses them, except browsers themselves.
- docandrew 5y agoAda is one. It splits the interface (specification) and implementation (body) into separate files (.ads and .adb). This is also unlike C which just does a "copy-and-paste" wherever the #include occurs. This also makes its formal verification (SPARK dialect) nice because you can add pre and post-conditions to the interface without cluttering up the code body.
- nullifidian 5y ago>I can't name a single language off-hand that would have explicit header-file like mechanism. Ocaml's .mli files?
- jcelerier 5y agoC++20 has module interface units and module implementation units