Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I certainly appreciate the syntactic sugar of Groovy as a clear improvement over vanilla Java. But with time as a scarce resource I've opted to learn Scala and Clojure instead. It would be great if somehow we could smush Gradle and sbt together to build a best of all possible worlds build system for Scala.

Back in 2009, James Strachan (the creator of Groovy) stated that if he'd known about Scala first he probably wouldn't have built Groovy [1]. This Dr. Dobb's article [2] also has some good points on evaluating Groovy and whether or not it will continue to thrive. The simplicity of its syntax vs scala is a great point for Groovy though.

[1] - http://macstrac.blogspot.com/2009/04/scala-as-long-term-repl... [2] - http://www.drdobbs.com/jvm/the-groovy-conundrum/240147731



> It would be great if somehow we could smush Gradle and sbt together to build a best of all possible worlds build system for Scala

www.gradle.org/overview does say "The Gradle design is well-suited for creating another build script engine in JRuby or Jython. It just doesn't have the highest priority for us at the moment. We happily support any community effort to create additional build script engines."

I have looked at the Gradle source code and Groovy seems to be tightly entangled in it, and it would be difficult to get Gradle to use another DSL language. I'm also doubtful about what they say about happily supporting community effort to create other script engines. Based on my previous experience with the people behind Groovy, not only with regards to the Groovy++ fiasco of mid- to late-2011 but many times before, that line could easily mean "We're happy to hear about any community effort to create additional build script engines so we can scuttle your attempt before it gets very far."

> The simplicity of its syntax vs scala is a great point for Groovy though

Did you say Groovy's syntax is simple? The Gradle DSL is just a tiny subset of Groovy's grammar, see [1]. It's also still stuck on Antlr 2 because no-one wants to try upgrading it to Antlr 4. Scala was designed so its grammar would be light and the functionality residing in the libraries.

[1] http://svn.codehaus.org/groovy/eclipse/trunk/base/org.codeha...


Thank you for these links! I love programming history and the many things you can learn about your tools.

I am stuck on a few projects at work using Groovy/Grails. Groovy itself has been fine and I regularly switch between Groovy, Python and JavaScript with little more than a Google to double check syntax.

However dealing with Grails is a damn nightmare. I recently ran into a bug where grails parsed a parameter query variable containing a nbsp symbol. Instead of giving me a string with an nbsp character, it inserted an "A" with an accent mark in addition to the ndbsp character. Two for the price of one!

The best part was, this only happened after I compiled the app to a war file so it didn't show up in development.

This is the 3rd parsing bug in grails I have found in the last few months alone.

Another one was the when using "render as obj as JSON" shortcut for controllers. The parser was converting "</" characters into a single Unicode character. Causing the HTML string I was trying to render break. However doing the conversion to JSON manually in a service class and setting the right response headers then returning the JSON string worked fine.

The third one was XML builder. Errors are thrown if I have empty leaf nodes (at a minimum I need to add {} to the end of leaf nodes). Only works in dev however as gain when I build the war it does not work at all. Instead I just build my XML string manually.

The final thing I don't care for is the GORM. We have never gotten DB auto reconnect to work with any MSSQL server or DB2 in the last 2 years (that we have been actively trying to get it to work) across 4+ applications.

tl;dr

Groovy is OK but Grails is a total PITA.


> Back in 2009, James Strachan (the creator of Groovy) stated that if he'd known about Scala first he probably wouldn't have built Groovy [1].

I wish people would stop quoting this as if it is some kind of damning evidence against Groovy as a language. It is sad because I often want to say generous things about frameworks and tools that are competitors to ones I am involved in, but then I remember how ruthlessly and persistently people exploit this line (almost guaranteed to get quoted in every Scala discussion if someone mentions Groovy) and I realise that in the real world you can pay a lot for being generous at the wrong time.


Very True. I'm pretty sure that quote wasn't meant to be a critique of the Groovy language, just an expression of interest in Scala. Yet its brought out every time somebody wants to dismiss Groovy.

Compare that quote to this[1] presentation where Paul Phillips lays in to scala for 50 minutes. Even when somebody does criticize their own creation I doubt they mean "Hey everybody, that thing I spent a bunch of time on? Throw it all in the garbage, its pointless".

[1]https://www.youtube.com/watch?v=TS1lpKBMkgg




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: