Live data from Hacker News

Scala 2.11.0 Release Notes

scala-lang.org

41–50 of 77 posts

Re: Scala 2.11.0 Release Notes

#43
post #38
post #7

Earlier quoted context omitted.

To be fair, 2.10 introduced quite a few new features (my favorite being string interpolation). To name some more: implicit classes, value classes, language imports, reflection & macros,... 2.11 set the tone for the remainder of the 2.x cycle: smaller, faster, stabler. 2.12 will focus on Java 8 support and making it (even) easier to learn and use Scala. We're also working on making the compiler a better platform for o…

I really hope that you guys aren't planning to pull a Python 3 with the 3.x series. We're using Scala quite heavily in our production systems and the naysayers will have a great "I told you so" moment of we end up sitting on a ton of critical Scala code which no longer compiles in a future version.

I kind of hope the Scala guys do that, actually. There is too many ways to do certain things. "list.map(_+2)" is legal while "list.map((_+2)+3)" is not. Instead, you need to use an anonymous function like this: "list.map(x => (x+2)+3)". Why is the _-style even legal if it's so inflexible? Why not force functions all the time? Why have two ways to do the same simple thing?

Re: Scala 2.11.0 Release Notes

#44

Compared to 2.10 the 2.11 release is nothing special: some optimizations, bunch of bug fixes and deprecations (that hopefully lead to slash and burn of little used language features in 2.12). Curious to test out build times in 2.11, sounds like some minor gains have been made there, and more to come in the 2.11 release cycle as the new scalac optimiser is integrated ( http://magarciaepfl.github.io/scala/ )

async/await and removal of the case-class/tuple 22 field limit are the big ones I think. (edit: the limit is still in effect for Tuple apparently. Only removed for case-classes.)

In database (or Actor ask) heavy code dealing with a lot of Futures async/await has the potential to fairly significantly influence code style. for-comprehensions often don't cut it when you're dealing with a Future[Option[User]] and need to pull in their assigned roles from a Future[Seq[Role]].

  val userOption = db.get(userId) flatMap {
    case None => Future.successful(None)
    case Some(user) =>
      Future.sequence {
        user.roleIds map(db.get(_))
      } map { roles =>
        Some(user.copy(roles = roles.flatten))
      }
  }
vs:

  val userOption = async {
    for {
      user  
Or something like that anyways.

Re: Scala 2.11.0 Release Notes

#45
post #44

Compared to 2.10 the 2.11 release is nothing special: some optimizations, bunch of bug fixes and deprecations (that hopefully lead to slash and burn of little used language features in 2.12). Curious to test out build times in 2.11, sounds like some minor gains have been made there, and more to come in the 2.11 release cycle as the new scalac optimiser is integrated ( http://magarciaepfl.github.io/scala/ )

async/await and removal of the case-class/tuple 22 field limit are the big ones I think. (edit: the limit is still in effect for Tuple apparently. Only removed for case-classes.) In database (or Actor ask) heavy code dealing with a lot of Futures async/await has the potential to fairly significantly influence code style. for-comprehensions often don't cut it when you're dealing with a Future[Option[User]] and need to…

Tuple field limit was not removed, there are comments below regarding that.

Re: Scala 2.11.0 Release Notes

#46

Buried in the release notes is this gem: reflection via ClassTags wasn't (and still isn't) threadsafe in 2.10; this has been fixed in 2.11 (see http://docs.scala-lang.org/overviews/reflection/thread-safet... )

ClassTags were always thread-safe - they are simple wrappers over j.l.Class. TypeTags however were not, and that's supposed to be fixed in 2.11.0.

Re: Scala 2.11.0 Release Notes

#47
post #7

Earlier quoted context omitted.

There have not been any huge library/language changes since 2.8.

To be fair, 2.10 introduced quite a few new features (my favorite being string interpolation). To name some more: implicit classes, value classes, language imports, reflection & macros,... 2.11 set the tone for the remainder of the 2.x cycle: smaller, faster, stabler. 2.12 will focus on Java 8 support and making it (even) easier to learn and use Scala. We're also working on making the compiler a better platform for o…

Glad to hear faster is a priority. Hopefully faster for loops will make it in.

Re: Scala 2.11.0 Release Notes

#48
post #44

Compared to 2.10 the 2.11 release is nothing special: some optimizations, bunch of bug fixes and deprecations (that hopefully lead to slash and burn of little used language features in 2.12). Curious to test out build times in 2.11, sounds like some minor gains have been made there, and more to come in the 2.11 release cycle as the new scalac optimiser is integrated ( http://magarciaepfl.github.io/scala/ )

async/await and removal of the case-class/tuple 22 field limit are the big ones I think. (edit: the limit is still in effect for Tuple apparently. Only removed for case-classes.) In database (or Actor ask) heavy code dealing with a lot of Futures async/await has the potential to fairly significantly influence code style. for-comprehensions often don't cut it when you're dealing with a Future[Option[User]] and need to…

> for-comprehensions often don't cut it when you're dealing with a Future[Option[User]] and need to pull in their assigned roles from a Future[Seq[Role]].

If you aren't familiar with Monad Transformers, yes, it can be tricky. However it's trivial using an Option monad transformer (OptionT[Future,A]]) to have the same semantics.

   for { 
      user        
Look at http://github.com/scalaz for already built Monad Transformers (Either/State/Option/Writer) that will work with the standard lib Future along with tons of other goodies. I actually actively dislike the async stuff as it gives you another way of doing the same thing, at a less powerful abstraction.

Re: Scala 2.11.0 Release Notes

#49
post #38
post #7

Earlier quoted context omitted.

To be fair, 2.10 introduced quite a few new features (my favorite being string interpolation). To name some more: implicit classes, value classes, language imports, reflection & macros,... 2.11 set the tone for the remainder of the 2.x cycle: smaller, faster, stabler. 2.12 will focus on Java 8 support and making it (even) easier to learn and use Scala. We're also working on making the compiler a better platform for o…

I really hope that you guys aren't planning to pull a Python 3 with the 3.x series. We're using Scala quite heavily in our production systems and the naysayers will have a great "I told you so" moment of we end up sitting on a ton of critical Scala code which no longer compiles in a future version.

We've been thinking about this a lot, even though Scala 3 is a couple of years out. Our current thinking is to bring the 2.x series as close to 3.0 as possible, with the remaining breaking changes being compelling enough to switch. Please share your ideas/concerns over at scala-internals!

Part of the solution will be tooling, and the team at EPFL has started prototyping a migration tool that generates patches to turn a well-typed Scala 2 program into the equivalent one on Scala 3. I believe our type system and the fact that we're a compiled language will make a big difference compared to Python.

Re: Scala 2.11.0 Release Notes

#50
post #4

Probably the best change in my opinion was resolving the arity limit for case classes: https://issues.scala-lang.org/browse/SI-7296 I've bumped up against that limit pretty bad while trying to deserialize json. Shapeless did a lot to solve the problem, but I'm sure glad that limit has been removed.

I wish the same was done for tuples, but it wasn't and it's unclear whether that's even in plans.

I'm not sure I understand the situations where having a tuple of that arity is beneficial. Some sort of code generation thing, perhaps?
Post reply on HN