3 ms·
Swift is not perfect but I've been writing it a bunch recently and it's hands down one of the most productive languages I've written in. Fundamentally I believe
by adamnemecek 11y ago
Swift is not perfect but I've been writing it a bunch recently and it's hands down one of the most productive languages I've written in. Fundamentally I believe that it might be one of the most important languages because it's relatively close to the metal, it's a 'modern language' (i.e. functional, has a pretty good type system), open source, and a major company and platform behind it. I think that if Swift 4.0 adds concurrency to the language (as hinted), that we could see it defeat Go on the web.
- jbverschoor 11y agoFully agree. It's a very nice language to work with, and I'm amazed about the small number of bugs / programming mistakes I made with it.
- proyb2 11y agoWe will also need a dashboard like Akka for profiling concurrency will be a bonus.
- deepGem 11y agoAnd you gotta love the Swift REPL :)
- pivo 11y agoAs a longtime lisp developer I thought I'd love the REPL, but so far I really haven't had much use for it. I find myself using playgrounds quite a bit though.
- goldbrick 11y agoSwift might be "functional" (which means it has immutable values I guess?) or have a "pretty good type system" (which means it has generics?) but for a supposed "most productive language", I've never heard anyone mention how short the standard library falls. I decided to start using it this week and after learning the requisite umpteen fiddly syntax idiosyncracies was startled to discover how little Swift supports you where traditional platforms (Java, C#, Ruby, Python, Node, Go) you got for free: a dang HTTP server, for example, requires you to write several[0] thousand[1] lines[2] of[3] code[4]. For a batteries-included language, Swift has a long ways to go before thinking about "defeating Go on the web". [0] https://github.com/PerfectlySoft/Perfect/blob/master/Sources/PerfectLib/HTTPServer.swift https://github.com/PerfectlySoft/Perfect/blob/master/Sources... [1] https://github.com/PerfectlySoft/Perfect/blob/master/Sources/PerfectLib/NetTCP.swift https://github.com/PerfectlySoft/Perfect/blob/master/Sources... [2] https://github.com/PerfectlySoft/Perfect/blob/master/Sources/PerfectLib/WebRequest.swift https://github.com/PerfectlySoft/Perfect/blob/master/Sources... [3] https://github.com/PerfectlySoft/Perfect/blob/master/Sources/PerfectLib/WebResponse.swift https://github.com/PerfectlySoft/Perfect/blob/master/Sources... [4] https://github.com/PerfectlySoft/Perfect/blob/master/Sources/PerfectLib/WebSocketHandler.swift https://github.com/PerfectlySoft/Perfect/blob/master/Sources...
- adamnemecek 11y ago> "functional" (which means it has immutable values I guess?) No, it means that it's a functional language. Please consult google if you are not sure what that means. > "pretty good type system" (which means it has generics?) No, it means that it has a more advanced type system than any of the languages you mentioned. It's most likely the most popular language with a type system that can be considered somewhat advanced. There might be idiosyncrasies but like compared with say JS or whatever it's still miles ahead. Yeah, the standard library is somewhat lacking but like that will be fixed. The language is very solid though. Also don't judge a language by lack of an HTTP server in the standard library.
- goldbrick 11y agoIt's not a functional language: http://robnapier.net/swift-is-not-functional 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/General/Reference/SwiftStandardLibraryReference/ https://developer.apple.com/library/ios/documentation/Genera...
- chris_7 11y agoThe 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.