0

I was contemplating on the necessity of different non-Java languages coming up on the JVM. Apart from syntactic sugar and built-ins, does any of them actually exploit some corner of the JVM, which has not been peeked into by the Java language?


The following is not a part of my question; but here is why I want to know this:

I have been a Java developer for over 10 years, and the only 'java-tiredness' that has creeped in me big time, is its verbosity. The reason which now pushes me to a less-verbose-java-like programming language (with a functional/scripting flavor), which would refresh my tiredness from time to time.

And here, after skimming through the likes of Scala/Groovy (not so much of Clojure); I strongly feel something like Python is just better if I really wish to learn another programming language , not to disown Java, but to add real value to my existing programming arsenal.

Marko Topolnik
  • 195,646
  • 29
  • 319
  • 436
sutanu dalui
  • 663
  • 7
  • 25
  • @Erik - Okay. Thanks for the suggestion. Will do that. – sutanu dalui Aug 18 '15 at 07:09
  • Have you used lambdas in Java 8 much? – Peter Lawrey Aug 18 '15 at 07:12
  • @PeterLawrey - Not really. And here, I should confess that for me using anon classes seem okay. I agree it hits on 'less-verbosity' point bang on, but somehow, using Java, lambdas don't occur naturally to me. – sutanu dalui Aug 18 '15 at 07:15
  • 1
    @Erik this question is a _very_ poor fit for Programmers - it would be quickly voted down and closed over there, see [On discussions and why they don't make good questions](http://meta.programmers.stackexchange.com/q/6742/31260). Recommended reading: **[What goes on Programmers.SE? A guide for Stack Overflow](http://meta.programmers.stackexchange.com/q/7182/31260)** – gnat Aug 18 '15 at 07:15
  • Have you tried writing low latency Java? This is like a sub-set of Java which is highly performant. i.e. where you need consistent micro-seconds latencies. – Peter Lawrey Aug 18 '15 at 07:16
  • 1
    I don't see how you can call it syntactic sugar. Scala is an entirely different language than Java altogether and looks nothing like it, Groovy models more after how Ruby works, Ceylon focuses more on the web rather than general purpose programming, the list goes on. – Gimby Aug 18 '15 at 07:16
  • @sutanudalui This is where your IDE can help. IntelliJ for example can turn anonymous classes into lambdas and visa-versa. This way you can learn to use lambdas without having to write them yourself ;) – Peter Lawrey Aug 18 '15 at 07:17
  • @Gimby Scala models after Haskell and ML-typed languages. And Groovy is more of a dynamically-typed Java than Ruby. Plus, note that you _can_ write Scala which looks very much like Java. That's what Scala looks in the hands of those coming fresh from Java. – Marko Topolnik Aug 18 '15 at 07:18
  • @PeterLawrey - Oh, I did not know that about IntelliJ; have been using Eclipse all the way. – sutanu dalui Aug 18 '15 at 07:20
  • @gnat - My main question is: "Does any of the non-java JVM language actually exploit some feature of the JVM, which has not been accounted into by the Java language". Is this not eligible for a SO question? – sutanu dalui Aug 18 '15 at 07:22
  • 1
    @sutanudalui the JVM was designed for Java so it doesn't have any features Java doesn't use. – Peter Lawrey Aug 18 '15 at 08:13
  • @PeterLawrey "The Java virtual machine knows nothing of the Java programming language..." (VM Spec, [1.2 The Java Virtual Machine](http://docs.oracle.com/javase/specs/jvms/se6/html/Introduction.doc.html#3057)) – gnat Aug 18 '15 at 09:04
  • @gnat true but that doesn't mean that teh JVM wasn't designed for Java originally and changed very little since. (In terms of byte code) – Peter Lawrey Aug 18 '15 at 09:12

1 Answers1

2

Apart from syntactic sugar and built-ins, does any of them actually exploit some corner of the JVM, which has not been peeked into by the Java language?

Java has added invokedynamic to specifically cater for dynamic non-Java JVM languages. Java 8 uses invokedynamic in a limited way for lambda expressions, but this instruction truly comes into its own with Groovy, JRuby, etc.

the only 'java-tiredness' that has creeped in me big time, is its verbosity

Lambdas and powerful type inference of Java 8 eliminate a huge amount of boilerplate and verbosity. In fact, many people today object the tersity of some lambda-oriented idioms.

I strongly feel something like Python is just better if I really wish to learn another programming language

By all means learn a language other than Java, don't stay monoglot.

Marko Topolnik
  • 195,646
  • 29
  • 319
  • 436