5 ms·
Has anyone written a reverse CoffeeScript compiler that compiles legacy js into cs? Seems like it would be a great tool for starting off refactoring of big js f
by jackfoxy 16y ago
Has anyone written a reverse CoffeeScript compiler that compiles legacy js into cs? Seems like it would be a great tool for starting off refactoring of big js files, or if you simply wanted to adopt cs as your standard.
- albemuth 16y agoLike with HAML,one would think the htlm2haml tool was key to its adoption
- pyrotechnique 16y agohttp://mindynamics.github.com/js2cs/ http://mindynamics.github.com/js2cs/ It is not without its cavets, though, with a little work it could be brilliant. Alot of things that are in CoffeeScript simply are not possible in JavaScript; given there is no 1-1 relationship between CoffeeScript and JavaScript constructs.
- jsilver 16y agothanks! it means a lot to me. :) i made this a couple of months ago as an experiment on someone's suggestion and ended up getting REALLY far. only current caveats are that some hacks are used (of course).. and CoffeeScript 1.0 is not supported. I have been busy and I don't know what kind of updates that will take right now. I have been meaning to get around to it of course, but for the mean time I put the demo up there. The source is of course open, it's written in JavaScript. Have a look in App.js. It's a recursive AST walker. If you do manage to patch it you can send me a pull request on github. The code is relatively clean and easy to read. It should also serve well as a learning tool to see what the symbols of CoffeeScript are. Danke for the mention! -jsilv