Faster Dynamically Typed Languages on JVM 7 - Headline
Home » Headline

Faster Dynamically Typed Languages on JVM 7

16 July 2009 No Comment

Before going into what Java is offering in this new release, let us understand what dynamically typed languages are. Examples are Javascript, Ruby, Python, Groovy and so on. Few details of these languages -

  • Common feature is an ability to modify classes at runtime to allow implementation of new interfaces. The name is dynamically typed language because it is possible to determine the type at runtime. E.g. in Javascript we declare a var abc. This can contain String, int, or any other type of value. While using this value we can cast it to appropriate type and use it.
  • Have their own execution engine that runs the scripts written in given language using underlying OS or other environment like JVM.
  • Java based versions of such languages are also available e.g. JRuby, Jython, Groovy etc.
  • Performance of these languages depends on how fast the engine runs on underlying environment.
  • JVM did not treat the engines differently against general Java programs.
  • JVM is designed mainly for statically typed languages (i.e. those which do not change classes dynamically). Hence designing with these JVM has always been a challenge for the dynamically typed language.

Until Java 6, there was primarily only Javascript to cater such dynamic requirements. But things are changing after that. See how -

Java 6 (JSR 223):

  • Introduced API to access Java code from dynamic scripts.
  • Framework for hosting scripting engines in Java Applications.
  • Rhino scripting language which is implementation of Javascript.

Java 7 (JSR 292):

  • Bytecode method invocation through invokevirtual, invokeinterface, invokestatic, and invokespecial methods.
  • New package java.dyn containing packages linked with dynamic scripting languages.
  • Still it is being looked at the possibility of allowing dynamically injection of interfaces to modify classes.

If we look at these modifications, then one can see clearly what Java is trying to do in this market of scripting languages. It is making JDK friendly to the dynamically typed scripting languages. Encouraging such new languages, to use JDK as an underlying platform, to build execution engines, will definitely increase the market share of Java. Already we have a huge number of open source frameworks dependent on Java, and in addition to that we will have future scripting languages also Java based.

Reference:

New JDK 7 Feature: Support for Dynamically Typed Languages in the Java Virtual Machine

 

More Related Posts in Headline

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.