
Usman Ehtesham Gul • over 9 years ago
Question about Requirements of the project
Hello, I had a question regarding the challenge. It looks pretty interesting but i am not sure about the following:
"Submissions should be in the form of open source JavaScript/CoffeeScript libraries that have APIs similar to Acorn or Esprima."
I would like to add Python capability. So are we supposed to write Javascript/CoffeeScript APIs that will be able to teach Python?
Also what aspects/topics of compilers should we be aware of?
I would really appreciate help in clarifying requirements of the challenge.
Comments are closed.
3 comments
nwinter Manager • over 9 years ago
Hi uehtesham90!
You pretty much only need to do the parser part of the compilers. Your parser code should run in the browser, so it should be written in JavaScript or CoffeeScript. It should take, as input, arbitrary Python programs (although you don't have to implement all of the Python standard library). It should output an abstract syntax tree that's compatible with the Acorn/Esprima/Mozilla format.
Then our Aether transpiler will do the rest of the work to turn it into instrumented, sandboxed, friendly JavaScript that CodeCombat (or anyone else) can run in the browser.
There's some more discussion over here, too: https://github.com/codecombat/codecombat/issues/72
Sameer Indarapu • over 9 years ago
Does generated JavaScript work? If yes, it might be easier to write the Python parser in something high level and compile it to JavaScript using emscripten.
nwinter Manager • over 9 years ago
It's generally hard to integrate emscripten-compiled code with existing JavaScript code, especially when you need to pass objects in and out. It's not very maintainable to have a JavaScript tool that's written in Python but used as JS. So we'd favor a parser that was in JavaScript or CoffeeScript.