5 ms·
Scala compiles to JavaScript, to the JVM, to Android, and (soon) to native. Give it a try!
by premium-concern 10y ago
Scala compiles to JavaScript, to the JVM, to Android, and (soon) to native. Give it a try!
- Nullabillity 10y agoI love Scala, but last time I tried to build an Android app using it (about a month ago), I just got various weird errors in IntelliJ when trying to build it. Eventually I just gave up and rewrote my app in Kotlin instead. But yeah, it's absolutely my first choice for JVM or web work.
- premium-concern 10y agoThat sounds weird. How did you build it? Can you paste the SBT error?
- Nullabillity 10y agoIt happened with both the make button and when running it (yes, I had removed the "Gradle-aware make" step and replaced it with android:packageDebug from the SBT shell plugin). Sadly, I don't have the error message anymore, and it seemed to work when building from the command-line tool. I suppose I could have kept going like that, but it's very nice to have the proper debugging tools that an IDE provides. :/
- premium-concern 10y agoWhich version of sbt-android do you use?
- Nullabillity 10y ago1.6.1, I think, but I'm not sure. I was stupid enough to delete my project files...
- lomnakkus 10y agoNot a huge fan of Scala[1], but it must be said that Scala.js is AMAZING for what is does. We've been using it in production since 0.4 (I think?) and we've never had any problems that could be traced back to sjs. [1] Long story. "Trapped" programming Scala instead of Haskell by my own conservatism -- and now -- the need to support legacy systems. Still... it's way better than Java, so at least there's that. When thinking of Kotlin I always think of it as a sort of "what Java should have been", but when thinking of Scala I can't help but think "Well, it's not quite Haskell, is it?". (The poor type inference, the whole OOP thing, the lack of TCO means that any Monadic abstraction must be trampolined and that's just cruel.)
- premium-concern 10y ago> but when thinking of Scala I can't help but think "Well, it's not quite Haskell, is it?". (The poor type inference, the whole OOP thing, the lack of TCO means that any Monadic abstraction must be trampolined and that's just cruel. Some good news: - Better type inference at the place were it was sorely needed landed in 2.12 (use -Ypartial-unification to enable) or use it on 2.11 with a compiler plugin. - Even if you are not a fan of OO (I'm not), I still love that I get a great module system for free. Haskell's module system is a completely mess. - Scala-Native already supports all kinds of TCO, including mutually recursive ones.
- lomnakkus 10y agoOh yeah, definitely looking forward to 2.12. Don't get me wrong Scala is still good, just not great. (Hence the scare quotes around "trapped") > - Better type inference at the place were it was sorely needed landed in 2.12 (use -Ypartial-unification to enable) or use it on 2.11 with a compiler plugin. I was actually thinking of things like local definitions not needing type signatures. It's really easy to underestimate how much more fluent this makes the language feel. (Think of functions defined in 'where' clauses and things like that. Entirely subjective, but there's this feeling of fluency when you don't need any type signatures for non-top-level things.) I don't think Scala is ever going to move away from requiring all functions to have an explicit type signature. > - Even if you are not a fan of OO (I'm not), I still love that I get a great module system for free. Haskell's module system is a completely mess. Not so much "mess", I think... more completely underpowered? It's really just a namespacing mechanism. Hopefully we'll get Backpack at some point... > - Scala-Native already supports all kinds of TCO, including mutually recursive ones. Really? This is surprising to me, but perhaps they've gone with the Pascal(?) calling convention so as to make it trivially supportable? It's still sad it can't be relied upon per language spec. :/