3

I'm curious what's the "best" way to program RIAs with Scala.

I'm new to Scala and would simply like to know where to start learning. It seems obvious that for web-apps Lift is the perfect choice to be combined with Scala. However from what I've seen so far Lift is not really providing the key to great visuals. Certainly there are hundreds of possible frameworks due to the compability with Java but that's not very helpful.

What would you recommend ?

What is a common set-up ?

Among others I found cappuccino, a very impressive framework. http://www.scala-lang.org/node/7281 It just seems like Cappuccino is designed for a language named Objective-J. That doesn't sound like great compability to me. Yet somehow they can work together. http://frothy.liftweb.net/

lhk
  • 27,458
  • 30
  • 122
  • 201

2 Answers2

2

Well, if you are new to Scala you should probably try Play, because learning a web framework and a new programming language is hard.

Play has a big community and seems to be quite user-friendly (pressing F5 in your browser reloads your code and displays any errors which have occured).

Normally any Java web framework can also be used in Scala, but Play seems to be pretty Scala-friendly.

There are quite a few Scala-specific web frameworks too, but I don't know enough to tell you more about them.

Lift is an powerful and impressive framework, but certainly nothing for beginners. (I assume "new to Scala" doesn't mean "I programmed in Haskell, ML and Scheme for decades").

soc
  • 27,983
  • 20
  • 111
  • 215
  • You're right: "new to Scala" doesn't hide vast experiences in other functional languages. Moreover Play looks great. Nevertheless as I haven't used Play yet, learning Scala and Play would be learning a new language + framework as well as learning Scala and Lift. Wouldn't it make more sense to learn Lift which is meant to be used with Scala instead of Play which is meant to be used with Java ? – lhk Dec 09 '10 at 14:32
  • 1
    Play is primarily targeted at Java developers, so it caters more to the "average" ones. I use Scala since quite some time, but I still don't understand all of the magic Lift does. – soc Dec 09 '10 at 23:19
1

Of course it all depends. Personally, I have had no problem starting with Lift even though I’d only used Scala in the REPL before and just for some toying around to get to know the syntax.

It certainly helps a lot if you already know how to use collections in a functional way without explicit loops, so you can read and understand other people’s code more easily. But basically, I’d say it is doable learning both Lift and Scala at the same time even without a background in functional languages. It’s just the collections thing you’ll have to get used to and if you happen to know Ruby (or a language with list comprehensions) you’ll easily understand it.

The Frothy integration has not yet been updated to the newest version of Lift and I don’t know of any site which actually uses it but maybe this is a thing to ask on the Lift mailing list. In any case, I think Frothy only helps you connecting a Lift setup with some Cappuccino frontend but does not provide many wrappers to the Objective-J code, so you’ll still have to write code in Objective-J.

At that point you can ask yourself: Why not write the whole thing with Cappuccino and decide afterwards if Lift integration is actually needed.

Considering Lift alone: You certainly can use Lift with some UI Kit like JQuery UI for the visuals. Lift has many advanced possibilities which make it possible to build complicated web applications but you’ll have to care about the wiring for the visuals yourself.
(And arguably, a stateful, non-MVC (‘view first’) framework like Lift might be better suited for a rich internet application than a pure MVC framework…)

Debilski
  • 66,976
  • 12
  • 110
  • 133
  • Where would I use Lift and where JQuey UI ? JQuery smells like Javascript is needed in the entire GUI. Personally I dislike Javascript and hoped that Lift would replace most of it. – lhk Dec 09 '10 at 14:28
  • You don’t need to use JQuery UI. It was just a suggestion for styling the visuals. For everything else, Lift is trying to wrap all JavaScript in helper methods so that you don’t need to write any of it but just use these methods. – Debilski Dec 09 '10 at 14:36