The meta-programming tag has no wiki summary.
72
votes
22answers
34k views
Automatic programming: write code that writes code [closed]
After reading the book The Pragmatic Programmer, one of the arguments I found most interesting was "write code that writes code".
I tried searching over the net for some more explanations or articles ...
19
votes
3answers
2k views
Must I think about compiled machine code when I write my code?
For example I've got following code:
auto z = [](int x) -> int {
if (x > 0) {
switch (x) {
case 2: return 5;
case 3: return 6;
default: return 1;
...
11
votes
5answers
2k views
Is monkeypatching considered good programming practice?
I've been under impression, that monkeypatching is more in quick and dirty hack category, rather than standard, good programming practice. While I'd used from time to time to fix minor issues with 3rd ...
10
votes
4answers
485 views
How common is meta-programming? [closed]
How often do you or have you seen meta-programming be used in projects? In uni I've never seen this be applied, but I've seen this on my previous job (when I saw it I was blown away of how effective ...
7
votes
1answer
461 views
Loop fusion example using aspect-oriented framework
I had recently read a paper 'Aspect-Oriented Programming' by Gregor Kiczales and others, and found there the loop fusion example.
Here is a definition of the loop fusion from the paper
…the loop ...
6
votes
6answers
353 views
How to do pragmatic high-level/meta-programming?
Imagine you have implemented the creation of a nice path-based star shape in Lisp. Then you discover Processing and you re-implement the whole code, because Processing/Java/Java2D is different. Then ...
6
votes
2answers
357 views
Are there any reliable solutions for annotations/reflection/code-metadata in C?
Not all languages support java-like annotations or C#-like attributes or code metadata in general, however that doesn't mean it is not possible to have in languages that don't have this.
An example ...
5
votes
2answers
310 views
Example of time-saving usage of compile-time meta-programming?
The webpage of Converge states that:
Converge has a macro-like facility that can embed domain specific languages with arbitrary syntaxes into source files.
I am most intrigued by the possibility ...
4
votes
3answers
294 views
Metaobject protocol:Why is it known as an important concept
Metaobject protocol is protocol for metaobjects in a programming languages. Although I understand it on simple terms, I want to know the reason and a summary of real world usage patterns of this ...
4
votes
1answer
230 views
s expression representation for c
Experimenting with various lisps lately (clojure especially) i have wondered if there are any s expression based representations of (subsets) of c, so you could use lisp/closure to write macros and ...
3
votes
3answers
297 views
Is there a name for this functional programming construct/pattern?
I wrote a function and I'd like to find out if it is an implementation of some functional programming pattern or construct. I'd like to find out the name of this pattern or construct (if it exists)?
...
3
votes
1answer
357 views
Good introduction to metaprogramming in Prolog?
I would like to make for example imperative programs as output of Prolog (shaders of graphic card) and also event-driven programs (game logic) ... also I would like to learn how to metaprogram in ...
2
votes
1answer
197 views
Are symbolic programming and metaprogramming the same thing?
Are symbolic programming and metaprogramming the same thing?
I've always read about symbolic programming while using Mathematica, but I've never searched about it's meaning, I've searched about it ...
1
vote
5answers
408 views
Is it possible in C++ to define several methods at once?
Sorry for the confusing title of this question, but I can't think of an exact way to word it. I have a very long class with hundreds of similar methods and I am trying to find a way to construct it ...
-1
votes
4answers
134 views
Identifier for the “completed” stage of a process: 0, 99, something else?
Say, that you are handling a multi-step process (like a complex registration form, with a number of steps the user has go through in order). You need to be able to save the current state of the ...