Skip to content

Migrating Flix Compiler to Scala 3

Jakob Schneider edited this page Apr 6, 2023 · 5 revisions

I think the correct way to do this is to build everything via Gradle.

Resources

Progress

Running

scalac -Xsource:3 -sourcepath main/src/ -classpath lib/ main/src/ca/uwaterloo/flix/Main.scala

yields errors as it does not know where to find the online dependencies (from Maven central).

Maybe this can be fixed by adding the -Xsource:3 flag to the compiler in build.gradle or downloading the dependencies / jars manually from Maven and including it in the lib/ directory.

When this works, the code has to be written to have zero incompatibilities, after which we should invoke the Scala 3 compiler (possibly also with some more library flags etc.):

scalac -rewrite -source:3.0-migration main/src/ca/uwaterloo/flix/Main.scala

Maybe this last part can also be invoked from Gradle.

Questions

What do we do with Scala reflect and the parser library that uses macros? Maybe replace with scala-parser-combinators

Clone this wiki locally