Let players code in CoffeeScript #71

Closed
nwinter opened this Issue Jan 4, 2014 · 7 comments

Projects

None yet

4 participants

@nwinter
Contributor
nwinter commented Jan 4, 2014

This shouldn't be that bad, actually--the CoffeeScript Redux compiler should already be parsing things into the Mozilla abstract syntax tree format, at which point we can use the rest of the existing Aether tooling to just run it with the rest of our World simulation.

Implementing it will mostly be handling all the little things that come up, like adding options for players to use JavaScript or CoffeeScript, reformatting docs and code examples to not assume JS syntax, adding Aether options to know to expect CoffeeScript, and integrating the CoffeeScript Redux parser.

@nwinter
Contributor
nwinter commented Jan 9, 2014

I think the first thing to do would be to see if we can add get the CoffeeScript Redux compiler running in the browser in CodeCombat. The second thing to do would be to see if we can tell it to just give us the AST instead of compiling all the way to JavaScript (since otherwise Aether would have to parse it again). If those work, we could integrate them into the Aether project and tell it to parse the user code as CoffeeScript instead of using Esprima and thinking it's JavaScript.

A little bit of #99 would let the player specify whether to code in CoffeeScript or JavaScript.

@deepak1556
Contributor

http://michaelficarra.github.io/CoffeeScriptRedux/ , CoffeeScript.parse() gives the CS AST, good thing is coffeescriptredux is written to be extensible :)

@bdickason

I would be concerned with this feature. Although it is great in theory to support any language, you open up a huge number of support issues when a user is working in python and they run into a problem with a level (for example).

You also reduce the ability for a user to come to CodeCombat and easily help another user.

For example:
"I come to Codecombat.com to help another user when they're stuck (Guide class, I believe), and I login and find that this user is writing in Clojure.. which I don't know."

My hunch is that sticking with one, universally popular language (javascript) will help keep the game and company focused and provide a very clear starting point and progression path for users.

Just my two cents.

@nwinter
Contributor
nwinter commented Feb 11, 2014

@deepak1556 has landed CoffeeScript support in Aether, so now we need #99 in order to let the player specify CoffeeScript mode.

@nwinter
Contributor
nwinter commented Mar 14, 2014

#99 is ready for anyone to add CoffeeScript support to the editor, and we can fix up the LevelSessions and such to know what language the code is in as we see what needs doing trying to hook it up.

@dkundel
Contributor
dkundel commented Mar 19, 2014

Just seen that there is actually an issue for this :) I'm on it just need to fix some small things in Aether to run smoothly :)

@nwinter
Contributor
nwinter commented Mar 31, 2014

#748 yeeees!

I imagine there will be bugs and places (like multiplayer code evaluation) that need updating to know the language, but we can make specific issues for those as we find them.

@nwinter nwinter closed this Mar 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment