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

Clojure is the thing that fills the flexible, expressive language niche on the JVM for me. This is to say nothing about Groovy, I've never touched or looked at it.


I think Clojure is great. I even wrote -- a year or so after writing this post -- that it might be a great language as a mind expander[1].

But Clojure is so dramatically different from both Java (the language) and dynamic languages more broadly (e.g. Python/Ruby), that it's a bit of a leap for workaday programmers; it's certainly no clean-up man.

[1] http://www.pixelmonkey.org/2012/06/13/clojure


> and dynamic languages more broadly (e.g. Python/Ruby)

[sigh]

It's a sign of the times when HN posters say "dynamic languages" and manage to ignore the Elder Language, the language from whence all dynamic languages sprung. And that language is...


The Land of Lisp http://www.youtube.com/watch?feature=player_detailpage&v=HM1...

(but I'd argue it wasn't until InterLISP and Smalltalk that all the pieces were there)


Lisp!


From a practical perspective, Clojure is pretty close to Python in day to day usage. The largest difference to adapt to for me (and a couple others that I worked with), was the absence of the imperative-style for loop/yield keyword combination in Python. To get something similar, you tend to need to rewrite into something with lazy-seq/loop+recur. Everything else (for work doing web development, data processing, and internal API development) is pretty close with favorable points to each depending on the task.

If you were already writing pure functions in python and then creating data flows using generator expressions or list comprehensions, moving to Clojure is very natural. If you aren't, and if your job is to move bits from one place to another performing transformations along the way, you were already having issues in Python and might want to consider the approach regardless of the particular language employed.


I really want to learn Clojure, but somehow my brain refuses to engage with Lisp-style syntax. I just cannot read it at all.

Groovy is perfect for me, because it has a familiar syntax, but it allows me to do much more in a much more readable way than Java would.


Groovy isn't just a language that runs on the JVM, it is a super set of Java. Valid Java is valid Groovy, so if you want to convert an existing project from Java to Groovy you just have to change the build scripts, and change .java to .groovy. Intermingling Java and Groovy classes feels natural because their syntax's are so similar.


Clojure is my favorite JVM language, too (alongside Kotlin), but I think Groovy can fill a different role even if your go-to language is Clojure. Groovy is great for writing non-lispy DSLs; one of those is Gradle, that's quickly becoming the de-facto standard JVM build tool, slowly but surely replacing Maven. Also, I think Clojure is better for "serious" projects, while Groovy is better for throwaway scripts (not that you can't do serious projects in Groovy or "non-serious" ones in Clojure).


> Groovy can fill a different role even if your go-to language is Clojure. Groovy is great for writing non-lispy DSLs

You can just stick the required syntax atop Clojure, using parsers and macro forms. For an example, see my https://github.com/gavingroovygrover/grojure


I did the transition from Java to Groovy (because of Grails) which helped me to become familiar with closures and a more functional style of programming, which eventually got me interested in Clojure.

I still think Groovy is valuable as a "better Java than Java" but it's kind of hard to explain to newcomers how much ahead Clojure is. It took me a while to leave my prejudices against the parens and try to understand why it was so powerful and why the LISP family of languages is still alive. It's not by mere coincidence.


I've tried Clojure. I just can't do it, I don't find it terribly expressive. I like functional idioms and immutable data but I just find Clojure to be a never ending sea of parenthesis and brackets that bury the expressiveness of the language.


What's needed is a Groovy-like syntax atop Clojure to get the best of both worlds: Clojure's power and Groovy's readability.




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

Search: