Live data from Hacker News

Swift open source – let the revolution begin

jessesquires.com

21–30 of 58 posts

Re: Swift open source – let the revolution begin

#21
post #19
post #18

Earlier quoted context omitted.

No, originally Apple just provided huge patch sets. Here is some history from 2005, a few months before WebKit moved to a public CVS repo: https://blogs.kde.org/2005/05/13/webcore-khtml-firefox-know-...

Good example! And yes, KHTML's license requires Apple to release the source code for their changes, but it doesn't require them to do so in anything like a nice fashion. You can comply with the (L)GPL with tarballs and silence-implying-raised-middle-fingers rather than public repositories and bug trackers.

It goes even farther than that. They could have separated most of their work out into separate modules that linked with the LGPL code from KHTML, and all they would have to do to comply with LGPL is provide a way for the user to replace the LGPL code. They would not have had to release the source for their modules.

LGPL is quite friendly to proprietary code.

Re: Swift open source – let the revolution begin

#22

I'm excited about Swift but is there any reason someone who is not making money as an iOS dev but knows objective C well should drop everything in learn it (serious question)? My initial opinion was swift does a lot of things much better, (no header files, new operators, etc.) but learning a new language takes a long time + it appears a majority of code is still in objC

It takes a few days to learn enough Swift to start coding in it. Just start adding new Swift methods to your Objective C classes by using extensions

extension MyViewController {

  func fooAction(sender:AnyObject) {

 }
}

You need a bridging header to call back to ObjC

Very few people are blogging or writing books with ObjC. It's mostly Swift, and has been since June 2014:

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

Re: Swift open source – let the revolution begin

#24
post #23

I wish I could use the Swift compiler from the command line instead of having to download a 10GB XCode monster over my shitty 14kb modem that will take a couple of years. Is there a swifter option?

It's part of the Command Line Tools, which is about 160 Mb on my computer. If you install Homebrew you should get a prompt to install the tools (or try to run gcc from the command line).

Re: Swift open source – let the revolution begin

#25
It seems to be the same effect as people getting Macbooks because... they have an Apple logo on them.

Technically, either Rust, Python, or Go is superior to Swift in every usecase it has. It doesn't fill a niche, its just Apple would rather reinvent the book than use an alternative on iOS, and they wanted clean compatibility with their other NIH language Obj-C. Its a nice compromise language for applications, but it is currently an app language without a framework outside Apple operating systems.

Besides that ecosystem compatibility its just worse than the alternatives besides the whole Apple is behind it so everyone is developing in it because they dream of working at / for / with Apple for some reason. Are Mozilla, Google, and and Guido just not sexy enough anymore?

Re: Swift open source – let the revolution begin

#26
post #25

It seems to be the same effect as people getting Macbooks because... they have an Apple logo on them. Technically, either Rust, Python, or Go is superior to Swift in every usecase it has. It doesn't fill a niche, its just Apple would rather reinvent the book than use an alternative on iOS, and they wanted clean compatibility with their other NIH language Obj-C. Its a nice compromise language for applications, but it…

Since I expect nothing less than clear, well-informed commentary from Hacker News regulars, I would be very interested in learning exactly what technical aspects make Rust, Python, and Go superior to Swift in each use case, as well as lessons that future PL designers might draw from the Swift team's missteps.

Re: Swift open source – let the revolution begin

#27
post #21
post #19

Earlier quoted context omitted.

Good example! And yes, KHTML's license requires Apple to release the source code for their changes, but it doesn't require them to do so in anything like a nice fashion. You can comply with the (L)GPL with tarballs and silence-implying-raised-middle-fingers rather than public repositories and bug trackers.

It goes even farther than that. They could have separated most of their work out into separate modules that linked with the LGPL code from KHTML, and all they would have to do to comply with LGPL is provide a way for the user to replace the LGPL code. They would not have had to release the source for their modules. LGPL is quite friendly to proprietary code.

> They could have separated most of their work out into separate modules that linked with the LGPL code from KHTML, and all they would have to do to comply with LGPL is provide a way for the user to replace the LGPL code.

And indeed, they _do_ do this, I think; a lot of WebKit is BSD license.

Re: Swift open source – let the revolution begin

#28
post #25

It seems to be the same effect as people getting Macbooks because... they have an Apple logo on them. Technically, either Rust, Python, or Go is superior to Swift in every usecase it has. It doesn't fill a niche, its just Apple would rather reinvent the book than use an alternative on iOS, and they wanted clean compatibility with their other NIH language Obj-C. Its a nice compromise language for applications, but it…

> Technically, either Rust, Python, or Go is superior to Swift in every usecase it has.

How so, exactly? The only one on that list I'd say maybe to is Rust.

Re: Swift open source – let the revolution begin

#29
post #8

I'm excited about Swift but is there any reason someone who is not making money as an iOS dev but knows objective C well should drop everything in learn it (serious question)? My initial opinion was swift does a lot of things much better, (no header files, new operators, etc.) but learning a new language takes a long time + it appears a majority of code is still in objC

Learning a new language doesn't take a long time. If you can program, then picking up a new language is a matter of days especially if it's the same paradigm. If it's something radically different, I can't see why it should take more than a month. The only learning curve to swift would be it's standard library. But in this age of IDEs with auto competition and copious documentation that's not much of a program.

> in this age of IDEs with auto competition and copious documentation that's not much of a program.

I can see you wrote that post in an auto-completing IDE.

Re: Swift open source – let the revolution begin

#30
post #11

Swift is a good language, but compared to things like Python, the syntax is still not as clean and intuitive. It's definitely a much better improvement of Obj C and I would have never built 3 apps in the app store without it, but I don't see it going out of the iOS dev environment anytime soon.

I'm not sure that this is completely the same, but when node.js was introduced it provided a server-side programming language that a ton of web developers were familiar with. Swift is doing something similar now that it's open source there is a huge community of iOS (and to a smaller extent Mac) developers who are excited that they can code on other platforms (or will be able to in the near future) using a language t…

Honest question: how common are non-GUI Objective-C apps? So far as I know, Objective-C has been available outside of Cocoa for a long time, but you never hear of people using it for non-Mac/iOS apps.

Is Swift different in this regard? Is more of the standard library open in Swift vs. in Obj-C? Any reason to expect it's non-Apple uptake will be better than Obj-C?

Post reply on HN