
Scala on Heroku - adamwiggins
http://blog.heroku.com/archives/2011/10/3/scala/
======
zbailey
I love Heroku's little "language and community" section of these articles when
they add a new supported platform. For example, the link to the explanation of
Scala's Hindley-Milner type inference method
([http://www.codecommit.com/blog/scala/what-is-hindley-
milner-...](http://www.codecommit.com/blog/scala/what-is-hindley-milner-and-
why-is-it-cool)) definitely taught me something new about the internals of
Scala, and in general a new topic in Computer Science.

Congrats on shipping yet another supported platform!

~~~
bad_user
Minor correction - Scala does not have the Hindley-Milner type inference
method and for technical reasons it would be very hard to have something
similar. Languages that do have Hindley-Milner are those from the ML family,
like Ocaml, Haskell and F#.

That said, the linked article is pretty cool.

~~~
gtani
The codecommit article is a good intro to H-M as in Haskell, OCaml, F#, SML
(AKA Damas-Milner by at least one dev I respect), here is codecomit guy re:
why Scala can't use HM / DM, rather, Scala is flow-based, or "local type
inference".

[http://scala-programming-
language.1934581.n4.nabble.com/scal...](http://scala-programming-
language.1934581.n4.nabble.com/scala-Does-scala-use-Hindley-Milner-type-
inference-td1997689.html)

[http://stackoverflow.com/questions/3689407/disadvantages-
of-...](http://stackoverflow.com/questions/3689407/disadvantages-of-scala-
type-system-versus-haskell)

[http://stackoverflow.com/questions/7234095/why-is-scalas-
typ...](http://stackoverflow.com/questions/7234095/why-is-scalas-type-
inference-not-as-powerful-as-haskells)

this sentence in OP objectionable

 _Erlang and Clojure: two other functional, concurrency-focused languages
which many developers find inscrutable._

------
Roboprog
I'll bite: what is Heroku? I read the "polyglot programmer" link on the
article. What it seemed to point at was common deployment tools between
languages, but it seemed vague, and there must be more. What is it?

~~~
kalid
Think Google App Engine with more languages, with real database access (bring
your own db if you want, or they can host it), dozens of add-ins, and a sane
pricing model.

~~~
jshen
"sane pricing model"

by sane you mean really expensive for hobby projects. I keep thinking this
will be a problem in the long run, disruptive technologies tend to be bottom
up. I can't host a message board on heroku because it's way too expensive.

~~~
kalid
Yeah, I don't consider Heroku or the platform-as-a-service providers good for
hobby projects, esp. something like a forum or blog where you can just get a
cheap VPS somewhere.

The sweet spot is having very reasonable billing like $15/month for a 20GB
database (5MB free) and $35/month for a 2 dedicated workers (or free for 1
which needs to be spun up and is ~10 seconds for the first request). My
current use case is projects which could become small income earners, where
~50/month to experiment is dirt cheap if it saves me hours of setup time.

~~~
jshen
you know, I hadn't evaluated it since it was a pure ruby service. It's a bit
different with a jvm language where you can get away with 1 worker (threaded
request handling) and the db upgrade. $15/month would likely be sufficient for
a forum. I'll give it a try and see how it goes :)

I wish there were something between the $15 and $200 db offerings.

~~~
kalid
Yep, it's definitely a steep jump from 20GB shared to dedicated. At that point
it might be better to move onto your own hardware (if I fill up 20GB database
then I'm doing something right).

------
oacgnol
Excellent news. I'm just starting to learn Scala as a natural evolution to
Java. The pace of Heroku rolling out new language support lately has been
great. I'll be playing around with Heroku more, but I have to wonder: should I
be expecting to pay something to use Heroku as a side learning exercise?

~~~
slashclee
Depends on whether or not your side project uses more than 5MB of database
storage. I'm running a tiny node.js app on Heroku and you get up to 750 hours
per month of free CPU time, so I haven't paid a dime (but I _am_ really in
love with how slick everything is).

Is anyone else stunned at how quickly Heroku has been pumping out new hotness?
I was kind of worried when they announced they were being acquired, but if
anything, it seems like being acquired has increased their pace.

------
tomjen3
Just a quick warning for those of you who consider using this service. The
scala version they use is extremely old and the new version has been greatly
refactored as has an excellent new parallel collection system.

I urge you to find another host if possible.

~~~
hp
On Heroku, you can use any Scala version that SBT will use. I even used
parallel collections in the sample app:
[http://devcenter.heroku.com/articles/scaling-out-with-
scala-...](http://devcenter.heroku.com/articles/scaling-out-with-scala-and-
akka)

------
ilcavero
anybody knows if this means that something like a lift project or a scala play
project now work on heroku? I only see a finagle example but that's not a web
framework

~~~
hp
Play support came out a while ago:
<http://blog.heroku.com/archives/2011/8/29/play/> One trick with play-scala is
that the default welcome page is broken because it depends on a module that's
only enabled in dev mode, and Heroku runs play in prod mode. So replace the
default welcome page with a real page.

The announcement today is for SBT-based projects. Anything you can build with
SBT should be possible to use. You have to figure out how to honor the Heroku
configuration variables (namely PORT for the port to listen on) and you have
to figure out how to get an executable command, for example with
<https://github.com/typesafehub/xsbt-start-script-plugin>

We put up two examples today, the Finagle one and the larger "web words" one:
[https://github.com/typesafehub/webwords/tree/heroku-
devcente...](https://github.com/typesafehub/webwords/tree/heroku-devcenter/)

Web words example shows how to run Jetty, and you should be able to drop
various web frameworks into Jetty.

~~~
Mongoose
I'm curious how this will work with Play 2.0, which will be sbt-based.

