A next generation Scala compiler
Singapore Scala Meetup - 12 April 2017
_hhandoko
hhandoko
hhandoko
hhandoko.com
Source:
https://pbs.twimg.com/media/CthyVVWWcAAIq-a.jpg:large
25 - 26 February 2017
Tokyo, Japan
Talks2:
Notes:
[1] - http://2017.scalamatsuri.org/index_en.html
[2] - https://www.youtube.com/channel/UC6DFHglgVXQUVDbUmQHtxDQ
1 RT = $3
1 fav = $1
... but seriously, people are excited about Dotty!
Notes:
[1] - https://twitter.com/_hhandoko/status/835764141843333121
Source:
https://pbs.twimg.com/media/Ctd6sdMWYAEaBGX.jpg:large
DOT and Dotty
Dotty Developer Tooling
Dropped, Implemented, and Proposed Features
Release and Timeline
Get Involved!
Source:
https://pbs.twimg.com/media/CprNb0PWEAAFS3F.jpg
Notes:
[1] - http://www.scala-lang.org/blog/2016/02/17/scaling-dot-soundness.html
[2] - https://www.youtube.com/channel/UC6DFHglgVXQUVDbUmQHtxDQ
"A common theme among earlier systems is their complexity, which makes them hard to reason about and extend with new features."
Notes:
[1] - https://infoscience.epfl.ch/record/215280
Notes:
[1] - https://infoscience.epfl.ch/record/215280
Notes:
[1] - https://infoscience.epfl.ch/record/215280
Source:
https://pbs.twimg.com/media/CfSQdwUW8AErog1.jpg
Notes:
[1] - https://www.lightbend.com/company/news/after-a-quiet-2015-martin-odersky-outlined-significant-plans-for-scala-at-scala-days-new-york
Notes:
[1] - https://www.infoq.com/news/2016/08/scala-development-is-heating-up
Notes:
[1] - https://github.com/VladimirNik/tasty
[2] - https://infoscience.epfl.ch/record/226194
[3] - https://docs.google.com/document/d/1Wp86JKpRxyWTqUU39H40ZdXOlacTNs20aTj7anZLQDw
[4] - https://docs.google.com/document/d/1h3KUMxsSSjyze05VecJGQ5H2yh7fNADtIf3chD3_wr0
Notes:
[1] - http://scalameta.org/
[2] - https://www.slideshare.net/Odersky/scala-days-nyc-2016
[3] - http://docs.scala-lang.org/overviews/macros/blackbox-whitebox.html
inline def m(inline x: Int, y: Float): Float =
meta { ... }
Notes:
[1] - https://www.scala-lang.org/resources/img/scalameta-sketch.jpg
Notes:
[1] - https://d-d.me/talks/scaladays2015/
[2] - https://d-d.me/talks/scaladays2016-linker/#/5
Source:
https://pbs.twimg.com/media/CgGkN6YVAAAZ3_1.jpg
Notes:
[1] - https://scastie.scala-lang.org/
[2] - https://github.com/lampepfl/sbt-dotty
[3] - https://www.jetbrains.com/help/idea/2017.1/getting-started-with-dotty.html
Notes:
[1] - http://guillaume.martres.me/project1_report.pdf
[2] - https://github.com/Microsoft/language-server-protocol
[3] - https://github.com/eclipse/lsp4j
Notes:
[1] - http://www.scala-lang.org/blog/2016/10/14/dotty-errors.html
Notes:
[1] - https://summerofcode.withgoogle.com/archive/2016/projects/5280919451598848/
[2] - https://github.com/lampepfl/dotty/pull/1453
[3] - https://www.scala-lang.org/gsoc/2017.html
[4] - http://dotty.epfl.ch/docs/usage/dottydoc.html
Notes:
[1] - https://scalacenter.github.io/scalafix/
[2] - http://www.scala-lang.org/blog/2016/10/24/scalafix.html
Source:
https://pbs.twimg.com/media/ChJzv9lUYAA9D5E.jpg:large
package scalaworld.macros
import scala.meta._
class Main extends scala.annotation.StaticAnnotation {
inline def apply(defn: Any): Any = meta {
defn match {
case q"object $name { ..$stats }" =>
val main = q"def main(args: Array[String]): Unit = { ..$stats }"
q"object $name { $main }"
case _ =>
abort("@main must annotate an object.")
}
}
}
Notes:
[1] - http://scalameta.org/tutorial/
object Test {
def foo() { // procedure syntax
???
}
}
Notes:
[1] - https://d-d.me/talks/scalaworld2015/
object Test {
def foo(): Unit = {
???
}
}
Notes:
[1] - http://www.cakesolutions.net/teamblogs/2012/09/03/existential-types
[2] - https://www.reddit.com/r/scala/comments/4o36r1/what_are_the_simplifications_that_come_with_dotty/
def foo(as: Seq[A[X]] forSome { type X })
def foo(as: Seq[A[_]])
Source:
https://pbs.twimg.com/media/Cf7eHZ1W4AEeZJA.jpg:large
Notes:
[1] - https://github.com/lampepfl/dotty/pull/1758
[2] - https://github.com/lampepfl/dotty/blob/master/library/src/scala/FunctionXXL.scala
package scala
/** A function with all parameters grouped in an array. */
trait FunctionXXL {
def apply(xs: Array[Object]): Object
override def toString() = "<functionXXL>"
}
trait A { def foo: Int }
trait B { def bar: Int }
def baz(ab: A & B) = ab.foo + ab.bar
trait HasX { def x: Int }
case class A(x: Int) extends HasX
case class B(x: Int, y: Int) extends HasX
def getX(ab: A | B): Int = ab.x
Notes:
[1] - http://felixmulder.com/talks/deconstructing-dotty
Notes:
[1] - http://docs.scala-lang.org/sips/pending/trait-parameters.html
[2] - http://felixmulder.com/talks/deconstructing-dotty
trait Super {
def x: String
println(x)
}
class Foo extends Super {
val x = "hello"
}
new Foo // prints: null
trait Super(x: String) {
println(x)
}
class Foo extends Super("hello")
new Foo // prints: "hello"
Notes:
[1] - http://felixmulder.com/talks/the-new-scala-dev-exp/#/18
[2] - https://d-d.me/talks/scalaworld2015/#/62
[3] - http://docs.scala-lang.org/sips/pending/improved-lazy-val-initialization.html
[4] - https://github.com/scala/scala.github.com/pull/491
[5] - http://www.scala-lang.org/blog/2016/05/06/multiversal-equality.html
[6] - http://docs.scala-lang.org/sips/pending/42.type.html
[7] - https://github.com/scala/scala/pull/2848
Source:
https://s-media-cache-ak0.pinimg.com/564x/2c/4c/9b/2c4c9b3070518409dd3bb60866376e94.jpg
Notes:
[1] - https://github.com/lampepfl/dotty/issues/1970
enum Color { case Red, Green, Blue }
sealed abstract class Color extends scala.Enum
object Color {
private val $values = new scala.runtime.EnumValues[Color]
def enumValue: Map[Int, Color] = $values.fromInt
def enumValueNamed: Map[String, Color] = $values.fromName
def enumValues: Iterable[Color] = $values.values
def $new(tag: Int, name: String): Color = new Color {
def enumTag: Int = tag
override def toString: String = name
$values.register(this)
}
final case val Red: Color = $new(0, "Red")
final case val Green: Color = $new(1, "Green")
final case val Blue: Color = $new(2, "Blue")
}
Notes:
[1] - https://github.com/lampepfl/dotty/issues/1495
[2] - https://www.slideshare.net/Odersky/scala-days-nyc-2016
Notes:
[1] - https://www.slideshare.net/Odersky/scala-days-nyc-2016
[2] - https://www.reddit.com/r/scala/comments/2zff6d/effects_with_implicit_how_would_that_work/
[3] - https://github.com/lampepfl/dotty/issues/1347
[4] - https://www.scala-lang.org/blog/2016/12/07/implicit-function-types.html
Source:
https://pbs.twimg.com/media/Cg-zWsMWwAEJ-Zn.jpg:large
Notes:
[1] - https://www.slideshare.net/Odersky/from-dot-to-dotty
Source:
https://pbs.twimg.com/media/Cp6WqQdWAAEpvFt.jpg:large
Source:
https://github.com/lampepfl/dotty/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22
Source:
http://i.imgur.com/simMMnz.png