Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python+Tornado vs Scala+Lift?

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

like image 318
florin.bunau Avatar asked Aug 29 '11 08:08

florin.bunau


2 Answers

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 :)

like image 76
jonesy Avatar answered Oct 21 '22 01:10

jonesy


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.

like image 44
soc Avatar answered Oct 21 '22 00:10

soc