« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today
XML

Blog::Navigation

GetJava Download Button
Get the Source
Personal Blog

Blog::Referers

Today's Page Hits: 1077

Powered by Roller Weblogger.
« Scriptpad sample in... | Main | JSR-223 engine for... »
20060822 Tuesday August 22, 2006

Script engines written in JavaScript

JDK 6 contains javax.script (JSR-223) API and a Rhino based sample JavaScript engine. http://scripting.dev.java.net project has been created to develop JSR-223 engines for other languages and useful, demo applications that use scripting.

Just added two more script engines to http://scripting.dev.java.net. Unlike other script engines, this script engine is implemented in JavaScript. These engines implement JSP/ASP/PHP-like templating for JavaScript.

  1. ejs - embedded JavaScript - implements <%= expr %>, <% code %>
  2. jst - JavaScript Templates - this is based on TrimPath's JavaScript Templates.

It should be possible to use these script engines in Java code as well - because these implement javax.script API as required. But, you have to create a JavaScript engine and eval the corresponding scripts. And then call ejsScriptEngineFactory or jstScriptEngineFactory function to create javax.script.ScriptEngineFactory for these engines.

It should be possible to use the jst and ejs engines with Phobos web application framework. [though I am yet to test that part!]

I came across these other language implementations on JavaScript:

  1. Oberon Script. A lightweight Compiler and Runtime System for the Web
  2. Scheme Implementation in JavaScript

Also, it seems that JavaScript 2 would be implemented as a translater that translates js2 to js1 (atleast to startwith).



( Aug 22 2006, 12:19:49 PM IST ) Permalink del.icio.us | furl | simpy | slashdot | technorati | digg

Comments:

Post a Comment:

Comments are closed for this entry.
Copyright (C) 2005, A. Sundararajan's Weblog