4 ms·
Or Google could just embrace Scala. You can already use it to develop on Android, it already has all the good stuff Swift has (and more), you can use all the ex
by eloisant 12y ago
Or Google could just embrace Scala. You can already use it to develop on Android, it already has all the good stuff Swift has (and more), you can use all the existing ecosystem because of the compatibility with Java.
Having it officially pushed by Google would mean better tooling and more Scala-ish APIs.
- DCKing 12y agoAlthough I love Scala, I don't think it will work as a primary language for an app platform such as Android. Idiomatic Scala is just too alien for most people to comprehend quickly. The beauty of both Swift and Dart is that they are very "light" languages. You can read a piece of Swift/Dart and see what it's supposed to do immediately. Most people with a JS/Ruby/Python/Java/C# background can immediately see what's going on, and probably quickly pick it up. Yet they still provide productive modern language features. Scala's learning curve is much greater.
- frowaway001 12y agoSwift vs. Scala: http://leverich.github.io/swiftislikescala/ http://leverich.github.io/swiftislikescala/ Yes, Swift is pretty much missing the FP parts, but isn't that an argument about familiarity, not simplicity?
- danieldk 12y agoThere will always be somebody to go wild with scalaz and/or shapeless. Scala has the same problem as C++ - you have to agree on a reasonable subset within a team and ensure that everyone sticks to it.
- frowaway001 12y agoThe good thing is: You can prevent advanced code by just not allowing the scalaz/shapeless dependency. Preventing bad code is a lot harder than that.
- danieldk 12y agoUnless some library you are using has scalaz or shapeless as a transitive dependency. Which, by now, are many.
- DCKing 12y agoMy argument was also about familiarity. The imperative subset of Scala is really familiar to Swift, you're absolutely right (+1 for posting that comparison). However, real-world Scala is different. With powerful trait-based OO programming, its functional style with routinely chaining monad after monad, and implicits everywhere. It's incredibly powerful, but not an accessible language for an app platform as large as Android's.
- frowaway001 12y agoPeople can always stick to a style they are comfortable with. It's perfectly possible to use code which uses "powerful trait-based OO programming, its functional style with routinely chaining monad after monad, and implicits everywhere" without having to know that part of the language.
- mdellabitta 12y agoThe problem is that Google's been in court for a long time over their Java API reimplementation, and Scala doesn't get them away from that.
- frowaway001 12y agoScala's dependencies on the JDK are minuscule, certainly a lot smaller than what's considered "the core packages required by/to support the Java language" by the court.
- deleted 12y ago[deleted]
- mastazi 12y agoWhy not Groovy? Scala is a beautiful language but it has a complex type system and it's multi-paradigm which can be confusing for new developers. Groovy, on the other hand, is very simple (especially if you already know Java) and suits well fast prototyping. When I saw Swift announced at WWDC the first thing I thought was "Google could bring official support for Groovy to Android"
- frowaway001 12y agoGroovy is kind of dead (as a project) and obsolete (in terms of technology). Just have a look at their mailing lists. Or the issues they are currently struggling with. It seems that today's Groovy mainly exists for its owning company (which seems to change every now and then) to sell training. But considering Google's taste for mediocre languages, Groovy would fit right in next to Dart and Go.
- vorg 12y ago> mediocre languages, Groovy would fit right in next to Dart and Go Groovy's dead for JVM scripting, and Grails is losing adoption share rapidly, but it's rebounding as the DSL in Gradle. I've yet to see a Gradle build script that actually drops out of the DSL to use Groovy to do any programming, though - perhaps Gradle's too good at what it does. Developers like Gradle because it has Maven-depth functionality with a JS/CSS-like syntax. Gradle would have more uptake if it enabled developers to plug in other dynamic JVM languages, e.g. JRuby, Jython, Clojure, Nashorn, JDart. Even Scala's dynamic mode might work. I've looked briefly at Gradle's source and Groovy seems to be entangled deeply in it - Gradle even manipulates Groovy's AST all over its source. I suspect Gradle was set up with the specific intention of promoting Groovy and making it difficult to work with other languages, despite the quote on gradle.org: "We happily support any community effort to create additional build script engines". Gradle needs to expose an API for its use like other products do if anyone is going to believe they're not going to change their source to prevent other build script languages being plugged in, just like Groovy 1.7 and 1.8 source changed to give Groovy++ and others the runaround around 2010 / 2011. But I suspect the same people behind that are ultimately behind Gradle.
- Touche 12y ago> (and more) That's why I have no interest in Scala. I prefer languages with only a handful (or less) of "good stuff" that you can then build on top of.
- frowaway001 12y agoThe main thing Swift is lacking compared to Scala is support functional programming. I'm not sure that's the part which you want to back away from. Apart from that, Scala is built on an impressively small amount of orthogonal concepts (at least compared to stuff like C#, F#, C++, OCaml, etc.) despite what all those "experts" on the Internet say. :-)
- pjmlp 12y agoSwift feels right at home in the ML language family. Not sure what you mean by lacking functional programming support.
- frowaway001 12y agoType-classes, monadic syntax and higher-kinded types come to mind.
- pjmlp 12y agoSo OCaml, Scheme and Lisp aren't functional programming languages?
- frowaway001 12y agoMaybe in the 80ies. I suppose with things like Agda, Idris & friends, one can say that the standards are rising.
- pjmlp 12y agoTime to throw away SICP then?!?