|
1 | 1 | ---
|
2 |
| -title: Dotty |
3 |
| -layout: base |
| 2 | +title: Scala 3 |
| 3 | +layout: main |
| 4 | +hasFrame: false |
4 | 5 | extraCSS:
|
5 | 6 | - css/frontpage.css
|
6 | 7 | ---
|
7 |
| -{% include logo-page.html %} |
8 |
| -{% include getting-started.html %} |
| 8 | + |
| 9 | +<section class="page bg-red bg-dark"> |
| 10 | + <header> |
| 11 | + <nav class="navbar navbar-expand-md navbar-dark"> |
| 12 | + <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarContent"> |
| 13 | + <i class="fas fa-bars"></i> |
| 14 | + </button> |
| 15 | + <div class="collapse navbar-collapse" id="navbarContent"> |
| 16 | + <ul class="navbar-nav ml-auto mr-0"> |
| 17 | + <li class="nav-item"> |
| 18 | + <a class="nav-link" href="#getting-started"> |
| 19 | + Try it now |
| 20 | + </a> |
| 21 | + </li> |
| 22 | + <li class="nav-item"> |
| 23 | + <a class="nav-link" href="blog/index.html"> |
| 24 | + Blog |
| 25 | + </a> |
| 26 | + </li> |
| 27 | + <li class="nav-item"> |
| 28 | + <a class="nav-link" href="docs/index.html"> |
| 29 | + Reference |
| 30 | + </a> |
| 31 | + </li> |
| 32 | + <li class="nav-item"> |
| 33 | + <a class="nav-link" href="https://docs.scala-lang.org/scala3/"> |
| 34 | + Docs |
| 35 | + </a> |
| 36 | + </li> |
| 37 | + <li class="nav-item"> |
| 38 | + <a class="nav-link" href="https://github.com/lampepfl/dotty"> |
| 39 | + <i class="fab fa-github"></i> |
| 40 | + </a> |
| 41 | + </li> |
| 42 | + </ul> |
| 43 | + </div> |
| 44 | + </nav> |
| 45 | + </header> |
| 46 | + <div class="container"> |
| 47 | + <div class="scala-logo-container"> |
| 48 | + <img src="images/dotty-logo-white.svg" alt="logo" /> |
| 49 | + <div class="subtitle text-center"> |
| 50 | + <h1 id="dotty" class="above-byline">Scala 3</h1> |
| 51 | + <p>A next-generation compiler for Scala</p> |
| 52 | + <p>(scroll down for more info)</p> |
| 53 | + </div> |
| 54 | + </div> |
| 55 | + </div> |
| 56 | +</section> |
| 57 | +<section class="page bg-blue bg-dark"> |
| 58 | + <div class="container"> |
| 59 | + |
| 60 | + <h1 id="getting-started">Try Scala 3</h1> |
| 61 | + <p>There are multiple ways of <a href="https://docs.scala-lang.org/scala3/getting-started.html">getting started</a> with Scala 3.</p> |
| 62 | + <ol> |
| 63 | + <li>You can try Scala 3 in your browser with <a href="https://scastie.scala-lang.org/?target=dotty">Scastie</a>.</li> |
| 64 | + <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> |
| 65 | + <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> |
| 66 | + <li>You can <a href="#install">manually install Scala 3</a> on your computer.</li> |
| 67 | + </ol> |
| 68 | + |
| 69 | + <h1 id="install">Install Scala 3</h1> |
| 70 | + <p>If you are a <strong>Mac</strong> user, you can install Scala 3 with <a href="https://brew.sh/">brew</a>:</p> |
| 71 | + <pre><code>brew install lampepfl/brew/dotty</code></pre> |
| 72 | + |
| 73 | + <p> |
| 74 | + 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/> |
| 75 | + 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/> |
| 76 | + 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>. |
| 77 | + </p> |
| 78 | + |
| 79 | + <p>Now you can compile Scala source code:</p> |
| 80 | + <pre><code>scalac hello.scala</code></pre> |
| 81 | + |
| 82 | + <p>To start the REPL, run: <code>scala</code>.</p> |
| 83 | + |
| 84 | + <h1 id="getting-started-with-a-project">Create a Scala 3 Project</h1> |
| 85 | + <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> |
| 86 | + |
| 87 | + <p>Create a Scala 3 project:</p> |
| 88 | + <pre><code>sbt new <a href="https://github.com/lampepfl/dotty.g8">lampepfl/dotty.g8</a></code></pre> |
| 89 | + |
| 90 | + <p>Or a Scala 3 project that cross compiles with Scala 2:</p> |
| 91 | + <pre><code>sbt new <a href="https://github.com/lampepfl/dotty-cross.g8">lampepfl/dotty-cross.g8</a></code></pre> |
| 92 | + |
| 93 | + <p>For documentation see the <a href="https://github.com/lampepfl/dotty-example-project">Scala 3 Example Project</a>.</p> |
| 94 | + |
| 95 | + <h1 id="documentation">Learn more about Scala 3</h1> |
| 96 | + <p>You can find much more information about Scala 3 in ...</p> |
| 97 | + <ul> |
| 98 | + <li>... the <a href="https://docs.scala-lang.org/scala3/">Scala 3 documentation</a>,</li> |
| 99 | + <li>... the <a href="https://docs.scala-lang.org/scala3/book/introduction.html">Scala 3 book</a>,</li> |
| 100 | + <li>... the <a href="docs/index.html">Scala 3 reference docs</a>,</li> |
| 101 | + <li>... the <a href="https://docs.scala-lang.org/scala3/guides.html">Scala 3 guides</a>.</li> |
| 102 | + </ul> |
| 103 | + </div> |
| 104 | +</section> |
0 commit comments