Compiling to JavaScript

Isn't writing in one language and compiling it into another language just adding lots of complexity?

Most programming languages compile into another language and compilers have been around since the first programming languages. Those compilers typically generate a language that is only meant for the computer to read, not the developer.

Scripting languages can be different in that they run without compilation, simply interpreting the script code you have written.


However, its a fairly recent trend (for the last two decades) to use one language to generate another, often referred to as transpiling.

This concept has become quite common in the Javascript world, especially when developers want to make use of newer features in Javascript but still want their code to run across all the commonly used browsers.

Examples of Javascript transpile languages

  • CoffeeScript
  • ClojureScript
  • JavaScript 6 and onward (ECMAScript 6 and onward)
  • PureScript
  • TypeScript

Hint Rather than call this compilation, generating one language from another is called Transpiling.

results matching ""

    No results matching ""