Skip to content

Commit 2f87c18

Browse files
committed
Add Getting Started Page for Users
1 parent 5192eac commit 2f87c18

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed

docs/docs/usage/getting-started.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
layout: doc-page
3+
title: Getting Started: Users
4+
---
5+
6+
7+
8+
Basics
9+
------------
10+
Make sure that you are using Java 8 or later. The output of `java -version`
11+
should contain `1.8`.
12+
13+
14+
Getting Dotty
15+
--------------
16+
```bash
17+
$ git clone --recursive https://github.com/lampepfl/dotty.git
18+
$ cd dotty
19+
$ sbt managedSources # Needed for IDE import to succeed
20+
```
21+
22+
Dotty provides a standard sbt build: compiling, running and starting a repl can
23+
all be done from within sbt:
24+
25+
```bash
26+
$ sbt
27+
> dotc tests/pos/HelloWorld.scala
28+
> dotr HelloWorld
29+
hello world
30+
```
31+
32+
Try Dotty
33+
----------
34+
Try it in your browser with [Scastie](https://scastie.scala-lang.org/?target=dotty)
35+
36+
37+
Create a Dotty Project
38+
-----------------------
39+
The fastest way to create a new project in dotty is using [sbt (0.13.5+)](http://www.scala-sbt.org/)
40+
41+
Create a dotty project:
42+
```bash
43+
$ sbt new lampepfl/dotty.g8
44+
```
45+
46+
Or a Dotty project that cross compiles with Scala 2:
47+
```bash
48+
$ sbt new lampepfl/dotty-cross.g8
49+
```
50+
51+
For an example project, see the [Dotty Example Proejct](https://github.com/lampepfl/dotty-example-project)
52+
53+
54+
Bash Scripts
55+
-------------
56+
Assuming that you have cloned the Dotty repo locally, append the following line on your `.bash_profile`:
57+
58+
```shell
59+
$ export PATH=$HOME/dotty/bin:$PATH
60+
```
61+
62+
and you will be able to run the corresponding commands directly from your console:
63+
64+
```shell
65+
# Compile code using Dotty
66+
$ dotc tests/pos/HelloWorld.scala
67+
68+
# Run it with the proper classpath
69+
$ dotr HelloWorld
70+
```
71+
72+
73+
Starting a REPL
74+
----------------
75+
```bash
76+
$ sbt
77+
> repl
78+
Welcome to Scala.next (pre-alpha) (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_101).
79+
Type in expressions to have them evaluated.
80+
Type :help for more information.
81+
scala>
82+
```
83+
84+
or via bash:
85+
86+
```bash
87+
$ dotr
88+
```
89+
90+
91+
Generating Documentation
92+
-------------------------
93+
To generate this page and other static page docs, run
94+
```bash
95+
$ sbt
96+
> genDocs
97+
```

0 commit comments

Comments
 (0)