Does anyone have any tips for learning Scala? I want to learn the language, it looks very interesting, and I have some familiarity with Scheme, Haskell and Ocaml, but I just don't know how to start. What should I read? What should I build?
Scala 2.12.0 is now available
51–60 of 78 posts
Re: Scala 2.12.0 is now available
#52Earlier quoted context omitted.
Well Martin also worked on scalac, with all its warts & problems, so you can't say that it will be better just because he's also working on it. :) IMO much more important is the fact that Dotty is being developed after several years and iterations of scalac. Ideally this would mean that the problems to be solved, and the different ways to solve them are known. Dotty can do this without having a large legacy inherited…
Have you heard any of his presentations on the new compiler architecture? I'm incredibly impressed with the stewardship of Scala: they did a thorough assessment of the strengths and weaknesses of language and compiler and are working on a complete refoundation of the language semantics and a rewrite of the compiler while also steadily progressing along a multi year roadmap for the current compiler.
Re: Scala 2.12.0 is now available
#53This is the version of Scala that breaks compatibility with Java 6 in the generated bytecode, by making use of Java 8's features, like invokedynamic, default interface methods and integration with SAM types. This is great because the generated bytecode is smaller and more resistant to binary compatibility issues. Scala has had problems with binary compatibility because its features don't map that well on top of the J…
> the world is not ready to fully commit to Java 8, as sadly there are projects like Android that are holding us back. This is only going to get worse after Java 9 and 10 get released. I imagine by the time we get Java 10, Google might be considering to eventually cherry pick Java 9 features. They just forked the whole eco-system, and lots of people blindly post links to their Java 8 references, without looking into…
Re: Scala 2.12.0 is now available
#54Offtopic. Does anybody know of a practical imperative language in which promises are implicit? Often, when writing software, it happens that deeply nested functions suddenly have to return a promise instead of a direct value, and this forces the programmer to rewrite all the callers of that function into dealing with promises, which of course sucks. So it would be better if the programming language would do that rewr…
for {
resa
which just gets rewritten to asyncCall(1).flatMap(resa => asyncCall(2).flaMap(resb =>
asyncCall(3).map(resc => new Obj(resa, resb, resc))))
This doesn't just work for futures, it works for any monad. This is super amazingly useful. Also, query syntax for LINQ in C#/F# can support this too.Re: Scala 2.12.0 is now available
#55Offtopic. Does anybody know of a practical imperative language in which promises are implicit? Often, when writing software, it happens that deeply nested functions suddenly have to return a promise instead of a direct value, and this forces the programmer to rewrite all the callers of that function into dealing with promises, which of course sucks. So it would be better if the programming language would do that rewr…
Contrast that with JavaScript where you're forced to use promises/async await. If you don't, you block the whole event loop.
See also "What Color is Your Function": http://journal.stuffwithstuff.com/2015/02/01/what-color-is-y...
Re: Scala 2.12.0 is now available
#56Offtopic. Does anybody know of a practical imperative language in which promises are implicit? Often, when writing software, it happens that deeply nested functions suddenly have to return a promise instead of a direct value, and this forces the programmer to rewrite all the callers of that function into dealing with promises, which of course sucks. So it would be better if the programming language would do that rewr…
Re: Scala 2.12.0 is now available
#57Earlier quoted context omitted.
> the world is not ready to fully commit to Java 8, as sadly there are projects like Android that are holding us back. This is only going to get worse after Java 9 and 10 get released. I imagine by the time we get Java 10, Google might be considering to eventually cherry pick Java 9 features. They just forked the whole eco-system, and lots of people blindly post links to their Java 8 references, without looking into…
This is why both Scala and Kotlin make a lot of sense for Android development.
JetBrains, as Kotlin steward, takes an effort to have Kotlin work painlessly within Android Studio.
The Scala support for Android apparently only works properly within InteliJ, which means a few versions behind what Android Studio actually supports. It also requires much more configuration steps.
Re: Scala 2.12.0 is now available
#58Does anyone have sample sizes on Jar file size reduction, or clean compile time from the new backend? I haven't been deep in Scala for a few months, and it sounds interesting that Java8 allowed some improvements on the back end...
regarding jar size, from http://get-scala.org/2.12 (mentioned in this thread already): 2.9 2.10 2.11 2.12 Scala library 9.0 7.1 5.7 5.5 Scala compiler 11.5 14.5 15.5 10.1 ScalaTest (3.0.0) 10.5 10.4 7.0 data is in Megabyte. Compilation would be interesting, since I have read multiple times that it is slower due to a jvm bug. Only a few days ago for example: https://www.reddit.com/r/programming/comments/5ab948/scala_2…
extremly depending on your use case (p.s. it's not only compile time slower, but -Xminin-forwarders made it way better, but of course bigger jar files), the jar size, too.
Re: Scala 2.12.0 is now available
#59I'll try it again, as I believe it's an excellent idea. Having objects so fine grained allows it to emulate functional programming really well. But I suspect I'll be disappointed again.
Re: Scala 2.12.0 is now available
#60Offtopic. Does anybody know of a practical imperative language in which promises are implicit? Often, when writing software, it happens that deeply nested functions suddenly have to return a promise instead of a direct value, and this forces the programmer to rewrite all the callers of that function into dealing with promises, which of course sucks. So it would be better if the programming language would do that rewr…
This is what monadic syntax is for. You can do the following for any Future in scala: for { resa which just gets rewritten to asyncCall(1).flatMap(resa => asyncCall(2).flaMap(resb => asyncCall(3).map(resc => new Obj(resa, resb, resc)))) This doesn't just work for futures, it works for any monad. This is super amazingly useful. Also, query syntax for LINQ in C#/F# can support this too.