Question

I need to write a small Web based UI that would run on a raspi and since I'm trying to pull some Scala into my daily work, I'd like to use one of Play, Scalatra or Lift. Does anybody have experience with developing for Raspberry Pi with these frameworks? If so, which one is more advisable in terms of performance?

Was it helpful?

Solution

People have reported very good low memory performance using Scalatra. One example write-up is at:

http://fehguy.tumblr.com/post/33760322808/my-house-heater-has-a-rest-api-with-phidgets-scala

Memory usage figures as low as ~30MB to ~40MB have been bandied about in blog posts and IRC conversations.

Some tips:

1) Scalatra allows you to select exactly the dependencies you want. The core HTTP router will work just fine on a Raspberry Pi - be extremely careful with selecting additional libraries and benchmark your memory usage whenever you add a new jar.

2) The current Scalatra g8 template will, by default, wire up precompiled Scalate templates for you. These are fine on a normal server, and it's usually very convenient to have things set up for you already, but in a memory-constrained environment they are the first thing you'll want to look at either ditching or optimising.

3) At least three people in the #scalatra irc channel on Freenode have already experimented with running it on a Pi, so depending on your use cases(s) their pain may be your gain.

4) You'll get the best possible memory consumption by launching your Scalatra app as a standalone Jetty servlet. This is detailed in the Scalatra standalone deployment guide.

OTHER TIPS

Diego Medina blogged a while back about successfully using Lift on a Raspberry Pi: http://blog.fmpwizard.com/blog/lift-running-on-raspberrypi.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top