heathermiller / scala-pickling

Fast, customizable, boilerplate-free pickling support for Scala. MOVED TO http://github.com/scala/pickling
18 stars 1 forks source link

(Please note that this project has been moved to https://github.com/scala/pickling.)

scala-pickling 2.10.x

This project aims to turn a custom build of macro paradise that we used in Object-Oriented Pickler Combinators and an Extensible Generation Framework into a standalone library that targets 2.10.x (more precisely, the library will require 2.10.2+, since it's when implicit macros, a key ingredient to our technique, have been fixed).

Since we are making extensive use of quasiquotes, which cannot be added to 2.10.x due to binary and source compatibility restrictions, building (but not using!) scala-pickling-210x requires a custom build of scalac, as explained in comments to Build.scala. Please note that scala-pickling-210x can be used without any problems with vanilla scalac 2.10.2 - custom scalac is only necessary to build this library, not to compile against it or to link to it at runtime.

Known limitations:

  1. No support for @pickleable, since we cannot have macro annotations in 2.10.x.
  2. In the public API (and everywhere else), vanilla type tags are replaced with scala.pickling.FastTypeTag/scala.pickling.fastTypeTag.
  3. Picklers are generated directly at call sites, since we cannot have introduceTopLevel in 2.10.x.
  4. No runtime compilation, since it's not obvious how to package it without inducing a dependency on scala-compiler.jar.
  5. No classpath scans, because they don't work.