Stuck with JVM, Sick of Java... Where to go? [closed]
Asked Answered
D

11

11

For the next 3 years I will have to work with the JVM (project requirement) using a very specific third party API. They want Java but I've been given leeway to move away from Java. I was hoping we could move back to the .NET framework so I could develop code in F#, being absolutely in love with OCaml. .NET development has been struck down by our customer. It is a no go.

I've turned to looking, reading, and poking around programming blogs/forums trying to understand which language might appeal to me further: Scala or Clojure. Those seem to have the largest community/fan base. Being experienced with ML languages I see lots of people who compare Scala to ML. However, there are some real naysayers when making this comparison. If Scala was that close to ML my productivity and learning curve would benefit making this switch.

The internet is full of misinformation and wonder if I'm suffering from such. I don't like the syntax of Lisp (don't hurt me!) but if Scala has the warts I'm reading (poor IDE support, in flux Unit testing framework, performance issues) I'm wondering if Clojure is the better option. I want to be productive out of the gate, using functions as first class objects, and minimizing concurrency pain.

So anyways, before I spend too much time on the internet and not working... I'm stuck with the JVM, sick of Java and wondering where to go?

Demolition answered 24/9, 2009 at 18:0 Comment(17)
You know the alternatives, why ask here? It's mostly about personal opinion from here on.Aquifer
to a new job, so you'll work in an environment that makes you happy, and your current company can hire someone more professionalLegist
just about every language that existed before this morning can be compiled for JVM. Take your pick.Fanti
What's unprofessional about wanting to work with languages/technologies that you enjoy?Archoplasm
That is a slightly personal attack. Having said that I don't quite get the idea in the 1st paragraph. Whitespace en.wikipedia.org/wiki/Whitespace_%28programming_language%29 is a great language to write invisible come in.Fizz
@Don - nothing at all. Whining because your current employer wants to use a language that you don't enjoy, however ...Legist
And more importantly, deciding tow switch languages just because you're bored of the old one. Which means that your client will be paying for your newbie mistakes.Legist
I'm not "bored" of Java. I'm also not "whining." I'm just stick of all the boilerplate code I have to develop in Java to get anything done. It kills my productivity. In OCaml I can get done in 10 lines what it would take me 50 to do in Java. Why wouldn't I want to switch to a more productive language?Demolition
Possibly useful. en.wikipedia.org/wiki/List_of_JVM_languagesAcronym
Out of curiosity, you say you're afraid of poor IDE support but does OCaml actually have any IDE to speak of? (I have no idea).Guanine
A good IDE or just an IDE? OCaml has a pluggin for Eclipse, Camelia, I believe one in NetBeans, and then there's always Emacs. I'm not saying they're good. On the other hand F# (which is OCaml.NET with true multi-threading support) has VS2010 (and a VS2008 pluggin.)Demolition
wheaties, you are whining. Changing languages because you are bored is not a valid reason. A valid reason to change jobs - yes, to change languages on a current job - no. Each time someone experiments with a new language for the heck of it they create a maintenance headache for everybody else. You change if the current language can't handle the requirements, not because you don't like to use it.Prosecutor
About whining: I ask that all of you who say wheaties whines stop doing so. It's completely irrelevant to wheaties' question, and not polite. Moreover, it's definitely not a good way to help a new StackOverflow member to feel welcome.Ergosterol
Is it unprofessional to reach for the tools that will deliver the application the client wants faster and with fewer bugs, while retaining the same performance? Is it unprofessional to be concerned about one's produtivity and motivation, and look for ways to improve them? Is it unprofessional to state a professional opinion about the tools of your job and their aptitude to the task you are being put to? Wheaties isn't going behind his manager's back to get the job done (the job done!). Instead, he has discussed his preferences and was given freedom within limit to exercise his expertise.Stylography
Daniel (the True(tm) one) said it: professionalism is often ill-defined. True professionalism is all about making sure you love what you do the most you can, so that you may do it the best you could.Ergosterol
It's also unprofessional to openly insult wheaties. Give your insults one level of indirection. :-) And really, Java is verbose, I have some sympathy. That's why Scala was developed, and by the author of Sun's current Java compiler...Discountenance
@Prosecutor - you are absolutely right. Changing languages/platforms for the sake of "liking" or "disliking" them creates headaches for everyone, especially when the language/platform you are changing FROM handles things equally well (or better such as the case here).Jamin
F
10

Have you considered Groovy? I don't think it is quite as functional as Scala/Clojure, but it's certainly a lot more functional than Java**. In general, I can get the same work done in Groovy with about 50% of the code it would take me in Java.

This is because Groovy is syntactically similar to Java and provides seamless access to the JDK libraries, but the addition of a lot of language features (closures, meta-programming, properties) and dynamic typing eliminates almost all the boilerplate associated with Java programming.

** I mean functional in the sense of 'functional programming' rather than 'working correctly'

Floorman answered 24/9, 2009 at 18:12 Comment(9)
Groovy is a great suggestion. It's similar enough to Java that it doesn't necessarily inspire fear in the hearts of Java houses, but it's similar enough to Ruby that it's a lot easier to be concise and expressive and try functional-style solutions than with plain Java.Interrelation
Groovy, huh? I'll have to give that one some thought! Thanks for your answer. That would make the very good point Oscar Reyes brought up in his post about me working in one language, the rest working in another less of an issue.Demolition
That's right. But it seems Groovy has lost most of its momentum, and who knows if it'll get it back? (I have no data to prove this, other than the fact I see it less often mentioned now than the other alternatives). That said, watch out for Groovy's performance. It's definitely a lot behind Clojure's and Scala's. Plus, since you come from ML, you will find yourself quite limited on the functional programming side of the things.Ergosterol
Groovy's sweetspot is to be used as a scripting language. From what I remember, it aims to bring dynamic typing to Java and a few functional features, and etc.Ergosterol
I disagree that Groovy has lost momentum recently. By way of evidence, check out the growth in Grails downloads over the last couple of years. Also, the company responsible for Groovy & Grails (G2One) were recently acquired by SpringSource, so several million of their dollars says Groovy is alive and wellArchoplasm
Don, you're right. I should have restrained myself to saying Scala and Clojure seem to now have more momentum.Ergosterol
That's probably true, but I'd attribute much of the coverage they've been getting to their newness, rather they any great success or large user base. I reckon there are a lot more developers using Groovy regularly than Scala and Clojure combined, but I've exactly zero evidence to support that statement :)Archoplasm
While I have been accused in the past of dissing Groovy, I'll take this opportunity to point out that calling Groovy APIs from Java is a non-issue, while care must be taken when designing Scala code to enable seamless calling of Scala APIs from Java. Note that neither language has any problems calling Java APIs.Stylography
So one way calling is seamless but backward compatibility with Java has to be approached with care? This is food for thought. One more reason I should give Groovy a much more thorough look even if it isn't functional in the FP sense.Demolition
E
25

In my opinion, both Clojure and Scala don't have great IDE support, if that's really important to you. That said, here's what I can collect from my reading & experience.

Scala's pros

  • Faster than Clojure thanks to more static typing
  • Closer to ML (syntax, type-directed programming)
  • Bigger standard API (Clojure's APIs grow very slowly, because they want to make sure they find the best idioms before making them public. That said, Clojure still has semi-official supplementary APIs)
  • Better integration practices with the typical Java toolset (Clojure is still making some choices, so less firmly established yet on this regard)
  • Older than Clojure (but Clojure is built on top of a very old and proven core: Lisp)
  • People say it has chances to reach mainstream, while they wouldn't say the same about Clojure

Clojure's pros

  • Incredibly easy, fast and right concurrency thanks to MVCC-based STM and other concurrency mechanisms
  • Immutability by default helps doing the right thing first
  • More stable standard API
    • When things change, usually you don't have to rewrite any existing code
    • (Scala's collections are being remade again for 2.8)
    • (I have also read somewhere that it's common knowledge that Scala's Actors implementation needs a rethinking and rewrite.)
  • Easier to learn (small language, being a (very-clean) Lisp)
  • An opportunity for you to grow by learning something different
  • Clojure's performance will only get better with time; there's still room for nice optimizations in the compiler
  • Scala's tying to Java feels more limiting than Clojure's (interactions between Scala's and Java's static type systems). One could sometimes say the same about Clojure (Object-Orientation's support is not a 1:1 fit, but support for this will soon get better)
  • Rich Hickey has a gift for making choices that put Clojure in the position of having technical leading features that will be adopted by other languages in the decades to follow. And he also has a gift for explaining them. So use them today in Clojure, or wait to use them in another language in some number of years. :)

On distributed concurrency

If your concurrency needs are distributed, Clojure doesn't yet have anything for this unless you run it on top of Terracotta or something similar, in which case you'll be able to use all its concurrency features. If you do, you will end up with a better distributed concurrency experience than with Scala's Actors, IMO.

Conclusion

IMO Scala tries to do everything, and succeeds at doing most of it. Clojure doesn't try the same thing, but what it focuses on is more than enough and succeeds so well that most people really knowing Clojure wouldn't want to go back to something else. Disclosure: my personal preference goes, of course, to Clojure. I hope I've been able to be objective in what I wrote.

Ergosterol answered 24/9, 2009 at 19:23 Comment(2)
You've been very objective and informational. I hadn't heard about Terracotta. One more thing to bring to my boss. Thanks again.Demolition
You're welcome. That said, if you consider using distributed concurrency with Clojure, make sure you search/ask the clojure google group about it; they have sometimes mentioned other choices besides Terracotta. Who knows if one of these would be a better fit for your project? I suggest searching the group for "terracotta", you'll find all discussions related to this matter, with lots of great insights.Ergosterol
F
10

Have you considered Groovy? I don't think it is quite as functional as Scala/Clojure, but it's certainly a lot more functional than Java**. In general, I can get the same work done in Groovy with about 50% of the code it would take me in Java.

This is because Groovy is syntactically similar to Java and provides seamless access to the JDK libraries, but the addition of a lot of language features (closures, meta-programming, properties) and dynamic typing eliminates almost all the boilerplate associated with Java programming.

** I mean functional in the sense of 'functional programming' rather than 'working correctly'

Floorman answered 24/9, 2009 at 18:12 Comment(9)
Groovy is a great suggestion. It's similar enough to Java that it doesn't necessarily inspire fear in the hearts of Java houses, but it's similar enough to Ruby that it's a lot easier to be concise and expressive and try functional-style solutions than with plain Java.Interrelation
Groovy, huh? I'll have to give that one some thought! Thanks for your answer. That would make the very good point Oscar Reyes brought up in his post about me working in one language, the rest working in another less of an issue.Demolition
That's right. But it seems Groovy has lost most of its momentum, and who knows if it'll get it back? (I have no data to prove this, other than the fact I see it less often mentioned now than the other alternatives). That said, watch out for Groovy's performance. It's definitely a lot behind Clojure's and Scala's. Plus, since you come from ML, you will find yourself quite limited on the functional programming side of the things.Ergosterol
Groovy's sweetspot is to be used as a scripting language. From what I remember, it aims to bring dynamic typing to Java and a few functional features, and etc.Ergosterol
I disagree that Groovy has lost momentum recently. By way of evidence, check out the growth in Grails downloads over the last couple of years. Also, the company responsible for Groovy & Grails (G2One) were recently acquired by SpringSource, so several million of their dollars says Groovy is alive and wellArchoplasm
Don, you're right. I should have restrained myself to saying Scala and Clojure seem to now have more momentum.Ergosterol
That's probably true, but I'd attribute much of the coverage they've been getting to their newness, rather they any great success or large user base. I reckon there are a lot more developers using Groovy regularly than Scala and Clojure combined, but I've exactly zero evidence to support that statement :)Archoplasm
While I have been accused in the past of dissing Groovy, I'll take this opportunity to point out that calling Groovy APIs from Java is a non-issue, while care must be taken when designing Scala code to enable seamless calling of Scala APIs from Java. Note that neither language has any problems calling Java APIs.Stylography
So one way calling is seamless but backward compatibility with Java has to be approached with care? This is food for thought. One more reason I should give Groovy a much more thorough look even if it isn't functional in the FP sense.Demolition
S
10

I'll address the points you raised about Scala.

  • IDE support:

    Scala doesn't have the same level or IDE support Java has -- or, for that matter, that F# should have with VS10.

    That said, it has one of the best (maybe even the best?) IDE supports on JVM, outside Java. Right now NetBeans is good enough, and people have consistently said IDEA is still better (hearsay). The Eclipse plugin is unstable though.

    But you mentioned a 3-years range, and the IDE support for Scala should be greatly enhanced once Scala 2.8 is out, as it will provide some compiler-support for IDEs. There's no release date defined, but it looks to be within the next six months, maybe three. And the Eclipse plugin will be updated right along with it.

  • In flux unit testing framework:

    Yes, if you meant it is vibrant, evolving and well supported, instead of stagnant and abandoned. ScalaTest, Specs and ScalaCheck are top quality frameworks, compatible between themselves, and compatible with other Java frameworks and libraries, such as JUnit and JMock.

    The testing frameworks, in fact, are almost a child poster of what is possible with Scala.

    EDIT: Scala has basic unit test support in its standard library (scala.testing.SUnit). However, given that many superior, actively-supported and free alternatives have appeared, this has been deprecated and will likely not be part of the library shipped with Scala 2.8.

  • Performance issues:

    I'm unaware of any, aside from the fact that you can write lousy code, just as with any other language. People not used to functional programming will often do stuff that's not efficient, such as not using tail recursion, or concatenating lists, and the paradigm shift that Scala enables brings that to light.

    At any rate, you can write Scala code as fast as Java code (even faster with some upcoming features). And you can write Scala code with functional features almost as fast as Java code.

Stylography answered 24/9, 2009 at 19:45 Comment(2)
Daniel, if I could I'd give you a bump in reputation. What you say is very true of the IDE support. On unit tests, I had thought I had found misinformation regarding these. There were conflicting views from "SUnit is being deprecated" to "JUnit doesn't work on Scala." Thank you for clearing that up.Demolition
Ah! That makes sense. I'll complement the answer, but the short of it is that Scala (still) comes with a Unit test in its standard library, which is SUnit. While better than nothing, it has long been surpassed by the third party alternatives.Stylography
E
9

Quite frankly, get another job.

If you are to spend the next three years feeling uncomfortable on what you're doing, you should consider looking for more attractive alternatives.

Even if you manage to get a language you like, if you are part of a team ( which I guess you are ) the rest of the team might not like that language. If the rest of them code in Java and you in "fill in the blank" programming language, then problems may arise.

It is not that bad after all.

Talk with your boss, let him know how do you feel. Start looking for alternatives and have a nice and professional "leave".

There is no reason why you can't still have a good relationship with your current boss. If eventually they have a new project for .net you may come back. Talk about that also with them. Leave your doors open.

Extrauterine answered 24/9, 2009 at 18:31 Comment(2)
Oscar, you raised a good point with me working in one language, the rest in another. Although I have talked to my bosses and they're ok with me going this route as long as my productivity increases. I won't leave a job just because I don't get to work in my language of choice.Demolition
I think the choice of language is a perfectly valid reason for leaving a job :) or even a girlfriend or wife!Midian
A
6

Its not really a zero sum game, learn them all!
ps: i vote for Clojure, i find it the most fun!

Aboveground answered 24/9, 2009 at 19:1 Comment(0)
S
5

You should consider yourself lucky that you can use the JVM, because the JVM is becoming more and more popular for alternative programming languages than Java.

Besides Java there's Groovy, Scala, Clojure (a Lisp dialect on the JVM), JRuby (Ruby on the JVM), Jython (Python on the JVM), Jaskell (Haskell on the JVM), Fan (runs on the JVM as well as the .NET CLR) and lots more, and there's also an OCaml-Java, OCaml that runs on the JVM.

So, there's lots of choice in programming languages on the JVM, from purely functional to simple scripting and anvanced OO languages.

Semiotics answered 24/9, 2009 at 19:35 Comment(3)
It's been years since the last time I took a look at Fan. Interestingly, it looks much more interesting than Groovy! "Productivity of Ruby, Performance of Java". See fandev.orgErgosterol
Lol, I am lucky to be using the JVM but I can always have hope that one day I'll find myself working with a language which mirrors all my loves. Didn't mean to come across as totally opposed to the JVM. I'm more opposed to working with Java and all its warts. Before I get flamed... All languages have warts, it's just which ones you're willing to handle.Demolition
That's right, Java, the One language under the Sun with Dozens of Thousands of Classes in its APIs. :DErgosterol
R
3

Tool support for Scala and Clojure may be immature, but it's steadily improving.

Since you like F#, then Scala is most likely your best bet. I say try it out and form your own opinion - you might find that the things people gripe about are things that don't matter to you, or things you can work around.

Relucent answered 24/9, 2009 at 18:18 Comment(0)
D
2

Don't forget jRuby, and note that an IDE is optional for non-Java

I think you have a great situation. How many people get permission to choose the implementation language? With everything available for the JVM having your environment chosen is not much of a restriction.

  • You won't need great IDE support in the less verbose languages
  • In a language as powerful as Ruby with no type declarations, you don't need an IDE at all
  • Scala was developed specifically to cure the verbose-java-blues
  • Count yourself lucky that you have three years of work lined up :-)
  • Clojure might be fun and provides functional concurrency-safe design patterns
Discountenance answered 25/9, 2009 at 3:31 Comment(1)
You're right. I am very, very lucky that I've been given permission to explore languages. I have heard wonderful things about Ruby. Hasn't it been described as "Perl without the baggage?" However, does it reduce concurrency pain? The client would like to see more emphasis on scalability.Demolition
L
0

Noop? http://code.google.com/p/noop/ (experimental though)

Legofmutton answered 24/9, 2009 at 18:11 Comment(1)
Can't go with something too experimental. That's why I was limiting myself to Scala/Clojure. Scala has already been shown to work in industry while Lisp has been around for ages.Demolition
M
0

In terms of IDE support and other doubts you're having, Clojure doesn't do any better than Scala. And for a person with ML/F# background (or generally that in strictly, statically typed FP languages), you'll definitely find Scala much closer to what you're used to.

Morehead answered 24/9, 2009 at 21:0 Comment(1)
Damn. I was hopeful it might. Thanks.Demolition
E
0

If you like ML you might like CAL which is more-or-less Haskell 98 for the JVM.

It is high quality and very stable, and has good IDE support on Eclipse, but sadly is no longer under active development.

Ermines answered 26/9, 2009 at 21:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.