TypeScript Design Goals and Components

Type Script Design Goals

TypeScript is designed and developed by Microsoft. Following are some of the design goals behind TypeScript

  • Strongly Typed Programming Language

As JavaScript is not strongly typed it cannot prevent potential run time errors.  A strongly typed programming language and perform static type checking at compile time can prevent these potential run time errors.

  • High Compatibility

TypeScript is highly compatible with existing JavaScript code. It is designed as a super set of JavaScript.  This resulted in a scenario where any JavaScript code can be a valid typescript code also.

  • Structuring Mechanism

TypeScript introduced class-based object orientation , interfaces and modules. This will help to structure large applications in a better way. This will help developers to adhere to best object oriented principles and practices thereby reducing potential integration issues. The code will become more maintainable and scalable.

  • No Runtime Overheads

During design developers will use TypeScript code and on compilation it will become JavaScript code. That is TypeScript is the design time code and JavaScript is the execution time or runtime code.

  • Code Transformation and Erasure

TypeScript compiler has a mechanism to convert TypeScript features to JavaScript implementations. Erasure feature will remove the TypeScript specific features when converted to JavaScript.

  • Compilation Target

TypeScript compiler can translate the converted JavaScript into various specification targets like ECMAScript 3, ECMAScript 5 or ECMAScript 6.

  • Align with ECMAScript Proposals

TypeScript is developed making sure it supports ECMAScript specification.

  • Open Source and Cross Platform

TypeScript is released under Open Source Apache license by Microsoft.  This will result in installing and executing typescript in all major operating systems.

TypeScript Components

TypeScript has THREE main layers.  Each Layer is further divided into sublayers and components.

The three main layers are

  • The Language
  • The Compiler
  • The Language Services (to help editors and IDEs better assistance).
Posted in: Programming

Leave a Comment