News for hackers. Stuff that matters.
Re:The Play Framework at LinkedIn by ratpik on Thursday February 21, 2013 @02:07PM (#5259379)
Was excited to check out Linkedin using Play but then the reasons highlighted in the article almost let me down.

I am comparing to Python frameworks and Node and everything mentioned there has been available in the Python stack for a while and now Node (extra points for realtime websockets stuff).

As per the post Play boasts of:

Rapid iteration, Reactive (only for the server not the client), Open, Supported, Flexible, Java & Scala

Maybe I would consider Java & Scala just for the enterprise community scale but definitely not the only one for functional paradigms or rapid iterations.

Everything else is there in other modern web frameworks in Python, Javascript & even perhaps Ruby.

Probably a new thing for Java but why the choice? Is LinkedIn constrained to use the JVM?

Re:The Play Framework at LinkedIn by brikis98 on Thursday February 21, 2013 @02:36PM (#5259641)
LinkedIn is primarily a JVM shop. We believe that type-safe languages like Java and Scala are a good choice for building performant and reliable systems that scale to huge numbers of users as well as huge numbers of developers. We aren't constrained to the JVM - for example, we use node.js for our mobile server - but it has significant advantages and we have years of investment in it.

Unfortunately, we found developer productivity in the Java/Scala world to be a huge problem. We also found that most Java/Scala web stacks, based on servlets, were far behind other web frameworks (RoR, Django, etc) in terms of keeping up with the requirements of modern web development. Play helps on both fronts: it dramatically improves developer productivity and handles all the requirements of a modern web stack (MVC, web sockets, powerful routing, easy JSON handling, DRY form handling, etc).

Is it better than RoR, Django, Node? In some ways yes (e.g. Play's reactive programming model is dramatically better than JavaScript's callback mess), in some ways no (e.g. it's hard to compete with dynamic/interpreted languages for pure reload time). Is it better than everything else in the Java/Scala world? We think so.

Re:The Play Framework at LinkedIn by zmmmmm on Thursday February 21, 2013 @06:45PM (#5261450)
I'm curious if you ever evaluated Groovy?

With optional static typing you can pretty much pick and choose the best mode for each part of your application, which for me seems like nirvana. Even with static typing enabled, I find the syntax more concise and productive in Groovy than I do with Scala (I'm more experienced with Groovy so there's a lot of bias in that though).

Re:The Play Framework at LinkedIn by brikis98 on Thursday February 21, 2013 @07:00PM (#5261541)
LinkedIn has been using Grails for ~4 years. It's a terrific framework, but we found that Groovy was one of the downsides. The language is very easy to learn and use with Java, but we found that it didn't scale nearly as well to large numbers of users or developers. It's worth noting that this was pre Groovy 2.0, so I'm not sure what has changed in the latest version of the language.
Re:The Play Framework at LinkedIn by zmmmmm on Thursday February 21, 2013 @07:07PM (#5261584)
Thanks - that's really interesting to hear. It sounds like your use predated 2.0, at which time I would certainly have said the same thing. However static compilation (a feature of 2.0) has definitely changed my feeling about it - you're getting compile time type checking and near-Java speeds, but all the highly expressive Groovy syntax still works.
Re:The Play Framework at LinkedIn by vorg on Thursday February 21, 2013 @08:00PM (#5261828)
> you're getting compile time type checking and near-Java speeds

The static compilation added in Groovy 2 is much faster than dynamically-compiled code but is still buggy e.g. http://stackoverflow.com/questions/14774709/groovy-2-1-0-wei.... It was written by one developer, and first shipped in Grails only 2 months ago, which doesn't even seem to use the static compilation features (correct me if I'm wrong). Let the Groovy/Grails developers eat their own dogfood first before recommending Groovy's static compilation to others.

Re:The Play Framework at LinkedIn by smrtinsert on Thursday February 21, 2013 @03:15PM (#5260017)
Developer productivity is really broad. Can you elaborate? Most modern webapps I work on end up as json services and the backend are just java pojo services that can be unit and int tested - tdd with java is extremely fast in my experience.

the whole servlets/jsp/jsf thing is dead imo, is that where you guys were losing time?

Re:The Play Framework at LinkedIn by brikis98 on Thursday February 21, 2013 @04:24PM (#5260524)
We had Java services that produced JSON, some that used JSPs, and a variety of others. TDD works in some cases, but if you ever wanted to do manual testing - for example, actually see the UI you were working on with real data - that meant redeploying the server after every change.

Play makes this dramatically faster/easier. TDD is better with Play as well: the plugin support, strong test tools, and sbt's ~test command are amazingly productive.

Re:The Play Framework at LinkedIn by smrtinsert on Thursday February 21, 2013 @06:18PM (#5261304)
Personally I rarely test all ui because QUnit verifies all frontend code so long as it meets the json contract.

Regardless, thanks for your post, I'll give Play a go!

Re:The Play Framework at LinkedIn by chaostheory on Thursday February 21, 2013 @03:28PM (#5260127)
If I were to guess, it would be configuration, more specifically the myriad number of choices and combinations of it. Spring's strength and weakness is the power of customizing it.
Re:The Play Framework at LinkedIn by johnx123-up on Friday February 22, 2013 @01:47AM (#5263074)
Thanks for the insights. But, why not Scooter http://www.scooterframework.com/ or ActiveWeb https://code.google.com/p/activeweb/ ? Both look quite comparable with RoR than Play!
Re:The Play Framework at LinkedIn by rybosome on Friday February 22, 2013 @02:40PM (#5266248)
Does LinkedIn make use of Play's async response features for anything public facing? That's a feature that I am very curious about.
Re:The Play Framework at LinkedIn by brikis98 on Sunday February 24, 2013 @04:55PM (#5276082)
Our Play frontends are entirely reactive/non-blocking, so yes, we're using the async features very heavily. We'll have a blog post about this in the near future.

Our Play backends, if they use JDBC to talk to a database, are fully blocking, since pretty much all JDBC drivers are blocking. One of the nice things about Play is it's easy to configure the thread pool to handle this configuration as well.

Re:The Play Framework at LinkedIn by brown9-2 on Thursday February 21, 2013 @02:31PM (#5259587)
Probably a new thing for Java

Not really. I don't see what features Play Framework has that are revolutionary or things that no other framework running on the JVM/Java wasn't able to do before.

"Rapid iteration" is the kind of "feature" that every framework claims to allow. No one advertises they allow "slow iteration".

Re:The Play Framework at LinkedIn by eloisant on Thursday February 21, 2013 @03:38PM (#5260196)
I believe The biggest differentiator in Play 2 is the reactive programming. Even if you look outside the JVM, NodeJS is the only other web framework providing that level of non-blocking http.

Rapid iteration is probably obvious for PHP, Rails or Django, but on the JVM (or .net), it's pretty rare to see a framework that really supports it well.

Re:The Play Framework at LinkedIn by brown9-2 on Thursday February 21, 2013 @04:14PM (#5260440)
The JVM has plenty of non-blocking IO available - what do you think Play's support of it is built on top of? See Netty, for example.
Re:The Play Framework at LinkedIn by platypii on Thursday February 21, 2013 @04:49PM (#5260701)
Right, but that's what I like about Play. They took Netty, and they took Akka and all the other really nice reactive stuff and integrated it very cleanly.

With Akka you get most of the concurrency benefits you would get from a language like Erlang, but with the benefits of having access to the entire JVM ecosystem.

Re:The Play Framework at LinkedIn by slurgfest on Thursday February 21, 2013 @02:51PM (#5259801)
To be fair, if a framework was totally uninterested in fast iteration or couldn't even remotely claim it, then they would simply say nothing rather than offering "slow iteration".
Re:The Play Framework at LinkedIn by dxbydt on Thursday February 21, 2013 @02:21PM (#5259493)
>... Scala...definitely not for functional paradigms

I am sorry, what ?

Re:The Play Framework at LinkedIn by chimeracoder on Thursday February 21, 2013 @02:27PM (#5259544)
I could probably copy-paste this comment from any one of the many other Scala discussions where this has come up, but in short:

Scala isn't functional; Scala is proper (pure) OO in a way that Java never was. Scala doesn't support top-level functions (only singleton objects), which doesn't exactly prevent it from being functional, but certainly suggests that the primary paradigm is still object-orientation.

It just so happens that pure OO, when properly done, happens to embody a lot of features similar to functional programming - Smalltalk is the easiest example of this (eg. the similarities between Smalltalk message passing and Haskell's implicit currying are very clear).

The reason for this is that it's trivial to create a good object system in a purely functional language, so the FP-OO relationship isn't an either-or so much as a 'special case' (ie, OO can be seen as a 'special case' of FP). The converse isn't so true; it's hard and clumsy to build a truly functional paradigm within an OO paradigm.

What GP probably meant is that Scala isn't a good choice for those who are coming from an FP background, since they'll likely notice that Scala seems very OO by comparison (because it is). Even on the JVM, there are other languages (ie, Clojure) which embody functional paradigms more transparently. On the other hand, Scala is a decent choice for OO programmers who want to get a taste of functional programming (or who want to incorporate those paradigms into their code), because Scala allows several aspects of the FP paradigm to come through as well.

Re:The Play Framework at LinkedIn by jorgeortiz85 on Thursday February 21, 2013 @03:30PM (#5260142)
"Functional programming" is one of the most ambiguous and misunderstood terms in software.

If you ask someone coming from ML or Haskell, Scala is more "FP" than Clojure.

If you ask someone coming from Lisp, Clojure is more "FP" than Scala.

Ultimately, it doesn't matter what you call it. Pick your tools based on what they do, not on what other people call them.

Re:The Play Framework at LinkedIn by nessus42 on Thursday February 21, 2013 @07:11PM (#5261605)
> Scala doesn't support top-level functions (only singleton objects)

This is neither here nor there. Scala has "package objects" and functions put into a package object are scoped directly at the top level of the package. They are not nested within any other object. The only downside to this that I can see, is that at the moment, a package can only have a single package object, which means all the top-level functions for the package have to reside within a single file.

Re:The Play Framework at LinkedIn by sixbrx on Friday February 22, 2013 @07:05AM (#5263837)
Technically Scala does support top-level functions, because a top level singleton object can extend FunctionX[...]. It just doesn't support the short "def" form of declaring them at the top level.
Re:The Play Framework at LinkedIn by epsylon on Friday February 22, 2013 @09:40AM (#5264343)
> OO can be seen as a 'special case' of FP

That's quite a claim you're making here. I, on the other hand, pretend that object-orientedness and functionalness are orthogonal concepts.

Re:The Play Framework at LinkedIn by slurgfest on Thursday February 21, 2013 @02:53PM (#5259816)
Is there any objective basis for saying that Clojure is "better" than Scala?
Re:The Play Framework at LinkedIn by chimeracoder on Thursday February 21, 2013 @02:57PM (#5259853)
Not "better" as a language - "better" at exhibiting functional paradigms more transparently. I've fixed the wording.
Re:The Play Framework at LinkedIn by SourPatch on Thursday February 21, 2013 @06:21PM (#5261319)
What do you mean by that? Scala supports closures, currying, immutable data structures, recursion. I'm failing to see how these concepts are less obvious in Scala.
Re:The Play Framework at LinkedIn by ratpik on Thursday February 21, 2013 @02:24PM (#5259528)
Typed out too soon. Meant it is a good reason but not the only language with that reason unless you wish to stick to the JVM.
Re:The Play Framework at LinkedIn by ikailan on Thursday February 21, 2013 @02:17PM (#5259463)
LinkedIn isn't constrained to the JVM, as they had some apps running on CRuby 1.8 and node.js, but they do heavily favor the JVM. JVM interop DOES help with much of their existing codebase which is Java heavy.
Re:The Play Framework at LinkedIn by ratpik on Thursday February 21, 2013 @02:26PM (#5259540)
Yeah I agree to interoperability. Makes it much simpler to have the same Java stack across the distribution. Either way, that's a big boost to Play framework!
Re:The Play Framework at LinkedIn by ikailan on Thursday February 21, 2013 @03:51PM (#5260287)
It's been a while, but there was a lot of use of Groovy on Grails a few years ago for exactly this reason. I was a strong advocate of JRuby when we did run Ruby code, but it didn't get very far.