Talk:Reflective programming
This template must be substituted. Replace {{Requested move ...}} with {{subst:Requested move ...}}.
Self-modifying code
How does reflection relate to self-modifying code? The terms are used in quite different contexts, of course, but aren't they really forms of the same thing? Self-modifying code is usually done in assembly language, and is normally considered bad form; reflection is usually considered a good thing, especially if the language is set up for it. I might at least add a "see also" to the other one on both pages. Benhoyt 20:56, 22 December 2005 (UTC)
Is reflection slow?
I removed "Depending on the implementation, code with reflection tends to run slower than that without it." Sure, it does depend on the implementation, but I thought this was unhelpful, because it only applies to a particular kind of reflection. With many types of reflection, such as macros and code compiling code, the whole point is to make the result run faster.
For example, in Forth you could add up the numbers from 0 to 9 with a loop, or with an unrolled, reflective-style loop:
: count ( -- ) 0 10 0 do i + loop . ; count
: unrolled-count ( -- xt ) :noname 0 postpone literal 10 0 do i postpone literal postpone + loop postpone . postpone ; ; \ effectively ":noname 0 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + . ;" unrolled-count execute
For a better, more "real-life" example, see Bruce Hoyt's Fast Pentomino Solver written in Forth using generated macros. Benhoyt 20:26, 22 December 2005 (UTC)
Emmited vs produced
Is the meaing of the word "emmited" here similar to the word "produced?" It might be easier for a non-programmer to understand the intended meaning if the word "produced" were used, since one reading this is probably already immersed in unfamiliar terminology that may have meanings beyond typical language.
Uh, aren't C# and Visual Basic.NET reflective languages? If not why not? They have runtime metadata. KellyCoinGuy 07:29, August 20, 2005 (UTC)
Reflection in C
Humm, in fact the GNU C language does have some reflection capabilities, through the dl library. Here is the code example for that:
#define _GNU_SOURCE 1 #include <dlfcn.h> int main(void) { typedef int (*printf_t) (const char *format, ...); printf_t the_printf; the_printf = dlsym (RTLD_DEFAULT, "printf"); the_printf ("Hello %s!\n", "world"); return 0; }
Behdad 03:47, 23 September 2005 (UTC)
- That's not reflection, that's dynamic linking, a form of late binding. It does allow you to do things you couldn't do statically, but it doesn't give you knowledge about the program's own structure like reflection does. You can't find out how many arguments a function takes or what procedures a library exports, for example, or dynamically create objects of a given type name, find out what members an aggregate type has, etc. If we can call this reflection at all, it's a very weak sort of reflection, and it's certainly not part of the language itself (support for dynamic linking comes from the environment; the language guarantees nothing). 82.92.119.11 15:09, 25 November 2005 (UTC)
Paradigm
This article should include a section on reflective programming as a paradigm. And the list of languages should also be presented in a multi-column tabular form, for better readability --Soumyasch 10:00, 26 March 2006 (UTC)
- I will be trying to do so. --Soumyasch 10:03, 26 March 2006 (UTC)
- Done. Please review and comment. And I suggest that the list of languages be moved to a separate article, for reasons stated below. --Soumyasch 04:27, 27 March 2006 (UTC)
Title is incorrect
Per Wikipedia's manual of style for capitalization, this should be at computational reflection if anything. Making this correction would require fixing the double redirects. Fredrik Johansson 12:11, 26 March 2006 (UTC)
- Google hits show Computational Reflection with both capital C and capital R --Soumyasch 12:23, 26 March 2006 (UTC)
- Doesn't matter; it is Wikipedia's house style to capitalize only the first word in a title (with exception for proper nouns). See Wikipedia:Naming conventions (capitalization). Fredrik Johansson 12:47, 26 March 2006 (UTC)
JA: The move from Reflection (computer science) to Computational reflection was ill-advised (if advised at all). Analogous considerations have come up many times before, for example, with all discipline-specific usages in mathematics, for instance, Group (mathematics) versus Mathematical group. If you think a little bit ahead (Partial lookahead (computer science)), you will perhaps see what kind of mess you are getting into with this strategy for disambiguation. Jon Awbrey 13:46, 26 March 2006 (UTC)
- I did not do it as a means of disambiguation but because "Computational Reflection" is a more formal name to the technique. Calling it "reflection" is a colloquialism and the word "computational" is dropped only when referring to something such as "reflective programming" or "reflective system", but if the technique is mentioned, it is always formally introduced as "Computational Reflection", even though it might be referred to as "reflection" only.
You can also refer to these [1], [2], [3], [4], [5], and all references on these pages. --Soumyasch 15:26, 26 March 2006 (UTC)
JA: I am familiar with the literature. The intent of the adjective is to disambigaute the use of the term, but context already does that. However, putting the adjective up front introduces additional problems. For instance, if you consider the paradigm of parallel usage, like "computational process", the term "computational reflection" connotes an algorithm that carries out reflection. This is a useful concept, one that may even be discussed under this head, but it is not in general the concept that is being discussed here. Again, this sort of thing has come up very often before, and experience shows that putting the disciplinary category in parenthesis works best, especially as one begins to use terms in combination, supply quick wiki links, and so on. Jon Awbrey 15:42, 26 March 2006 (UTC)
- Well, now what? Should this title be kept or get it moved back? I have no problem with any name, its the content that matters to me. As posted earlier, I am going to expand the definition of reflection a bit, tabularize the list of languages and add a section for reflection as a programming paradigm (I know it will be bit theoretical, but I will try to make it as layman-ly as I can). I would appreciate comments in this respect as well. --Soumyasch 17:08, 26 March 2006 (UTC)
JA: As far as I can tell, what little I know, the move back to Reflection (computer science) is now blocked by previous history, so requires Admin assistance. I can go through the steps for that later tonight. I think that this falls under "moves that require discussion and consensus", so that's what I think happens next. Maybe somebody else knows an easier way though? Jon Awbrey 17:16, 26 March 2006 (UTC)
List of languages
I would suggest the list of reflective programming languages be forked off into a new article. The list is preventing the article from having a coherent structue and because, lists generally have their own page. Please support or oppose. --Soumyasch 03:36, 27 March 2006 (UTC)
- No one objected. Doing it. --Soumyasch 04:25, 28 March 2006 (UTC)
Requested move
- Computational reflection → Reflection (computer science) … Return to previous name now blocked by history, more standard practice to disambiguate a term with the discipline name in parentheses. — Jon Awbrey 04:52, 27 March 2006 (UTC)
- Add *Support or *Oppose followed by an optional one-sentence explanation, then sign your opinion with ~~~~
- Support --Soumyasch 05:03, 27 March 2006 (UTC)
Discussion
- Add any additional comments