
Transpile(动词)指将一种编程语言的源代码转换为另一种相同抽象层级的编程语言的源代码。与"编译"(compile)不同,transpile 强调的是源代码到源代码的转换,而非源代码到机器码的转换。
/trnzpal/
TypeScript code is transpiled into Javascript before it runs in the browser.
TypeScript 代码在浏览器中运行之前会被转译为 Javascript。
When we transpile our codebase from Python 2 to Python 3, we need to carefully review the output to ensure that subtle behavioral differences don't introduce bugs.
当我们将代码库从 Python 2 转译为 Python 3 时,需要仔细检查输出,以确保细微的行为差异不会引入错误。
Transpile 是一个混成词(portmanteau),由 transform(转换)和 compile(编译)合并而成,最早出现于20世纪末的计算机科学领域。随着 Web 前端开发的兴起(尤其是 TypeScript、Babel 等工具的流行),这个词在21世纪初被广泛使用。它强调的是"同层级转换"即源代码到源代码的翻译过程,而非传统编译中从高级语言到低级语言的转换。