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)
149 questions
94
votes
8 answers

How to approach creating a JVM programming language?

I have created a compiler in C (using Lex & Bison) for a dynamic typed programming language that supports loops, functions declarations inside functions, recursive calls, etc. I also created a virtual machine that runs the intermediate code created…
functional
83
votes
4 answers

Haskell on JVM?

I'm wondering if there is some way to make Haskell run on the JVM (compiled or interpreted)? There exists JHaskell on Sourceforge but this one seems to be empty and dead. GHC uses LLVM as compiler backend. Would it be a good idea or possible to…
jeha
  • 10,024
  • 5
  • 46
  • 67
55
votes
4 answers

What is the difference between def foo = {} and def foo() = {} in Scala?

Given the following constructs for defining a function in Scala, can you explain what the difference is, and what the implications will be? def foo = {} vs. def foo() = {} Update Thanks for the quick responses. These are great. The only question…
52
votes
4 answers

How are coroutines implemented in JVM langs without JVM support?

This question came up after reading the Loom proposal, which describes an approach of implementing coroutines in the Java programming language. Particularly this proposal says that to implement this feature in the language, additional JVM support…
marknorkin
  • 3,476
  • 9
  • 41
  • 69
49
votes
2 answers

Using partial functions in Scala - how does it work?

I'm new to Scala, I'm using 2.9.1, and I'm trying to get my head around how to use partial functions. I have a basic understanding of curried functions, and I know that partial functions are kind of like curried functions where they are only 2nary…
PlexQ
  • 3,080
  • 2
  • 19
  • 24
46
votes
8 answers

Is there anything like VirtualEnv for Java?

Is there anything similar to Python virtualenv for Java or JVM Languages?
Gautam
  • 7,444
  • 9
  • 61
  • 102
41
votes
3 answers

Is Clojure compiled or interpreted?

I read somewhere Clojure is compiled. Is it really compiled, like Java or Scala, rather than interpreted, like Jython or JRuby?
OscarRyz
  • 184,433
  • 106
  • 369
  • 548
34
votes
5 answers

Groovy advantages over Jython or Jruby?

Why would I choose to use Groovy when I could use Jython or Jruby? Does the language provide any inherent advantages to make up for the fact that Jython and Jruby skills are applicable to their parent languages outside of the JVM? Keep in mind that…
James McMahon
  • 45,276
  • 62
  • 194
  • 274
32
votes
8 answers

Should I study Scala?

I am an experienced C++ programmer with average Python skills. The reasons I studied Python in the first place were: to get a different perspective on programming (static vs dynamic, interpreted vs compiled, etc.) to increase the breadth of…
rpg
  • 7,518
  • 2
  • 36
  • 43
29
votes
5 answers

Scala and Clojure both in one project

I'm looking for a guide for polyglot programming in this two languages. I know that interop between them is possible, since they are both running on the same Java VM, and both got compiled to the same bytecode. But there is some cumbersomes: Can…
om-nom-nom
  • 60,231
  • 11
  • 174
  • 223
28
votes
3 answers

Why not use GlobalScope.launch?

I read that usage of Globalscope is highly discouraged, here. I have a simple use-case. For every kafka message (let's say a list of Ids) that I receive I have to split it and invoke a rest service simultaneously and wait for it to be done and…
so-random-dude
  • 12,394
  • 9
  • 47
  • 96
27
votes
1 answer

How to integrate Scala into core Android platform?

I am interested in integrating Scala (or some other non-Java JVM-language) into the android platform. I am not referring to writing an android application with Scala, that I did early early on, but actually hooking into the build process that builds…
Octoberdan
  • 460
  • 5
  • 10
24
votes
5 answers

what are the options for hadoop on scala

We are starting a big-data based analytic project and we are considering to adopt scala (typesafe stack). I would like to know the various scala API's/projects which are available to do hadoop , map reduce programs.
prassee
  • 3,551
  • 5
  • 27
  • 49
22
votes
3 answers

Why can't tail calls be optimized in JVM-based Lisps?

Main question: I view the most significant application of tail call optimization (TCO) as a translation of a recursive call into a loop (in cases in which the recursive call has a certain form). More precisely, when translated into a machine…
Mars
  • 7,975
  • 2
  • 36
  • 64
21
votes
3 answers

What compromises Scala made to run on JVM?

Scala is a wonderful language, but I wonder how could be improved if it had it's own runtime? I.e. what design choices were made because of JVM choice?
Łukasz Lew
  • 43,526
  • 39
  • 134
  • 202
1
2 3
9 10