SHARE:

No, TypeScript is not compiled into JavaScript

I allow myself to write this article, because I hear regularly the developers wrongly claim the following:

TypeScript, when compiled, is transformed into JavaScript.

Although the “transformation” aspect is correct, the term “compilation” is wrong.

Let’s go back to what compilation is, or rather what a compiler does:

“A compiler is a term used in computer science to designate a program that transforms a source code written in a programming language (the source language) into another computer language (referred to as the target language) .1 For it to be exploited By a machine, the compiler translates the source code, written in a language of high level of abstraction, easily understood by the human, towards a language of lower level, a language of assembly or machine language.”

 

compiling

You will agree that, finally, this is not what happens when TypeScript is “transformed” into JavaScript.

In reality, TypeScript is “transpiled” in JavaScript, but what is a transpiler?

“It’s a source-to-source compiler, it translates source code from one language to another.”

transpiling

Is it clearer now? 🙂

Written by

anthonygiretti

Anthony is a specialist in Web technologies (14 years of experience), in particular Microsoft .NET and learns the Cloud Azure platform. He has received twice the Microsoft MVP award and he is also certified Microsoft MCSD and Azure Fundamentals.
%d bloggers like this: