Python+Tornado vs Scala+Lift?
Asked Answered
N

3

12

I'm looking to start a Google Maps based web application. My initial thoughts are that in the first phase the focus should be on the front-end, and the backend should be easy to write and to prototype, and should aid as much as possible the development of the frontend.

There will be no 'classic' pages, just a meebo.com style interface. javascript + jquery. (meaning, very few if none at all static pages).

My eye has caught the comet-style , server push paradigm, and I'm really interested in doing some proof of concepts with this.

Do you have any recommendations or advantages and disadvantages or any experiences in working with :

Python + Tornado vs Scala + Lift ?

What other advantages or disadvantages in other areas of a web application might a choice bring?

Note : This is for max 2 developers, not a big distributed and changing team.

Thanks

Noletta answered 29/8, 2011 at 8:33 Comment(2)
Lift comes with a rich JavaScript DSL and makes it very easy to write Ajax/Comet webapps where you only need to update certain snippets of your page. (I have no experience with Tornado, hence only a comment).Gamesmanship
Why Comet server push? For a typical map app I'd imagine all interaction to start on the client, so AJAX callbacks should be enough and you don't really need server push unless there are further unstated requirements.Retorsion
K
14

I think Python and Tornado are a great team, for the following reasons

  • Tornado is really an IOLoop that happens to come with an HTTP implementation that runs on it (and a few helpers).

This means that it comes with everything you need to do web development with it.

It also means that if you find, down the road, that you need other back end services to help scale your application, tornado is very likely of good use in that area. I've actually written more back end services than front end ones in Tornado (but a coworker has the exact opposite experience with it -- he's more front-end oriented and finds it just as nice to work with). A bit off-topic, but we've also used their template module outside of tornado with great success. The code is very modular and there's almost no interdependence, so reusing its components is a breeze.

  • You can learn it, and know it well, very, very quickly.

It would take you all of a day to figure out. It's code is clean and unbelievably well-commented, and it has decent documentation besides. I was able to produce a production service with Tornado 0.2 (ca. 2009) in about a week having never seen it before. The tornado source code is very anti-magic.

  • It's fast, and stable. Under load.

I don't know if it's the absolute most blazing fast thing in existence, but in the projects I've used it in, it's taking on some very heavy load, in terms of both number of concurrent users, and in terms of data transfer (high-volume image uploads, for example), and it's been a) completely rock solid in terms of stability, and b) fast enough that I haven't had to consider scaling it horizontally or getting bigger hardware.

  • Python is extremely flexible and adaptable.

I use Python regularly for web development using Tornado (and other things too, including Django on occasion). However, I also use it for things completely unrelated to the web services themselves, like sysadmin/automation tasks, reporting & data munging (for example, I write hadoop jobs in Python), and other things, where the standard library modules (os, sys, shutil, itertools, collections, etc) make things blindingly fast to build. I can use Python for just about anything, in just about any environment, whether the output goes over a stream, into a browser, to a fat GUI, or a console.

It also has a fantastic community around it of really smart people who are also very friendly. I can't compare it to the scala community, but in comparison with lots of other communities, Python is easily my favorite and has a lot to do with why I became so attached at the hip with it. I'm a polyglot, but if I have a question, I would most like to pose that question to a Python community member :)

Keneth answered 2/9, 2011 at 17:0 Comment(1)
Thank you, very convincing comment. I find it reassuring that you and your colleague have used it successfully. As time passes I'm probably inclining more to Python, although I originally thought of Scala. I'm still waiting for more experiences and opinions till the end of the bounty, but definitely the best I heard so far. thanks :)Noletta
L
6

Scala is a substantially cleaner language and enables you to use object-oriented and functional paradigms as you see fit.

Python has much more syntactic sugar and embraces the "there is only one way to do it" philosophy.

Scala is usually used with IDEs like Eclipse/Idea - although support for vim/emacs also exists, too - and built with SBT. If you are not accustomed to these tools, it might take some effort to set them up the first time.

Python is often used with much more lightweight editors. Re-running an updated Python script is easier by default.

Lift is really targeted at web applications, enabling Desktop-like responsiveness and behavior. If you're just wanting to create a homepage, there are certainly other frameworks around, which don't make you learn as much as with Lift.

Lubow answered 29/8, 2011 at 14:24 Comment(1)
Thanks for you comments. I'm comming from Java desktop and distributed agents land. I have heavy experience with Java, but I've written C#, C, C++, and python before. Scala wouldn't be a problem, and the application would be more complex than homepages. Desktop-like responsiveness and behaviour is what I want.Noletta
C
3

I would suggest going with Python for these reasons:

1. Debugging

What I find especially useful when writing Python code, is the ability to easily debug ( see the pdb module ), all you need is a command prompt and a text editor to set your breakpoints. With Scala, you will probably have to rely on a IDE to do all your debugging.

2. Easy to learn

As for programming language, I don't know what your experiences with either languages are. If you are both Python and Scala beginners, my personal opinion is that you will learn Python faster.

Caaba answered 29/8, 2011 at 13:53 Comment(1)
We both know python better, but I have more experience with the Java stack. You do make a good point about debugging, i forgot about that. I will certainly consider it during the evaluation of PoC's with both methods, thanksNoletta

© 2022 - 2024 — McMap. All rights reserved.