

The best Web Framework - what makes Lift different - sorenbs
http://seventhings.liftweb.net/index

======
jasonkester
Looks like it's great for building the things the authors thought you might
want to build.

Just like every other "SuperMagic" framework, I suspect there's a lot of pain
to be had once you step just a little outside of what it expects you to do
with it.

We've all re-written Django inside of Django at least once, and thus have been
burned by this sort of thing before. Personally, I think I'll wait to see some
big projects written by people other than the framework designers before I
agree that this is indeed the "best" web framework.

~~~
bad_user
I've been using Django for a lot of projects, but have recently converted to
Rails 3 for a personal project.

What I like about Rails is that plugins are mostly pieces of infrastructure,
not ready-to-use mini-applications that are hard to customize. And Rack
plugins (pieces of middleware, done in a standard/reusable way, contrary to
Django's middleware) are just awesome.

I also like about Rails that authentication and admin are not built-in. Lots
of plugins available for a quick-and-dirty job anyway.

I also like that defining models and even querying has been abstracted away in
different interfaces, and that you can use MongoDB in a similar way as you
would use a relational database.

Also, in case you need to decouple the request validations from the models
(i.e. forms in Django) without HTML-rendering logic attached (useful at times,
but completely getting in your way once you try doing anything complicated);
in Rails you can, and it looks and feels cleaner because the field types don't
have to be related to stuff you're rendering in the HTML response (i.e. field
= forms.MultipleChoiceField(widget=CheckboxSelectMultiple)).

Django is awesome in case you ever thought about using Drupal for a project:
much more flexible and dev friendly. But it completely got in my way so many
times that I actually thought about writing my own Python web framework; which
I shouldn't because people have been working on web-related stuff for the past
20 years.

~~~
zeemonkee
> But it completely got in my way so many times that I actually thought about
> writing my own Python web framework; which I shouldn't because people have
> been working on web-related stuff for the past 20 years.

You could always try Flask or Pylons.

~~~
parfe
Pylons is dead. The authors moved on to Pyramid after declaring Pylons core
too difficult to maintain. The upgrade path to Pyramid is "Run your pylons app
inside pyramid as you rewrite it from scratch [into our new shiny framework we
promise not to abandon]!"

------
Pewpewarrows
1\. Fetching content with AJAX and placing it into the DOM is "supported" by
every web framework in existence.

2\. Proxying ads through your own backend that threads itself? Yawn.

3\. AJAX and COMET have pretty standard support. Again, this is left up to you
with your Javascript library of choice.

4\. Again, this is Javascript work. It might save me a little bit of
development time, but I'd much rather be in complete control over the process
of wiring my pages together.

5\. Calling controls through classes isn't any more designer-friendly than
Rails or Django template tags.

6\. Pretty sure both Rails and Django have one-click install extensions for
form Wizards (Rails might support it out of the box, haven't played with 3
enough lately to know)

7\. All of these security principles are taken care of my every major web
framework I can think of.

So we have some magic Javascript-generating controls and... that's it. Those
are nice conveniences for sure, but a lot of these are uncommon use-cases, and
I know I can probably bang-out a Django app to handle most of them in an
afternoon, or just pull the real Javascript code I've used to handle these
cases a dozen times over in the past.

The condescending attitude and failure to meet expectations means I'll
probably never look at this framework again, which is a shame because it seems
like it might be neat to toy around with. Too bad.

~~~
aaronblohowiak
1\. Lift goes further in enabling convention over configuration for common
AJAX tasks that are part of normal workflows, so there is less boilerplate to
write.

2\. Parallel rendering means you can move to a SOA where different components
on the UI are served by different backend services. This can be great if you
have a recommendation service, a shopping cart and main content areas that are
all served by different systems that may have different performance
characteristics.. It also parallelizes the loading of the different parts of
the page, which should decrease page load time.

3\. Is there good comet support in existing frameworks out of the box? How
would you easily update a partial in a rendered page when an object changes in
rails or django? With Lift, you can hook up the rendered page (and its events)
to server-side Actors... without any boilerplate code. This helps the
productivity of development and (AFAIK) is still a rare feature.

4\. You do have complete control, it is merely a matter of style. Lift does
more things server-side.

5\. One of the differences is that you don't need to have "partials", which
could be more designer-friendly. I agree that this isn't a huge win.

6\. yep.

7\. I don't think the "No Direct Object Reference" security principle is taken
care of by any other major web framework. It is a pretty big win for security
-- because all of your exposed ids are session-specific, whole classes of
problems just "go away".

I'm not saying that Lift is to Rails/Django what Rails/Django was to PHP, but
it does have some interesting features that set it apart.

Note: I have a bias.

~~~
zem
> Is there good comet support in existing frameworks out of the box?

nitrogen [<http://nitrogenproject.com/>] is worth a look

------
asnyder
It's somewhat frustrating to me when they continuously say _"something that's
hard or impossible in other web frameworks is trivial in Lift"_.

As one of the co-founders and developers of the NOLOH PHP Framework
(<http://www.noloh.com>), I know that we've had many of these features for
quite some time, including Comet (we support all protocols including
streaming, short-polling and long-polling) with little to no effort on the
developer's part, and in many cases significantly less effort than described
here in lift.

I have nothing against Lift, and clearly I'm bias, however, the tone should've
been less hostile in my opinion. However, maybe the hostile tone is good
marketing. It's hard to say.

~~~
swannodette
What methods are you using to make Comet functionality scalable "without any
effort" ?

~~~
asnyder
You can find extensive details regarding our thinking on Comet in our Comet
slides from various conferences. [http://www.slideshare.net/noloh/comet-by-
pushing-server-data...](http://www.slideshare.net/noloh/comet-by-pushing-
server-data-we-push-the-web-forward).

There's no way we can easily answer you with the "methods" we're using as we
implement extensive original research. However, from a developer perspective
it boils down to the developer specifying what they want to "Listen" to, and
optionally how (streaming, short poll, long poll, etc) and NOLOH then takes
care of the rest. For example, <http://diffpaste.com/#/717/>.

Philip Ross will be publishing an extensive white papers soon that goes into
more academic depth if you're interested.

~~~
simonw
How do you implement scalable long polling and streaming in PHP? I've always
been under the impression that you really need non-blocking IO to get that to
work in a scalable fashion.

~~~
asnyder
Unfortunately you'll have to wait until the white paper for details. Philip
Ross has spent a significant amount of time and effort these past 2.5 years
researching and implementing various solutions. I unfortunately can't
summarize the solution in any succinct way, and fortunately/unfortunately he
stays away from outlets such as HN (better for actually getting work done).

However, I can promise you that as soon as he's done, I'll post it on HN and
personally send you a message.

------
steele
Lift is good, and if you're doing webapps in scala, you're probably going to
use a lift package _somewhere_.

My impression of Lift is that the API aren't self-explanatory at first glance.
import SHtml and S, hmmm, I know they do different things but I have to be
reminded of what exactly from those packages I need.

I'm surprised no one has mentioned stateful vs stateless and horizontal
scaling, yet. These are concerns dpp have addressed in the past but its worth
reviving discussion. 4sq seems to be doing fine.

What is neat about lift and the foursquare story are the improvements to lift
and scala web dev that come from that camp. Most recently, using MongoDB, devs
now have a choice between java interop, casbah, and 4sq's rogue. Lift is an an
integral and primary contributor to the scala web dev ecosystem.

~~~
aaronblohowiak
Yea, we're working on the docs.

Session affinity using the session id works pretty well. Many of the features
come from the ability to have actors that propagate their state up to clients.

------
doublez
What's not mentioned (it's hard to sell) is, 50%+ of the reason Lift is so
fabulous is, you're writing Scala. It's a mighty upgrade in quality of life,
from either Ruby, Java or Python.

By corollary, what's being omitted is, the learning curve is steep. Scala
isn't super-easy, and Lift dives fairly deep into the more complex stuff -
implicits, currying, etc.

Nor is Lift itself all too well documented just yet. Yes, there's two books
and a super-helpful community, but the experience is still in a different
universe from the lavishly over-documented Spring MVC where you never really
have to ask a question.

~~~
DennisP
Two books on Lift? All I know about is the Apress book, which significantly
lowered my opinion of Apress. What's the other?

~~~
icey
A couple possible matches:

Exploring Lift: <http://exploring.liftweb.net/>

Lift in Action MEAP: <http://www.manning.com/perrett/>

~~~
sorenbs
exploring lift is the free (and more updated) version of the apress book. Lift
in action is not completed yet, but already provides a nice starting point to
Lift. It has a tutorial like feel to it. <http://stable.simply.liftweb.net/>
is the founders book, which has been in the workings for a couple of months
only.

------
petervandijck
Nice, but that first sentence (Lift is the most ...) is a little annoying and
makes the rest of the site seem less credible.

~~~
rickmode
Ya - it's link bait. Saying "Lift is the most powerful, most secure web
framework available today for Scala and Java" might be more accurate, but
would be a yawn.

------
strooltz
Just out of curiosity can you highlight the advantages lift has over other
modern frameworks such as rails or django (and maybe some of the php
frameworks). Most (or all) of the 7 things ship with rails 3. Stacking them up
against one another might yield a better comparison.

~~~
Stormbringer
I think that the author is coming from the Java world, in which case the
comparison he likely had in mind is not Rails or django, but the plethora of
Java web frameworks.

Personally, for Java Web Frameworks there are two I like, for quite different
reasons.

The first is Spring MVC. the rest of Spring can go die in a fire for all I
care, but the Spring MVC part is quite nice. Used properly it allows you to
very quickly write a 'low ceremony but high fidelity' server based system. If
you make some simplifying assumptions you can have all the Ajax you want too.

The other is GWT. The authors continually harp on about saving us from
Javascript inconsistencies and cross browser compatibility. And, to be honest,
I think they have a very good point. Anyone who has done serious web work
would have run into cross browser problems. There are some other benefits to
GWT, such as moving client state down to the client, where it well and truly
belongs. Also the ability to pass real, proper Java objects (or at least
_pretend_ that is what you're doing) means GWT would never even notice most of
the 'heavy lifting' that other frameworks keep rupturing their disks over -
such as parsing form parameters, or having to post forms to the server to get
them validated only to have to go back to the client and recreate the failed
form... (save yourself the round trip and a square headache).

Now, obviously I'm clueless, but to my untrained eye as a programmer the bits
I'd need to put into a Lift app look similar in some respects to the JSP tag
libraries. E.g. they are trying to get you to do the programming in the html
or xml. The problem is that xml (or any of its bastard love-children) is
absolutely awful for doing logic in, which makes it deeply unsuited for that
task. The only JSP tag library that I remember being worth mucking around with
was some sort of super-duper-table-thingy.

Oh sure, you might not need to use weird variants on tags like <h:form> or
<f:u:form> or <z:button> or whatever it was, but is moving the weirdness from
the tag into the style/class really that big of an improvement? It is still
doing the programming in the wrong place, that is, in the html.

~~~
weichi
Naive question here (I've worked on web apps, but it was using Java technology
of the circa 2000 vintage, so my knowledge is quite limited).

It seems to me that it would be really nice for a developer to be able to
treat html/javascript/css similar to the way that developers today treat
assembler - a very low-level way to the browser to do exactly what you want,
but something that the large majority of programmers don't need to know
anything about. So that instead of needing to write html/javascript/css, a
developer codes to an api that operates at a higher level (in much the same
way that developers of GUI applications code to an api that operates at a high
level).

Are there web frameworks that insulate developers totally from
html/javascript/css? Is this what frameworks like rails/lift/django give you,
at least for a limited domain of applications? Is such a framework even
possible? Desireable?

~~~
bad_user
The problem with your logic is that HTML / CSS ... is the most powerful API
ever invented for building interfaces.

It is so powerful that similar APIs are being brought to mobile phones, e.g.
Silverlight / Qt Quick; but for the record, even Silverlight / Flex are a pain
compared to plain HTML / CSS (try building customized components sometimes).

The only problem with HTML / CSS is the browser inconsistencies involved and
I'm obviously biased here, but it's nothing compared to what I experienced
while developing / testing with Java Swing or wxWidgets.

Cross-platform is a bitch, trying to solve it is nice and all that, but you're
going to quickly run into the problem of "leaky abstractions". And for the
record, I tried GWT and other web frameworks that tried doing this ... I
completely hated every minute of it.

------
jcromartie
Meh... not too impressive. Parallel Rendering: why is this a big deal? Wiring
is what ASP.NET has been doing for ages. I don't see the Wizard being more
than a few lines of Clojure, and Seaside just completely blows it away.

~~~
aaronblohowiak
Parallel rendering matters because it increases page load speed. Let's say you
have a page with 10 components that take an average of 100 ms to serve
(including calls to db/soa, controller and view.) If loaded sequentially, your
page will take 1 second. If loaded in parallel, it will only take 100ms (+ a
little overhead.)

You might think: "oh, but this is just rendering, but most of the time is in
the models/db/soa". You'd be right in other frameworks. Lift is view-first, so
it will figure out what components it needs to serve up based on the view and
then parallelize all of the computation required to fulfill them.

------
extension
Unfortunately, this site takes the approach of "look how you can build wiz-
bang with only N lines of code" rather than explaining the underlying
functionality. This is exactly the wrong approach to impress developers.

It may be that Lift uses versatile and air-tight abstractions to accomplish
these things, but we can't really figure that out from what's on this site. I
recommend that the authors focus more on the principles on which Lift is
built.

------
herrherr
Hm. Lift even works on Google App Engine. Pretty nice:

<http://www.scala-lang.org/node/1826>

That would take the pain out of deploying an app.

~~~
sorenbs
An example app running in app engine: <http://lift-example.appspot.com/>
Please notice that comet (and actors in general) does not work on app engine.
If you are comfortable in linux it is pretty easy to copy jetty and a war to a
vps like linode.com. For a more app-engine like experience the newly announced
amazon beanstalk might be a pretty good choice, but i have not tried it yet.

------
bryanwb
I would love to see how performant lift is (or isn't) when compared to rails
and django

~~~
mtarnovan
I would expect it to be faster than both because it's build in Scala, which is
way faster than Ruby and Python.

~~~
bryanwb
I also expect as such but would like to see some numbers rather than rely on
my assumptions

------
wyuenho
Let's pretend that these 7 things are really important and makes Lift
different. The key hurdle of people adopting Lift is probably the Scala
language more than anything. If people feel like they are comfortable in a
language, they'll use anything they can get their hands on just to have some
fun.

But does it look like people are having fun with Scala? When I learned SML in
school, I remembered it was quite pleasant. The syntax was simple, type
signatures were easy to read and be understood, and the rules were very
straight-forward. Basically, I could fit the entire language in my head.

When I learned Java on my first job, I remembered it was also quite pleasant.
The syntax was familiar, and concepts easy to grasp. It was verbose as ever,
but hey, as least I could brain dump my thoughts into the source code, and
read other people's brain dumps. Then Java 1.5 came with its "generics" that
can't even remember it's own type after compilation...

A couple years later we now have this bastard child monster all grown up
called Scala with its hybrid parametric P /subtype S polymorphic _ with
implicit DSL <: smilies and the ever redundant parentheses and braces still in
the control structures of a 201x language with optional .s and () in function
calls. Don't even get me started on its suicide note that's called the Scala
2.8 Collections in the standard library.

I'm sorry, but I just don't see how this language eco-system can reach a
critical mass with the handful of libraries it has now. Maybe when the tools
are up to speed in a few years, smart Java people who are sick of Java will
migrate over. It just has way too many rules and surprises.

~~~
shadowfiend
Please, do start on the 2.8 collections. I'm curious to know what your
problems are that an actual user of the collections would run into when using
them.

------
csomar
_Lift is the most powerful, most secure web framework available today._

Sorry, but I failed to understand: is this a web server, a programming
language...? I don't exactly get, what it does and for what I should use it.

~~~
LiveTheDream
Lift is a web application framework, written in Scala. Scala is a programming
language. You would run this application with an HTTP server/servlet container
like Jetty (optionally putting a different HTTP server/reverse proxy/load-
balancer in front of that, like nginx).

<http://www.liftweb.net/>

<http://www.scala-lang.org/>

<http://jetty.codehaus.org/jetty/>

<http://wiki.nginx.org/Main>

------
KevBurnsJr
Is supergluing your framework to the dom really a feature?

~~~
aaronblohowiak
If you want to have your dom events be handled server-side, then it is. It
also lets you do things like have a dom node be bound to the state of a
server-side object so the dom contents are updated when the server-side
object's contents are changed -- it just takes care of the plumbing for you.

~~~
simonw
How well does Lift work if you want your applications to still work with
JavaScript disabled?

~~~
shadowfiend
It's possible to do, but by default Lift's form element bindings are done in a
stateful way, and your session's lifetime is determined by an occasional AJAX
heartbeat request. In short, while you _can_ write applications that should
work with JS disabled, you lose many things that make it awesome.

------
marcamillion
I think the biggest drawback with this framework is the hyperbole description.

If the offerings were sold as more direct and straight forward, perhaps it
wouldn't have been such a disappointment. I expected more - based on the
title.

------
clu3
As per "Lazing loading", if I view the source code of the link. I see all
javascript files are loaded right at the beginning of the page, which is not a
good practice. js loading is blocking

------
wavewash
On the multi-page form demo. It goes automatically from page 1 to page 3. I
expected a page 2.

~~~
mgkimsal
If the age entered is < 18 it goes to page 2 - read the code.

------
tommyg
Although lift has some interesting points their "7" points aren't really
selling me

------
fleitz
If your pages directly access the model, where is the controller? When I see
things like foo.html it makes me think that this is not an MVC framework. (eg.
foo.html on the server = /foo.html on the website)

If you don't shred pages from the designer then how to you retain the same
look and feel across pages (eg. Does lift not have templating?)

Also, Lift is not the best framework for me because you have to write HTML and
can't use something like HAML.

Sass + Haml + coffescript = WIN!

