3 ms·
Any tools that work in the opposite direction? ( e.g., JS -> C )
by amadiver 16y ago
Any tools that work in the opposite direction? ( e.g., JS -> C )
- spicyj 16y agoYou can use a JavaScript engine such as V8 to run JavaScript code anywhere, but I don't know of any native compilers.
- praptak 16y agoRhino 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().
- sedachv 16y agoRed Daly has a JavaScript to Parenscript (Common Lisp) translator: https://github.com/gonzojive/js-to-parenscript 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/ http://marijnhaverbeke.nl/cl-javascript/ This is a translator/compiler/"simulator" (http://www.cs.aau.dk/~normark/oo-scheme.html http://www.cs.aau.dk/~normark/oo-scheme.html) that provides good integration between the two languages.