The purpose of this article is to explain in simple terms what a transpiler is and how to get started. My target audience is junior or intermediate coders who don’t know what this is.

By the end of this article you’ll know where to get started on your own transpilers or compilers. Demistify!

It’s a source to source translator.

A compiler takes some source code and compiles it down to some lower language. This lower language might be source code or it might be something less than source code. For example, C++ compiles down to bytecode. Some programmers can mess around with bytecode. Most can’t or wont. Typescript compiles to Javascript since Typescript is a super-set of Javascript.

A transpiler is very similar, except it transpiles source code to some other source code. Generally speaking, this translation is to and from human readable code.

It’s easy to get these things mixed up, and in some cases the destinction between the two can be severely blurred. Sometimes the needs of the program are complicated enough that there is some dispute on wether or not a program is a transpiler or a compiler.

There are build tools that transpile code and also compile code. It’s messy.

For simplicity Just think of a transpiler as a source code to source code translator.

#javascript #computer-science #coding #ruby #programming

Ruby: How to make a Transpiler
3.70 GEEK