Transpiler, a Meaningless Word (2023)
Scope of the Term “Transpiler”
- Broad agreement that a transpiler is a kind of compiler; disagreement over whether the extra word is useful or misleading.
- Common proposed definitions:
- Source-to-source compiler whose input and output are “similarly high-level” languages.
- Compiler that outputs code intended for another compiler/interpreter, rather than an assembler or VM.
- Compiler whose output language is normally written by humans (JS, C, Python), not “object code”.
- Counterpoint: many real tools blur these lines (Nim→C with gotos, Elm→JS with huge runtimes, TS→JS, Java/C#→bytecode), so “same abstraction level” or “human-readable” is fuzzy.
Semantics vs. Syntax
- Several comments echo the article’s concern: “transpiler” is often used as if it implied a shallow syntactic rewrite, ignoring semantics.
- In practice, many “transpilers” require whole-program semantic transformations (e.g. generators, async/await), so the underlying complexity is that of a full compiler.
- Warning against using the label to downplay how hard the problem is (“don’t use the distinction to lie to yourself”).
Human-Readability and Idiomatic Output
- One camp: transpilers are distinguished by output that stays close in structure and idiom to the source (CoffeeScript→JS, Pascal→readable C).
- Another camp: if the target code is unidiomatic or obviously “compiler C/JS”, it’s just a compiler using a high-level language as an assembly.
- Edge cases (SCSS→minified CSS, TS/JS with heavy transformations, assembly that humans still write) show that “human-readable” is a spectrum.
Lumpers vs. Splitters and Terminology Politics
- Discussion framed as “lumpers vs splitters”:
- Lumpers: “compiler already covers this; extra term adds noise or marketing spin.”
- Splitters: finer categories (native compiler, cross-compiler, bytecode compiler, transpiler, decompiler, etc.) aid communication.
- Some see “transpiler” as harmless, like “crimson” vs “red”.
- Others argue it can be used rhetorically or commercially to mystify or mislead (“not a compiler, a transpiler”; analogies to “micellar water”, “collagen supplements”, “serverless”, “cloud”).
Alternative Taxonomies and Continuum View
- Several comments treat everything as “language translators” on a continuum:
- Compiler (general), with subtypes: assembler, transpiler, decompiler, recompiler, pretty-printer, “cispiler” (same-language transform), partial evaluator.
- VM/JITs and multiple backends (e.g. Nim→C vs Nim→LLVM) further weaken any hard compiler/transpiler boundary.
- Consensus trend: the word “transpiler” isn’t rigorously definable, but many practitioners still find it a modestly useful, context-dependent label.