News for hackers. Stuff that matters.
Re:List of languages that compile to JS by amadiver on Thursday January 06, 2011 @09:56AM (#2075492)
Any tools that work in the opposite direction? ( e.g., JS -> C )
Re:List of languages that compile to JS by sedachv on Thursday January 06, 2011 @04:41PM (#2077342)
Red Daly has a JavaScript to Parenscript (Common Lisp) translator: https://github.com/gonzojive/js-to-parenscript

The generated code from that won't run without a JS runtime implementation in CL backing the JS-specific Parenscript forms, which currently doesn't exist to my knowledge (it's not hard to write, just not very useful). This is useful by itself for writing JS analysis and transformation tools and moving JS code to Lisp.

There's CL-JavaScript: http://marijnhaverbeke.nl/cl-javascript/

This is a translator/compiler/"simulator" (http://www.cs.aau.dk/~normark/oo-scheme.html) that provides good integration between the two languages.

Re:List of languages that compile to JS by praptak on Thursday January 06, 2011 @03:50PM (#2077103)
Rhino does JS -> Java bytecode internally but I don't think you can grab those classes and execute them outside Rhino.

A full compiler would of course always have the problem of dynamically generated JS, i.e eval().

Re:List of languages that compile to JS by spicyj on Thursday January 06, 2011 @11:02AM (#2075763)
You can use a JavaScript engine such as V8 to run JavaScript code anywhere, but I don't know of any native compilers.