News for hackers. Stuff that matters.
Re:Server APIs Project by tormeh on Tuesday October 25, 2016 @04:11PM (#12791241)
Swift was influenced by Scala, so that's no surprise.
Re:Server APIs Project by desdiv on Tuesday October 25, 2016 @04:35PM (#12791434)
Re:Server APIs Project by yvsong on Tuesday October 25, 2016 @05:13PM (#12791690)
The comparison should be updated to Swift 3. Swift syntax is more intuitive and readable than Scala. A common mistake in language design is to depart from C syntax, without substantial gain. For example, replacing {}, &&, || with other things. Swift strikes a great balance between intuition and innovation.
Re:Server APIs Project by premium-concern on Tuesday October 25, 2016 @07:28PM (#12792699)
> Swift syntax is more intuitive and readable than Scala

Example?

Re:Server APIs Project by manojlds on Tuesday October 25, 2016 @10:44PM (#12793508)
And scala doesn't have {}, &&, || ?
Re:Server APIs Project by chris_7 on Tuesday October 25, 2016 @05:09PM (#12791663)
Some of these comparisons aren't great. The "Variable Number Of Arguments" example is better expressed in Swift with "reduce", and it's really comparing "summing an array", the varargs aspect is a minor detail of the example. The "Idiomatic Scala" example doesn't even declare a function with varargs! (yes, it uses one, but that's not really the point)

The Swift function in the protocols example doesn't need to be generic, as the protocol doesn't have any associated types, and really ought to be a protocol extension regardless.

Re:Server APIs Project by tormeh on Tuesday October 25, 2016 @04:43PM (#12791506)
Wow. They're basically identical. Scala has a bit less boilerplate sometimes, but it's also older, so I guess Swift will get syntactical sugar to catch up in time.
Re:Server APIs Project by melling on Tuesday October 25, 2016 @04:57PM (#12791589)
Re:Server APIs Project by vorg on Tuesday October 25, 2016 @06:09PM (#12792177)
Neither Scala nor Apache Groovy are listed in the 8 languages Swift was influenced by on its Wikipedia page. That Groovy link was written by the Apache's Groovy PMC chairperson, and is more wishful thinking that fact.
Re:Server APIs Project by melling on Tuesday October 25, 2016 @07:33PM (#12792731)
Yeah, I already knew what Wikipedia said. My point was that a lot of languages look similar.

Scala might have influenced Swift. Zip you go to the author's blog, he says lists those languages and says many more that he doesn't name:

http://nondot.org/sabre/