TypeScript "import / using / include" keyword

Topics: Language Specification
Jan 3, 2013 at 3:24 PM

We're working on tweaking the reference syntax.  I agree the comment and XML syntax is a little odd. 

Having two different keywords for working with files (and modules) is one of those subtle gotchas for coders coming from languages like C#.  It's also one of those quirks of being heavily based in JavaScript.  The difference between concatenating files together (which in some sense is what ///<reference...> is doing) and using dynamic module loaders, like AMD, is too different to abstract away easily.  That said, we're working hard to simplify the story where we can and retain the expressivity. 

We're definitely open to ideas on how to improve things further.

Jan 6, 2013 at 7:44 PM

Why not just use "reference" as the keyword.  For example,

reference "jquery-1.8.d.ts";

Seems pretty straightforward to me.