Hacker News new | ask | show | jobs
by cwyers 3347 days ago
I never understood the insistence in this. A transpiler is "a compiler that targets a high-level language." It's a term that adds information above and beyond compiler. All transpilers are compilers, not all compilers are transpilers.
1 comments

> A transpiler is "a compiler that targets a high-level language."

So rustc is a transpiler when using the emscripten backend but not when using the native backend? How does that even make sense?

You say it doesn't make sense, and yet you were able to figure out how to apply it correctly to the example you gave, so you have to have some understanding of the idea.

Like, in most American homes, there's a bathtub with a showerhead in it. When we're using the showerhead, we'll say, "I was in the shower..." When we're using the faucet, we'll say "I was in the bathtub." This sort of thing happens all the time. It makes plenty of sense that something is a transpiler when it's transpiling and not when it isn't.

Does prominent compiler literature use the term "transpiler"?