News for hackers. Stuff that matters.
Re:Swift 3.0 Release Process by kev009 on Saturday May 07, 2016 @03:58AM (#11648783)
It looks like a really well thought out language, and the willingness to break some things that looked like C holdovers in 3.0 for future clarity is also interesting.

I'm wondering if Swift will hit a sweeter spot than Go (GC, weird takes or delay on things like packaging, generics) and Rust (complexity) for userland systems software.

Re:Swift 3.0 Release Process by brudgers on Saturday May 07, 2016 @09:08AM (#11649434)
My intuition is the Swift ecosystem will struggle against conflation with particular platforms, i.e. iOS and OSX. This struggle is common among languages: C# with Windows and JavaScript with the browser come to mind. Historically, C faced similar association with the Unix platform. Language platform conflation makes it difficult to parse information from blogs, books, and StackOverflow: the worst offender of course is Javascript where the presentation may be based on jQuery or NPM dependencies even for things practical in vanilla Javascript [or rather ECMAscript].

Outside of Google, using Go tends to be a decision made among a wider range of technical options whereas Swift is very often "not-ObjectiveC." To put it another way, Google created Go as an inhouse alternative for applications where Python, C++, or Java might have been the choice previously. A wide language range: even more considering the range of Java alternatives [Scala, Clojure] on the JVM.

A third factor I see with Go is the Clojure effect. The median Computer Science and Engineering knowledge in its community tends to be high relative to languages chosen based on platform limitations, institutional standards, or "this is the language I know".

I've left out Rust because I don't see it as likely to achieve the scale of adoption of Go or Swift...and saying that I should clarify that I think that platform binding, and a few billion platforms at that, will mean Swift is likely to instantiate more lines of code than Go. Clarifying further, I think Rust's adoption will be a matter of power law distribution not technical shortcomings.

Re:Swift 3.0 Release Process by npalli on Saturday May 07, 2016 @01:14PM (#11650387)
Apart from swift on iOS/mobile which is gigantic, you are underestimating the push for Swift by enterprise players (IBM,SAP..). The next big frontier for enterprise applications is cloud, IoT and of course mobile (buzzwords or not). Java is increasingly being used by Oracle to extract revenue, there is no guarantee they will not change their mind and start charging fees from future versions as their other businesses (database, apps etc.) shrink.

The major enterprise players are not going to let Java (with Oracle stewardship) continue to be the language for the next generation of enterprise platforms and be at Oracle's mercy. Swift is open source and apple enterprise agnostic, easy to see other enterprise players pile on this language. IBM and SAP already on board. If you remember, this is how Java came to dominate enterprise space. Don't be surprised if Google release some sort of compatibility layer for Android.

[Case for bringing Swift on the Server by IBM]

https://www.infoq.com/presentations/swift-server

You are also overestimating Go's influence. It has been five years since the language release, it seems to have settled as a niche language like Clojure and topped out. Unless some major platform adopts it, it will remain a niche area. It certainly hasn't replaced (or even come close to) Python, C++, Java in any sense.

Re:Swift 3.0 Release Process by kjksf on Saturday May 07, 2016 @02:25PM (#11650713)
Where do you get your stats about Go usage? My data points tell me that it whizzed past Clojure and is still on exponential growth path.

I'm tracking a list of companies that use go: https://quicknotes.io/n/1XB0-Companies%20using%20Go. I stopped adding to it because at this point it's everyone and his mother.

If you go to https://triplebyte.com/ycombinator-startups#q=&page=0&refine..., which is a list of YC companies where you can filter by technology they claim to use, Go is currently ~4.3% (30 startups out of 697).

If you narrow that to just San Francisco, it's 19 out 258 i.e. ~7.4%. I consider SF a leading indicator i.e. other parts of the country and the world will follow that usage growth.

I grant you that it's still far behind Python/Ruby/JavaScript/Java, but those things have exponential growth for a long time and 6 years is early. Those other languages took 10+ years to establish mainstream presence.

Judging by many metrics (number of significant software like Docker or Juju or CockroachDB, number of jobs available, number of Go-related conferences and meetups and their size), Go is easily past "niche language" like Earlang/Haskell and even Clojure and Scala (both of which riding JVM wave) and well on its way to be a peer of Python/Ruby/Java in the next 5-10 years.

Re:Swift 3.0 Release Process by npalli on Saturday May 07, 2016 @03:27PM (#11650980)
You are looking at a narrow slice of technology companies in SF. This is not representative of a general trend. I will add that you are right, it is not "as niche" as clojure. If you look at a broad indices --

1. At Tiobe, it is now at #42. It was language of the year in 2009 and has been slowly moving down

http://www.tiobe.com/tiobe_index

2. At redmonk programming language rankings, it has been hovering around #15 for more than a year

http://redmonk.com/sogrady/2016/02/19/language-rankings-1-16...

http://redmonk.com/sogrady/2015/01/14/language-rankings-1-15...

http://redmonk.com/sogrady/2015/07/01/language-rankings-6-15...

3. Look at jobs on dice.com same number of jobs for golang and clojure. I have been tracking them occasionally and they seem to around the same since last year.

dice.com

Your use of Docker as a datapoint is interesting, while it is written in golang, far more people use it as a sysadmin tool. So why is that a factor for golang usage? That is a general issue though, lot of infrastructure might be written in golang (and should be) but that doesn't mean there will be golang jobs.

As for taking 10+ years to establish mainstream, things move faster nowadays so unless there is a established or rapidly growing platform exclusively for golang, I wouldn't necessary bank on it becoming hot in another 5-10 years just because it has been around.

Re:Swift 3.0 Release Process by brudgers on Saturday May 07, 2016 @02:44PM (#11650797)
Sorry if I was unclear. I intended to communicate that Go has been used in lieu of the three languages at Google. Unsurprisingly, since that was the intent behind developing it.

To the degree IBM and SAP drive enterprise languages I suppose their consultants and sales staff could go whole hog behind Swift as a long term strategy. I'm not sure I see the same strong parallels with Java, I remember Sun playing a role that uniquely leveraged its hardware and software synergy. Redhat played a role there too: there having being at least as much Java as an alternative the Microsoft stack as a dictate of blue suit consultants.

Which makes me wonder if the rationale for Swift's adoption based on open source is significantly more compelling than predicting the adoption of C# on a similar basis or a case that the adoption of the opensource .NET as the replacement for the JVM. I suppose it's that I'm not sure I see IBM and SAP as having orders of magnitude more influence on enterprise or tools selection than Microsoft or that I see top down implementation of consultant recommendations as dominating bottom up decisions by small teams.

Of course, predictions are hard particularly about the future and your mileage may vary.

Re:Swift 3.0 Release Process by geodel on Saturday May 07, 2016 @03:01PM (#11650880)
There is no doubt IBM is making big Swift announcements but IBM is also making huge contribution to Go. They are porting it to PowerPC / s390 architectures. They are also contributing Go based blockchain implementation (~50k LOC) to hyperledger project.

IBM/SAP swift support looks like riding along with marketing of Apple/OSX/ios. These tech consulting giants will definitely make a top-down push for swift but grabbing developer mindshare might not be so easy. At least IBM swift on server support looks Websphere like play. At one point it was a big business or may be still is but given alternative huge number of developers will prefer alternative.

Unlike Java/Swift which are often introduced or talked by executives at Oracle/Apple, Go is not a corporate mandated language and Google execs do not talk about it like android. Google I/O does not have any Go specific talks. The biggest Go conf is organized by 3rd party.

Go influence need not be over or under emphasized. Hugely influential cloud based projects such as Docker/rkt/etcd/kubernetes/juju and many more are written in Go.

Re:Swift 3.0 Release Process by caycep on Saturday May 07, 2016 @02:05PM (#11650631)
Maybe it will differentiate w/ the flavor of their libraries? It seems Go is the go-to networking and low level language, whereas Swift may be better for graphical applications and user-facing apps?
Re:Swift 3.0 Release Process by ebbv on Saturday May 07, 2016 @07:55AM (#11649244)
I've written a fun little OS X/iOS game in Swift 2.0 and found the language incredibly satisfying. Swift 3.0 seems to bring a ton of improvements including some of the bugbears I encountered during that first project.

It's probably mostly personal preference, but I prefer Swift's approach to things over Go or Rust. Go in particular does a lot of things that I personally find obnoxious (capitalization of method names indicating exporting instead of using a proper keyword I find particularly egregious, but I also find the := assignment operator annoying as well.)

Swift is the first language I've learned in a while that had way more "OH yeah that's awesome!" than "What?! Why did they do that?"

Re:Swift 3.0 Release Process by AsyncAwait on Saturday May 07, 2016 @09:25AM (#11649493)
I actually find Swift and Rust to be pretty similar in how they approach things from the end-user perspective, (I think of Swift as application-level Rust), it's just that Rust targets a different market which involves quite a bit more complexity in its domain, which is reflected in the language where needed.
Re:Swift 3.0 Release Process by yokohummer7 on Saturday May 07, 2016 @07:38AM (#11649202)
> It looks like a really well thought out language

Well, I think it could have been more cleanly designed if it was able to abandon the burden of Objective-C interoperability. (But Apple can't do this, obviously.) The standard libraries could have also been much cleaner if it didn't rely on NextStep. Also, I don't personally like the dichotomy of value types and reference types, but YMMV.

Re:Swift 3.0 Release Process by cies on Saturday May 07, 2016 @08:04AM (#11649267)
You say

> it could have been more cleanly designed if it was able to abandon the burden of Objective-C interoperability

You mean this for the language itself and not the (standard) libraries; right?

> The standard libraries could have also been much cleaner if it didn't rely on NextStep.

I agree.

Re:Swift 3.0 Release Process by TillE on Saturday May 07, 2016 @09:41AM (#11649546)
There are at least a few aspects of the language (eg, the special case for the first argument passed to a method) which would be completely bizarre decisions if not for the Objective-C compatibility requirements. Though I think they're tweaking that a bit.
Re:Swift 3.0 Release Process by donut2d on Saturday May 07, 2016 @11:05AM (#11649842)
> special case for the first argument passed to a method

Are you talking about the weirdness where the first argument doesn't require a label? If so, that decision has been made explicit in the last few dev snapshots of 3.0. Basically, if you don't want to require a label when call a function/method then it must be made explicit.

Re:Swift 3.0 Release Process by Scarbutt on Saturday May 07, 2016 @04:07AM (#11648804)
I'm wondering if Swift will hit a sweeter spot than Go

I think Swift will be a Go killer.

Re:Swift 3.0 Release Process by spriggan3 on Saturday May 07, 2016 @05:14AM (#11648921)
How does Swift handles concurrency ? does it have CSP with channels, and a select statement ? because if it doesn't it's not going to kill anything.
Re:Swift 3.0 Release Process by stepanhruda on Saturday May 07, 2016 @05:19AM (#11648936)
It doesn't right now, you are dependent on grand central dispatch. Adding concurrency features to the language will be a focus in Swift 4.

Here is a document describing the current state of concurrency in the language: https://github.com/apple/swift/blob/master/docs/proposals/Co...

Re:Swift 3.0 Release Process by austinz on Saturday May 07, 2016 @05:34AM (#11648969)
To be clear, that document contains brainstorming by some core Swift team developers. It's neither implemented in Swift nor officially accepted as a guideline for future development.
Re:Swift 3.0 Release Process by stevetrewick on Saturday May 07, 2016 @07:20AM (#11649160)
"The implementations of the thread-safety layer, the thread verifier, and programs that use the three concurrency libraries are available in the concurrency git branch."
Re:Swift 3.0 Release Process by austinz on Saturday May 07, 2016 @11:39AM (#11649960)
"This is a proposal and not a plan of record."

Not only that, the git feature branch, if it ever existed, doesn't anymore.

Re:Swift 3.0 Release Process by stepanhruda on Saturday May 07, 2016 @05:19PM (#11651390)
Oops, thanks, I should've been clearer.
Re:Swift 3.0 Release Process by stevetrewick on Saturday May 07, 2016 @07:39AM (#11649205)
Thanks, I'm going to have to take a long hard look at that and the repo. I've just spent a couple of weeks abstracting over async in Swift [0] and where I ended up looks a lot like that - to the point where some of the primitives have identical type sigs (mainly because the patterns used here are not novel - promise/future, async/await, etc). Be great to see this as a core language feature!

At least now we can see stuff coming, I had just finished writing unit tests for my OAuth library when Apple rolled an implementation into iOS.

[0] I'm aware of PromiseKit and co (and read a bunch of their sources), but I didn't feel like I had a good conceptual grasp on their implementation until I could create something similar and understand how it works and how to use it to solve my actual problems. Often I'll bin my own implementation afterward and use an extant library, so this is almost - but not entirely - quite unlike NIH.

Edit:punctuation

Re:Swift 3.0 Release Process by donut2d on Saturday May 07, 2016 @11:12AM (#11649865)
Check out VeniceX[1]. It provides Go-style concurrency. The same group[2] that is working on this is also working on a GCD based concurrency library but the name escapes me at this time.

[1]: https://github.com/VeniceX/Venice [2]: https://github.com/Zewo/Zewo

Re:Swift 3.0 Release Process by danappelxx on Saturday May 07, 2016 @01:52PM (#11650570)
Yeah, it's very cool stuff! Would just like to add that VeniceX is actually single-threaded, so it's more safe than Go's. It's similar to libuv in that way, but since it doesn't use callbacks it's much nicer.
Re:Swift 3.0 Release Process by zzzcpan on Saturday May 07, 2016 @10:40AM (#11649752)
CSP with channels in Go is just a fancy locking mechanism, something that Rob Pike and co wanted to experiment with, and a marketing feature, of course. Nothing more. They don't really work that well. Their limitations, verbosity and quite complex implicit behavior makes them hard to use for high level things. I think mutexes are more widespread and more encouraged already in Go, than channels. So, idiomatically and in the standard library Go doesn't handle concurrency well at all, on the opposite, it has the worst kind of concurrency - shared memory multithreading. And anything can be better than that. Even a wrapper around synchronous APIs ;)

It doesn't mean, of course, that Swift or any other language will be a Go killer. It means that most people never write complex concurrent programs to begin with and don't really care about good concurrency models. Sadly or luckily, this applies to people, who design languages as well, so concurrency tend to be a hype-driven mess. The only known exception is Erlang, where the whole language was designed to solve concurrency problems.

Re:Swift 3.0 Release Process by lobster_johnson on Saturday May 07, 2016 @01:45PM (#11650528)
I agree. I've found Go channels to be disappointing in practice. There's lots of PR but little criticism of something so key.

The fact that they are implemented using mutexes is, from my admittedly limited, non-concurrency-expert perspective, inexplicable. The simplest use case, an unbuffered channel, should be trivial to implement using CAS. There's a bunch of research on implementing robust queues using CAS.

Then there are the various ugly edge cases: Closing a closed channel is an error (now you have to implement your own refcounting implementation if you want to hand out a single channel to multiple consumers), receive on nil channel blocks (means you can't use nil as a signal to mean "I've closed the channel"), etc.

I really like GCD's style of enqueueing concurrent tasks, which I think is a concurrency model that often works more naturally than channels. A major difference between GCD and goroutines is that you can specify what queue to use. I'm looking forward to see what they come up with for Swift.

Re:Swift 3.0 Release Process by danappelxx on Saturday May 07, 2016 @01:56PM (#11650587)
I think that Go's biggest mistake was making goroutines multithreaded. Libmill takes a much safer approach by making everything still run on one thread (and by taking advantage of libmill, Venice brings a similar scheme but with the added safety).
Re:Swift 3.0 Release Process by jaegerpicker on Saturday May 07, 2016 @02:15PM (#11650674)
Built-in, it's threading and Grand Central Dispatch. However there are a shit of good quality libraries available for swift. PromiseKit being the one I'm most familiar with. There are others that offer CSP and channels.

Also Swift 4 will contain it as a native part of the language.

Re:Swift 3.0 Release Process by chrisamanse on Saturday May 07, 2016 @05:19AM (#11648935)
Swift has Grand Central Dispatch (GCD) for running concurrent code
Re:Swift 3.0 Release Process by wlesieutre on Saturday May 07, 2016 @10:08AM (#11649637)
(But only on OS X and iOS)
Re:Swift 3.0 Release Process by chrisamanse on Saturday May 07, 2016 @10:26AM (#11649710)
Yes, currently. But in the link, it states that "For Linux, Swift 3 will also be the first release to contain the Swift Core Libraries." And GCD (or libdispatch) is part of the Swift Core Libraries :)
Re:Swift 3.0 Release Process by lobster_johnson on Saturday May 07, 2016 @01:46PM (#11650534)
Isn't libdispatch fully implemented on Linux and *BSD?
Re:Swift 3.0 Release Process by kartickv on Saturday May 07, 2016 @09:15AM (#11649459)
The practical side of me welcomes a language that can be used both on the client and server, and on both Apple and non-Apple platforms.

The idealistic side of me notes that Swift seems like a far more complex language than Go, so if Swift kills go, it will be bittersweet.

Re:Swift 3.0 Release Process by hellofunk on Saturday May 07, 2016 @04:35AM (#11648856)
I'm curious how Swift is getting adopted on Linux and what success folks are having in writing Linux command-line apps or other apps?
Re:Swift 3.0 Release Process by pjmlp on Saturday May 07, 2016 @07:49AM (#11649229)
IBM is betting on it as a programming language for enterprise applications. Expect a Swift EE coming from them.

Microsoft also acknowledged that Swift support is the top request for their iOS bridge.

Re:Swift 3.0 Release Process by codeOfRobin on Saturday May 07, 2016 @08:35AM (#11649333)
They already built a flask type server side framework :

https://github.com/IBM-Swift/Kitura/

Re:Swift 3.0 Release Process by donut2d on Saturday May 07, 2016 @11:09AM (#11649854)
I've built a few simple apps running on Linux that have worked great.

Check out Zewo[1]. They've been doing a lot of great work to make Swift 3.0 on the server work really well. Also, check out VeniceX[2] for concurrency and Open Swift[3] for cross project standards[3].

[1]: https://github.com/Zewo/Zewo/ [2]: https://github.com/VeniceX/Venice [3]: https://github.com/open-swift/docs

Re:Swift 3.0 Release Process by tannernelson on Saturday May 07, 2016 @01:51PM (#11650563)
2nd most starred web framework for Swift:

http://github.com/qutheory/vapor

Works on linux.

Re:Swift 3.0 Release Process by mlsarecmg on Saturday May 07, 2016 @10:42AM (#11649759)
I don't know - this is a language that can't easily handle concurrency. Instead you mess around with dispatchers. And then you're dealing with thread-unsafe structures, objects, arrays, etc.

This is such a critical thing with todays interconnected apps that i have no idea how they did not worry about it from the start. Having had the pleasure of dealing with threads, mutexes, dispatchers, execution-contexts and the like there is no way i'd pick up a language that hasn't evolved in that regard, especially on a server. Even Javascript has this figured out with stage-3 async/await.

Re:Swift 3.0 Release Process by zepto on Saturday May 07, 2016 @11:17AM (#11649892)
This is inaccurate. There is no term in either Swift, or the Objective-C runtime named 'dispatcher', which makes it seem like you are unfamiliar with the platform.

There are dispatch queues, and the whole purpose of them is to abstract away threads and locks. Using them does not require you to use threads, mutexes or execution contexts.

Yes, it would be better if Swift incorporated language level concurrency, but it isn't a priority because the platform provides a good solution.

Re:Swift 3.0 Release Process by jaegerpicker on Saturday May 07, 2016 @02:22PM (#11650698)
As others have said this is misleading and inaccurate. GCD, which will be cross platform as of swift 3, is very pleasant and robust to work with and abstracts the threads, mutexs, and dispatchers away from the developer. PromiseKit and Venice are third party libs that also provide other better concurrency patterns.
Re:Swift 3.0 Release Process by chillacy on Saturday May 07, 2016 @03:23PM (#11650955)
Also GCD can be faster than locking with a mutex because it doesn't have to trap into the kernel. So now in my app I tend to protect access to variables with queues instead of @synchronized. The only downside is that it can't replace recursive locks
Re:Swift 3.0 Release Process by donut2d on Saturday May 07, 2016 @10:54AM (#11649806)
I don't have much experience, but I think the VeniceX packages from Zewo answer the concurrency issues quite well.

https://github.com/VeniceX/Venice

Re:Swift 3.0 Release Process by proyb2 on Saturday May 07, 2016 @11:17AM (#11649890)
and Vapor web framework include Venice.