

Show HN: Try Scala in your browser - eranation
http://scalatutorials.com/tour/interactive_tour_of_scala_scalculator.html

======
CraigJPerry
Really clear. Good job.

As a guy who usually reaches for python when no language is mandated by other
factors, I'm supposed to like go.

I think Scala is a more attractive proposition. Maybe this is more a
reflection of my python style having become more "functional" of late.

~~~
lesingerouge
Indeed, really cool to see so much similarity with Python. Anybody have any
recommendations for a book on Scala? Something to use as an introduction to
the language?

~~~
craigwblake
Odersky's _Programming in Scala_ is a fantastic book, but unfortunately so far
as I know it has not been updated for the last couple of versions of the
language and libraries which have some significant changes.

Still, it stands out to me as the best introduction to the language.

~~~
saryant
To expand on this, _Programming in Scala_ is based on Scala 2.8. We're now on
2.10 with 2.11 coming up (it's in RC mode right now).

Fortunately, this means that the book is up-to-date with 2.8's major
collections refactor.

I would say the biggest change to the standard library since then are the
deprecation of scala.actors and their replacement by Akka actors. I _think_
that's the only chapter in the book that's no longer relevant. There are a few
smaller ones (replacement of scala.Application with scala.App) and a few nice
additions (implicit classes aka Ruby monkey patching) but I can't think of
anything substantial for a beginner.

------
eranation
Credit goes to the team behind codebrew.io for the "scala worksheet" like
execution engine

~~~
shmed
Hey really cool tool! I am one of the dev behind codebrew.io, and we are
really happy that you are using it :)

Just a small comment, in the about page, you are giving credit to Scalakata
(made by Guillaume). ScalaKata is an older project, Guillaume is now part of
the new Codebrew.io team. His old site is redirecting to our new Codebrew.io
website. (SkalaKata doesn't exist anymore). I believe the engine you are using
is the Codebrew engine, not the ScalaKata engine. We would appreciate if you
credit the Codebrew.io team (we are 5 devs!) instead of ScalaKata. Again, it's
not a big deal at all, we really appreciate that you are giving us some credit
here on HN. :)

Thanks again and awesome job on the website!

~~~
eranation
Yes, fixed that!, sorry about that, and thank you so much for codebrew.io!

[http://scalatutorials.com/about.html](http://scalatutorials.com/about.html)

Can you please do a pull request to add the developer's names / github
accounts etc?
([https://github.com/scalatutorials/scalatutorials.github.io/e...](https://github.com/scalatutorials/scalatutorials.github.io/edit/master/0_about.html))

Thanks again and sorry!

~~~
shmed
Thanks for that, you're awesome. Pull request sent :)

~~~
eranation
Live
[http://scalatutorials.com/about.html](http://scalatutorials.com/about.html)
:) Thanks again!

------
picardo
Very cool. Is the source code available? Which libraries did you use?

~~~
eranation
Thank you! Great question, the site is static and is open source
([https://github.com/scalatutorials/scalatutorials.github.io/](https://github.com/scalatutorials/scalatutorials.github.io/))

The execution engine uses a WebSockets API courtesy of
[http://codebrew.io](http://codebrew.io), more specifically
[https://github.com/jedesah/scala-codesheet-
api](https://github.com/jedesah/scala-codesheet-api) (see
[http://www.reddit.com/r/programming/comments/1ry70r/hey_this...](http://www.reddit.com/r/programming/comments/1ry70r/hey_this_is_the_codebrewio_team_we_just_launched/cdsetp1))

Credits for other open source resources:
[http://scalatutorials.com/about.html](http://scalatutorials.com/about.html)

The tour steps are in a Google docs spreadsheet (lazy man's database) and I
wrote a hacky google docs CSV to markdown engine to avoid some boilerplate at:
[https://github.com/eranation/ScalaTutorialsTourMaker](https://github.com/eranation/ScalaTutorialsTourMaker)

------
sehr
Where is the output supposed to show up?

~~~
eranation
for println(...) it should show in a black console like at the bottom.

For inline values, it shows in an orange comment //> value

e.g.

1 + 2 //> 3

try changing it and pressing the green button

Thanks!

~~~
Stratoscope
I think it would be a good idea to _not_ show the initial result when the page
is first loaded. The first thing I tried on the page was to click the Run
button without changing the expression, so of course nothing changed. This was
a bit confusing.

Of course I soon realized what happened, but it would be less confusing if my
very first click of the Run button actually appeared to do something.

I would go so far as to do something like highlighting the result with a
yellow background that fades out over a second or two, to draw attention to
the result. Maybe you'd just want this at the beginning and then stop doing
the fading after a few clicks of the Run button, I'm not sure. But it would at
least be helpful when getting familiar with the page.

~~~
eranation
Thanks! good point, and I agree, will remove the initial results from the
code, thanks

------
wtetzner
It would be nice if it remembered your cursor position after pressing
Ctrl+Enter. At the moment it puts the cursor at the beginning of the textbox.

Otherwise, very cool.

~~~
eranation
Thanks, yes, it's annoying, I'm getting weird exception from the code mirror
API when I try to do in place replacements, but that's no excuse :) will try
to resolve it, good point.

------
zackliscio
Appears to be down.

