DynamicLaguageSupport

What is Dynamic Language Support feature in Java 7?

We need to understand following two concepts:

1. JVM: JVM does not execute Java Code. It executes the byte code which is in .class file. Now, "normally" this .class file is created by compiling Java Code. It can also be created by other means (e.g. writing byte code at runtime, Groovy, JRuby, Jython, Scala)

2. Dynamic Language: A dynamic language (or dynamically typed language). Type in the simplest term is "data-type". When we define a type(say int i), Java code verified that all the code should use int only(that is parameters passed, returned, computation, etc, and thus is called strongly typed also). This checking at compile time is called Static Type Checking.

The dynamic languages e.g. Groovy, Jython, requires some other scripting library (e.g. Apache BSF) to be compiled as JVM Byte code (please confirm). Now, this is not required. Java 7 introduces new byte code "invoke virtual" which help in executing this.

Grovy vs Java

The major difference (that I could understand in 10 minutes) is that it is "simpler" syntax Java. Thats it.

Dynamic Type: Type includes even the function name. As shown in the link: http://pinderkent.blogsavy.com/archives/157/, the function name is (wrongly) passed as argument and is detected at runtime.

Dynamic Language: The language which determines the type of datatype at runtime. One it identified, it generally is not change.