Skip to content

Releasing 0.5.0

Compare
Choose a tag to compare
@soronpo soronpo released this 09 Apr 07:40
· 213 commits to master since this release
c2a8761

Towards much better performance and potential Scala 3.0 support

With added caching, use of Scala 2.13.x Singleton and other improvements, we have ~20% performance increase in Scala 2.13. Scala 2.12.x/2.11.x also got a performance bump.
The code is moving towards having a macro-less dependency above the literal-type computation. This is because dotty officially has literal-type arithmetic, so we currently assume that will be in Scala 3.0, and we will rely on it to provide the additional singleton-ops features (like TwoFace and Checked).

New Features

  • Caching (under-the-hood). Since literal type arithmetic is done via implicits, caching the operations and sub operations can improve performance significantly in codebases that use many similar such operations.

Dropped

  • Symbol support. Since Scala 2.13.x now official deprecated symbols (in favor of literal strings), it's time to remove this from the library as well.
  • Global implicit conversions for containers. E.g.
trait Foo[T]
val foo5 : Foo[5] = Foo[2 + 3]
val fooWide : Foo[Int] = Foo[5]

This used to work out-of-the-box, but caused unnecessary checks for the compiler.
Instead we need to add:

trait Foo[T]
object Foo {
  implicit def caster[F, T](c : Foo[F])(implicit eq : OpContainer.Eq[F, T, Int]) : Foo[T] = c.asInstanceOf[Foo[T]]
}

Improvements and Fixes

  • GetArg and GetLHSArg Improvements. These constructs use to refer to specific argument value in order to get the more narrow type from its tree. More cases are handled, and including a workaround for weird string interpolation behavior.