Skip to content

blog post about scastie release #649

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 1 commit into from
May 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
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 blog/_posts/2017-02-20-introducing-scastie.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ We also enable a worksheet mode, which feels much like a worksheet in an IDE. Th
## What's next?

* Improve the sharing model. For example, we could use a similar approach as gist or JS Fiddle where you can fork and edit code snippets.
* Support Scala.js and Scala-Native. Vote on which one you'd like to see first! ([Vote for Scala.js](https://github.com/scalacenter/scastie/issues/38) or [vote for Scala Native](https://github.com/scalacenter/scastie/issues/40))
* Support Scala.js and Scala-Native. Vote on which one you'd like to see first! ([Vote for Scala.js](https://github.com/scalacenter/scastie/issues/38) or [vote for Scala Native](https://github.com/scalacenter/scastie/issues/50))
* Make it possible to embed Scastie in your project's documentation.

## Want to try it?
Expand Down
142 changes: 142 additions & 0 deletions blog/_posts/2017-05-19-scastie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
---
layout: blog
post-type: blog
by: Guillaume Massé
title: Scastie is out of beta and available to everybody!
---

The Scala Center team is extremely happy to announce that
[Scastie](https://scastie.scala-lang.org) is out of beta! That means anyone can
use Scala in the browser over at
[scastie.scala-lang.org](https://scastie.scala-lang.org)!

## What is Scastie?

**Scastie is... Scala + sbt in your browser!**. You can:

- use any version of Scala (scalac), or even alternate backends such as Dotty, Scala.js, Scala Native, and Typelevel Scala.
- use any library published on Maven.
- save and share Scala programs/builds with anybody

This is all possible because Scastie is based on sbt, allowing us to support newer
Scala versions and resolve library dependencies on Maven.

Want to see what Scastie can do? Check out our [ray tracer demo using Scala.js on Scastie](https://scastie.scala-lang.org/9ZgBIUCQQ6u8bRaJFLI0Yg) below!

<a href="/resources/img/blog/scastie/scastie2.png" target="_blank">
<img alt="scastie screenshot"
src="/resources/img/blog/scastie/scastie2.png">
</a>


## How does Scastie work?

When a user evaluates their code, the browser sends all its input to our server.
We run your code in an isolated Java Virtual Machine on our servers. We
integrated a scaladex interface to allow you to search the Scala ecosystem and
include any published Scala library in your project. You don’t need to remember
what the latest version number of a specific library is anymore!

The output will be streamed back to the user. A specific protocol will allow the
client to interpret different events such as compiler errors, runtime
exceptions, instrumentation, console output, etc.

We also enable a worksheet mode, which feels much like a worksheet in an IDE.
This lets a user write code as top-level expressions, without having to put code
inside of a class or object with a main method. Worksheet mode gives you two
ways to interleave your results; on the one hand, when an expression is
evaluated, you can see the value and type of the evaluated expression to the
right of the code that you wrote. On the other hand, worksheet mode also makes
it possible to do a kind of literate programming; that is, you may interleave
code and HTML blocks much like in notebook environments such as iPython
notebooks.

## New features

So, what's new since we released our original beta a couple of months ago? Other
than a stabler Scastie with fewer bugs, we have a brand new UI, support for
sharing snippets, and support for Scala.js!

### New UI

We collaborated with <a href="https://www.47deg.com/" target="_blank">47Deg</a> to provide a fresh UI.

<a href="/resources/img/blog/scastie/newui.png" target="_blank">
<img alt="scastie screenshot"
src="/resources/img/blog/scastie/newui.png">
</a>

### Sharing

The main purpose of Scastie is to help people learn and communicating with code
examples.

In the last few months, we've worked hard to provide a new sharing model. Now
it's possible to save, fork, and update snippets! Just like JSFiddle, you can
now fork an existing snippet, change it however you like, and then login with
GitHub to save it!

When logged in through GitHub, you can now create new snippets or edit existing
ones.

### Scala.js

Since the intial release of our beta, we also added support for Scala.js! In Scala.js mode, once your code is compiled, your snippet is run in your browser.

HTML DOM elements referred in your code such as images appears in the editor for convenience. This feature is illustrated in this example: [such doge!](https://scastie.scala-lang.org/MasseGuillaume/KuKtYXx1SpW7gu5HUTmPSA/1).

Since the execution environment is your browser, you can set breakpoints in your
javascript inspector. Source mapping is enabled and allowing you to step into
your Scala code.

<a href="/resources/img/blog/scastie/Scala-js-debug.png" target="_blank">
<img alt="scastie screenshot"
src="/resources/img/blog/scastie/Scala-js-debug.png">
</a>

You can try it out yourself: [ray tracer](https://scastie.scala-lang.org/9ZgBIUCQQ6u8bRaJFLI0Yg)
([Li Haoyi](https://github.com/lihaoyi) is the author of this demo)

## What's next

### Google Summer of Code

Dmitrii Petukhov was accepted as a Google Summer of Code student to work on
[Auto-completion and type
information](https://summerofcode.withgoogle.com/organizations/4568241046290432/#5494264097144832).
Rory Graves, an ENSIME contributor, is the mentor for this project. ENSIME is an
IDE server. It can power text editors such as vim an eclipse with IDE
functionnalities such as autocompletion.

### Scala Center's Plan

The Scala Center will continue the development of Scastie. We want to improve
the integration with Scala projects. We will add an embedded mode were you can
include Scastie in your documentation. We also want to use existing data sources
such as StackOverflow or GitHub to have more code examples.

## Talk to us!

Thoughts or opinions about Scastie? Join us over on [Scala Contributors](
https://contributors.scala-lang.org/t/introducing-scastie-an-interactive-playground-for-scala/494)
to contribute to the discussion.

## Brought to you by

Scastie is an original idea from Aleh Aleshka ([OlegYch](https://github.com/OlegYch/)).

<div>
<a href="https://scala.epfl.ch/" target="_blank" style="border:none;">
<img alt="scalacenter logo"
style="padding: 15px; height: 60px"
src="/resources/img/blog/scalacenter/scala-center-swirl.png">
</a>
Scala Center is covering the hosting cost and the engineering work.

<a href="https://www.47deg.com/" target="_blank" style="border:none">
<img alt="47deg logo"
style="padding: 15px; height: 60px;"
src="/resources/img/blog/scalacenter/47deg-logo.png">
</a>
47Deg worked on the UI design.
</div>
Binary file added resources/img/blog/scalacenter/47deg-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 resources/img/blog/scastie/GSoC2016Logo.jpg
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 resources/img/blog/scastie/Scala-js-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 resources/img/blog/scastie/icon-scastie.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 resources/img/blog/scastie/newui.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 resources/img/blog/scastie/scastie2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.