PencilCode / pencilcode

An online IDE for kids: pencilcode.net.
http://dev.pencilcode.net/
MIT License
167 stars 100 forks source link

Js2coffee Integration (issues/126) #193

Open dinukadesilva opened 9 years ago

dinukadesilva commented 9 years ago

An extra new line is introduced by the coffee script compiler. Still I'm searching how to fix it

davidbau commented 9 years ago

Thanks for working on this change Dinuka - are we able to switch from coffee -> js -> coffee again and get back to the original code? (I'd expect not - how commonly is it different?) Do you think we should remember the most recent version in the old language, and if the user switches back without any edits, then use the remembered version?

dinukadesilva commented 9 years ago

Since this is a translation process, I don't think keeping records of old versions is useful. because what the user should expect is the translation of the code. in case if some one need to switch to the original version, they can close it without saving and open it again.

dinukadesilva commented 9 years ago

What do you think, is it needed to keep records of old versions.

weihang7 commented 9 years ago

How different, usually, is the code after translating from js -> coffee -> js?

davidbau commented 9 years ago

"for" loops are unrolled into "while" loops and there are a bunch of superfluous extra "myvar = undefined"'s added. Try out the branch!

It would be nice to fix js2coffee to do better on these; on the other hand this is already pretty neat functionality. What do you think, Frank? Would you want to merge it?

On Sat, Sep 12, 2015 at 5:46 PM, Weihang Fan notifications@github.com wrote:

How different, usually, is the code after translating from js -> coffee -> js?

— Reply to this email directly or view it on GitHub https://github.com/PencilCode/pencilcode/pull/193#issuecomment-139821864 .

davidbau commented 9 years ago

Hi Dinuka, I'm thinking of just going ahead and merging this "as-is" to get the functionality. Let me know if there are other things you'd like to change before I merge.

dinukadesilva commented 8 years ago

I would like if you don't merge this right now. Give me some more time to look into this. Because, I need to look into those issues we discussed earlier.