Monthly Archives: October 2010

Why I gave up Google App Engine for now

Google App Engine is nice. Cloud Computing is nice. But I’m giving up GAE for now, and bellow is why.

I (re)started to play around with Google App Engine about one or two weeks ago. Of course I read a lot about it in the past, and decided to play a little bit.

The first thing you have to do is to go to http://appengine.google.com/ and Sign Up. You will have to enter a mobile number and they will send you an SMS to validate your registration. The problems started here for me. It simply didn’t work for my number. After trying several times and waiting a few hours, I decided to use my Mom’s mobile – and a few seconds later, she received the message. It should not be that complicated, but at least now I could try GAE out.

Then, I installed the Eclipse plugin and created a sample project. This is the nicer part of all. Just click the “Deploy to Google App Engine” button in the tool bar, fill in your google credentials in the dialog that will appear, and your application will be uploaded and deployed. Really easy and impressive.

So far so good. So why did I gave up using it? If you read this blog for some time, you already know I’m really interested in Scala. So, what I really wanted to do was to deploy something using Scala to the cloud. Specifically, I wanted to deploy a Lift web application.

It turned out that, during some readings, I discovered that the main feature I was using with Lift doesn’t work with GAE: Ajax and (Ajax) Comet. GAE has  some restrictions that you can usually overcome, but there is one that hits this Lift feature pretty hard:  you cannot create Threads in a Google App Engine application. Usually, this is not a problem, but Lift’s implementation of Ajax uses Actors which, if I understood correctly, are implemented with Threads – and this make a lot of sense.

So, no GAE for me, at least for now. At least until I get bored with Lift :p


Simple Build Tool for Scala

Recently I started looking at some alternatives for increasing productivity when writing code and building systems in Scala. One option that is getting some attention is SBT – Simple Build Tool. In some ways, it is similar to Spring Roo. It generates some skeleton code (not sure how much though) and has an interactive shell that allows us to execute some tasks like compile and building, and even running in an application server if you are building an web application – which is what I was testing.

After some trouble installing, you can simply type sbt in a terminal to start the interactive shell. If the current directory doesn’t have an sbt project created, it will ask you to create one. Then, you can use commands like ~jetty-run to start your web application and make it run with jetty.

One thing I noticed is that it uses maven internally a lot (or seems to…) – at least for downloading dependencies and storing them in the local maven repository. But differently from maven, it copies the libraries used by the project to the project folder and use them from there. Also, although I’m not sure what this means exactly, sbt has several commands that have maven equivalents.

The web application I was trying was the Lift Chat Demo which you can find here: http://liftweb.net/getting_started. It is a pre-made sbt project; after downloading the sample, you execute sbt in the command line and can start playing (they have maven and other tool’s versions as well). When running this application with ~jetty-run changes made to the html files are detected on the fly. And so are the changes made to the Scala code. This is nice, but doable with maven as well.

This last statement leads to this post’s conclusion: sbt is a nice tool, but I’ll stick to maven for now, for one main reason: IDE support. Maven is greatly integrated with NetBeans (and Eclipse as well, I suppose), and I couldn’t find a nice way to use sbt with any IDE. Since I’m NOT a vi programmer, this leaves me with no option for now.

As a last note, please keep in mind that I only took a quick look at the most basic features of sbt – they probably have a whole lot more to offer. It just happens that I’m ok with the NetBeans + Maven combination for now.

And finally, a link that helped me clearing some ideas: http://php.jglobal.com/blog/?p=363

EDIT: Paul Phillips corrected me in an email in the Bay Area Scala Enthusiasts list about sbt using maven. Well, it doesn’t. It uses only the maven repositories, which is absolutely reasonable. Still, it certainly learned a lot with what maven does – again, very reasonable.


Follow

Get every new post delivered to your Inbox.