I still miss the C-style compilation model: each source file is compiled into an obj file, and each obj is the smallest unit for linking. The advantages of this model include:
- The target exe or dll has a size as small as possible.
- Each file can be compiled independently, without requiring to have all its dependencies available beforehand.
The disadvantages of this model include:
- It requires header files, which is considered not modern.
But how do swift, java, c#, go and other modern programming languages deal with this problem? I never heard that swift has a concept like crate in rust, and I also never heard swift requires a header file. Is the concept of crate REALLY necessary to achieve the benefits of rust: safety, concurrency, high performance? What stops us from adopting a swift-style import?