Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

At a glance it looks like Hack is to PHP what TypeScript is to JavaScript. Is that a fair analogy?


Yes and no. Yes, because TypeScript is bringing a type-system to a dynamically typed language and so did Hack. No: because Hack is bringing some additional language features affecting the runtime. Modest changes for now, but we intend to carry on in that direction.


> No: because Hack is bringing some additional language features [...]

TypeScript added classes, interfaces, modules, and arrow functions.


The key difference is affecting the runtime. All those typescript features can be compiled down to regular JS and typescript-generated javascript can be run in a browser without extending the JS engine.


Well, it seems Microsoft is doing similarly with Typescript, except instead, waiting for the spec to catch up. I like both ideas.


I don't know what you mean by that... stuff like classes were already in the harmony proposal phase before Typescript implemented them. Stuff like type hints won't be in JS ever.


At least to date, Microsoft stresses the "TypeScript is just JavaScript." New language features are added to ES6 and then wrapped with types in TypeScript.




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

Search: