|
|
|
|
|
by tlarkworthy
4501 days ago
|
|
I am doing serious transpiler stuff at the moment and I think its easier to do in JS than any other language. It look me about 2 hours to design and write this little utility for finding and removing redundant braces in expressions using node-falafel:-
http://edinburghhacklab.com/2014/02/remove-redundant-bracket... The larger problem I am doing is static code analysis for Firebase and the JS tools for doing such stuff are delightful compared to yacc and lex and javacc etc. Functional programming really shines in this domain. You can populate your symbol table with functions that get "called" when "CallExpressions" are encountered during parsing, or functions that expand to function declarations on "MemberExpression" are encounter during parsing (the <dot> operator). Its very easy to mirror the true structure of JS using JS if that makes sense. |
|