Skip to main content

Posts

Showing posts from April, 2017

Compiling and Transpiling

Compiling is the general term for taking source code written in one language and transforming into another language. Transpiling is a specific term for taking source code written in one language and transforming into another language that has a similar level of abstraction. It is a specific kind of compiling. So when we compile C#, your method bodies are transformed by the compiler into IL. This cannot be called transpiling because the two languages are very different levels of abstraction. When you compile TypeScript, it is transformed by the compiler into JavaScript. These are very similar levels of abstraction, so you could call this transpiling. Both compilers and transpilers can optimise the code as part of the process. Other examples of transpiling include C++ to C, CoffeeScript to JavaScript, SASS/LESS to CSS, PHP to C++ etc.