The Source for Java Technology Collaboration
User: Password:



David Herron

David Herron's Blog

Tutorial on implementing a scripting language on top of Java

Posted by robogeek on April 28, 2006 at 07:23 PM | Comments (3)

Build your own scripting language for Java covers a topic I had wanted to research and write. Fortunately someone else took up the cause.

At issue is the question of using the JSR 223 features, in Mustang as the javax.script package, to implement a scripting language on top of Java.

I've written about this earlier, but I see this as potentially a very good strategic move. Any language author of a scripting language has a choice of "how do I implement the interpreter?". Typically a language author has to both design their language as well as the underlying interpreter engine. But, I think the required skills are very different. To be a good language designer, and to be a good interpreter implementer, are very different tasks.

With JSR 223 a language designer can now concentrate on the language design. They can rely on the Java VM to provide the execution engine.

Plus, their user community doesn't have to reinvent the whole world ... instead they can reuse the vast library of available Java classes.

In the Java World article I've linked to, the author takes you through the design of a simplistic language and the implementation of two ways to execute that language within Java.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • I think "scripting language on top of Java" should be available in clients as well (Browsers etc). Javascript even though has the name advantage should be supplanted with a real Java centric scripting language that makes a developer even more productive. I wonder if anything is being considered on that front?

    Posted by: tchangu on May 01, 2006 at 11:13 AM

  • Use of a JSR223 scripting language in an applet should "just work" (knock on formica). That's because it's "just" a .jar file providing services and I can't think of anything which would prevent that from working.

    Getting a java based scripting language to replace javascript ... well ... that does sound attractive, but would be a real tough change to achieve. If only because, for it to have any significant effect, one would have to get Microsoft to adopt this, and I dare say Microsoft is rather unlikely to adopt such a thing. What, given the history between Microsoft and Sun and Java that is...

    Posted by: robogeek on May 01, 2006 at 11:51 AM

  • Id think it'd be possible given that I believe Jython can be used in this way and that was even before the Scripting language API.

    leouser

    Posted by: leouser on May 01, 2006 at 02:20 PM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds