Swift is a lot like Scala
11–20 of 54 posts
Re: Swift is a lot like Scala
#12I'm fairly convinced that Swift enums and Scala case classes are only superficially the same, and based off the discussions I've heard about generics in Swift, Swift is miles aways from even C++-levels of generics, let alone Scala's.
Unless someone shows me otherwise, I'm convinced that Scala and Swift only have superficial similarities.
Re: Swift is a lot like Scala
#13Any language designer that has both "modern, powerful features" and "familiar for current developers" as design goals, will end up with something not unlike other languages that have this. It is not a coincidence that Scala, modern C#, Kotlin, Xtend, Nemerle, Ceylon, Dart and Swift have a lot in common. They're all compiled languages with pretty high performance characteristics. They have support for OO stuff because…
Re: Swift is a lot like Scala
#14It's interesting, given that Joel Spolsky says of Swift "It feels exactly like go", and this person is saying, "Swift is a dialect of Scala". Does that then imply that Go is a dialect of Scala?
Re: Swift is a lot like Scala
#15Any language designer that has both "modern, powerful features" and "familiar for current developers" as design goals, will end up with something not unlike other languages that have this. It is not a coincidence that Scala, modern C#, Kotlin, Xtend, Nemerle, Ceylon, Dart and Swift have a lot in common. They're all compiled languages with pretty high performance characteristics. They have support for OO stuff because…
Now, C# is by far my favorite language (even though I think in ML), but I'm now a bit envious of the Java approach: One of the big ideas of OOP going back to Alan Kay is that OO languages should be extremely dynamic, and that you achieve performance by building better hardware (or tuning it)†. This is what Java and Objective-C do. And, this is why Java programmers can create classes and objects with reckless abandon and still get excellent performance. Meanwhile, in C#, I find myself worrying about whether something should be a class or a struct; it doesn't happen often, and I know that I ought not be thinking about it, but it's there.
So, in summary, I now appreciate the value of putting the performance knobs on the machine rather than in the language, which represent the two different philosophies of Java and C#.
†Said by Alan Kay, and repeated by Steve Jobs: “People who are really serious about software should make their own hardware.”
Re: Swift is a lot like Scala
#16Re: Swift is a lot like Scala
#17Re: Swift is a lot like Scala
#18* first class functions
* single inheritance with traits/protocols
* extension methods
* distinction between variables and constants
* a few builtin data structures (tuples, arrays, maps etc)
By this, most "recent" PLs look like Scala. The omitted differences are where most actually disappear (i.e. handling of variance/generics)
Re: Swift is a lot like Scala
#19let emptyArray = String[]()
That's actually old, and no longer valid. The current syntax is
let emptyArray = [String]()
Re: Swift is a lot like Scala
#20It's interesting, given that Joel Spolsky says of Swift "It feels exactly like go", and this person is saying, "Swift is a dialect of Scala". Does that then imply that Go is a dialect of Scala?
And they all feel like dialects of OCaml ;). (I am not saying 'Haskell' here, because it does not include object oriented programming.) The thing is that the current generation of languages have so many overlapping features, that they are not all that different language-wise. Just like moving between Pascal, Ada, and Modula-2 was not that hard. Also, I'd say that Go is the exception here, because in contrast to Go, S…
I'm not a language geek mind you, but if people find it useful (and plenty of large and small companies have had huge wins with it at rapid pace) who cares if it's utterly boring?