Sunday, February 6, 2022

Type Script Part 1

Initially Google thought of Developing AtScript Language as they wants to Use this For Angular Framework. So later on they thought of using TypeScript which is same to AtScript language, and an open source. They dont want to waste there time in Developing AtScript language. 

Microsoft has introduced one language called TypeScript.

Google uses TypeScript language to develop Angular Framework.

TypeScript is a typed superset of JavaScript that transpiles |compiles into a plain JavaScript.

*Typed means typescript provides type safety

   Example:
    let price:number;
           ...
    price=50000; //accepted
         ...
    price="dell"; //not accepted[type safety]


SuperSet means typescript is an extension to JavaScript.

TypeScript== JavaScript+[Type Safety + Access specifiers + Interface+..]

                                |
                         Extension | Superset to JavaScript[ The above all make ]


Typescript is provided by Microsoft in the year 2012 as Typescript0.8,the
current version is typescript4.x

     https://www.typescriptlang.org
               


Typescript program  file extension is ts.

Typescript compiler is tsc.exe

Typescript code is not understandable to browser(or node engine) , it need to be converted into plain JavaScript using compiler[tsc.exe]



  <>.cs  ==========>compiler============>IL code=================>runtime[CLR]
[c# prog]                      [csc.exe]


<>.java =======>compiler ========>byte code========>runtime[JVM|JRE]
[java prog]     javac.exe]


<>.ts===>compiler===>JavaScript code==>runtime[browser or nodeengine]
[typescript     [tsc.exe]
 prog]
|
high level              middle | low level
programming        programming


High level languages are developer friendly , so TypeScript is developer Friendly Compared to JavaScript.

Type Script compiler can be installed using node package.

Node packages can be installed using "npm" tool, this tool comes with node.js Installation.

Nodejs installation will be provided with "node engine" and "npm" tool.



The below command will install TypeScript compiler globally[-g] into a system, Globally means TypeScript Compiler[Tsc.exe] is available throughout the system in any drive and directory.



Go to Command Prompt and Check Now



It will be accessible in Any Drive.




Install TypeScript using NPM

npm install -g typescript





No comments:

Post a Comment

Thank you for visiting my blog

Kubernetes

Prerequisites We assume anyone who wants to understand Kubernetes should have an understating of how the Docker works, how the Docker images...