Skip to content

Instantly share code, notes, and snippets.

@SethTisue SethTisue/

Last active Aug 29, 2015
What would you like to do?
Scalawags #14

Scalawags #14: Shapelessless

in which Shapeless is only threatened to be discussed.

music and dancing (0:00)

Scala 2.10.4 and 2.11.0-RC3, Java 8 (2:30)

  • Josh & co have 900,000 lines of open source Scala code compiling on 2.11.0-RC3
  • does 2.10.4 support Java 8? as far as we know. (Daniel had bytecode validation problems with 2.10.1)
  • scalac can't handle Java 8 sources yet
  • have we tried Java 8 language features? no, that would require us to use Java
  • no more PermGen! (= thrash and fail later, instead of fail early?) the world needs more PermGen.
  • Seth likes using Nashorn to test his CoffeeScript and JavaScript code without leaving the Scala ecosystem
  • Josh says the Play framework guys are hooking up different JS engines (including Nashorn and V8) to sbt

sbt 0.13.2-RC1, 0.13.5 (16:35)

  • name-hashing (Grzegorz Kossakowski) in 0.13.2 should “dramatically improve” performance on incremental compilation, says Josh
  • except for Daniel
  • sbt 0.13.5 (previewing sbt 1.0) will fragment sbt so everything will be a plugin
  • binary compatible with existing 0.13 plugins and projects

Northeast Scala Symposium 2014 (20:50)

  • only Dick didn’t go but next year will be at Dick’s house and we’ll drink all his wine
  • love from Daniel for nescala audiences willing to follow him into crazyland

Free monads & scalaz-stream (25:40)

  • Daniel’s nescala day 2 conversation with Lars H, Paul C, Rúnar B, Brian M, Tim P, et al debating the future of Scalaz’s IO monad
  • IO being replaced with Task. IO falls out as a special case
  • trampolined computations are suspendable and resumable
  • not just for avoiding stack overflow
  • comparison with Future (Task doesn't start running right away)
  • free generalizes trampolining
  • build up computations as graphs to be evaluated later. your program writes a program
  • tasks can run sequentially or in parallel
  • in what sense is this nondeterminism?
  • (tpolecat on IRC: “parallel applicative composition is nondeterministic if your actions are side-effecting, which they are in IO. that's the whole point”)
  • Dick gave a talk at Bay Area Scala about scalaz-stream
  • He worked on a project (with Rúnar et al) supporting bioinformaticians
  • Providing them with a high-level API similar to the Scala collections
  • Hit a bug where some tasks were evaluated too eagerly during cleanup and fallback
  • Difficulties debugging code where execution is dispersed across multiple threads
  • Except Josh, he never has any trouble
  • Josh: Iulian Dragos’s work on debugging in an asychronous world
  • Daniel’s pie-in-the-sky ideal debugger

Scalive & REPLs (49:10)

  • Scalive — attach a Scala REPL to any already-running JVM “without any prior setup”
  • by Ngoc Dao,
  • discussion on tech details
  • limitation re: classloaders
  • Dick sheds a tear for Smalltalk
  • Seth sheds a tear for Macintosh Common Lisp
  • Daniel hearts JRebel
  • Seth: Scala REPL as tool for exploring code fails if anything in your code isn’t public
  • if the REPL could switch packages, that would help
  • or even switch into a specific class?
  • Josh: you can do setAccessible(true)
  • mpilquist on IRC: “would be straightforward to give access to private methods using Dynamic that sets accessible and invokes reflectively”)
  • “public by default” and “binary compatibility” are enemies
  • Josh: don't make access impossible, just make it feel evil
  • making everything public can restrict freedom for an API to change
  • on sbt Josh uses private[sbt] to mark code that may change. people are free to do package sbt to get in there.

Mythbusters: Scalacheck revisited (1:07:05)

  • Dick is unrepentant about ScalaCheck
  • Seth invites ScalaCheck lovers to publish their experience reports on the blog
  • (Lars H said at NE Scala that their blog seeks case studies and experience reports from users of typelevel libraries)
  • Daniel: ScalaCheck is great for testing a codec (serialization/deserialization)
  • Josh runs a miiiiiiiiillion ScalaCheck cases
  • shhhhh, the partiality monad is the same as the trampoline monad, but don't tell anyone Daniel said so
  • Daniel: don't just generate random cases from nothing; randomly fuzz your handwritten cases
  • Josh (& Daniel): if ScalaCheck regression testing is too slow, segregate it from your fast unit tests. save it for PR validation

The end (1:17:00)

  • let's talk about Shapeless next time?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.