3 ms·
I wrote a post awhile back, called "Groovy, the Python of Java"[1], which praised Groovy as a great language for Python/Ruby developers who are forced to work w
by pixelmonkey 13y ago
I wrote a post awhile back, called "Groovy, the Python of Java"[1], which praised Groovy as a great language for Python/Ruby developers who are forced to work with the JVM and associated libraries.
In the post, I said, "Python is still my muse, but Groovy is my Winston Wolf."[2]
As for Scala and Clojure, these are wonderful JVM languages, but they force you into a new programming model. You go from Java's "object-orient all the things" to Scala/Clojure's "function-orient all the things". Groovy, like Python, strikes a balance by being dynamic and multi-paradigm. A true clean-up man.
Its only downside, IMO -- the JVM :)
[1] http://www.pixelmonkey.org/2011/04/09/groovy-the-python-of-java http://www.pixelmonkey.org/2011/04/09/groovy-the-python-of-j...
[2] Scene from Pulp Fiction introducing Winston Wolf http://www.youtube.com/watch?v=ANPsHKpti48 http://www.youtube.com/watch?v=ANPsHKpti48
- mcv 13y agoJVM a downside? I like the JVM. And I love Groovy. It has the easy syntax and familiarity of Java, but instead of using all the ugly stupid stuff of Java, you can also use all the cool fun stuff of Ruby. It's a very enjoyable balance with the best of both worlds.
- pron 13y agoI can understand why in some circumstances the JVM is not the most appropriate choice, but to me, the sentence "Its only downside... the JVM", sounds like "The car's only downside... it's a Ferarri". I've worked with so many runtimes in my career but have yet to see one fit to kiss the JVM's feet. It's far from being the simplest, but in terms of sheer power (runtime instrumentation, runtime linking, performance monitoring, hardware/OS support and more) nothing else comes even remotely close.
- peterashford 13y agoThis is HN. Trash talking anything Java related is image-enhancing amongst code fashionistas.
- pron 13y agoI don't think this is the case. After all, Twitter, LinkedIn, Netflix, Square, Foursquare and eBay are pretty much JVM-only shops, almost all of Facebook's important stuff runs on the JVM, as well as much of Google and Amazon. I don't think anyone honestly thinks the JVM is not very much in fashion.
- sdesol 13y agoI like the JVM but I really don't think the general population of programmers would call it fashionable. I have a friend who never visits HN but has a distrust for it even though his exposure to it was decades ago. The hardware back then was just not ready for it and it probably left some lasting scars. I find that Java and the JVM is just something that you don't talk about, which is why it's never going to be fashionable. Useful yes. Fashionable, I'm not sure.
- pixelmonkey 13y agoI use the JVM "as little as is absolutely necessary", which is often, thanks to technologies like Lucene, Hadoop, Storm, Zookeeper, etc. And, "code fashionista"? Hah, give me a break. Python actually predates Java. I can't tell you how many times in the period 2005-2009 people derided me for using a "scripting" language for real work. All the "real programmers" used C++ or Java, of course! Then, in 2009-2013, everyone suddenly realizes, oh, perhaps we don't need 200 classes per 1,000 lines of code and perhaps we don't need an IDE to that vomits boilerplate all day long and perhaps static types aren't such an important thing and perhaps generics are overrated and perhaps programmer time truly is much more expensive than machine time, ... and, now I'm a "code fashionista" for still using Python for production projects, 6 years later? The "scripting" language that's so non-serious that it's used by thousands of production large-scale systems and scientists the world over? Yes, that one -- the "fashionable" language. The one that isn't fussy and just gets work done.
- pron 13y agoPython is a language, and isn't any more concise than Groovy or Clojure. Also, if the "stuff" you need to get "done" is process a million transactions per second on a concurrent database that runs on a 64-core machine then it's completely inadequate. In all those companies I mentioned, Java the language's competitor is C++, not Python, and that's pretty much the language you can compare Java to. Also, "everyone" is just most people in web startups, which are a very small minority of software developers with very specific needs. They usually work in small teams, so languages designed to help with large project management are not a requirement, but a very fast turnaround is. So, sure, Python is better suited than Java if those are your requirements. This is still just a tangent to the JVM discussion.
- sdesol 13y agoI can't emphasize how easy it is to extract JVM runtime information and how useful that information is for performance tuning. Sure the JVM uses a bigger initial footprint when compared to a natively compiled application, but the ability to see how it's working is invaluable. My program is RAM hungry...ish, but with its easily accessible garbage collection (GC) information, I can really get the most out of a 512MB VPS. Just have the GC logs written to RAM disk and have it rotate and you'll be amazed at what kind of useful stats you can generate. You can see how I'm using it here: http://screenshots.gitsense.com/jvm-monitoring.html http://screenshots.gitsense.com/jvm-monitoring.html The 10 minute ratio stat lets me know how much time was spent doing garbage collection within the last 10 minutes.
- pron 13y ago... and VisualVM, and Flight Recorder + Java Mission Control, and BTrace/Byteman... the list goes on and on. If you need to, you can print out the assembly code generated by the JIT at runtime, modify your code on the fly, and see how the assembly changes. Erlang's BEAM VM has some of these capabilities, but not the JVM's performance. Other runtimes are decades behind.
- pjmlp 13y ago> Other runtimes are decades behind. To be fair, .NET also offers a similar level of support. The only difference is that you have to pay for it, by getting Visual Studio Premium or third party tooling like dotTrace which plug into the CLR monitoring API. For many people, the fact that they get such tools without paying a dime is a selling point for the JVM vs .NET.
- pron 13y agoYes, .NET is excellent, too. But it's Windows only.
- pjmlp 13y agoMany of us don't have a problem with it. :) On my type of work, the tools are chosen by the customers, not me. So usually .NET in Windows only shops, JVM languages in heterogeneous shops, and a little sprinkle of C++ via JNI/Interop if really required.