Hacker News new | ask | show | jobs
by goldbrick 3683 days ago
It's not a functional language: http://robnapier.net/swift-is-not-functional

Please inform me what Swift's type system has over, say, Java as I don't know of anything and neither does a cursory Google.

The lack of an HTTP server is only an example. Let's see you parse JSON, or stream a Unix socket, or any of countless basic things that even Node includes in its standard lib. Swift doesn't really have much of anything except some types and traits: https://developer.apple.com/library/ios/documentation/Genera...

1 comments

The Foundation libraries provide that functionality, they're not core to the concept of a programming language, so they're not part of the minimal standard library. There are also numerous community provided implementations.

One way that Swift's type system is more advanced than Java is the ability to define extensions to protocols (interfaces) constrained to specific types, i.e. you can add "average" to "SequenceType where Generator.Element == Double". You can also use this to provide default implementations for protocols, but only in the case of specific associated types.