Skip to content

Comment on Show HN: a compiler from Python syntax to JavaScript syntax (like CoffeeScript)parent

Comments

Here's the decision procedure:

If there's no collateral damage and the JS is clear (e.g. 28 --> Math.pow(2, 8)): do it.

If there's no proper way to express the JS in Python (e.g. instanceof and typeof keywords): do it

If it's really important (only "print" and "self"): do it

Else: DON'T

These few special cases that mess with your code are all mentioned in a section on the the main page.

And you can easily remove them from the transformations if you want.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.