Exposing internals is still bad design.
Couldn't a simple compiler take in .m files and output compiled code + .h files?
By simply glancing over a header file one can achieve a quick idea of the interface without consulting the documentation. It's self documenting, reading a Java file in the same way is impossible.
Forward declaration in header files and imports in implementation is also a huge benefit in compilation speed and complexity.
When I last used C#, I remember Visual Studio would extract and display such public overviews directly from compiled .NET assemblies.
Even if no IDE is involved, something could just auto-generate a text file for distribution. It could even be adorned with a .h file extension for faux-retro appearance!
In fact Objective-C already includes pretty much everything necessary in the binary already, as you can see by using class-dump. Perhaps additional work would be required to support exposing absolutely everything that might be required, but there's no obvious reason why the language couldn't be extended to allow direct use of compiled code, with no need for a .h file.
- Object Pascal
- Delphi
- Modula-2
- Modula-3
- Oberon
- Active Oberon
- Component Pascal
- OCaml
- Haskell
- D
- Ada
- Eiffel
- ...
All languages with native code compiler available, where the header files can bot the manually or automatically generated from the implementation.
Many of them have, or used to have, code browsers and auto complete by reading the metadata stored in the binaries.
C based toolchains are still at stone age, in terms of modular programming support.