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
3
votes
2 answers

Can Coldfusion CFCs be instantiated from Java?

I know it is possible to instantiate a Java class from ColdFusion, but is it possible to instantiate a ColdFusion CFC from Java code? For instance (in Java): ColdFusionCFC obj = new ColdFusionCFC("filename.cfc"); I am wondering if it is possible to…
danmcardle
  • 2,079
  • 2
  • 17
  • 25
3
votes
3 answers

Which could become a strong alternative JVM language: Scala, Clojure, Fan, JavaFX Script, or other?

I am currently deciding on an alternative JVM language to port an existing Swing desktop application written in Java 6. Given that JavaFX specifically targets this kind of application, it would seem that my best option is JavaFX Script. However,…
Rogério
  • 16,171
  • 2
  • 50
  • 63
3
votes
1 answer

JVM lack of support for NaN vs scala Double.NaN

I recently read in the Java Virtual Machine Specification that the JVM does not support a NaN value, nor a way to signal overflow. I'm specifically referring to section 2.8.1 of the jvms 7, key differences between floating-point arithmetic supported…
nairbv
  • 4,045
  • 1
  • 24
  • 26
3
votes
1 answer

Why scala compiler says that this type is used in non-specializable position?

I have this method in package object: def extractLoop[@specialized T](x: Map[T, T]) = { val whatever = x.head val stop = whatever._1 def iteration( acc: Seq[T] = Seq(whatever._1, whatever._2), last: T =…
2
votes
1 answer

Code generation from three address code to JVM bytecode

I'm working on the byte code compiler for Renjin (R for the JVM) and am experimenting with translating our intermediate three address code (TAC) representation to byte code. All the textbooks on compilers that I've consulted discuss register…
akbertram
  • 1,330
  • 10
  • 16
2
votes
2 answers

java virtual methods: feature or bug?

Take this base class: public abstract class XMPPSubservice { protected XMPPService mTheService; protected XMPPSubservice(Context context) { Intent intent = new Intent(context, XMPPService.class); …
kellogs
  • 2,837
  • 3
  • 38
  • 51
2
votes
3 answers

Use of When and Then in Groovy?

I have been seeing the use of "when" and "then" keyword in Groovy in several Groovy articles. One of them is here. I searched for the Groovy Doc's but I couldn't find it. So whats the actual purposes of these keyword's? Similar to if/then?
Ant's
  • 13,545
  • 27
  • 98
  • 148
2
votes
2 answers

what does const TAB = ^I in pascal?

I'm following the tutorial here. Under the heading The Cradle, you can see the code: const TAB = ^I; well this is a pascal code, actually I'm trying to re-implement those pascal code to Java or groovy(so that I can build a kind of compiler using…
Ant's
  • 13,545
  • 27
  • 98
  • 148
2
votes
1 answer

Why is the JVM a Stack Based virtual Machine?

Why is the JVM a stack based virtual machine? What exactly does that mean and what are the advantages over register based virtual machines? Are there any other major design / implementation choices for virtual machine builders?
ams
  • 60,316
  • 68
  • 200
  • 288
2
votes
2 answers

Which JVM-based language should I use for mapping of one type to another?

I'm currently working with Java to write a program that does an EAI between two applications. One application comes with HL7, which I parse with HAPI. So I get a Java object structure. I want to transform this structure to my own structure that I…
martin
  • 2,957
  • 3
  • 25
  • 46
2
votes
2 answers

Setting CLASSPATH for Clojure project

I have a plain project structure: Base Dir src ;; Pile of Clojure files lib ;; Jar files To export the classpath: $ export CLASSPATH=$CLASSPATH:src:lib/* Trying to run a Clojure file: java -cp $CLASSPATH -jar lib/clojure.jar…
Chiron
  • 20,081
  • 17
  • 81
  • 133
2
votes
2 answers

Why it is possible to build custom language for JVM, like Groovy, Scala, Clojure, Kotlin?

These languages differ from Java in significant ways, like OO system, type system (most notable). The actual question is whether JVM keeps track of objects under the hood? Is there an object inside JVM? Is it responsibility of creators of such…
Anthony
  • 1,877
  • 17
  • 21
2
votes
4 answers

Sun branded competitor to .NET using the JVM

There have been many JVM languages in the recent few years including Javascript, Python, Ruby etc. (full list here: List of JVM Languages). My question is this: why has Sun not come out with a full suite of languages for the JVM just like…
Bala
  • 979
  • 1
  • 10
  • 21
2
votes
2 answers

How does types erasure help Clojure exist?

How does JVM type erasure help Clojure? Can Clojure exist without it? What would happen if the JVM had reified types? That is, how would Clojure change?
Eli Schneider
  • 4,903
  • 3
  • 28
  • 50
2
votes
0 answers

Flexible JVM language for creating domain specific languages?

Say I am interested in creating a JVM-based implementation of Prolog. I would like to know if it is possible to use an existing JVM language for emulating the Prolog syntax, instead of relying on a Prolog parser that takes as an input a text file…
Sergio
  • 8,532
  • 11
  • 52
  • 94