Hacker News new | ask | show | jobs
by ohgodplsno 1119 days ago
SwiftSyntax is a Swift package, so to have SwiftSyntax work, your IDE needs to already be able to integrate with Swift. Needless to say, unless you're Apple, since nobody else uses Swift, it is going to be awful to make it work because Swift has its own calling convention, the only way to call swift is through cinterop and requires an @_cdecl() attribute on the Swift function you're calling. Apple does not expose any of this. The Swift calling convention is a barely documented piece of shit. Additionally, SwiftSyntax is fully unable to handle partial bits of code, which is a non starter for any IntelliJ IDE. The difference between how responsive IDEA is when adding code and XCode that waits for 5 seconds for the parser and compiler to stop dying before giving out an awful error message is night and day, and no IntelliJ user would ever accept such an experience.

>Swift has compile-time-checked regular expressions

And IntelliJ has had inspections over regular expressions for a decade, nothing special about it, or hard to implement.

> concretely-typed generics

Handled for years by IntelliJ.

> so much more not seen in other languages.

I'd be curious to see a list, because there's not much that is very special about Swift.

The biggest problem that AppCode faced is that even when they open source things, unless it grows way beyond Apple like LLVM did, Apple still only does things for Apple. They have no incentive of making Swift-Syntax easy to consume and use. For the longest time, they would push gigantic dumps of commits to the various Swift repos on release date, meaning that Xcode would already have everything integrated, and others are left to play catch-up. This is entirely done on purpose to kneecap competitors.