源代码到源代码编译器(英語:source-to-source compiler)、翻译器transcompiler)或转译器transpiler)是以某种编程语言的程序源代码作为输入,生成以另一种编程语言构成的等效源代码的编译器。源代码到源代码编译器会在大致相同的抽象级别之间抽象化,而传统編譯器则从一个较高等级的高级语言转换为低级语言。举例来说,源代码到源代码编译器可以将一个程序从Pascal转换为C语言。自动并行化英语Automatic parallelizing编译器经常采用高级语言的程序作为输入,然后转换代码并增加并行代码注释(例如OpenMP)或语言结构(例如Fortranforall语句)。[1]

转译语言的例子包括:Closure Compiler英语Google Closure ToolsCoccinelle英语Coccinelle (software)CoffeeScriptDartHaxeNimTypeScript[2]ValaEmscripten[3]

参考资料

Wikiwand in your browser!

Seamless Wikipedia browsing. On steroids.

Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.

Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.