Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Try Scala in your browser (scalatutorials.com)
61 points by eranation on April 19, 2014 | hide | past | favorite | 22 comments


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.


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?


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.


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.


I'd recommend Cay Horstmanns 'Scala for the Impatient'.


Thanks! again all credit for the cool execution engine should go to the http://codebrew.io team (http://scalatutorials.com/about.html)


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


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!


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

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...)

Thanks again and sorry!


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



Nice work.

Scala worksheets are a joy, REPLs in comparison are quite weak, IMO.


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


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

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

Credits for other open source resources: 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


Where is the output supposed to show up?


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!


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.


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


Ah! Didn't even notice the comment changing, thanks for that.


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.


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.


Appears to be down.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: