Format
This hasn’t been reviewed by evolution, so nothing has sailed yet. Having said that…
I’m sure you thought about this, but the issue here is simply that Dhall isn’t in LLVM’s compiler-building toolkit; YAML is, because the API notes and TBD (text-based dylib) files that already ship in frameworks are written in YAML. (As well as some ephemeral inputs, like the VFS files that Tony mentioned, but if we didn’t have YAML shipping in SDKs already, I would have thought twice.) It doesn’t make much sense to support a third general-purpose text serialization format (besides JSON and YAML) in the compiler.
Just too much effort for too little gain. To be honest, these were serious contenders:
- Plain text list of newline-separated module names
- Put all three module names into the path (like
KarrKit.swiftcrossimport/Combine.swiftbystander/_KarrKit_Combine.swiftoverlay) and don’t read the files’ contents at all.
But having a version number and the ability to specify fields that are currently ignored seemed useful enough to justify the tiny engineering cost of using a structured format the compiler already understood.
Writing these files in Swift would have turned a day’s work into a month or two and also made loading slower. There was just no way to justify that.
(I also could have done is something like the modulemap format: use the Swift tokenizer but write a custom parser for the format. But again, this would have been a lot more work than using YAML for basically no gain.)
ABI
ABI compatibility issues would probably prevent us from fixing the Dispatch/Combine extension problem with cross-import overlays, but I think it would have been a great tool for layering issues like that one if we’d had it at the time. As the saying goes, the best time to add a feature plant a tree is thirty years ago; the second-best time is now.
I haven’t tried it, but at the very least, you wouldn’t be able to backwards-deploy calls compiled with the new SDK to older OSes, because they would be calling the new version instead of the old one.
This would be nice, but the fact that the set of protocols a protocol refines is known is baked into the ABI and I don’t think it can be changed at this point. (Varun talks about some of the reasons for this; I won’t duplicate his discussion.)
Other
It is, yes.
@_exported is in a weird spot: It’s not officially supported and we don’t want people over-using it, but the implementation is pretty good by now, and it’s so widely used and underpins so many important things (like traditional overlays) that removing it would be a de facto source compatibility break. It makes sense to support @_exported officially, but we’d have to decide how to design it to avoid misuse (and whether we want to reform import visibility more generally at the same time). This proposal just isn’t the place to make those decisions, and we don’t think it makes sense to hold up this proposal until those decisions are made.
It’s a bit awkward, but I think it’s the right decision. If @_exported gets an official spelling in the future, we can correct this proposal’s spelling so that it makes sense to future readers.