aboutsummaryrefslogtreecommitdiff
path: root/docs/usage
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-10-04 12:58:10 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-10-06 16:39:39 +0200
commit4fa7c71af100d45bce37c2cce0890c1d8365dbc4 (patch)
tree18bfbe1a5bd3561c1094d10fd283f25c83cc2a37 /docs/usage
parenteaa7f1730aa9da0aa7e4b2c4e86fbcc3acf26131 (diff)
downloaddotty-4fa7c71af100d45bce37c2cce0890c1d8365dbc4.tar.gz
dotty-4fa7c71af100d45bce37c2cce0890c1d8365dbc4.tar.bz2
dotty-4fa7c71af100d45bce37c2cce0890c1d8365dbc4.zip
Move wiki into docs dir
Diffstat (limited to 'docs/usage')
-rw-r--r--docs/usage/migrating.md41
-rw-r--r--docs/usage/sbt-projects.md9
2 files changed, 50 insertions, 0 deletions
diff --git a/docs/usage/migrating.md b/docs/usage/migrating.md
new file mode 100644
index 000000000..7852058d1
--- /dev/null
+++ b/docs/usage/migrating.md
@@ -0,0 +1,41 @@
+Migrating to Dotty
+==================
+
+### Minor tweaks ###
+ * `sym.linkedClassOfClass` => `sym.linkedClass`
+ * `definitions` => `ctx.definitions`
+
+### Member Lookup ###
+`tpe.member(name)` and `tpe.decl(name)` now return a `Denotation`, not a
+`Symbol`. If no definition is found they return `NoDenotation` (instead of
+`NoSymbol`).
+
+### Symbol Properties ###
+Most `sym.isProperty` methods don't exist in dotc, test for flags instead. See
+[dotc vs scalac: Trees, Symbols, Types & Denotations]
+
+### Logging, Error Reporting, Failures ###
+
+There are various kinds of logging:
+ * Errors, warnings, etc: `ctx.inform`, `ctx.warning`, `ctx.error`, ...
+ * Log messages displayed under `-Ylog:phase`: `log(msg)` in scalac =>
+ `ctx.log(msg)` in dotc
+ * Debug-Log messages displayed under `-Ydebug -Ylog:<phase>`: `debuglog(msg)`
+ in scalac => `ctx.debuglog(msg)` in dotc
+ * Assertions: `assert(invariant)`
+ * Fatal errors: `abort(msg)` in scalac => `throw new
+ dotty.tools.dotc.FatalError(msg)` in dotc
+
+
+#### During development / debugging ####
+Instead of `Predef.println`, use `dotc.config.Printers.somePrinter.println`
+[Printers.scala]. Printers can be easily added, enabled and disabled
+without changing command line arguments.
+
+```scala
+val default: Printer = new Printer // new Printer => print
+val core: Printer = noPrinter // noPrinter => shut up
+```
+
+[dotc vs scalac: Trees, Symbols, Types & Denotations]: https://github.com/lampepfl/dotty/wiki/dotc-vs-scalac:-Trees,-Symbols,-Types-&-Denotations
+[Printers.scala]: https://github.com/lampepfl/dotty/blob/master/src/dotty/tools/dotc/config/Printers.scala
diff --git a/docs/usage/sbt-projects.md b/docs/usage/sbt-projects.md
new file mode 100644
index 000000000..89989bb6b
--- /dev/null
+++ b/docs/usage/sbt-projects.md
@@ -0,0 +1,9 @@
+Using Dotty with sbt
+====================
+It is now possible to use Dotty with sbt thanks to the dotty-bridge project.
+There are two alternatives in how to create an sbt project that uses dotty:
+
+* [dotty-example-project](https://github.com/smarter/dotty-example-project)
+ for a simple sbt project that compiles code with Dotty
+* [sbt-dotty](https://github.com/felixmulder/sbt-dotty) an sbt plugin that
+ takes care of all dependencies and settings needed to get a Dotty sbt project