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
4
votes
1 answer

How are nested functions and lexical scope compiled in JVM languages?

As a concrete example for my question, here's a snippet in Python (which should be readable to the broadest number of people and which has a JVM implementation anyway): def memo(f): cache = {} def g(*args): if args not in cache: …
JLasseter
  • 88
  • 5
4
votes
3 answers

Decompiling JVM languages

Is it possible to decompile JVM languages like Groovy, Scala to their initial form? If I try and decompile a 4 line Groovy class I get about 20 lines of decompiled Java code. It's more of a theoretical question than a practical one, cause there are…
Alexandru Luchian
  • 2,760
  • 3
  • 29
  • 41
4
votes
1 answer

Will the JVM be extended to handle generics?

What do you think? Will the JVM ever get support for generics? Quite likely that would not only require substantial changes to the JVM, but also to the class file format, but languages running on the VM would greatly benefit from it. Edit: The Java…
soc
  • 27,983
  • 20
  • 111
  • 215
4
votes
2 answers

Is it possible to "fool" java that an environment variable is set from the command line

I'm running in an environment where I can pass parameters but not set environment variables using a normal commandline. I would like to set environment variables nevertheless. Is there an alternative way to "fool" java that an environment variable…
Marcin
  • 48,559
  • 18
  • 128
  • 201
4
votes
3 answers

Why is the JVM considered such a remarkable piece of software engineering?

The JVM is broadly used: Scala, Groovy, Jython, etc. I've heard it described as 'remarkable', 'brilliant', and 'massively under-appreciated'. Why? More specifically, what makes the JVM unique? With all the money poured into .NET, or the length of…
kayaker243
  • 2,580
  • 3
  • 22
  • 30
4
votes
1 answer

What happend to groovy++?

I just stumbled upon groovy++ and found it quite interesting. Unfortunately it seems that it's not further developed? According to github the last commit was over a year ago. The mailing list is totally inactive and the last message was back in…
Florian Gutmann
  • 2,666
  • 2
  • 20
  • 28
3
votes
1 answer

How do I eval a clojure data structure within the context of a namespace?

I'm writing a clojure app for internal use, and I want the config file to be in clojure too. I have defined a few macros to make writing the config file easier, but when I try to eval the data from the config file, it cant find my macros. This…
Chris
  • 455
  • 5
  • 10
3
votes
2 answers

Bash script interpreter that runs in JVM (Jbash?)

I'm wondering if there exists a bash shell script interpreter that runs solely in the JVM (i.e., does not rely on "shelling out" to a system bash.) A "Jbash" if you will. Such interpreters exist for many other languages (JRuby, Jython, etc.) I'd…
jwfearn
  • 28,781
  • 28
  • 95
  • 122
3
votes
5 answers

is there statically typed language with nice lambda support for the JVM?

I'd quite like to write some Google App Engine apps, but I'm a c# developer by trade, and as such I like static typing and Linq (or at least extensions + lambdas + predicates, if not query syntax). Is there a language I can use on the JVM that…
mcintyre321
  • 12,996
  • 8
  • 66
  • 103
3
votes
2 answers

Groovy implementation details

Where can I find more details about how Groovy is implemented under-the-hood? Aside from the source code, are there good papers, blogs, videos, slide decks etc discussing the implementation details?
Binil Thomas
  • 13,699
  • 10
  • 57
  • 70
3
votes
2 answers

Stack-based machine depends on a register-based machine?

Normal CPUs (for example, Android devices) are register-based machines. The Java virtual Machine is a stack based machine. But does a stack-based machine depend on a register-based machine to work? Can't stack-based machines run lonely, because…
user141302
3
votes
2 answers

Learning Clojure coming from Lisp

I'm thinking seriously of making Clojure my new hacking language since I love Lisp but have some problems with CL and Scheme. I've never worked in the Java environment before and my lisp experience is limited to working through "SICP" and "The…
afkbowflexin
  • 4,029
  • 2
  • 37
  • 61
3
votes
1 answer

java.lang.VerifyError on constructor call

I recently started writing a compiler for my own language but it started to throw an exception when I call the main method. It works with my other test classes, but it doesn't want to work with this one. As far as I can tell, there isn't anything…
EnderShadow
  • 105
  • 8
3
votes
1 answer

What assembler did Scala/Clojure use?

I've been doing some research about compilers (to be ran on JVM). And I've successfully found two assemblers which targets that. However, the two I found, one is Jasmin, which not quite well maintained (last update in 2010). And the other,Krakatau,…
Qiaosen Huang
  • 1,093
  • 1
  • 10
  • 25
3
votes
5 answers

Reference to an object of any class that implements two or more given interfaces

Given any interface I, it is possible to declare a variable that holds a reference to any object of a class C that implements I: I i = new C(); I want to do something similar. Given two interfaces, I want to declare a variable that holds a…
isekaijin
  • 19,076
  • 18
  • 85
  • 153