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
20
votes
4 answers

Explanation of "Lose your head" in lazy sequences

In Clojure programming language, why this code passes with flying colors? (let [r (range 1e9)] [(first r) (last r)]) While this one fails: (let [r (range 1e9)] [(last r) (first r)]) I know it is about "Losing your head" advice but would you please…
Chiron
  • 19,366
  • 15
  • 74
  • 132
20
votes
4 answers

In Scala, how do I get the *name* of an `object` (not an instance of a class)?

In Scala, I can declare an object like so: class Thing object Thingy extends Thing How would I get "Thingy" (the name of the object) in Scala? I've heard that Lift (the web framework for Scala) is capable of this.
Scoobie
  • 1,037
  • 2
  • 12
  • 22
18
votes
8 answers

Differences between JVM implementations

Where do JVM Implementations differ (except licensing)? Does every JVM implement Type Erasure for the Generic handling? Where are the differences between: JRockit IBM JVM SUN JVM Open JDK Blackdown Kaffe ..... Deals one of them with…
Martin K.
  • 4,520
  • 7
  • 33
  • 47
18
votes
4 answers

Ruby/Rails thread safety

I have been hacking with Ruby from time to time, but I haven't done anything big or multithreaded with it. I have heard that MRI only supports green threads and JRuby supports native threads via JVM. However, I stumble upon comments on blogs and…
auramo
  • 12,607
  • 12
  • 62
  • 87
18
votes
8 answers

Is anyone using Scala in anger (and what advice for a Java programmer)?

I've been a Java programmer for over 10 years since starting off with Smalltalk. It's my opinion that next big languages are likely to be ones which run on the ubiquitous Java Virtual Machine. I'd like to take advantages of some of the features that…
oxbow_lakes
  • 129,207
  • 53
  • 306
  • 443
18
votes
1 answer

What is the maximum of number of arguments for varargs in java?

What is the maximum of number of arguments which can be used by a vararg in java ? I believe there should be some limit and it is not infinite.
ACS
  • 307
  • 3
  • 9
18
votes
1 answer

Python compiler for simple language to java vm code algorithm

I have a simple language that I am trying to write a compiler for (yes it is homework) to compile a simple language I shall describe if necessary to java vm code. It currently works pretty well I've just hit a bump with logical AND's and OR's. Each…
Zeno15
  • 189
  • 9
18
votes
4 answers

OCaml for JVM. Is there any?

I took a look at some new languages for JVM. Two of them are gathering much interest these days: Clojure and Scala. But in my humble opinion, both of them are not ideal. (Let's keep it a speculation, cause I don't want to damage myself…
Bubba88
  • 1,860
  • 19
  • 41
16
votes
4 answers

Efficacy of sticking to just the functional paradigm in Scala

I recently bought Programming Scala, and have been reading through it. The language definitely isn't what I expected! Specifically, it seems to implement just about every programming language idea I'm aware of, outside of Lisp macros and Haskell's…
16
votes
2 answers

Sending a POSIX signal from the JVM

How do I send a POSIX signal from within the JVM? (in Java or Clojure) I never thought this would be an issue until I tried googling it — there is lots of information about handling signals, but nothing about sending them. Short of using the JNI or…
Jan Rychter
  • 572
  • 4
  • 13
15
votes
1 answer

Frege's equivalent of Haskell's getLine and read

Is there any Frege's equivalent of Haskell's getLine and read to parse input from the console in the standard library? Currently I am doing it like this: import frege.IO getLine :: IO String getLine = do isin <- stdin isrin <-…
Marimuthu Madasamy
  • 12,173
  • 4
  • 27
  • 48
15
votes
4 answers

Which JVM functional languages are well IDE-supported? (IDE: IDEA, Netbeans, Eclipse or similar)

I have spent much time looking for a functional language that can seamlessly access Java legacy code (Weka code). Autocompletion of imported Java class methods would be excellent. I will present my impressions, please correct me if I am wrong. Yeti…
user445107
13
votes
2 answers

Generating a 'Hello, World!' class with the Java ASM library

I have started messing around with the ASM API for a compiler project I am working on. However, I am finding that the documentation is less than clear for a newcomer in many places and I thought having a good solid example of generating a class that…
seadowg
  • 4,033
  • 6
  • 32
  • 43
12
votes
2 answers

Canonical reference on JVM internals for programmer/developers

The title captures my question fairly well. I'm wondering if there is a good resource or leaping-off point for questions about how a JVM (not just HotSpot, but that's obviously the place to start) implements or handles a specific functionality? …
andersoj
  • 20,778
  • 6
  • 59
  • 72
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
  • 3,532
  • 4
  • 22
  • 38
1
2
3
9 10