[gambit-list] compiling javascript syntax to scheme

Marc Feeley feeley at iro.umontreal.ca
Mon Mar 22 16:41:18 EDT 2010


On 2010-03-22, at 4:30 PM, James Long wrote:

> Hey guys,
> 
> I'm thinking about a product I want to develop in the future, and I think a crucial point will be to convince non-Scheme developers to use it, and possibly convert them to Scheme programmers.  I want to include a "scripting" language in my product which has the syntax of Javascript.  I want to compile this language to Scheme.
> 
> This is exactly what SIX does in Gambit, but SIX doesn't quite have the grammar I want and is incomplete (I think "return" does nothing?).
> 
> Is anyone else interested in working on this?  I need to look at the SIX compiler in Gambit.  I could either extend it, or write a parser from scratch using something like SILex. I love the idea of SIX (including a built-in infix grammar), but is it used anywhere?  Is anyone interested in improving SIX to make it more usable as an actual language?

Funny you ask!  I'm interested in implementing a JavaScript parser generating S-expressions as AST.  By writing appropriate macros for the nodes of the AST, the semantics of JavaScript could be implemented (or by a simple code-walker if macros are not powerful enough).  I looked around and apparently there is a PLT package which implements a JavaScript parser and evaluator.  Maybe that would be a good starting point.

Marc




More information about the Gambit-list mailing list