Skip to content

Commit 6e46455

Browse files
committed
Update IDEA and talks
1 parent 7a3f880 commit 6e46455

File tree

12 files changed

+134
-44
lines changed

12 files changed

+134
-44
lines changed

docs/docs/contributing/eclipse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: doc-page
33
title: Building Dotty with Eclipse
44
---
55

6-
Build setup
6+
Setup
77
-----------
88

99
1. Run `sbt ;managedSources;eclipse`

docs/docs/contributing/getting-started.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,6 @@ layout: doc-page
33
title: Getting Started
44
---
55

6-
Talks on Dotty
7-
--------------
8-
- [Scala's Road Ahead](https://www.youtube.com/watch?v=GHzWqJKFCk4) by Martin Odersky [\[slides\]](http://www.slideshare.net/Odersky/scala-days-nyc-2016)
9-
- [Compilers are Databases](https://www.youtube.com/watch?v=WxyyJyB_Ssc) by Martin Odersky [\[slides\]](http://www.slideshare.net/Odersky/compilers-are-databases)
10-
- [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.
11-
- [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/#/)
12-
- [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/#/)
13-
- [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/)
14-
- [AutoSpecialization in Dotty](https://vimeo.com/165928176) by Dmitry Petrashko [\[slides\]](https://d-d.me/talks/flatmap2016/#/)
15-
- [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/)
16-
176
Requirements
187
------------
198
Make sure that you are using Java 8 or later, the output of `java -version`

docs/docs/contributing/intellij-idea.md

Lines changed: 44 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,54 @@ layout: doc-page
33
title: Building Dotty with Intellij IDEA
44
---
55

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

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

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

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

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

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

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

32-
[Scala plugin nightly]: https://confluence.jetbrains.com/display/SCA/Scala+Plugin+Nightly
33-
[IDEA 2016.1]: https://www.jetbrains.com/idea/nextversion/
34-
[IntelliJ Scala issue tracker]: https://youtrack.jetbrains.com/issues/SCL
35-
[IntelliJ Scala gitter]: https://gitter.im/JetBrains/intellij-scala
27+
![](../../images/idea/idea-sbt.png "Select modules to import")
28+
29+
Running/Debugging
30+
-------
31+
32+
To run the compiler you can do it either as an sbt command or via debugging the compiler.
33+
For the first option you can fire up sbt from the `Terminal` window of IDEA or you can do it externally.
34+
For example, to run a test you can write with or without flags:
35+
36+
```shell
37+
dotc tests/pos/Arrays.scala
38+
```
39+
40+
If you are interested in debugging the compiler you can enable the necessary agent on the JVM and this
41+
is done in two steps. For the first step you need to pass the
42+
necessary flag to the running VM. For convenience, this is already in comments on the `Build.scala` file under project.
43+
Uncomment the line and reload the project file with the `reload` command on sbt.
44+
Now, each time you run `dotc` the compiler listens at the designated address and waits the agent to connect.
45+
For, the second step you need to create a configuration for Debug through IDEA:
46+
47+
> Run > Edit Configurations > Add New Configuration > (select) Remote
48+
49+
![](../../images/idea/idea-debug.png "Create a Debug Configuration")
50+
51+
Now every time you run `dotc` you can set your breakpoints and hit the `Debug dotty-debug` button (since we used that name for
52+
the sample configuration above). The default data on the configuration match the enabled agent on the VM so, probably,
53+
you will not need to change anything else.
54+
55+
To contribute to dotty please follow the [Dotty Developer Guidelines](https://github.com/lampepfl/dotty/blob/master/CONTRIBUTING.md).
56+

docs/docs/contributing/workflow.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ Additional logging information can be obtained by changes some `noPrinter` to
4444
`new Printer` in `compiler/src/dotty/tools/dotc/config/Printers.scala`. This enables the
4545
`subtyping.println("")` and `ctx.traceIndented("", subtyping)` style logging.
4646

47-
## Running tests ##
48-
49-
```bash
50-
$ sbt
51-
> partest --show-diff --verbose
52-
```
53-
5447
## Running single tests ##
5548
To test a specific test tests/x/y.scala (for example tests/pos/t210.scala):
5649

docs/docs/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ Index
3131
scheme
3232
- [Periods](internals/periods.md)
3333
- [Type System](internals/type-system.md)
34+
* Resources
35+
- [Talks](resources/talks.md)
36+

docs/docs/resources/talks.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
layout: doc-page
3+
title: Talks
4+
---
5+
6+
Talks on Dotty
7+
--------------
8+
- (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)
9+
- (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)
10+
11+
Deep Dive with Dotty
12+
--------------------
13+
- (Mar 21, 2017) [Dotty Internals 1: Trees & Symbols](https://www.youtube.com/watch?v=yYd-zuDd3S8) by Dmitry Petrashko.
14+
This is a recorded meeting between EPFL and Waterloo, where we introduce first notions inside Dotty: Trees and Symbols.
15+
16+
- (Typelevel Summit Oslo, May 2016) [Dotty and types: the story so far](https://www.youtube.com/watch?v=YIQjfCKDR5A) by
17+
Guillaume Martres [\[slides\]](http://guillaume.martres.me/talks/typelevel-summit-oslo/).
18+
Guillaume focused on some of the practical improvements to the type system that Dotty makes, like the new type parameter
19+
inference algorithm that reasone about the type safety of more situations.
20+
21+
- (flatMap(Oslo) 2016) [AutoSpecialization in Dotty](https://vimeo.com/165928176) by Dmitry Petrashko
22+
[\[slides\]](https://d-d.me/talks/flatmap2016/#/). The Dotty Linker analyses your program and its dependencies to
23+
apply a new specialization scheme. It builds on our experience from Specialization, Miniboxing and the Valhalla Project,
24+
and drastically reduces the size of the emitted bytecode. And, best of all, it's always enabled, happens behind the
25+
scenes without annotations, and results in speedups in excess of 20x. Additionally, it "just works" on Scala collections.
26+
27+
- (ScalaSphere 2016) [Hacking on Dotty: A live demo](https://www.youtube.com/watch?v=0OOYGeZLHs4) by Guillaume Martres
28+
[\[slides\]](http://guillaume.martres.me/talks/dotty-live-demo/) Guillaume hacks on Dotty: a live demo during which he
29+
creates a simple compiler phase to trace method calls at run-time.
30+
31+
- (Scala By the Bay 2016) [Dotty: what is it and how it works](https://www.youtube.com/watch?v=wCFbYu7xEJA) by Guillaume
32+
Martres [\[slides\]](http://guillaume.martres.me/talks/dotty-tutorial/#/) Guillaume provides a high-level view of the
33+
compilation-pipeline of Dotty.
34+
35+
- (Scala World 2015) [Dotty: Exploring the future of Scala](https://www.youtube.com/watch?v=aftdOFuVU1o)
36+
Dmitry Petrashko [\[slides\]](https://d-d.me/scalaworld2015/#/) covers many of the new features that Dotty brings on the
37+
table such as Intersection and Union types, improved lazy val initialization and more.
38+
Dmitry also covers dotty internals and in particular the high-level of contextual abstractions of Dotty. You will get to
39+
become familiar with many core concepts such as `Denotations`, their evolution through (compilation) time, their
40+
transformations and more.
41+
42+
- (ScalaDays 2015, Amsterdam) [Making your Scala applications smaller and faster with the Dotty linker](https://www.youtube.com/watch?v=xCeI1ArdXM4)
43+
by Dmitry Petrashko [\[slides\]](https://d-d.me/scaladays2015/#/). Dmitry introduces the call-graph analysis algorithm
44+
that Dotty implements and the performance benefits we can get in terms of number of methods, bytecode size, JVM code size
45+
and the number of objects allocated in the end.

docs/docs/usage/intellij-idea.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
layout: doc-page
3+
title: Building Dotty with Intellij IDEA
4+
---
5+
6+
Dotty compiler support is available in the [Scala plugin nightly] starting from 2.2.39.
7+
You need to install [IDEA 2016.1] to try it.
8+
9+
## To create a new project with Dotty
10+
11+
1. Open New Project dialog and select `Scala` > `Dotty`
12+
2. Proceed as usual and don't forget to create or select Dotty SDK.
13+
14+
## To compile an existing Scala project with Dotty
15+
16+
1. Create a new Dotty SDK:
17+
`Project Structure` > `Global libraries` > `New Global Library` > `Dotty SDK`
18+
2. Replace Scala SDK with Dotty SDK in:
19+
`Project Structure` > `Modules` > `Dependencies`
20+
21+
Java 1.8 should be used as the Project/Module SDK. You also need to enable the
22+
Scala Compile Server to use Dotty compiler.
23+
24+
## Notes
25+
* Dotty support is experimental, many features including code highlighting and
26+
worksheet are not ready yet.
27+
* You can download the latest version of Dotty without creating a new Dotty SDK
28+
with the `Update snapshot` button in the Dotty SDK library settings.
29+
* Please report any problems to the [IntelliJ Scala issue tracker] or write
30+
to the [IntelliJ Scala gitter]
31+
32+
[Scala plugin nightly]: https://confluence.jetbrains.com/display/SCA/Scala+Plugin+Nightly
33+
[IDEA 2016.1]: https://www.jetbrains.com/idea/nextversion/
34+
[IntelliJ Scala issue tracker]: https://youtrack.jetbrains.com/issues/SCL
35+
[IntelliJ Scala gitter]: https://gitter.im/JetBrains/intellij-scala

docs/images/idea/idea-debug.png

119 KB
Loading

docs/images/idea/idea-import.png

52.8 KB
Loading

docs/images/idea/idea-sbt.png

100 KB
Loading

0 commit comments

Comments
 (0)