python
python

Reputation: 1940

Is groovy native to JVM or ported to JVM?

I know Jython and JRuby is ported to JVM, and scala/Clojure is native to JVM, what about Groovy? Groovy looks like a dynamic language, I guess it is ported, but it seems it could also be compiled. For those language native to JVM such as Scala, is that some tool to decompile the code to the source code?

Upvotes: 4

Views: 1846

Answers (2)

Jerry101
Jerry101

Reputation: 13367

"Ported" usually means "retargeted to run on." Groovy was designed to bring dynamic features from languages like Python and Smalltalk to Java. It was designed to be an extension of Java and in that sense it's native to the JVM and to the Java language. (The Groovy language, object model, and run-time libraries are extensions of Java's.)

But it sounds like you're asking about whether Groovy is interpreted or compiled. You can use groovyc to compile Groovy source code to Java .class files and run them in the JVM (linking in some Groovy run-time libraries). Or you can run Groovy source code interactively in GroovyShell, but what that does is compile, load, and run code for you incrementally.

A web search for [groovy decompiler] returns some possibilities for you.

Upvotes: 3

CptBartender
CptBartender

Reputation: 1220

I'm not sure whether it answers the entirety of your question, but the vast majority of Groovy and Groovy-Eclipse compiler is written in java, as seen on both projects' GitHub repositories.

Upvotes: 0

Related Questions