The Similarities of Swift & Scala
Join the DZone community and get the full member experience.Join For Free
- Scala Times #17 - Swift is Basically Scala!
- Hello Swift, Meet Scala
- Why Google Should Bring Scala to Android
Leverich's rundown of the similarities is thorough and well-organized, presenting a wide variety of common programming techniques compared in Swift and Scala with side-by-side code snippets. Something like this:
(Credit: Jacob Leverich, "Swift is a lot like Scala")
It's all split up into a handful of broad concepts:
So you can see how where they match up and where they differ. It's an interesting look at the two languages and the ways they overlap, and Leverich is careful to clarify that many of these similarities are fairly superficial. When you dig deep enough, he says, they start to disapper:
...Swift's runtime environment is quite distinct from Scala's, and is perhaps the most interesting aspect of the new language. Scala compiles to the JVM, uses garbage collection, and its object model transparently integrates with Java. Swift compiles to native code, uses automatic reference counting, and its object model transparently integrates with Objective-C. Thus, the similarity between the two languages does not extend much below the surface.
Check out Leverich's full post, and leave us a comment if you've noticed any other similarities.
Opinions expressed by DZone contributors are their own.