Skip to content

Fix #2180: Docs update #2422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 15, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/contributing/eclipse.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: doc-page
title: Building Dotty with Eclipse
---

Build setup
Setup
-----------

1. Run `sbt ;managedSources;eclipse`
Expand Down
11 changes: 0 additions & 11 deletions docs/docs/contributing/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@ layout: doc-page
title: Getting Started
---

Talks on Dotty
--------------
- [Scala's Road Ahead](https://www.youtube.com/watch?v=GHzWqJKFCk4) by Martin Odersky [\[slides\]](http://www.slideshare.net/Odersky/scala-days-nyc-2016)
- [Compilers are Databases](https://www.youtube.com/watch?v=WxyyJyB_Ssc) by Martin Odersky [\[slides\]](http://www.slideshare.net/Odersky/compilers-are-databases)
- [Dotty: Exploring the future of Scala](https://www.youtube.com/watch?v=aftdOFuVU1o) by Dmitry Petrashko [\[slides\]](https://d-d.me/scalaworld2015/#/). This talk includes details about the design of mini-phases and denotations.
- [Making your Scala applications smaller and faster with the Dotty linker](https://www.youtube.com/watch?v=xCeI1ArdXM4) by Dmitry Petrashko [\[slides\]](https://d-d.me/scaladays2015/#/)
- [Dotty: what is it and how it works](https://www.youtube.com/watch?v=wCFbYu7xEJA) by Guillaume Martres [\[slides\]](http://guillaume.martres.me/talks/dotty-tutorial/#/)
- [Hacking on Dotty: A live demo](https://www.youtube.com/watch?v=0OOYGeZLHs4) by Guillaume Martres [\[slides\]](http://guillaume.martres.me/talks/dotty-live-demo/)
- [AutoSpecialization in Dotty](https://vimeo.com/165928176) by Dmitry Petrashko [\[slides\]](https://d-d.me/talks/flatmap2016/#/)
- [Dotty and types: the story so far](https://www.youtube.com/watch?v=YIQjfCKDR5A) by Guillaume Martres [\[slides\]](http://guillaume.martres.me/talks/typelevel-summit-oslo/)

Requirements
------------
Make sure that you are using Java 8 or later, the output of `java -version`
Expand Down
67 changes: 44 additions & 23 deletions docs/docs/contributing/intellij-idea.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,54 @@ layout: doc-page
title: Building Dotty with Intellij IDEA
---

Dotty compiler support is available in the [Scala plugin nightly] starting
from 2.2.39. You need to install [IDEA 2016.1] to try it.
Setup
-----

## To create a new project with Dotty
You can setup IntelliJ [IDEA >= 2016.1](https://www.jetbrains.com/idea/nextversion) to contribute to Dotty.

1. Open New Project dialog and select `Scala` > `Dotty`
2. Proceed as usual and don't forget to create or select Dotty SDK.
Assuming you have cloned dotty's repository from Github you can now proceed with importing it to IDEA by selecting the
corresponding option from the startup menu. Navigate on the corresponding directory and select it. Next, you need
to select the model of the import and as the screenshot shows, select SBT.

## To compile an existing Scala project with Dotty
![](../../images/idea/idea-import.png "Import Dotty in IDEA")

1. Create a new Dotty SDK:
`Project Structure` > `Global libraries` > `New Global Library` > `Dotty SDK`
2. Replace Scala SDK with Dotty SDK in:
`Project Structure` > `Modules` > `Dependencies`
Next, you select the version of the JDK that this project relies on and verify that you have selected 1.8 (assuming
its installed on your local machine). Otherwise, specify it by pressing *New*.

Java 1.8 should be used as the Project/Module SDK. You also need to enable the
Scala Compile Server to use Dotty compiler.
![](../../images/idea/idea-sdk.png "Select the JDK")

## Notes
* Dotty support is experimental, many features including code highlighting and
worksheet are not ready yet.
* You can download the latest version of Dotty without creating a new Dotty SDK
with the `Update snapshot` button in the Dotty SDK library settings.
* Please report any problems to the [IntelliJ Scala issue tracker] or write
to the [IntelliJ Scala gitter]
On the final window we must select which modules we can import. Here, we are presented with the full list of SBT projects
that are defined in Dotty. You can either select all (expect performance degradation by IDEA if you select all) or
select only the `dotty` module. In order to do that, unselect all modules and select on `dotty`. IDEA, then, automatically
selects all the necessary dependencies and you press OK.

[Scala plugin nightly]: https://confluence.jetbrains.com/display/SCA/Scala+Plugin+Nightly
[IDEA 2016.1]: https://www.jetbrains.com/idea/nextversion/
[IntelliJ Scala issue tracker]: https://youtrack.jetbrains.com/issues/SCL
[IntelliJ Scala gitter]: https://gitter.im/JetBrains/intellij-scala
![](../../images/idea/idea-sbt.png "Select modules to import")

Running/Debugging
-------

To run the compiler you can do it either as an sbt command or via debugging the compiler.
For the first option you can fire up sbt from the `Terminal` window of IDEA or you can do it externally.
For example, to run a test you can write with or without flags:

```shell
dotc tests/pos/Arrays.scala
```

If you are interested in debugging the compiler you can enable the necessary agent on the JVM and this
is done in two steps. For the first step you need to pass the
necessary flag to the running VM. For convenience, this is already in comments on the `Build.scala` file under project.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe explain in more details what line to uncomment?

Uncomment the line and reload the project file with the `reload` command on sbt.
Now, each time you run `dotc` the compiler listens at the designated address and waits the agent to connect.
For, the second step you need to create a configuration for Debug through IDEA:

> Run > Edit Configurations > Add New Configuration > (select) Remote

![](../../images/idea/idea-debug.png "Create a Debug Configuration")

Now every time you run `dotc` you can set your breakpoints and hit the `Debug dotty-debug` button (since we used that name for
the sample configuration above). The default data on the configuration match the enabled agent on the VM so, probably,
you will not need to change anything else.

To contribute to dotty please follow the [Dotty Developer Guidelines](https://github.com/lampepfl/dotty/blob/master/CONTRIBUTING.md).

7 changes: 0 additions & 7 deletions docs/docs/contributing/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ Additional logging information can be obtained by changes some `noPrinter` to
`new Printer` in `compiler/src/dotty/tools/dotc/config/Printers.scala`. This enables the
`subtyping.println("")` and `ctx.traceIndented("", subtyping)` style logging.

## Running tests ##

```bash
$ sbt
> partest --show-diff --verbose
```

## Running single tests ##
To test a specific test tests/x/y.scala (for example tests/pos/t210.scala):

Expand Down
3 changes: 3 additions & 0 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ Index
scheme
- [Periods](internals/periods.md)
- [Type System](internals/type-system.md)
* Resources
- [Talks](resources/talks.md)

45 changes: 45 additions & 0 deletions docs/docs/resources/talks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
layout: doc-page
title: Talks
---

Talks on Dotty
--------------
- (ScalaDays 2016, Berlin) [Scala's Road Ahead](https://www.youtube.com/watch?v=GHzWqJKFCk4) by Martin Odersky [\[slides\]](http://www.slideshare.net/Odersky/scala-days-nyc-2016)
- (JVMLS 2015) [Compilers are Databases](https://www.youtube.com/watch?v=WxyyJyB_Ssc) by Martin Odersky [\[slides\]](http://www.slideshare.net/Odersky/compilers-are-databases)

Deep Dive with Dotty
--------------------
- (Mar 21, 2017) [Dotty Internals 1: Trees & Symbols](https://www.youtube.com/watch?v=yYd-zuDd3S8) by Dmitry Petrashko.
This is a recorded meeting between EPFL and Waterloo, where we introduce first notions inside Dotty: Trees and Symbols.

- (Typelevel Summit Oslo, May 2016) [Dotty and types: the story so far](https://www.youtube.com/watch?v=YIQjfCKDR5A) by
Guillaume Martres [\[slides\]](http://guillaume.martres.me/talks/typelevel-summit-oslo/).
Guillaume focused on some of the practical improvements to the type system that Dotty makes, like the new type parameter
inference algorithm that reasone about the type safety of more situations.

- (flatMap(Oslo) 2016) [AutoSpecialization in Dotty](https://vimeo.com/165928176) by Dmitry Petrashko
[\[slides\]](https://d-d.me/talks/flatmap2016/#/). The Dotty Linker analyses your program and its dependencies to
apply a new specialization scheme. It builds on our experience from Specialization, Miniboxing and the Valhalla Project,
and drastically reduces the size of the emitted bytecode. And, best of all, it's always enabled, happens behind the
scenes without annotations, and results in speedups in excess of 20x. Additionally, it "just works" on Scala collections.

- (ScalaSphere 2016) [Hacking on Dotty: A live demo](https://www.youtube.com/watch?v=0OOYGeZLHs4) by Guillaume Martres
[\[slides\]](http://guillaume.martres.me/talks/dotty-live-demo/) Guillaume hacks on Dotty: a live demo during which he
creates a simple compiler phase to trace method calls at run-time.

- (Scala By the Bay 2016) [Dotty: what is it and how it works](https://www.youtube.com/watch?v=wCFbYu7xEJA) by Guillaume
Martres [\[slides\]](http://guillaume.martres.me/talks/dotty-tutorial/#/) Guillaume provides a high-level view of the
compilation-pipeline of Dotty.

- (Scala World 2015) [Dotty: Exploring the future of Scala](https://www.youtube.com/watch?v=aftdOFuVU1o)
Dmitry Petrashko [\[slides\]](https://d-d.me/scalaworld2015/#/) covers many of the new features that Dotty brings on the
table such as Intersection and Union types, improved lazy val initialization and more.
Dmitry also covers dotty internals and in particular the high-level of contextual abstractions of Dotty. You will get to
become familiar with many core concepts such as `Denotations`, their evolution through (compilation) time, their
transformations and more.

- (ScalaDays 2015, Amsterdam) [Making your Scala applications smaller and faster with the Dotty linker](https://www.youtube.com/watch?v=xCeI1ArdXM4)
by Dmitry Petrashko [\[slides\]](https://d-d.me/scaladays2015/#/). Dmitry introduces the call-graph analysis algorithm
that Dotty implements and the performance benefits we can get in terms of number of methods, bytecode size, JVM code size
and the number of objects allocated in the end.
35 changes: 35 additions & 0 deletions docs/docs/usage/intellij-idea.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
layout: doc-page
title: Building Dotty with Intellij IDEA
---

Dotty compiler support is available in the [Scala plugin nightly] starting from 2.2.39.
You need to install [IDEA 2016.1] to try it.

## To create a new project with Dotty

1. Open New Project dialog and select `Scala` > `Dotty`
2. Proceed as usual and don't forget to create or select Dotty SDK.

## To compile an existing Scala project with Dotty

1. Create a new Dotty SDK:
`Project Structure` > `Global libraries` > `New Global Library` > `Dotty SDK`
2. Replace Scala SDK with Dotty SDK in:
`Project Structure` > `Modules` > `Dependencies`

Java 1.8 should be used as the Project/Module SDK. You also need to enable the
Scala Compile Server to use Dotty compiler.

## Notes
* Dotty support is experimental, many features including code highlighting and
worksheet are not ready yet.
* You can download the latest version of Dotty without creating a new Dotty SDK
with the `Update snapshot` button in the Dotty SDK library settings.
* Please report any problems to the [IntelliJ Scala issue tracker] or write
to the [IntelliJ Scala gitter]

[Scala plugin nightly]: https://confluence.jetbrains.com/display/SCA/Scala+Plugin+Nightly
[IDEA 2016.1]: https://www.jetbrains.com/idea/nextversion/
[IntelliJ Scala issue tracker]: https://youtrack.jetbrains.com/issues/SCL
[IntelliJ Scala gitter]: https://gitter.im/JetBrains/intellij-scala
Binary file added docs/images/idea/idea-debug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/idea/idea-import.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/idea/idea-sbt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/idea/idea-sdk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions docs/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ sidebar:
url: docs/usage/migrating.html
- title: Contributing
subsection:
- title: Eclipse
url: docs/contributing/eclipse.html
- title: Getting Started
url: docs/contributing/getting-started.html
- title: IntelliJ IDEA
url: docs/contributing/intellij-idea.html
- title: Eclipse
url: docs/contributing/eclipse.html
- title: Workflow
url: docs/contributing/workflow.html
- title: Testing
Expand Down Expand Up @@ -49,3 +49,7 @@ sidebar:
url: docs/internals/syntax.html
- title: Type System
url: docs/internals/type-system.html
- title: Resources
subsection:
- title: Talks
url: docs/resources/talks.html