Live data from Hacker News

“Swift will be open source later this year”

apple.com

261–270 of 573 posts

Re: “Swift will be open source later this year”

#261
post #39

Swift interfaces with C and Objective-C natively right? I can't wait to see web servers written with it.

I'm very excited to write web servers in it. I think this is probably how open sourcing it was sold, internally; that it would allow people to develop their entire infrastructure using apple's technologies.

I think they have two primary reasons for open sourcing it:

1. Being able to upstream more into LLVM means less maintenance of their internal forks.

2. The recent open sourcing of Microsoft .NET core parts.

Re: “Swift will be open source later this year”

#262
post #49
post #40

Earlier quoted context omitted.

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

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.

Re: “Swift will be open source later this year”

#263

Earlier quoted context omitted.

I think it's terrible. Parsing a JSON response into a Swift object takes a full-day to figure out when it's literally just JSON.parse(response) in any other language. You can't pass immutable structures (structs) into NSNotifications and I can't figure out why. It's confusing and poorly documented, and a complete chore to use. React Native is a godsend.

How is React "native" again? I'm not sure I understand how something not written in Swift or Obj. C is 'native.' This is only 30% snark; I actually don't know the answer. React is from the same people that thought html5 was a good idea for a mobile application right? I am not bashing React; I am only curious how it's considered native. Does it have official support from the iOS APIs? Can you integrate Objective C lib…

As far as i understand. It uses a javascript runtime on its own thread to parse "instructions" to native components dynamically. To answer your questions. yes, yes, yesno.

Reacts philosophy is to learn once write everywhere. If you know reactjs then it is just as easy to write react native as it is exactly the same (clear and concise) but with different api's available. The instructions are written in javascript the rendering can be done in dom, obejective-c, java.. etc.etc.

Would it be intellectually honest to place a 30% snark if you don't know the language?

Re: “Swift will be open source later this year”

#266

Earlier quoted context omitted.

This cannot happen soon enough. I'm not saying this because of anything to do with Apple's Swift announcement. I'm saying this because it'll be a huge benefit to Android.

> I'm saying this because it'll be a huge benefit to Android. reply How so? The language has a weaker type system than Java, doesn't support exceptions and requires error checking every other line, has very poor tool support (because the compiler was not designed with IDE's in mind). Except maybe add a few developers who refused to write code on Android because of Java, I really don't see what Go would bring to Andro…

[deleted]

Re: “Swift will be open source later this year”

#267

Earlier quoted context omitted.

Hey, look me up in a year and explain why you were wrong. Go has been out for 6 years and has less than 10,000 questions on StackOverFlow: http://stackoverflow.com/questions/tagged/go Swift has 37,000 questions in its first year: http://stackoverflow.com/questions/tagged/swift I'm a fan of Go. I built my websites in it and I've written a few small apps. However, you really are overlooking how much of a difference the…

I think part of the parent comment's point was that Swift does/will have a lot of users. Right now those 10,000 Go questions cover a lot of server related issues; the 37,000 Swift questions are almost completely iOS questions. If I started writing an HTTP server in Swift the day it comes out I won't find much help but I'll have a mountain of unrelated answers to filter. Essentially Swift's adoption for iOS apps doesn…

Objective-C never caught on outside of the Apple/NeXT ecosystem because its biggest advantages were in the application frameworks, not the language itself. By the time iOS made Objective-C popular there were entrenched alternatives in the C++, Java, and .NET ecosystems. Swift is facing the same challenges, but against a newer generation of competitors that are much less established. It's probably still an uphill battle for Swift to gain outside adoption, but it's not climbing a cliff.

Re: “Swift will be open source later this year”

#268

Earlier quoted context omitted.

Too little too late. Apple could have got my attention if they had done this from the start, but at this point I find it hard to get excited about this. Half the reason I find myself drawn to a new language is the culture and community surrounding it. You might think this seems silly at first glance, they're programming languages, not fraternities. But hear me out. Golang is a pragmatic crowd. Go into #go-nuts on fre…

Hey, look me up in a year and explain why you were wrong. Go has been out for 6 years and has less than 10,000 questions on StackOverFlow: http://stackoverflow.com/questions/tagged/go Swift has 37,000 questions in its first year: http://stackoverflow.com/questions/tagged/swift I'm a fan of Go. I built my websites in it and I've written a few small apps. However, you really are overlooking how much of a difference the…

Why would I ever care about Go for Android when I can write apps in Kotlin? Kotlin is fully interoperable with Java. I don't have much experience with Swift but Kotlin is so nice. It has the best features from numerous languages such as Ruby. C#, etc. It's being made by Jetbrains who makes the the core of Android Studio so it will have support. Kotlin is also nearly as fast at runtime as Java with a tiny 200kb runtime. Almost all the magic happens at build time so your build time will be a little longer. Kotlin also works with any existing Java library, even annotation processing libs.

Again, why would any Android developer choose Swift? Kotlin also runs fine on the server and it even compiles to Javascript.

If I were a startup doing an iOS, Android, and a backend I would do either Go or Rust on the backend. You will be able to distribute a native lib with your Android or iOS that shares network and model logic. Go and Rust both are planning on supporting cross compilation to iOS and Android.

That would leave you with Kotlin/Groovy/Clojure/Scala for the view layer of your Android app if you choose not use Java. Which is a good idea since there is no indication from Google Java 8 will be supported which means no lambdas unless you use an alt JVM language. On iOS you write your view layer in Swift. Both apps use the shared binary library.

Re: “Swift will be open source later this year”

#269

Earlier quoted context omitted.

I think it's terrible. Parsing a JSON response into a Swift object takes a full-day to figure out when it's literally just JSON.parse(response) in any other language. You can't pass immutable structures (structs) into NSNotifications and I can't figure out why. It's confusing and poorly documented, and a complete chore to use. React Native is a godsend.

How is React "native" again? I'm not sure I understand how something not written in Swift or Obj. C is 'native.' This is only 30% snark; I actually don't know the answer. React is from the same people that thought html5 was a good idea for a mobile application right? I am not bashing React; I am only curious how it's considered native. Does it have official support from the iOS APIs? Can you integrate Objective C lib…

I don't think the parent was saying React is native. He's referring to a project called React Native, which provides native rendering (eg., binds to a native button implemented in ObjC) in a PhoneGap/Cordova-style wrapper that lets you implement bridged access to native code (to talk to Apple-specific APIs or to implement performance-sensitive code, for example). In such an app, you would be able to get a native "look and feel" despite the application being written mostly in JS.

Re: “Swift will be open source later this year”

#270

Earlier quoted context omitted.

I think it's terrible. Parsing a JSON response into a Swift object takes a full-day to figure out when it's literally just JSON.parse(response) in any other language. You can't pass immutable structures (structs) into NSNotifications and I can't figure out why. It's confusing and poorly documented, and a complete chore to use. React Native is a godsend.

> Parsing a JSON response into a Swift object takes a full-day to figure out when it's literally just JSON.parse(response) in any other language. Something which has nothing to do with the language. Here's how you do it with a popular Swift lib: let json = JSON(data: response) if let userName = json[0]["user"]["name"].string{ .... }

Eh, the awful state of their respective standard libraries seems to come up quite a bit when people are critiquing OCaml or D.
Post reply on HN