Live data from Hacker News

Why Lift is My Favorite Web Framework

blog.fliptop.com

31–40 of 46 posts

Re: Why Lift is My Favorite Web Framework

#31
post #26

Earlier quoted context omitted.

Can you elaborate a little more on the server-side statefulness of Lift and the issues you encountered? I was reticent about statefulness on the server-side, until I read an article about statefulness in Lift[1], which does mention how having session affinity helps with it. Mostly, my questions are: does it scale and how do you handle state loss (due to servers catching on fire or other hardware/software failures)? […

State loss is something I've been doing a great deal of thinking about. Right now a page reload is necessary, and I've written code in the past to essentially store any modified fields before running the page reload and restore them when the reload completes. However, I'm still working through the conceptual aspects of restoring a page without a reload, over AJAX, provided I can figure out a good way to do it without…

I don't know much about how Lift works, but would doing something akin to PJAX[1] (reloading the entire page via AJAX) work in your case?

With regards to state loss, the only way I can see it working is if you save everything to a system of reference, just like you'd do in Play. Unfortunately, that's also a major pain in the ass, as we've found out, especially in the case of multi-step forms in Play.

[1] http://pjax.heroku.com/

Re: Why Lift is My Favorite Web Framework

#32
After some years of living with Lift: Liftweb is awful. Don't use it.

There is not enough documentation (by a large margin, even with the books, one example being the dozens of hooks you could hook into if they were documented), it's too complicated and there are a millions ways to do one thing.

That said the rendering and binding is the best way to do rendering I've seen yet. I'd wish this was easily usable with other frameworks. And Rogue (from foursquare) for Mongo on top of Liftweb persistence mapping is excellent. My understanding they will support things outside Lift in the future.

Re: Why Lift is My Favorite Web Framework

#33
post #30

Lift's JS & jQuery code generation is nightmare-inducing, it's ridiculous to call it a "benefit". JavaScript should not be auto-generated by some flavour-of-the-week web framework in a totally different language. You're just creating a whole world of pain for future-you.

I respectfully disagree. I was able to finish an ajax form, including value validation with only a snippet and it's binded scala function. I did not have to create a specific rest API and write up jquery ajax code along with the snippet. Lift's JS & Jquery support was never meant to replace js and jquery. (don't write up every js feature with lift.) It's meant to eliminate tedious js works that both frontend and backend developers don't want to spend time on.

Re: Why Lift is My Favorite Web Framework

#34
post #20

Regardless of the technical qualities of Lift, its future is pretty uncertain with 1) dpp leaving the project (in pretty bad terms) a few months ago and 2) Typesafe choosing Play over Lift for its stack. I would definitely not pick Lift today for a new project.

dpp did not leave lift. true he has other projects and focuses on more than just lift, but he is still heavily involved in it. as to why typesafe chose play over lift: they wanted to go with lift but dpp didn't want to work with them - didnt think it a wise decision. his explanation: http://www.quora.com/Lift-web-framework/Why-did-Typesafe-sel...

This was a very interesting read, especially the part about the internal workings of Typesafe (a bit concerning too).

Re: Why Lift is My Favorite Web Framework

#35
post #13

Many of the same advantages (and some additional ones, no doubt) hold for the Haskell web frameworks, with the added benefit of using Haskell. I'm in no position to say whether Yesod or Lift is better; I just wish more people would consider Haskell at all--it's a great choice for web programming (among many other things).

Yesod is great, especially its quasi quoters, such as Hamlet.

However, two things that I constantly bumped into maintaining a small Yesod app is that there was a fairly constant stream of API changes and that deployment on different machines was annoying because of version conflicts installing packages.

If you use Yesod, you are probably best off using a Cabal sandbox (e.g. via cabal-dev) and making specific package versions dependencies. Of course, that may be questionable from a security perspective.

I ended up rewriting that particular web app to Play, which offers some of the same benefits, but was a lot easier to deploy. You can create a stand-alone version of an application with play dist, which includes all the required jars, and the only thing required on a server is the Java runtime environment. Also, Maven/sbt seems a lot more mature than Cabal. As an added advantage, you can use tried and tested Java or can go all-functional via Scala.

Re: Why Lift is My Favorite Web Framework

#36
post #13

Many of the same advantages (and some additional ones, no doubt) hold for the Haskell web frameworks, with the added benefit of using Haskell. I'm in no position to say whether Yesod or Lift is better; I just wish more people would consider Haskell at all--it's a great choice for web programming (among many other things).

Yesod is great, especially its quasi quoters, such as Hamlet. However, two things that I constantly bumped into maintaining a small Yesod app is that there was a fairly constant stream of API changes and that deployment on different machines was annoying because of version conflicts installing packages. If you use Yesod, you are probably best off using a Cabal sandbox (e.g. via cabal-dev) and making specific package…

Well, for very relative values of "all-functional".

But yeah, Cabal is certainly a bit of a pain. Happily, people are working on it. Superior cabal-dev functionality is going to be integrated into cabal proper very soon, if it hasn't already, for example.

Also, couldn't you just compile your binary with static linking and just deploy that? I understand there can be problems if you depend on certain non-Haskell libraries like GUI toolkits, but that shouldn't be an issue for a web app. I think a statically linked binary is pretty similar to a jar file in practice.

Re: Why Lift is My Favorite Web Framework

#37
I might get downvoted for this..but I'll risk it, because it is a message that needs to be passed. My experience on using Lift. A few months ago, I was evaluating various frameworks to start off with my new web app. I am already running a dozen RoR apps and gradually I'm moving away from RoR. I will explain as to why, later in my post.

I was evaluating between Play and Lift and I ended up choosing....Lift. Lift has an extremely high barrier to entry mainly because of the poor documentation. When I first started off with scala, I didn't even know what the hell was SBT, when I downloaded Lift, there were a lot of things that were confusing - I was expecting perfectly organized folders just like ruby on rails, but everything was almost hidden/scattered. However this was the only barrier to starting up with Lift. I also did read about the controversies about the framework, etc [1]. of Lift, but honestly, none of them actually mattered to the developer, that is me. Now that I've chosen Lift, I think I made the right choice. Now, WHY is Lift better?

1) It's a 3+ year old Framework that is extremely stead-fast and stable, production-ready.

2) Scalability - This is a subjective view, but many high profile companies switch to Scala from Ruby/PHP/etc. when they need to scale. And Lift is a really good framework that gets the job done. [2][3]

3) Contrary to popular belief, once you cross the barrier to entry, it becomes much much easier to develop Web apps with Lift. Remember those wordpress days? How scary it was in the beginning to write custom themes and plugins?? But once you started writing a few, it felt like a breeze, right? That's what I'm talking about - That's exactly how Lift is too! [4]

4) Security - Security is hard. Sure you can write your Web app without using a framework. But if you use RoR, you will realize how much work is being done on behalf of you to make your app secure (Authenticity token, CSRF protection ,etc.) Lift is no different and it is one of the most securest frameworks I've ever worked with.[5] This is a very good guide explaining why you need to choose Lift over anything else.[6]

5) RoR vs Scala - Now, Imagine this scenario - You are a sculptor (web developer). You have two materials to choose from to create a statue (your web app). One is ordinary clay (Ruby on Rails) and the other one is a Metal, preferably some alloy made of copper and bronze (Lift). It is extremely easy to model your Statue (your web app) in Clay. And once you're done modeling, you can add some chemicals, or even thin layers of metal on top of it, etc. to make it strong (Think Unicorn, Phusion, etc). But, no matter what you do, the core is still made of clay and if you throw it down, your clay model will shatter into pieces.

Now compare it with the Bronze alloy (Lift). It is extremely hard to make a statue with it, but once you make statue with it, it's going to be so hard and robust, it can handle pressure (load) well - Even if you drop it, it might deform slightly, but never break. But, the disadvantage is that it takes too long to model a statue with this metal. However, you should decide if the trade-off in time is worth the effort in the long run. Of course everyone wants a nice status that is robust!

In the real world, you will probably be ok with RoR, but when you need to scale, you will realize the potential benefits you are missing out soon[7] - For example, if RoR can handle X requests/sec, and Lift can handle 10x requests per second, and assuming X requests require an Amazon box, then you save 9 boxes with Lift. That is huge savings for your start up, isn't it? I always wonder why people try so hard to scale RoR. It's a great framework, but the wiser thing to do would be to use something more efficient when you need to , than holding onto something that is less efficient because you like it. Also RoR has its own confusing terminologies (personal opinion). For example:

    render json: @post
    render :json => {:errors}
Notice the colons before and after the word 'json'.

If you are interested in Scala, Coursera has a course on Learning Scala by Martin Odersky (The creator of Scala) and it is really good. Scala is not a purely functional programming language, which means if you are accustomed to programming in Ruby style, you can take it with you to Scala too.

[1]http://www.quora.com/Lift-web-framework/Why-did-Typesafe-sel...

[2]http://img.scoop.it/FP9bEzouSr7kRinQRAtGmDl72eJkfbmt4t8yenIm...

[3]http://www.quora.com/Why-did-foursquare-choose-Lift

[4]http://stackoverflow.com/questions/2573608/what-type-of-weba...

[5]http://seventhings.liftweb.net/security

[6]http://seventhings.liftweb.net/

[7]http://lift.la/lift-state-and-scaling

Re: Why Lift is My Favorite Web Framework

#38
I am amazed people even see Lift as in the same balpark as Play. When I last used lift It appeared to be a relic of the J2EE stack ported to a new language. This goes beyond any technical capabilities of the framework and down to how it expects you to work in it. Even the author says that just getting started can be a pain, doesn't that tell you something about your framework. It its hard to understand what to do its hard for people in the future to understand what you did. So who cares if you can make pages with just a few "snippets" no one else can figure out what you did.

Re: Why Lift is My Favorite Web Framework

#39
post #19
post #6

I've had very similar feelings using enlive in Clojure land. I doubt I'll be switching back to a more traditional templating engine any time soon.

I'm very happy with Hiccup, I think both paradigms are better than the more common ERB style templating. Either pure Clojure (or whateverlanguage) or pure HTML rather than a mix. I wish Clojure had a batteries included framework like this just to draw more attention to the language.

Have you had a look at Luminus[1]?

[1]: http://www.luminusweb.net

Re: Why Lift is My Favorite Web Framework

#40
post #31

Earlier quoted context omitted.

State loss is something I've been doing a great deal of thinking about. Right now a page reload is necessary, and I've written code in the past to essentially store any modified fields before running the page reload and restore them when the reload completes. However, I'm still working through the conceptual aspects of restoring a page without a reload, over AJAX, provided I can figure out a good way to do it without…

I don't know much about how Lift works, but would doing something akin to PJAX[1] (reloading the entire page via AJAX) work in your case? With regards to state loss, the only way I can see it working is if you save everything to a system of reference, just like you'd do in Play. Unfortunately, that's also a major pain in the ass, as we've found out, especially in the case of multi-step forms in Play. [1] http://pjax.…

But we have a system of reference in Lift—CSS selector transforms refer to an element by its location in the DOM, rather than by a given name. I think there's room there for a creative solution.
Post reply on HN