Live data from Hacker News

Swift is a lot like Scala

leverich.github.io

11–20 of 54 posts

Re: Swift is a lot like Scala

#11
Basically both represent the new concept of how a new language should be today. Many similarity there are, but "it's fair to say that Swift is a dialect of Scala" it not true. Also, the word "dialect" should be mean a sublanguage much expressive, but in many of your examples Swift seems much "verbose" than Scala.

Re: Swift is a lot like Scala

#12
Kinda frustrating that the language comparaison is by syntax instead of features ( http://www.scribd.com/doc/227879724/Swift-vs-Scala-2-11 is what's referenced in the article).

I'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

#13
post #4

Any 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…

The development of C# 1 was led by the chief architect of Delphi. It probably got more features from the previous language its creator designed than from Java...

Re: Swift is a lot like Scala

#15
post #4

Any 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…

C# 1.0 (the spec) and especially Visual C# 1.0 (the IDE) were recapitulations of Delphi in Java skin.

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

#16
All those languages look like a combination of Java and ML to me. Of course they use different features and small additions here and there but overall: ML+Java.

Re: Swift is a lot like Scala

#18
The article appears to say: they both have

* 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

#20

It'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…

Aw, but what about utterly fast to develop in, utterly awesome at concurrency, utterly easy for ruby/python/dynamic-language devs to pick up and gain huge performance boosts, utterly easy to get in to the ecosystem, and utterly simple to use?

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?

Post reply on HN