[plt-scheme] ECMAScript and Scheme

From: Anton van Straaten (anton at appsolutions.com)
Date: Wed Mar 5 15:01:26 EST 2003

Dominique Boucher wrote:
> I would like to know if someone on this list is aware of any effort for
> implementing ECMAScript on top of Scheme, either by interpreting
> ECMAScript directly in Scheme, by byte-code compiling it or by
> compiling ECMAScript to Scheme.

I've previously looked at this:
http://js2scheme.sourceforge.net/

I haven't actually used it for anything, so don't know how well it works.
The project looks as though it hasn't had any activity since 2000.  Despite
no Sourceforge "releases", and some broken links, there's source available
on the Sourceforge CVS (see bottom of page at
http://js2scheme.sourceforge.net/dl.php3).

Here's an excerpt from the README:
==================================
* Goal

The aim of this project is to provide a translator for JavaScript language
and
eventually become part of the Guile translators project.

* Status

Currently, the translator supports a subset of JavaScript (or EcmaScript) as
described in ECMA 262 standard.  Some of the unsupported features include:

  * automatic semicolon insertion;
  * Date object;
  * many functions, that are part of the specification."
==================================

Although it's intended for Guile, the code looks fairly standard.  There
seems to be about 1300 lines of core Scheme code, excluding lexer/parser
stuff.  The README mentions wanting to "use GOOPS" in future, but happily,
that doesn't seem to have been done yet.  The code is LGPL.  The README
mentions reliance on Danny Dubé's Silex lexer, and expresses concern about
its informal non-commercial license, but I notice Silex is now GPL anyway.
The project also uses a LALR parser generator written by some guy named
Dominique Boucher, who will probably be happy to give you support...  :)

Anton



Posted on the users mailing list.