Impressions on: Typescript
Major language features
- Gradual typing: unannotated code is by default unityped (that is, typed with a single
- Compiles most ECMA6 features all the way down to ES3 (i.e., supports any browser).
- Offers more advanced typing features such as union types.
I just dove into Typescript after hearing a lot about it from various people over the last while. I was expecting a stodgy, Javaesque language, but although you could just use Typescript as such, you can also do so much more.
The type system is more advanced than I expected. Support for things like generics is complete and works well, and but there are also intersection and union types, guards, and the very-handy string literal type.
Gradual typing and type inference is what makes TypeScript truely nice to use. The interface between typed and untyped code is far, far less rocky than I expected. You can throw in a type annotation almost anywhere you think it might come up, and the compiler will start warning you about issues. Having type annotations at hot spots only really feels like the best of both worlds in Typescript.
Did I mention type inference already?
Besides that, Typescript’s tooling is probably the one of the most impressive I’ve seen
ts_server architecture makes it possible
for any editor support advanced language features. I use a Vim plugin called
Tsuquyomi that offers completion and
error highlighting with syntastic on file save – who needs an IDE? Of course, I
could be using Visual Studio, which does have quite the fanbase, so that might
be worth pursuing too.