orc-lang/swivel

Update swivel to only use features that will be available in Scala 3

Opened this issue · 0 comments

This is a long term tracking issue for changes needed to support Scala 3 when it comes out (probably not before 2020). The macro system in Scala 3 will likely eliminate all whitebox macros (including the whitebox annotation macros used in swival): https://contributors.scala-lang.org/t/what-kinds-of-macros-should-scala-3-support/1850

Scala 3 is expected to provide language support for type class derivation and that may well be enough to support swivel's use case. It might however break the API, but I don't think that's a problem for the Orc use case and as of yet there are no other users.

Type class derivation should allow swivel to provide type classes implementing Zippers and transformations. Zippers will be the harder part. It's not clear how to generate the Zippers with the appropriate fields based on the AST node class.

Another option would be to drop support for using swivel ASTs inside the same project they are defined. In that case we could use Scala 3 macros and live with their limitation of not allowing members added by macros to be visible to code in the same compilation unit. This would force a refactor to orc-lang/orc but that might be good as refactoring Orc would also enable clean dependencies between more fine grained projects: core ASTs (ext and OIL), core compiler, optimizing ASTs (Orctimizer and Porc), optimizers, shared runtime (Site API, fundimental sites, etc), token runtime, and PorcE runtime (and also OrcEclipse, etc). That being said it might be a lot of work.