forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
104 lines (93 loc) · 5.26 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
title: Scala 3
layout: main
hasFrame: false
extraCSS:
- css/frontpage.css
---
<section class="page bg-red bg-dark">
<header>
<nav class="navbar navbar-expand-md navbar-dark">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarContent">
<i class="fas fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav ml-auto mr-0">
<li class="nav-item">
<a class="nav-link" href="#getting-started">
Try it now
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="blog/index.html">
Blog
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="docs/index.html">
Reference
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://docs.scala-lang.org/scala3/">
Docs
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/lampepfl/dotty">
<i class="fab fa-github"></i>
</a>
</li>
</ul>
</div>
</nav>
</header>
<div class="container">
<div class="scala-logo-container">
<img src="images/dotty-logo-white.svg" alt="logo" />
<div class="subtitle text-center">
<h1 id="dotty" class="above-byline">Scala 3</h1>
<p>A next-generation compiler for Scala</p>
<p>(scroll down for more info)</p>
</div>
</div>
</div>
</section>
<section class="page bg-blue bg-dark">
<div class="container">
<h1 id="getting-started">Try Scala 3</h1>
<p>There are multiple ways of <a href="https://docs.scala-lang.org/scala3/getting-started.html">getting started</a> with Scala 3.</p>
<ol>
<li>You can try Scala 3 in your browser with <a href="https://scastie.scala-lang.org/?target=dotty">Scastie</a>.</li>
<li>If you already have sbt installed, you can <a href="#getting-started-with-a-project">create a Scala 3 project</a> and sbt will take care of the rest.</li>
<li>You can install all necessary dependencies with <a href="https://get-coursier.io/">coursier</a> by running <code>cs setup</code>. You can also run <code>cs install scala3-compiler</code> or <code>cs install scala3-repl</code> to install command-line commands for the compiler and repl, correspondingly.</li>
<li>You can <a href="#install">manually install Scala 3</a> on your computer.</li>
</ol>
<h1 id="install">Install Scala 3</h1>
<p>If you are a <strong>Mac</strong> user, you can install Scala 3 with <a href="https://brew.sh/">brew</a>:</p>
<pre><code>brew install lampepfl/brew/dotty</code></pre>
<p>
If you are a <strong>Linux</strong> or <strong>Windows</strong> user, as a prerequisite you need a JDK 8 or later properly installed on your system. The environment variable <code>JAVA_HOME</code> should point to your Java installation.<br/>
For <strong>Windows</strong> users, we recommend using <a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10">the Windows subsystem for linux</a> or some other bash shell like <a href="https://gitforwindows.org/">git bash</a>.<br/>
Then download the <a href="https://github.com/lampepfl/dotty/releases">latest release</a>. Optionally add the path of the folder <code>bin/</code> to the system environment variable <code>PATH</code>.
</p>
<p>Now you can compile Scala source code:</p>
<pre><code>scalac hello.scala</code></pre>
<p>To start the REPL, run: <code>scala</code>.</p>
<h1 id="getting-started-with-a-project">Create a Scala 3 Project</h1>
<p>The fastest way to create a new project in Scala 3 is using <a href="http://www.scala-sbt.org/">sbt (1.1.4+)</a>.</p>
<p>Create a Scala 3 project:</p>
<pre><code>sbt new <a href="https://github.com/scala/scala3.g8">scala/scala3.g8</a></code></pre>
<p>Or a Scala 3 project that cross compiles with Scala 2:</p>
<pre><code>sbt new <a href="https://github.com/lampepfl/dotty-cross.g8">lampepfl/dotty-cross.g8</a></code></pre>
<p>For documentation see the <a href="https://github.com/lampepfl/dotty-example-project">Scala 3 Example Project</a>.</p>
<h1 id="documentation">Learn more about Scala 3</h1>
<p>You can find much more information about Scala 3 in ...</p>
<ul>
<li>... the <a href="https://docs.scala-lang.org/scala3/">Scala 3 documentation</a>,</li>
<li>... the <a href="https://docs.scala-lang.org/scala3/book/introduction.html">Scala 3 book</a>,</li>
<li>... the <a href="docs/index.html">Scala 3 reference docs</a>,</li>
<li>... the <a href="https://docs.scala-lang.org/scala3/guides.html">Scala 3 guides</a>.</li>
</ul>
</div>
</section>