Hacker News new | past | comments | ask | show | jobs | submit login
Mascara: ECMAScript 4 → Classic Javascript translator (ecmascript4.com)
15 points by bdfh42 on June 5, 2008 | hide | past | favorite | 1 comment



The ECMAScript 4 support is only part of the goal of the project. Another part is to check integrity in existing classic JavaScript by performing static analysis. For example, inheritance through prototypes or other JavaScript patterns can (at least to a certain extent) be statically inferred, which allows us to catch a number of errors.

One idea I have been toying with, is to allow type annotations in comments on existing JavaScript, eg.

    /* type Point = {x : int, y: int}; */
    var p /* : Point */ = {x: 10, y: 100};
Ugly, yes, but might be a viable path for developers who are not ready to jump ship to ES4, but still would like better integrity checks. I believe this becomes more desirable the large the code base.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: