Live data from Hacker News

Swift is Open Source

swift.org

191–200 of 458 posts

Re: Swift is Open Source

#191

How is developing on iOS these days? Swift seems like such nice a nice language.

I've been developing on iOS since it came out. It is better than ever. Swift is a great language in my opinion – feels very familiar to Objective-C, but is much lighter-weight, and I find that I can spin up projects much more quickly. The type-safety took some getting used to, but pays dividends and has made programs easier to expand and maintain. Plus, I get to pull in ideas from the functional programming community which is great.

Re: Swift is Open Source

#192
post #135
post #98

Earlier quoted context omitted.

Anybody knows what effects of the "copyright owned by the contributor" are in the context of Swift's Apache license? I guess the "good side" is that the lawyers of other companies probably like when the code made by their programmers keeps being copyrighted by the company. But it is still an Apache license, so they can't demand too much from the users of the code. Still, are there any negative aspects? Any imaginable…

Not really. Your typical corporate IP lawyer might feel queasy about the collective copyright aspect, but so much of the open source world works this way now... they can suffer in their jocks. One important question they'll ask is: "Who can enforce the copyright and licence?" (Which is when the subtle difference between joint and collective copyright matters.) Non-trivial contributions are made under the terms of the…

"Who can enforce the copyright and licence?"

The answer is only the owner of an exclusive right of copyright has standing to sue. So any of these open source projects that have no copyright assignments would have trouble suing. But in practice, who cares. Unless you want to sue people, it literally doesn't matter.

The only folks who often care about suing are those who are trying to enforce certain types of share-alike licenses (GPL, etc) because they are ideological.

If you are using Apache or BSD, you probably aren't suing folks because you are fine with them commercializing it or doing whatever with it (and if you are using these liceneses and aren't okay with that, you may want to reevaluate your life choices)

Re: Swift is Open Source

#193

Earlier quoted context omitted.

It seems pretty consistent with functions in a set-notation sense, with functions that map a tuple of stuff to something else. The mapping being indicated by an arrow instead of a colon.

I was thinking more about Types here var name : String func nameMe(name: String) : String

I was half-thinking the same, but types and sets feel interchangeable on an intuitive level in such cases.

Having both `: String` and `: String` seems to suggest that they are the same type, which they are not. `nameMe(_)` is a function type, while `name` is a "plain value", so to speak. I think that using arrows more clearly indicates that it's a mapping from something to something else -- in the case of Swift, I guess a mapping from a tuple to something else.

And think about anonymous functions, in general since I haven't looked into Swift anonymous functions. If you indicate a function like this:

`func nameMe(name: String) : String`

How are you supposed to indicate an anonymous function? Like this:

`(name: String) : String`

Then it seems to say that name is a type of String, which in turn is a type of String. I guess you could add something like a lambda to distinguish it:

`(λ name => name): String`

But now you've still effectively said that both `name` (a value of type string) is the same type as the anonymous function (a function with one argument). That's clearly wrong.

Using arrows for functions seems to be better when you start to want to talk about types and values by themselves, like:

`1: Int`, `"hello": String`, `(λx => x) : a -> a`

Re: Swift is Open Source

#194
post #86

Such good news. I've bet my career on Scala, but Swift is sufficiently similar in style that it will be an easy transition. A language to write native (not VM-based) apps for the desktop, iPhone, iPad, Apple Watch, CarPlay and Apple TV is becoming very compelling indeed.

It doesn't work like that, you can't "bet your career" on a language. Either you are interested in continuous learning or you aren't, and it's pretty clear which one is a better choice when choosing between multiple employee candidates.

Re: Swift is Open Source

#195
Interesting that they rewrote the Foundation library in Swift for the open-source release rather than open-sourcing the ObjC one and bringing along the ObjC runtime. I wonder if this means they still believe the ObjC runtime and Foundation library are still worth keeping proprietary, or just that this is a step toward phasing out ObjC.

Re: Swift is Open Source

#196
post #120

Am I the only one who finds it odd that while pushing two high level but performant languages (Objective-C and Swift) Apple wrote their Swift compiler in C++?

I'm glad they didn't write it in Objective-C, as this would probably make compilation on Linux much harder (I have no idea what the state of Linux support for Objective-C is). As for writing it in Swift itself, that's not possible until Swift is sufficiently stable and with enough library support. Which it may or may not have now, but certainly didn't have when they started ;)

Linux support for ObjC is great on the compiler side (GCC supports the full language), but none of the core libraries are available. You can get some stuff (NSString, NSDictionary and so on) through GNUstep, but last I checked it was an uphill battle to be truly productive with ObjC on Linux.

Re: Swift is Open Source

#197

I see this as an hilarious welcome joke from the community : https://github.com/apple/swift/pull/17 Its developer's way to say FIRST

No. This is a childish joke, and inappropriate. As a community of professionals, we should do everything we can to discourage this kind of crap.

Joe Cumbo (mooman219), I hope you never apply for a job I'm the hiring manager for, because I would never hire you after seeing this kind of unprofessionalism in your Github profile.

Re: Swift is Open Source

#198
I would love to see Swift for Android programing. I'm already using Kotlin, a language very close to Swift, for programming our Android apps. But I find Swift niftier than Kotlin.

Re: Swift is Open Source

#199
post #142

What kind of trolling is that ? >I think we should use GPL v3 instead. https://github.com/apple/swift/pull/17

FLOSS gotta FLOSS. I'd be surprised if they didn't open a pull request to change the license.

I actually read this PR as trolling against GPL folks, in the vein of making fun of their license of choice. Seeing that people have also thought differently, it would perhaps be better not to blame a group at all.

Re: Swift is Open Source

#200

Earlier quoted context omitted.

Why would Apple write a Swift compiler in Objective-C, a language that it is in the process of phasing out in favor if Swift? And of course it is not possible to write a Swift compiler in Swift before the language exists. So no, not odd at all. Quite logical actually.

> of course it is not possible to write a Swift compiler in Swift before the language exists No, but you can do a self-hosting port after you have a first rudimentary compiler. Many compilers have been built like this. Some did it early in language development with a purpouse built one-off bootstrapping compiler, some did it after the language was somewhat stable (eg Go). ObWP: https://en.wikipedia.org/wiki/Bootstrap…

I believe I saw Lattner once describe a self-hosting compiler for Swift as an anti-goal, at least before the design had stabilized.

Aside from the value of maintaining LLVM as a shared codebase, the concern was that writing a compiler in Swift could bias early language design tradeoffs towards decisions that would make it easier to write a compiler at the expense of the larger universe of potential applications.

Post reply on HN