Tagged articles
metaprogramming
23 articles · Page 1 of 1
This article introduces C++26's new static reflection mechanism, explaining the two-phase model using the ^^ operator to obtain compile-time reflection info as std::meta::info and the [:...:] splicing syntax to reinject it into code, with practical examples for types and variables.
C++26compile-time reflectionlanguage features
0 likes · 6 min read

The article argues that PHP Traits are an underestimated metaprogramming feature offering low cognitive overhead, but their potential is limited by weak composition contracts; it proposes bidirectional contracts allowing traits to require interfaces and implement interfaces, turning traits into predictable compile-time class transformations.
Compile-time TransformationComposition ContractsPHP
0 likes · 8 min read

The article explains compile‑time polymorphism in C++, shows why traditional SFINAE is hard to read and debug, and demonstrates how C++20 Concepts provide clearer syntax, precise errors, and better multi‑condition support, backed by side‑by‑side code examples and a detailed feature comparison.
C++ConceptsSFINAE
0 likes · 12 min read

Template Metaprogramming (TMP) leverages C++ templates to perform compile‑time calculations and code generation, offering zero‑cost abstractions, type safety, and performance gains, with examples like compile‑time factorials and type‑trait utilities, while modern C++ features such as constexpr and variable templates simplify its usage.
C++Zero-cost abstractioncompile‑time
0 likes · 10 min read

This article explains C preprocessor macros in depth, covering simple constant replacement, parameterized macros, stringification, token‑pasting, predefined macros, variadic macros, conditional compilation tricks, common pitfalls, and best‑practice recommendations for safe usage.
C++DebuggingMacros
0 likes · 11 min read

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 PluginSWIFTcode generation
0 likes · 20 min read

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.
Rustcode generationmacro_rules
0 likes · 11 min read

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.
IntrospectionPythondynamic
0 likes · 6 min read

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.
Proxymetaprogrammingreflect
0 likes · 12 min read

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.
Pythonmetaprogrammingprogramming
0 likes · 7 min read

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 ClassesPythondecorators
0 likes · 8 min read

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.
DebuggingGroovyJava
0 likes · 6 min read

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

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.
PHPReflectionattributes
0 likes · 4 min read

Learn how Python's metaprogramming lets you dynamically create, modify, and control classes and functions at runtime, covering metaclasses for singleton patterns and class registration, decorators for caching, timing, and logging, and property accessors for validation and computed attributes, each illustrated with concrete code examples.
BackendPythonTutorial
0 likes · 7 min read

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 ClassesPython
0 likes · 8 min read

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++FunctionLua
0 likes · 26 min read

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

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.
Type Erasurelanguage designmetaprogramming
0 likes · 23 min read

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

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 LoadingDynamic LoadingORM
0 likes · 22 min read

This article introduces JavaScript’s Proxy object, explains its core concepts—targets, handlers, and traps—and demonstrates practical uses such as property validation, data binding, and wrapping RESTful API calls with code examples, highlighting its versatility for developers.
APIJavaScriptmetaprogramming
0 likes · 4 min read

This article demystifies Python metaprogramming by exploring objects, classes, metaclasses, import‑time vs run‑time behavior, singleton implementations, decorators, and descriptors, showing how to harness these advanced features to write cleaner, more elegant code while explaining underlying concepts and practical examples.
Pythondecoratorsdescriptors
0 likes · 9 min read
