by perimo · 12y ago · 0 comments
- Typescript is a superset of Javascript (mostly), so we ported by converting all the Coffeescript sources to Javascript and renaming them with .ts extensions. There was a bit of cleanup involved in getting modules to play nice together, but most of the code ran without modification.
- The JS that the Typescript compiler generates is much easier to read, in part due to less "magic" in the language.
- It also makes performance much easier to reason about, for the same reasons. One issue that bit us several times was Coffeescript's auto-return feature, which was invisibly accumulating large arrays of values from our interpreter's bytecode loop! This is no longer a concern with the current Typescript codebase.
- The inner workings of the JVM are fairly complex, so enforcing types at compile-time actually does catch bugs before they happen.
No comments yet.