Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Dotty REPL initial version #1082
An initial version of a REPL for Dotty. Basic functionality works.
(when started under scala, it does not find an Execution context. Hopefully somebody else is better than me at figuring this out).
A comment below explains how the REPL code was derived, and contains a list of TODOs with suggestions to improve it. I am very much hoping for the contributions of others to move this forward.
Explanations, copied from comment on
This REPL was adapted from an old (2008-ish) version of the Scala
The reason this version was picked instead of a more current one is that
There are a number of TODOs:
@odersky To launch repl with scala I used:
scala -J-Xbootclasspath/a:\ [path]/.ivy2/cache/me.d-d/scala-compiler/jars/scala-compiler-2.11.5-[version-info].jar:\ [path-to-dotty]/dotty/bin/../target/scala-2.11/dotty_2.11-0.1-SNAPSHOT.jar \ dotty.tools.dotc.repl.Main
Fork of scala compiler from me.d-d and dotty are added to bootclasspath.
Adding tab completion support to the REPL will be a good way to start experimenting with ways to make the typechecker IDE friendly, without the waiting for integration into Eclipse. This will be handy to validate that the parser and typechecker are fault tolerant and don't discard trees that correspond to the textual sources.
Try to avoid splicing user-written code into the synthetic wrappers as text. Ideally you want to be able to typecheck the expression as entered after programattically setting up a typechecker context that includes the imports of previously defined symbols and with previously entered imports. Once that is typechecked, it could be spliced into the synthetic wrapper via AST manipulation. This avoids awkward problems of quoting / escaping, and could probably avoid the need to have the deeply nested