Live data from Hacker News

“Swift will be open source later this year”

apple.com

521–530 of 573 posts

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

#521
post #506

Earlier quoted context omitted.

It's not that generics are hard to grok, it's that they get used in a hard to grok way. Wrapping your head around such things gets more and more hard as the app complexity grows. The base point is that languages like Go let you think of the program at runtime, only. Types are a runtime concept, everything is a runtime concept. Structuring APIs to use compile time safety requires a whole other kind of thinking, one wh…

Right, don't have to think about compile time. Instead they sometimes have to think about post-compile time[1], i.e. code generation . Now you don't have to think about those weird bracketed capital letters. Just take care to check where you have comments [2] that happens to include directives to some external tool. With how Go programming seems to work for some people, I can perfectly well imagine a system with comm…

Not everyone uses codegen or other tools. You can write generic-ish code in Go which is just runtime checked via vtable pointers (interface objects).

And of course, the loss of static checking means that one has to write more tests for mundane things. But again, designing tests requires "runtime thinking", designing statically checked APIs requires "compiletime thinking".

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

#522

Earlier quoted context omitted.

Supporting Linux is a surprise, but I think it's a great move on their part. Think: How many iOS apps are frontends to a server API? And how many of those APIs are running on Linux servers? Swift on Linux means ~all the code for a client-server iOS app can be written in the same language.

It's great news. Hopefully there will be a node-like ecosystem for writing small services on Linux soon. With F#, Swift and C# available, hopefully the proliferation of Javascript can be slowed on the server (without people running to Go).

With the .NET Framework actually declining, Swift still being far away from the server and frameworks like Meteor, JS seems to have a really good position.

With that said I will root for Clojure + ClojureScript. One could theoretically build a framework much more advanced than Meteor, on the same code-sharing principles.

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

#523
post #510

Earlier quoted context omitted.

The fact that I don't use OSX has been a barrier to getting better at iOS development. Hackintoshing has proven to be quite elusive and the vmware and vbox USB layers in Linux don't convince virtualized OSX enough to transfer over apps to my iDevices. I'm not convinced you can get to high quality by testing strictly on emulators. If anyone has an old mac that can run modern xCode (you probably know what this constitu…

> Hackintoshing has proven to be quite elusive I've been using a hackintosh since 2008. It's literally never been easier to get one up and running.

So many people report success but a half dozen attempts with 20 years of computing to back me up has been nothing but abysmal failure.

I don't know what kind of magical book of voodoo spells these people are using.

I wonder if the web is just biased towards success because generally the people who haven't succeeded have nothing to say.

If so, it would be nice to get insight on the whole picture here somehow

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

#524

Earlier quoted context omitted.

Here is how to see the point of Go: Open the rosettacode web site. Choice any algorithm you are familiar with. Place Go version and Java version. Compare the number of words and lines. Compare the Maven hell with how Go solves the same problems.

So, a more succinct Java, that can't leverage the JVM ecosystem? Why is that better than Scala, which can also be more succinct than Java, but can leverage the JVM ecosystem?

Go is enormously simpler than Scala.

(I also don't agree that the deployment story for the JVM and Go are similarly complex, but that's a different argument).

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

#525
post #328
post #108

Earlier quoted context omitted.

It's designed to give it hype, it's not a systems language. The first question you should ask for any systems language is how to I integrate assembler, when the answer is to use C / C++ then you know it's not a systems language. Also, how you can tell a language is a systems language, it has an operating system written in it used by a large user base. How do you layout a struct in Swift so that it's the exact size an…

To be fair, you don't have complete control over struct memory layout in standard C, either, and C is certainly a systems language. The compiler can choose to add padding where it likes. Pragma pack, attribute(packed) etc are compiler extensions. Edit: You can also link against .o files with Swift, which is the only sane way to integrate assembly language anyway (i.e. in a separate compilation unit).

I don't know if you are talking about swift only, but with GCC or clang working in C, inline asm is a lot more pleasant than another object file. More efficient too. (Unless you like that your code makes a pointless jump to run a single instruction and jump back.) You can contrast this with the Microsoft compiler which won't do inline asm on ARM.

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

#526

Earlier quoted context omitted.

To write an OS you simply need to be able to compile code that can be launched by a bootloader. That's it. You don't need explicit control over the layout of your data structures in memory. I'd hazard that the engineers at Apple are perfectly qualified to identify what is and isn't a "systems language" working for one of the few companies that has actually developed several from scratch (I am referring to A/UX, Mac O…

You do need to control the layout of structures in memory if you want to write a filesystem or a TCP/IP stack.

I assumed you were talking about there being a well-defined relationship between a struct definition and its layout in memory. As far as I know, Swift can allocate chunks of memory and play with bytes explicitly without resorting to assembler, so I think that's pretty much covered.

That said -- if Swift were to be used for systems programming, you'd probably want better support for all of this stuff (starting with inline assembler), and for all we know Apple is already tinkering with this stuff in-house, it just hasn't released it yet (e.g. because it's in flux).

Since it's perfectly possible to do inline assembler via a straightforward kludge, adding that particular feature to Swift would be almost trivial.

As things stand, it would be pretty easy for a third-party (once Swift is open sourced) to add the necessary niceties to the standard libraries or Swift itself, so these kind of objections are pretty minor. The big question is low-level performance, and Swift has real advantages over Python and Go here.

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

#527
In other news I have a macbook pro I really need to sell to buy a thinkpad.

Microsoft opened .NET, while apple is just releasing a language for its platform because mozilla and Google did too. While the latter opened sourced the languages.

Microsoft is just getting out of their walled garden, while Apple still has a much stronger one, which is worse because they tie their software with their hardware, which is a really dubious practice in my opinion.

I'm really starting to question the trial decision that made it illegal for developers to just run OSX on PCs. Either way we really need laws to prevent manufacturers to restrict other softwares from running on their hardware.

I slightly hated microsoft but always loved their OS and at the time I did not care abut apple. But now do I hate them.

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

#528

Earlier quoted context omitted.

> Native mobile is "winning", in terms of being usually a far superior UX, and by sheer numerical demand. Yeah? I could type a URL to anything here, and you could view it. If instead hide my content behind an app, I can't deep link to it. The likelihood of you installing the app to see the content is way lower. You need space on your mobile device to install my app. Potentially a password entered to install it. It ne…

Why would I prefer to type a URL? I can just as easily get an URL for the app in ap store and have it right there. Having app stored on my device is an advantage, unless you like your web apps download in full even on crappy mobile connection. And you really want the content of your app indexed by external search engine? I like being able to control the permissions my app has. Or does your web app not ask for the per…

> Why would I prefer to type a URL?

You can just click on URLs if I type them. Maybe if you go to your local library, someone can give you a demonstration of how the internet works.

> I can just as easily get an URL for the app in ap store and have it right there.

You're ignoring the deep-linking I'm talking about. Not just the app (like cnn.com), but to actual CONTENT on it, like some specific story.

> Having app stored on my device is an advantage, unless you like your web apps download in full even on crappy mobile connection.

Web Apps can store most of their content in your browser, now. So additional views are not downloading the full app.

> And you really want the content of your app indexed by external search engine?

Yeah, I really want content I produced to be indexed by search engines, so users can actually find it. Not 100% of the time, sure, but I'm in control of that. Explain to me how I can possibly get a search engine to index my content if it IS in an app?

> I don't need to bookmark where I were in the app: I open it and I am there at once.

If you want multiple bookmarks, then no, what you're saying isn't remotely true. If you want to share a bookmark, no, this isn't possible.

Or are you just being argumentative for the sake of being argumentative?

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

#529
post #527

In other news I have a macbook pro I really need to sell to buy a thinkpad. Microsoft opened .NET, while apple is just releasing a language for its platform because mozilla and Google did too. While the latter opened sourced the languages. Microsoft is just getting out of their walled garden, while Apple still has a much stronger one, which is worse because they tie their software with their hardware, which is a real…

Uh, Apple just weakened the walled garden. They allowed self-signed apps.

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

#530

Earlier quoted context omitted.

> Native mobile is "winning", in terms of being usually a far superior UX, and by sheer numerical demand. Yeah? I could type a URL to anything here, and you could view it. If instead hide my content behind an app, I can't deep link to it. The likelihood of you installing the app to see the content is way lower. You need space on your mobile device to install my app. Potentially a password entered to install it. It ne…

I am a huge proponent of the web architecture, I just think HTML is dying from the politicization of the standards process and resulting slow pace of innovation. "If instead hide my content behind an app, I can't deep link to it. " This is not true. I enter a URL into my iPhone's Safari, it deep links into the App associated with the domain. We just watched a WWDC keynote that showed plenty of deep linking between ap…

> We just watched a WWDC keynote that showed plenty of deep linking between apps, from Siri, etc.

True, apps are beginning to figure this out. But in general, I can easily share a link to any web page. Sharing a deep link into some content in some app is nowhere near a "solved problem."

> This is also contrary to the data - people love apps, download and use apps like mad.

Really? If I share a link to a CNN or HN article, you're less likely to view that? I don't think you're remotely correct. It depends on the kinds of content, I guess. I'm just saying there are cases where web wins huge.

> Same on any website I have to sign up with via form or OAuth2.

Yes, each of us is inventing situations where the other is wrong. But I think you agree with my fundamental premise there are times when the web utterly destroys apps.

> I'm following the money and the usage figures.

I'm sitting here typing to you on ycombinator.com. After spending time on reddit.com. facebook.com. plus.google.com. cnn.com. Yup, there are apps versions of those, but I sit at my desk for 8-10 hours a day, and my desktop experience is WAY better than my mobile experience...

I'm not saying web is better, I'm saying web is better at some things, still.

Post reply on HN