V2EX  ›  英汉词典
Enqueued related words: Babel, Minifier

Transpiler

Definition / 定义

transpiler(名词):一种源代码到源代码(source-to-source)的编译器/转换器,把一种编程语言(或同一语言的不同版本/方言)转换成另一种语言(或版本)的等价代码,常用于把“新语法”转换为“旧环境可运行的语法”(如把现代 JavaScript 转成兼容旧浏览器的 JavaScript)。也常被称为 source-to-source compiler

Pronunciation / 发音(IPA)

/trænˈspaɪlər/

Examples / 例句

A transpiler converts modern JavaScript into older JavaScript that browsers understand.
转译器会把现代 JavaScript 转换成浏览器能理解的旧版 JavaScript。

To target multiple platforms, the team built a transpiler that rewrites the project’s syntax into a safer, more portable subset of the language.
为了适配多个平台,团队构建了一个转译器,把项目语法改写成更安全、更可移植的语言子集。

Etymology / 词源

transpilertrans-(“跨越、转换”)与 compiler(“编译器”)的合成词,用来强调它的核心特点:跨语言/跨版本地“编译”,但产物仍然是可读的源代码而不是机器码。该词在现代前端工程(如 Babel 等工具)兴起后更为常见。

Related Words / 相关词

Literary Works / 文献与作品中的用例

  • Crafting Interpreters(Bob Nystrom)——讨论语言实现时涉及将代码转换为其他形式/表示,书中语境常提到 transpile/transpiler 这类“源到源转换”的思路与用途。
  • Eloquent JavaScript(Marijn Haverbeke)——在介绍现代 JavaScript 工具链与兼容性问题时,会涉及 transpilers(如 Babel)用于把新语法转换为旧环境可运行代码的概念。
  • Programming TypeScript(Boris Cherny)——讲解 TypeScript 工程实践时,常以“TypeScript 编译为 JavaScript”的流程说明转译/编译工具在项目中的角色。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   889 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 23:17 · PVG 07:17 · LAX 15:17 · JFK 18:17
♥ Do have faith in what you're doing.