after seeing yet another paper call something a "transpiler", i am once again requesting (telling) people to stop making up words that don't mean anything: https://rachit.pl/post/transpiler/
be better than a JavaScript tech bro
be better than a JavaScript tech bro
Comments
it is still a useful word even if it doesn’t have a precise definition and has overlap with compilers
tell me, is turning async-await into generators a "transpilation step" or a compilation one?
a compiler is the whole thing, not just the small steps. a parser alone doesn’t make a compiler
can you give me a *concrete* example of something that is *better described* as a transpiler instead of a compiler?
in general, the output of a transpiler should be something a reasonable person would view as source code
the example in my post uses a babel-based transform to implement generators. look at the output and tell me if you or a reasonable person would consider it source code?
if my editor supports variable rename, does that make it a compiler?
renaming a variable requires knowing what the scope of a variable is. knowing the of a variable requires...computing the type (done by the compiler)!
Still, what is the purpose of a transpiler different from a compiler or a compiler pass?
Also, would be interested in seeing usage going back 46 years if that's actually true.
A transpiler translated dialects. As I said, transliteration. It doesn’t ’compile’. PL/C was a good early example. Modern usage means, ‘syntactic conversion’, which is probably what you’re
(hint: people don't really use it consistently https://decomposition.al/blog/2017/07/30/what-do-people-mean-when-they-say-transpiler/)
a macro is an language construct that supports code generation.
crucially both need a compiler to work: for passes, the compiler orchestrates parsing and code gen; for macros, the compiler implements elaboration.
what is precisely different about "transpiler"? once again, what do you think of when you hear "transpiler"?
Not for any real technical reason, of course, the word just gets us all posting so vigorously we can't get any work done.
I first heard of transpilation in the context of JS, and since then my understanding had been “it’s a source-to-source compiler”.
However, in most software context, "transpiler" clearly means "convert a language that I know to another language that I know but I don't want to use because first language is better for
The meaning of words depends on the context of usage. For sure, "transpiler" does not mean anything in a coffee break at your lab.
Could they have used "compiler" instead, yes, but this would break some assumptions they have about the world, which is fine, we cannot be always pedantic.
No need to bash the js dev however
A transpiler is a compiler that targets a language at a similar or higher level of abstraction.
I think this captures nearly all uses of the term & is meaningfully different from other compilers.
let { a, b } = expr;
=>
let temp = expr;
let a = temp.a;
let b = temp.b;
A transpiling compiler stays at the same level or raises.
Would a translator from old BASIC, that uses GOTO for cf, to Python raise abstraction level.
How is something like this targeting a higher-level language?
ghcjs: both source and targets are high-level languages. Yes.
https://bsky.app/profile/jonathanaldrich.bsky.social/post/3lbx3uojfs224
"Human readable" is entirely subjective and expertise dependent
https://decomposition.al/blog/2017/07/30/what-do-people-mean-when-they-say-transpiler/
(Or maybe a decompiler only exists as an inverse of a specific compiler?)
IMO if someone means something more specific, that's because that's the context they encountered it.
If your compiler embeds or relies on what is clearly a compiler - eg, gcc - that first stage could be called a transpiler.
Of course the distinction dissolves if “transpiler” doesn’t have a single consistent definition…
I never thought of transpilers as not compilers. i thought of them as a particular kind of compiler. Same way I say "bytecode compiler".