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).

Comments:

Post a Comment:
Comments are closed for this entry.
About

sundararajan

Search

Archives
« April 2014
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
Bookmarks
Links

No bookmarks in folder

Blogroll

No bookmarks in folder

News

No bookmarks in folder