Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This places Swift right along Golang and Rust as the new interesting language.


I toyed with implementing Swift on the JVM (which is very doable by the way). The problem I've found with Swift is the minute size of the standard library. This has forced a large amount of Swift libraries to make calls to Objective-C/Cocoa classes libraries which makes it very non-portable. I haven't checked any time recently, but if a large, stable, swift-specific stdlib were to emerge then I believe it could definitely rival those other languages. Until then, most libraries will probably be Apple/OSX specific (not to mention Windows concerns).


>I toyed with implementing Swift on the JVM (which is very doable by the way).

It's already been done :D

https://leverich.github.io/swiftislikescala/


I'm curious about how memory management would work. Swift has rejected garbage collection in favor of ARC.


I was going to make it use GC and make ARC-specific constructs a noop (I hadn't decided whether I wanted "weak" to be a JVM WeakReference or not, I did not get that far).


I think Rust fills a slightly different niche with its safety-first principle, but Swift should eventually be a really attractive choice for anyone building cross-platform stuff that also needs to run on iOS.


Swift has a huge advantage in that it's got a bigger community. It doesn't matter which language is the best. On StackOverFlow, for example, Swift has many more questions asked and answered. I've catalogued over 1000 blogs in the first year alone.

http://www.h4labs.com/dev/ios/swift.html

All this makes it much easier to learn Swift in a short period of time.


1000 blogs or blog posts? If you meant blog posts, on roughly how many blogs did they appear?


1000 posts. I let people filter by site.

I put all the raw data on Github as a tsv so anyone can use in Excel, etc.

https://github.com/melling/SwiftResources

Hopefully, I get around to putting a real search engine behind it. I currently don't crawl and index the sites.


That's so obvious. Swift gives you an ability to create something that can generate you $$$ very quickly.

Rust on the other hand...


The ecosystem is far more important than the language. Swift has a chance to rival Java in adoption.


What?

Do you realize how far Java reaches into the enterprise?

And with Swift's focus still being around the walled garden of iOS/OSX development, even with the open sourcing there are many more "IFs" to achieve before Swift rivals Java in adoption.

Don't get me wrong. I don't use Java and I have made apps for iOS (though not with Swift yet unfortunately). I like Swift and intend on trying it. But rivaling Java? Certainly no time soon.


Yes, I've done Java in the enterprise. It's a 20 year old language and there's an estimated 9 million Java developers.

Swift is only one1 but with open source and cross-platform ability (Microsoft will port to Windows), I think we have several million Swift developers with 5 years.

[Update] 30 -> 20


As much as I like Swift, without real garbage collection I wouldn't want to use it an any enterprise project. Keeping track of ownership of reference counted objects shared between who knows how many other objects sounds like a nightmare.


There's nothing to keep track of, all reference counting is handled through ARC which is built in to the compiler.


I'm referring to cases where you have to use unowned, etc, to break reference cycles. The larger the application the harder it is to find these issues.


> It's a 30 year old language

20.


Besides iOS/OSX support, what are Swift's features that make it interesting compared to other languages?


It appeals to the functional crowd; according to Apple's textbyte [here](http://www.apple.com/live/2015-june-event/eda6e3f7-0fda-4b46...), Swift 2 will have support for ObjC-style generics, pattern matching, and (presumably) an updated FFI for C.

I doubt it will be more attractive to functional programmers than Haskell, though; although the fact that it's an open source language that lets you do functional programming for iOS is pretty huge, IMO.


It is a multi-paradigm programming language with great tooling and corporate backing.

I can easily imagine Swift joining F# in terms of corporate adoption.


It would certainly be all sorts of ironic if (many) more Android apps were written in Swift than Go, all because Google doesn't want to replace Java with Go and make it the primary language, while Apple is doing that with Swift.


I don't think any of those languages overlap much, but they all have interesting aspects.


Not really. Depends on whether or not Swift's standard libraries and core APIs are all open-sourced.


Don't most swift apps also still drop to Obj-C? That will make them less portable.


Tim Cook said they would be open sourcing the standard libraries.


I'm assuming he's not talking about the GUI libraries, which would make it considerably less interesting. As far as I know C/C++ is still the only (free) way to write cross-platform mobile apps. If I can compile my apps on iOS and have them run on Android, then I am definitely interested.


I wonder what this will mean for Qt and QML.


Why? Swift is a language and Qt is GUI framework


QML is akin to swift. Let's say, QML is to Qt as Swift is to Obj-C + native GUI libraries.

The purpose and syntax of QML and Swift are similar, too.

PS: Qt is not only a GUI framework. It's a cross platform C++ framework.


QML is a declarative UI markup language with javascript scripting. Are there really any parallels to Swift? I haven't looked at it in any detail before.


I hadn't looked much into Swift either, thought it was meant to be a declarative layer around Obj-C, my bad.

I would say though that QML + javascript fills a similar purpose as Swift.


True that Qt is a full C++ framework (my bad on that, i should know i use it everyday), but swift is nothing like QML.

QML is just a markup language that is interpreted by an engine written in C++, swift is a whole programming language that is compiled. It would be more fitting to compare C++ and swift than swift and Qt.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: