Re:Mixing Swift and C++
by saagarjha on Sunday July 23, 2023 @05:37PM
(#36840121)
Not really. These are pretty critical features for the language.
[ Parent
| on HN ]
Re:Mixing Swift and C++
by refulgentis on Sunday July 23, 2023 @06:10PM
(#36840393)
Not type inference, rather, whatever is so pathological about the fundamental algorithm for doing Swift type inference that it can become an infinite loop.
This is a Swift-only feature in major languages with type inference.
> Primary-file mode's advantages are that the driver can do incremental compilation by only running frontends for files that it thinks are out of date, as well as running multiple frontend jobs in parallel, making use of multiple cores. Its disadvantage is that each frontend job has to read all the source files in the module before focusing on its primary-files of interest, which means that a portion of the frontend job's work is being done quadratically in the number of jobs. Usually this portion is relatively small and fast, but because it's quadratic, it can easily go wrong. The addition of batch mode was specifically to eliminate this quadratic increase in early work.
One example that would improve the above: replace module imports with file specific imports, including within the module itself. You could also make a case for operator overloading and there are probably a bunch of candidates a swift compiler engineer could tell you that would be small but significant like that.
https://github.com/apple/swift/blob/main/docs/CompilerPerfor...