Jump to content

Talk:Template metaprogramming: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
Sigfpe (talk | contribs)
Line 7: Line 7:
:Considering that most other languages don't support template metaprograms, it's unsurprising that C++ is the only language mentioned. And considering that and the fact that D isn't especially widely used, it probably would make sense to delete it. [[User:68.238.86.68|68.238.86.68]] 14:07, 28 May 2006 (UTC)
:Considering that most other languages don't support template metaprograms, it's unsurprising that C++ is the only language mentioned. And considering that and the fact that D isn't especially widely used, it probably would make sense to delete it. [[User:68.238.86.68|68.238.86.68]] 14:07, 28 May 2006 (UTC)
::Since no objections has been voiced I removed it per suggestion above. The D-example was redundant and contributed no further information to TMP. The article consitently uses C++ as a vehicle, which is proper since it is the utterly dominant language with TMP facilities, and if other languages should be mentioned it should be through wikilinks to the relevant section in that language's article. I also rephrased a D-advocating edit in the "benefits and drawbacks" section. [[User:Mikademus|Mikademus]] 07:03, 19 July 2006 (UTC)
::Since no objections has been voiced I removed it per suggestion above. The D-example was redundant and contributed no further information to TMP. The article consitently uses C++ as a vehicle, which is proper since it is the utterly dominant language with TMP facilities, and if other languages should be mentioned it should be through wikilinks to the relevant section in that language's article. I also rephrased a D-advocating edit in the "benefits and drawbacks" section. [[User:Mikademus|Mikademus]] 07:03, 19 July 2006 (UTC)
:::If this is to be a C++ only article, it should be renamed "C++ Template Metaprogramming." But it is not so named, and it is common practice in Wikipedia to illustrate programming technique articles with how they work in various languages. The D programming language's template metaprogramming facilities are in many ways more powerful than C++'s. The D example should be put back in.


== Wow! or Eeeewwww! ==
== Wow! or Eeeewwww! ==

Revision as of 07:50, 22 July 2006

WikiProject iconC/C++ Unassessed
WikiProject iconThis article is within the scope of WikiProject C/C++, a collaborative effort to improve the coverage of C and C++ topics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
???This article has not yet received a rating on Wikipedia's content assessment scale.
???This article has not yet received a rating on the importance scale.

This was redirected to Talk:Generic, but no longer needs to since template metaprogramming is now described correctly. (well, let me know if it isn't correct!-)

D

Hmm, a recent edit added TMP code for factorials in D. Since this article is very C++ish the edit is out of place with the rest of the article. Either the article should be reworked to accomodate other languages, or something else need to be done... Mikademus 11:41, 19 March 2006 (UTC)[reply]

Considering that most other languages don't support template metaprograms, it's unsurprising that C++ is the only language mentioned. And considering that and the fact that D isn't especially widely used, it probably would make sense to delete it. 68.238.86.68 14:07, 28 May 2006 (UTC)[reply]
Since no objections has been voiced I removed it per suggestion above. The D-example was redundant and contributed no further information to TMP. The article consitently uses C++ as a vehicle, which is proper since it is the utterly dominant language with TMP facilities, and if other languages should be mentioned it should be through wikilinks to the relevant section in that language's article. I also rephrased a D-advocating edit in the "benefits and drawbacks" section. Mikademus 07:03, 19 July 2006 (UTC)[reply]
If this is to be a C++ only article, it should be renamed "C++ Template Metaprogramming." But it is not so named, and it is common practice in Wikipedia to illustrate programming technique articles with how they work in various languages. The D programming language's template metaprogramming facilities are in many ways more powerful than C++'s. The D example should be put back in.

Wow! or Eeeewwww!

As a countercounterweight to what is said below. C++ template metaprogramming is a poor man's version of a number of language features found in a wide variety of languages such as macros in Lisp. It's daunting because it's accidental, not designed, so it lacks proper support (poor error reporting, inconsistency and non-orthogonality, poor compiler implementation and so on). The fact that it's daunting has little to do with its power which is no different from that of any other language with staged computation. Sigfpe 22:00, 21 July 2006 (UTC)[reply]

As a counterweight to the opinion below I have to say that I've never yet in any other language found another tool as powerful as templated metaprogramming. It has given me freedom to write incredibly terse and efficient code. Yes, it is difficult to get into, but then again, so is programming. It looks daunting, heck, it is daunting, but so are real-life powertools. Mikademus 18:27, 20 November 2005 (UTC)[reply]

I don't know whether to be impressed or disgusted... supposedly it was the intention of the designers of C++ to eliminate the need for macros and tricky macro-based techniques. But now it appears that when they introduced templates, they opened the door to a whole new avenue for creative, uh, hacking?

Now that I have learned about this astonishing technique, I am going to try very hard to forget it. I think I'm going to go away now and write some programs in TECO. Dpbsmith 01:41, 9 Jan 2004 (UTC)

MPSH book

The book Metaprogramming GPUs with Sh actually doesn't have anything to do with template metaprogramming. The word in the title refers to run-time metaprogramming, as opposed to compile time metaprogramming. Sh is a runtime-embedded DSL in C++.

I'm not sure exactly what do with this. As one of the authors of that book, I can say that we're now avoiding the term metaprogramming more and more, because of this common confusion.

I'm leaving in the reference for now, but someone might want to either remove or clarify it.