Hacker News new | ask | show | jobs
by moo360 3215 days ago
I don't know if I'm right or not but I tend to use the word "transpiler" to talk about something that transforms into the same language as before.

So for example Babel is a transpiler since it turns JavaScript into JavaScript - it just allows you to use certain features (usually of a later version, or a draft) in earlier versions. So I write es8 and use babel to turn it into es5 compatible javascript, I'd call that transpiling.

However, sticking with JavaScript, I'd say that coffeescript -> javascript is compilation since coffeescript is not the same language and very syntactically different.

So I guess converting one language into another syntactically different language is a compiler. While converting a language into the same language but transforming specific parts for whatever reason (such as interop or backwards compat) is a transpiler.

That's how I tend to think of it anyway.

But I agree, probably could just use compiler for all of them, especially if not using it means added ambiguity.