Tag

metaprogramming

0 views collected around this technical thread.

Bilibili Tech
Bilibili Tech
Oct 22, 2024 · Mobile Development

Understanding Swift Macros in Swift 5.9 and Their Applications

Swift 5.9’s new macro system lets developers generate type‑safe code at compile time via external plug‑ins, using role‑based declarations such as @attached and @freestanding to create properties, extensions, or warnings, thereby reducing repetitive boiler‑plate and improving safety in large‑scale architectures like MVVP modules and exposure frameworks.

Compiler PluginMacroSwift
0 likes · 20 min read
Understanding Swift Macros in Swift 5.9 and Their Applications
Architecture Development Notes
Architecture Development Notes
Aug 18, 2024 · Fundamentals

Mastering Rust macro_rules! for Flexible Config Structures

This article explores Rust's macro_rules! system, demonstrating how to create reusable, flexible configuration structures with default values, deprecation handling, and custom validation, while providing step‑by‑step code examples and highlighting the benefits for maintainability and code reuse.

code generationconfigurationmacro_rules
0 likes · 11 min read
Mastering Rust macro_rules! for Flexible Config Structures
Test Development Learning Exchange
Test Development Learning Exchange
Jul 20, 2024 · Fundamentals

Python Reflection and Metaprogramming: Concepts and Practical Examples

This article explains Python's reflection and metaprogramming features, demonstrating how to inspect objects, dynamically invoke methods, create classes, use metaclasses, decorators, exec, inspect signatures, and other advanced techniques through ten clear code examples.

DynamicPythonintrospection
0 likes · 6 min read
Python Reflection and Metaprogramming: Concepts and Practical Examples
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jun 4, 2024 · Frontend Development

Why You Should Use Reflect Together with Proxy in JavaScript

This article explains the relationship between JavaScript's Proxy and Reflect objects, demonstrates their basic syntax and practical code examples, compares their performance, and outlines various real‑world scenarios where combining them leads to cleaner, more maintainable frontend code.

JavaScriptProxyReflect
0 likes · 12 min read
Why You Should Use Reflect Together with Proxy in JavaScript
Test Development Learning Exchange
Test Development Learning Exchange
Jan 10, 2024 · Fundamentals

Understanding Python Decorators: Theory and 10 Practical Use Cases

This article explains the concept and implementation of Python decorators as higher‑order functions and provides ten practical code examples—including timer, debugger, parameterized, class‑based, caching, permission, logging, exception handling, authentication, and chained decorators—to illustrate their versatile applications.

codedecoratormetaprogramming
0 likes · 7 min read
Understanding Python Decorators: Theory and 10 Practical Use Cases
Test Development Learning Exchange
Test Development Learning Exchange
Dec 18, 2023 · Fundamentals

Dynamic Class Creation and Modification in Python: 10 Practical Scenarios

This article explains Python's dynamic class creation and modification techniques—including the type function, metaclasses, and class decorators—through ten practical code examples that demonstrate how to build flexible, maintainable, and powerful object‑oriented designs.

Dynamic ClassesMetaclassesPython
0 likes · 8 min read
Dynamic Class Creation and Modification in Python: 10 Practical Scenarios
FunTester
FunTester
Dec 6, 2023 · Backend Development

Groovy Script setLength Error with StringBuilder and How to Work Around It

The article describes a Groovy scripting issue where calling StringBuilder.setLength(0) triggers a NoSuchMethodError, explains Groovy's automatic property generation, demonstrates debugging steps, metaprogramming attempts, and the final workaround that resolves the error.

GroovyJavaStringBuilder
0 likes · 6 min read
Groovy Script setLength Error with StringBuilder and How to Work Around It
Test Development Learning Exchange
Test Development Learning Exchange
Nov 27, 2023 · Fundamentals

10 Practical Python Metaprogramming Scenarios Using __getattr__, __setattr__, Property Decorators, Descriptors, and Metaclasses

This article demonstrates ten practical Python metaprogramming techniques—including dynamic attribute access with __getattr__, attribute assignment with __setattr__, descriptor-based validation, property decorators, dynamic class and method creation, and metaclass usage—providing complete code examples for each scenario.

DynamicAttributesPropertyDecoratorPython
0 likes · 6 min read
10 Practical Python Metaprogramming Scenarios Using __getattr__, __setattr__, Property Decorators, Descriptors, and Metaclasses
php中文网 Courses
php中文网 Courses
Oct 19, 2023 · Backend Development

Using PHP 8 Attributes to Extend Classes: Syntax, Examples, and Reflection

This article explains PHP 8’s new Attributes feature, showing how to define attribute classes, apply them to classes, methods, and properties, and retrieve their values using the Reflection API, with complete code examples.

PHPPHP8attributes
0 likes · 4 min read
Using PHP 8 Attributes to Extend Classes: Syntax, Examples, and Reflection
Test Development Learning Exchange
Test Development Learning Exchange
Aug 3, 2023 · Fundamentals

Dynamic Class Creation and Modification in Python: Techniques and 10 Practical Examples

This article explains Python's dynamic class creation and modification techniques—including the type function, metaclasses, and class decorators—through ten practical code examples that demonstrate how to build flexible, maintainable class structures for various programming scenarios.

Class DecoratorsDynamic ClassesMetaclasses
0 likes · 8 min read
Dynamic Class Creation and Modification in Python: Techniques and 10 Practical Examples
Test Development Learning Exchange
Test Development Learning Exchange
Aug 2, 2023 · Fundamentals

10 Practical Python Metaprogramming Scenarios Using __getattr__, __setattr__, and Descriptors

This article presents ten useful Python metaprogramming examples that demonstrate dynamic attribute access, setting, descriptor‑based validation, runtime attribute creation and deletion, computed properties, dynamic class and method generation, and metaclass techniques for flexible program behavior.

Pythoncode examplesdescriptors
0 likes · 6 min read
10 Practical Python Metaprogramming Scenarios Using __getattr__, __setattr__, and Descriptors
Tencent Cloud Developer
Tencent Cloud Developer
Mar 1, 2022 · Fundamentals

Understanding Function Type Erasure and Runtime Invocation in C++ Reflection (Ponder Library)

The article explains how Ponder’s C++ reflection library uses template‑based type erasure to register and invoke functions at runtime, detailing the Function class, registration syntax, argument conversion, Lua integration, performance considerations, and a complete Vector3 DotProduct example.

C++LuaRuntime
0 likes · 26 min read
Understanding Function Type Erasure and Runtime Invocation in C++ Reflection (Ponder Library)
Tencent Cloud Developer
Tencent Cloud Developer
Feb 22, 2022 · Fundamentals

C++ Runtime Reflection Implementation Overview with Code Examples

The article explains how to implement a runtime reflection system for C++ using the Ponder library, detailing type registration, property and function metadata, builder-generated meta‑objects, type‑erasure wrappers like UserObject and Value, and runtime APIs for dynamic object creation and invocation.

C++PonderRuntime
0 likes · 29 min read
C++ Runtime Reflection Implementation Overview with Code Examples
High Availability Architecture
High Availability Architecture
Nov 12, 2020 · Fundamentals

A Tour of Metaprogramming Models for Generics

This article surveys how various programming languages implement generic programming, comparing approaches such as boxing, monomorphisation, type erasure, vtables, dictionary passing, and compile‑time code generation, and illustrates each method with code examples from Go, Java, Rust, C++, D, and others.

Language DesignTemplatesType Erasure
0 likes · 23 min read
A Tour of Metaprogramming Models for Generics
Xianyu Technology
Xianyu Technology
Aug 22, 2019 · Fundamentals

Metaprogramming in Dart: AST Manipulation with Dill

Metaprogramming in Dart leverages the Dill intermediate representation and its abstract syntax tree to programmatically generate, transform, or inject code at compile time, enabling features such as custom serialization, AOP hooks, and reflection‑like capabilities without runtime overhead.

ASTCompilerDart
0 likes · 8 min read
Metaprogramming in Dart: AST Manipulation with Dill
Sohu Tech Products
Sohu Tech Products
Aug 22, 2018 · Mobile Development

Deep Dive into the Objective‑C Runtime: Object Model, Class Structure, Dynamic Loading and Practical Uses

This article provides an in‑depth exploration of the Objective‑C runtime, covering the underlying object model, class and metaclass structures, the isa_t layout, how classes are loaded and initialized, dynamic loading mechanisms, and practical applications such as ORM and automatic NSCoding implementation.

Class LoadingORMObjective-C
0 likes · 22 min read
Deep Dive into the Objective‑C Runtime: Object Model, Class Structure, Dynamic Loading and Practical Uses