Questions tagged [jvm-languages]

Languages that compile their source code to the byte code of the java virtual machine are commonly called JVM languages. A common feature of those languages is that the Java APIs can be used more or less seamlessly.

The following list could be completed over time.

Important JVM languages:

  1. Java (object oriented)
  2. Scala (object oriented/functional)
  3. Clojure (Lisp-y)
  4. Groovy (OO scripting)

Implementations of popular languages for the JVM:

  1. Python
  2. Ruby

Recent/upcoming languages:

  1. Kotlin (object oriented, ...)
  2. Ceylon (object oriented, ...)
  3. Frege (pure functional, like Haskell 2010)
150 questions
12
votes
2 answers

Why does Groovy replace java.lang.String.length() with size()?

Wikipedia's current article about the Groovy programming language explains that "Most valid Java files are also valid Groovy files" and gives the following examples, first of Java code: for (String it : new String[] {"Rod", "Carlos", "Chris"}) …
qntm
  • 4,147
  • 4
  • 27
  • 41
11
votes
5 answers

Use of recursion in Scala when run in the JVM

From searching elsewhere on this site and the web, tail call optimization is not supported by the JVM. Does that therefore mean that tail recursive Scala code such as the following, which may run on very large input lists, should not be written if…
gw111zz
  • 274
  • 2
  • 10
11
votes
11 answers

Stuck with JVM, Sick of Java... Where to go?

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…
wheaties
  • 35,646
  • 15
  • 94
  • 131
11
votes
4 answers

Google Go for Java platform?

JVM provides great performance - it's on the one hand. Golang sounds like a new paradigm and extremely productive - on the other hand. If we could bring together the best of two worlds - JVM performance and golang productivity - we could get a lot…
Alf
  • 1,285
  • 3
  • 14
  • 24
10
votes
6 answers

Can Scala survive without corporate backing?

I was wondering whether Scala will get the takeup it deserves without explicit corporate backing (I was thinking by Sun/Oracle but I suppose it could be someone else, such as Google). With Sun's recent decision not to include closures in JDK7,…
oxbow_lakes
  • 133,303
  • 56
  • 317
  • 449
9
votes
2 answers

How Does the any Method Work in Groovy?

I came across this bit of code: n = args[0] as Long [*n..1, n].any{ println ' '*it + '*'*(n - ~n - it*2) } It's used for printing a tree form of structure. Like this: * *** ***** ******* * (for n=4) How does the code [*n..1,n]…
Ant's
  • 13,545
  • 27
  • 98
  • 148
9
votes
1 answer

Are Kotlin's reified types incorrect for primitives on the JVM?

If a Kotlin function invocation reifies a primitive, say Int, the 'passed' class is that for the boxed primitive, not the unboxed version. inline fun reify() = T::class @Test fun reified_type_doesnt_match_for_primitive() { …
Duncan McGregor
  • 17,665
  • 12
  • 64
  • 118
8
votes
8 answers

What is your preferred scripting language in java world (scripting language on JVM) and way?

What is your preferred scripting language in java world (scripting language on JVM) and way? When do you prefer your scripting language over java (in what situations for example for prototyping)? Do you use it for large projects or for personal…
Darius Kucinskas
  • 10,193
  • 12
  • 57
  • 79
8
votes
4 answers

Recursive overloading semantics in the Scala REPL - JVM languages

Using Scala's command line REPL: def foo(x: Int): Unit = {} def foo(x: String): Unit = {println(foo(2))} gives error: type mismatch; found: Int(2) required: String It seems that you can't define overloaded recursive methods in the REPL. I thought…
Lars Westergren
  • 2,119
  • 15
  • 25
7
votes
4 answers

What does it really mean when you say "This language runs on JVM"?

I have been hearing a lot lately regarding Scala, Clojure, etc which is supposed to run on JVM. Does this means that those languages are implementing the Java API underneath? What does it mean for a language to run under JVM? Thanks.
user_1357
  • 7,766
  • 13
  • 63
  • 106
7
votes
4 answers

Adding default package imports

In Java, Scala, or generally any JVM language, there is a set of packages that is imported by default. Java, for instance, automatically imports java.lang, you don't need to do it in your Java code file. Now I don't know which component takes care…
pdinklag
  • 1,241
  • 1
  • 12
  • 28
7
votes
1 answer

Use cases for Clojure in projects

Of course I'm not talking about using Clojure just because I can. I'm curious about where/when to use Clojure and what is the value it brings to a project. Suppose I'm doing Java web development, where I can use Clojure? any use cases are in your…
Chiron
  • 20,081
  • 17
  • 81
  • 133
6
votes
3 answers

Akka as the concurrency model for Clojure

Looks there is a lot of cool things about Akka framework (I don't really understand the framework, hope to dig into it soon). Is it encouraged to use Akka in Clojure? does it make sense to use Akka as the concurrency model in Clojure projects and…
Chiron
  • 20,081
  • 17
  • 81
  • 133
6
votes
5 answers

Book for learning how to write Clojure/Lisp Macros

I'm reading "Programming Clojure" and I'm interested in a book that discusses how to create macros as extensive as possible. Do you suggest a book for this? Thanks.
Chiron
  • 20,081
  • 17
  • 81
  • 133
6
votes
9 answers

Why should a Java developer learn an additional JVM language?

I am a java developer and I want to know, what is the main benefit from learning a language such as Scala or Groovy?
Radi
  • 6,548
  • 18
  • 63
  • 91
1 2
3
9 10