aboutsummaryrefslogtreecommitdiff
path: root/docs/docs/usage
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-10-07 14:35:35 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-10-07 14:35:35 +0200
commit2ffc7cfaf05217394708d2c00ab85ab07663d03c (patch)
tree3a239da59946fcb2d6c7b7becd499c7b61e12007 /docs/docs/usage
parenta1d8e04af89d4b1ffc0f1c4efe587b8882461d6e (diff)
downloaddotty-2ffc7cfaf05217394708d2c00ab85ab07663d03c.tar.gz
dotty-2ffc7cfaf05217394708d2c00ab85ab07663d03c.tar.bz2
dotty-2ffc7cfaf05217394708d2c00ab85ab07663d03c.zip
Migrate dotty.epfl.ch to static site in repository
Diffstat (limited to 'docs/docs/usage')
-rw-r--r--docs/docs/usage/migrating.md46
-rw-r--r--docs/docs/usage/sbt-projects.md14
2 files changed, 60 insertions, 0 deletions
diff --git a/docs/docs/usage/migrating.md b/docs/docs/usage/migrating.md
new file mode 100644
index 000000000..d835aeea6
--- /dev/null
+++ b/docs/docs/usage/migrating.md
@@ -0,0 +1,46 @@
+---
+layout: default
+title: "Migrating to Dotty"
+---
+
+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/docs/usage/sbt-projects.md b/docs/docs/usage/sbt-projects.md
new file mode 100644
index 000000000..79418850d
--- /dev/null
+++ b/docs/docs/usage/sbt-projects.md
@@ -0,0 +1,14 @@
+---
+layout: default
+title: "sbt"
+---
+
+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