The Groovy project is looking for a new home(glaforge.appspot.com) |
The Groovy project is looking for a new home(glaforge.appspot.com) |
"Interest in Grails/Groovy is diminishing" - I won't comment on trends but there is still a large, active user base and community
I won't list the benefits of Ruby/Rails over Groovy/Grails because I will assume the audience here is familiar with Ruby/Rails.
Specifically here are some benefits of Groovy over Ruby:
- Very good JVM tooling and integration
- Familiar (Java)
- Developer friendly (Ruby has a number of syntax warts, e.g. elvis operator, null safe operator - just to start) syntax
- Optional static compilation
- Optional typing
and Grails over Rails: - Performance - take a look at techempower benchmarks http://www.techempower.com/benchmarks/#section=data-r9&hw=peak&test=query
- Spring integration - having Spring built in is often useful in an enterprise context where existing Spring use exists
- Typing is nice if you like that (Mentioned above)
When I need to decide between using Grails and Rails, it usually comes down to developer convenience vs performance. I am asking myself do I want to give up a lot of performance (with Grails) for a little more developer conveniences (with Rails)? Sometimes the answer is yes, sometimes no.Do you have any examples here? I can't think of a time when I've had to hunt long to figure out where things are happening in Rails.
Couple things to add to the pros/cons:
> Developer friendly (Ruby has a number of syntax warts, e.g. elvis operator, null safe operator - just to start) syntax
I would love to see the elvis operator and the null safe operator in Ruby, but I'd also like to see blocks in Groovy.
An addition to the pros of Groovy:
Interacts extremely well with existing Java code. While you can call into Java from JRuby, it's no where near as clean to interoperate with Java in the same code base. In the past I've loved Groovy because I could use it very cleanly inside a codebase that had a lot of Java, e.g. use Groovy to write controllers or data munging code but use Java for most other things.
Groovy allows passing a closure to a method with signature (where p3 is a callable)
a(p1, p2, p3)
as a(some_val, some_val){ closure content }
Are Ruby's blocks more powerful?It's much easier to write unreadable Scala code than Groovy.
Based on the docs for elvis, it looks like
potentiallyFalsyValue ?: safeDefault
is exactly equivalent to potentially_falsy_value || safe_default
in RubyFurther, the null-safe operator seems to be the same as #try in Rails and overuse of either is probably a bit of a smell that you might be violating Tell Don't Ask
<Type 1 or Type2> ||(Type1 arg1, Type2 arg2)
but in how many other languages is this? boolean ||(arg1, arg2)
C, Java, Objective-C, C++, C#, PHP vs Ruby, Perl, JavascriptIf || is used more frequently as a logical operator returning true(1) or false(0) to test logical or (not to be used for assignment), why overload this operator?
Having a separate operator like ?: better shows the intention of the usage. It also resembles the ternary function which has similar functionality.
Even though Pivotal Software is an amalgam, Pivotal received most of its culture from Pivotal Labs. To the extent that you can anthropomorphize a corporation, it really, really likes Ruby. Because of CF, it's warming up to Go fast. Spring is too big and important to neglect. But it's hard to see how Groovy/Grails fit into the big picture. It's not in vogue with the top decisionmakers and it's not critical to the business - it's just something that tagged along with Spring. I doubt anyone has any idea what to do with it.
Now that JRuby is more mature (and, as of today, the only one of the two with official sponsorship) the need for Grails is greatly diminished. The only other major development effort that utilizes Groovy is Gradle, and that has been met with mixed levels of enthusiasm. Add to this that Java itself has made some strides with adding functional(-ish) features to the language, and the benefits that Groovy brings to the table are not as pronounced as they once were.
And for devs who are wanting something that is more purely functional there is Scala.
Given this I'm not particularly surprised to see Pivotal's decision here. Groovy has always struggled for more widespread relevance, and while it is sad to see this happen, it's also far from unreasonable.
It provides fantastic support for concurrency with gpars.
It provides the ability to write static or dynamic code.
It integrates seamlessly with Java.
I feel groovy has created it's own space in the ecosystem, continues to grow and has a bright future.
OTOH, I expect both projects to remain alive, even without corporate backing, although perhaps not moving quite as quickly (which would still be a loss).
Good luck for the business.
http://webcache.googleusercontent.com/search?q=cache:tVxs2fJ...
Also, if the "portless" version doesn't work for anyone, I've experienced that adding :8080 and :8090 can have better luck. I am unaware of the difference between the two ports.
Seems its hype has been eclipsed by Clojure and Scala.
"I’m talking about at Dr. Nic’s talk at RubyConf 2011, a little more than a year ago. Dr. Nic had a fairly simple message: when performance matters, build multithreaded programs on JRuby (also: stop using EventMachine). Now granted he was working the company that was subsidizing JRuby development at the time, but I didn’t, and I for one strongly agreed with him. Not many other people in the room did. The talk seemed to be met with a lot of incredulity."
So even among Rubyists, there has been growing interest in Ruby beyond the MRI, and if that is happening in the land of Ruby, then the argument for Groovy is that much weaker.
At the same time, the growing interest in dealing with concurrency certainly helped increase interest in Scala and Clojure, and furthermore, functional programming in general. If you are a developer who wants to harness the power of concurrency for greater speed, Scala and (especially) Clojure are full of interesting ideas for how to do that. Groovy, meanwhile, feels off-topic.
Ruby doesn't have optional strong typing, which is critical to Groovy's bridging of Java and Ruby.
The optional strong typing enables a host of significant advantages, from code readability and assertions to IDE tooling/autocomplete ease... better API design... and many other things.
I often wish it had gained more momentum before Clojure and Scala showed up.
The Java interoperation is much, much cleaner than in Jython or JRuby due to Groovy being a first class JVM language.
Pivotal is trying to push vert.x now, which I think is a node.js for JVM type of thing.
Since they never did make an awesome configure-spring-with-groovy conversion, I guess this won't be too painful of a split.
Groovy was the #1 JVM language besides Java for quite a while, I think it still is despite Clojure/Scala hype. It was before pivotal took it on, and it probably will be fine.
It's feature set is actually fairly stable. It doesn't need to do Java lambdas, since it has its own, so no major Java cross compatibilities to port from Java8.
I have been using Groovy and Grails for less than a year now and love it so far.
But the buzz around Groovy has diminished. There's only so much room for the already crowded JVM ecosystem. It's great to have choice, but there's only X number of developers, X number of companies that can sponsor, X number of users that build a community.
I'd like to see a language like Groovy, but with some of the semantics of Clojure, and some optional typing. Maybe it's time for a reboot of the language.
Pivotal's decision is likely based not only on what you see, but on what else they see but you can't. They can see trends and revenues before the rest of us can, like former SpringSource CEO Rod Johnson who jumped ship over to Scala.
These are some concerns with Groovy I've blogged and commented about a lot over the past few years:
* the failure of static typing to take hold in any way. Groovy's a dynamically-typed scripting language for Grails, Gradle build scripts, and Java class manipulation. Virtually no-one uses Groovy to build systems, and even Gradle's codebase is virtually all Java. Groovy's a good scripting language for Java, like bash for Linux, and the project management should have stuck to their knitting and made it better instead of diversifying into static typing and now Android.
* their obsession with popularity rankings. Tiobe, Stack Overflow, and Github are gamed. The download numbers are fabricated. This goes far beyond what other programming language communities get up to. A year ago Groovy was number #18 in Tiobe (Oct 2003) but now they're not even in the top 50, and in April 2011, Groovy dropped from #25 to #65 in a single month, all this because of someone manipulating search engine results for some short-term marketing.
* the constant fight for control over the product. The original post is to a person's personal blog instead of one on Codehaus or Pivotal. This started happening a year ago, when that person also started soliciting for subscribers to a personal weekly mailout instead of supporting the community mailing list. No-one knows who controls the new Groovy website being promoted. One of the 5 despots in the official Codehaus despotry is trying to take over. This has been going on for the entire lifetime of Groovy when its creator was pushed out.
* the lack of documentation or any language standard designed to make people dependent on consulting and conferences. In the Groovy 1.x days, they even appeared to be changing things to shake off other independent documentation efforts or addon software like Groovy++. When the present management took over, they kept the JSR standard inactive to deliberately prevent anyone building another implementation.
I'm only talking about what happened to Groovy after its creator James Strachan left the project, not before. As for Grails, I don't know much about it except that Groovy's direction seems to be dictated by it. And Gradle seems to be on course for dropping Groovy as their sole scripting language if you read between the lines on their website.
It's good to get a view of whats going on within the community here, I've only ever seen it from the outside looking in.
That said I love groovy as a language. A friend and I wrote a fairly complicated currency breakdown algorithm (lots of corner cases and BigDecimals) once in groovy in about 3 hours, was about 40 lines of code. The production codebase was java so after porting it was something like 300+ lines of unintelligble masses of .divide() .multiply() .compareTo() and so on.
Ruby doesn't offer one of Groovy's killer features: optional static typing.
And Scala... far too alien and complex. There was some talk out there by one of the original Scala dudes talking about how there are something like 30 different fundamental types in Scala.
Groovy offers the most accessible functional programming paradigms to Java programmers. It is a sweet spot.
That said, it sounds like Groovy is a great fit for your organization.
From a few talks I have watched on the internet, it actually seems that Groovy is trying to adopt every language feature, like being lost while looking for new a direction kind of.
Kind of trying to stay relevant in a world of Scala, Clojure, Ceylon, Kotlin, js_ocaml, who knows what.
Maybe I am completly wrong, this was my impression after seeing recent videos.
Most refactors, pretty good line-by-line debugging, etc.
Edit: GGTS is A spring-specific eclipse distribution..
I find IntelliJ support quite excellent.
One instance of where this is handy is for
returning a 'sensible default' value if an
expression resolves to false or null
http://groovy.codehaus.org/Operators#Operators-ElvisOperator(?:)As I use Groovy more of a host for DSLs (like Gradle or Spock), I hope tooling for this areas will improve. In my eyes, this is Groovy's sweet spot.
Compared to what? JRuby? Groovy's adoption, from the number's I've seen, walks all over JRuby's.
It's just that the Java world is not fashionable (besides say Clojure) and you don't often hear from the people who use Groovy in their enterprise projects, whereas 10 startups using the language-du-jour can create the impression that it's the hot shit on HN.
Perhaps I should've used the expressions "compile-time ..." and "run-time ..." to be more accurate, but virtually everyone uses "statically-typed" and "dynamically-typed" in their place.
You can write code like:
List<MyObject> mylist = new HashSet<Integer>() {{ add("string"); add(1L); }}
You will get groovy.lang.GroovyRuntimeException with constructor issues.
Actually the Groovy developers call it optional typing, not static typing. And it has always been confusing.
Still though, if you really really need static typing at compile time, Groovy never stopped you. You have always had the possibility to call Java code from Groovy and Groovy code from Java as Groovy compiles to valid Java byte code.