Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any tools for generating JavaScript code from AST

Tags:

javascript

My friend and I want to learn to make our own programming language which runs by compiling to JavaScript code. And now there's plenty of languages which compiles to JavaScript. So far I've learnt basic simple methods of parsing code from source and running it in JavaScript.
But I'm not able to generate good code so far. Since many projects have done that, I'm wondering if there's any standard tool here, and with that I can generate JavaScript from the AST I got form parsing source?

like image 204
jiyinyiyong Avatar asked Jun 22 '12 06:06

jiyinyiyong


1 Answers

escodegen would be nice. https://github.com/Constellation/escodegen

like image 73
jiyinyiyong Avatar answered Oct 25 '22 17:10

jiyinyiyong