TypeScript standard library

Topics: General
Oct 2, 2012 at 4:23 PM

Have you guys considered a TypeScript standard library? 

The web development space today is comprised of a hodgepodge of libraries and tools for doing basic things, from list comprehensions to DOM manipulations to data binding to GET/POST.

It is reminiscent of pre-.NET Windows development days, where a mess of VB and C++ COM objects were floating around to do common 1990s programming tasks, each implementing tasks entirely differently: BSTR or CString or char*? We're hardly any different today, with $.map, array.map, ko.utils.array*, etc.

Having a standard library greatly improved the state of app development back then, and I think having such a standard library for TypeScript applications would likewise help.

Initially, you could address array filtering/iteration/comprehensions.  CoffeeScript skipped this step, and instead chooses to generate inline the same damned loop filtering everytime you use their list comprehensions. Perhaps TypeScript could improve on that: real list comprehension in the form of a standard library.

Coordinator
Oct 4, 2012 at 7:35 PM

Thanks for the feedback. That sounds like it could be helpful, though not sure if there is a best "standard library" for JS, as it depends on what you're doing (if you're in Node, you might not want DOM).  Perhaps a collection of libraries for different types of applications?

If you see a place where TypeScript could be helped by having added functionality, that sounds like a good place to dive in and work out what that would look like.  TypeScript is a community project and very much in the early stages.  Everyone is helping shape what TypeScript will become. 

Oct 4, 2012 at 9:21 PM

It might be useful for TypeScript to define some standard interfaces (for promises, modules etc) that the language would build on as primitives.  For example, if there was a standardized promise interface the language compiler could depend on it for 'await' support and any implementing library could ducktype their implementation into it.

 

Thanks

Joe