5 ms·
Scala on Heroku
- zbailey 15y agoI 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-and-why-is-it-cool http://www.codecommit.com/blog/scala/what-is-hindley-milner-...) 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 15y agoMinor 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.
- zbailey 15y agoOops, thanks for correcting me. I think the original article claimed it did use it, or at least something very similar - it looks like Herkou has tweaked their article and pulled that link.
- gtani 15y agoThe 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/scala-Does-scala-use-Hindley-Milner-type-inference-td1997689.html http://scala-programming-language.1934581.n4.nabble.com/scal... http://stackoverflow.com/questions/3689407/disadvantages-of-scala-type-system-versus-haskell http://stackoverflow.com/questions/3689407/disadvantages-of-... http://stackoverflow.com/questions/7234095/why-is-scalas-type-inference-not-as-powerful-as-haskells http://stackoverflow.com/questions/7234095/why-is-scalas-typ... this sentence in OP objectionable Erlang and Clojure: two other functional, concurrency-focused languages which many developers find inscrutable.
- Roboprog 15y agoI'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?
- hp 15y agoIf you follow the "how to run it on Heroku" section in the README here: https://github.com/typesafehub/webwords/tree/heroku-devcenter/ https://github.com/typesafehub/webwords/tree/heroku-devcente... then you would get something like this running app here: http://webwords.herokuapp.com/ http://webwords.herokuapp.com/ That's pretty much what it does ;-) Some people call this a "Platform-as-a-Service" or PaaS.
- matan_a 15y agoIn the simplest simplest terms, it's hosting for your app. But you get a lot of bonuses like add-on services, great deployment and app management, and easy scaling (assuming your app is built to support that). Since their new infrastructure upgrade, it seems it's easier for them to support more and more language stacks. There also seems to be quite a bit of add-ons you can use.
- kalid 15y agoThink 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 15y ago"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 15y agoYeah, 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.
- oacgnol 15y agoExcellent 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 15y agoDepends 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.
- ilcavero 15y agoanybody 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 15y agoPlay support came out a while ago: http://blog.heroku.com/archives/2011/8/29/play/ 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 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-devcenter/ https://github.com/typesafehub/webwords/tree/heroku-devcente... Web words example shows how to run Jetty, and you should be able to drop various web frameworks into Jetty.
- Mongoose 15y agoI'm curious how this will work with Play 2.0, which will be sbt-based.
- NiceOneBrah 15y agoCan Haskell be next?
- tomjen3 15y agoJust 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 15y agoOn 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-and-akka http://devcenter.heroku.com/articles/scaling-out-with-scala-...