V2EX  ›  英汉词典
Enqueued related words: Metaprogram

Metaprogramming

释义 Definition

元编程 / 元编程技术:一种编程方式,程序把“代码”当作数据来读取、生成、修改或分析,从而在编译期或运行期自动产生或改变程序结构。常见于宏(macros)、模板(templates)、反射(reflection)、代码生成(code generation)等场景。(也可泛指“写能够写程序的程序”。)

发音 Pronunciation

/ˌmɛtəˈproʊɡræmɪŋ/

例句 Examples

Metaprogramming can reduce repetitive code in large projects.
元编程可以减少大型项目中的重复代码。

By using metaprogramming, the library generates optimized functions at compile time, but the added complexity can make debugging harder.
通过元编程,这个库在编译期生成优化过的函数,但额外的复杂性也可能让调试更困难。

词源 Etymology

由 **meta-**(“关于……本身、超越/更高层次”)+ programming(“编程”)构成。字面意思是“关于编程的编程”,强调在更高层次上对代码进行操作,让程序能够生成或改写程序。

相关词 Related Words

文学与作品用例 Literary & Works

  • The Pragmatic Programmer(Andrew Hunt, David Thomas)——在讨论提升开发效率与减少重复时,常涉及宏、代码生成等元编程相关思想。
  • *Structure and Interpretation of Computer Programs (SICP)*(Harold Abelson, Gerald Jay Sussman)——通过 Lisp/Scheme 的符号处理与宏思想,展示“把代码当数据”的理念,与元编程高度相关。
  • Programming Languages: Application and Interpretation(Shriram Krishnamurthi)——在讲解语言机制与解释器/宏等内容时,涉及元编程式的语言设计与实现视角。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   759 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 19:58 · PVG 03:58 · LAX 11:58 · JFK 14:58
♥ Do have faith in what you're doing.