Talk:D (programming language): Difference between revisions

Content deleted Content added
Not relevant to contents of article.
 
(46 intermediate revisions by 35 users not shown)
Line 1:
{{afd-merged-from|GtkD|GtkD|23 August 2011|date=August 2011}}
{{WikiProject Computing|class=Start|importance=}}
 
{{WikiProject Computer science
{{archives}}
|class=Start
{{WikiProject banner shell |class=C |1=
|importance=low
{{WikiProject Computing |importance=Low |software=y |software-importance=Low |science=yes |science-importance=Low |free-software=yes |free-software-importance=Low}}
}}
 
==Old discussionHelloWorld==
Where is HelloWorld? <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/12.15.136.26|12.15.136.26]] ([[User talk:12.15.136.26|talk]]) 21:03, 14 October 2010 (UTC)</span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->
"(This needs elaboration.)" has just turned into a link, the target of which has only one sentence of relevance, which says practically nothing.
:[http://rosettacode.org/wiki/Hello_world/Text#D D's Hello World] is pretty boring. I think it'd only waste space in the article. --[[User:CyberShadow|Vladimir]] ([[User talk:CyberShadow|talk]]) 01:05, 23 October 2010 (UTC)
 
::But all the others have HelloWorld. In VB it's just <code>MsgBox("Hello, World!")</code> but we still have it. --[[User:Joshua Issac|Joshua Issac]] ([[User talk:Joshua Issac|talk]]) 00:47, 15 November 2010 (UTC)
OK, so it gives a lower bound for the number of languages that have been called D, but that's certainly nowhere near an adequate elaboration in my mind.
 
Maybe someone should start [[D programming language (disambiguation)]]....
 
-- [[User:Smjg|Smjg]] 09:44, 20 Apr 2004 (UTC)
-----
Wouldn't it be slightly better to use a D-specific statement in the example like foreach instead of for ?
 
The problem is that it won't have exactly the same output as the current example (you can't print the number of the argument unless you add an ''i'' variable somewhere and increment it each time, but that doesn't look very clean)
 
: D allows foreach loops to be indexed, so there's no problem at all. -- [[User:Smjg|Smjg]] 22:36, 3 Jul 2004 (UTC)
 
:: OK, I don't know D well enough :) and what do you think of my proposition then ? [[User:SeeSchloss|&rarr; SeeSchloß]] 20:44, 5 Jul 2004 (UTC)
 
::: Yes, we should put this in. A good code example is one that does things in the way of the language. -- [[User:Smjg|Smjg]] 09:45, 6 Jul 2004 (UTC)
 
:::: Thanks, I've replaced the ''for'' example with the ''foreach'' one. By the way it looks like the new release now has writef() and writefln(), which could give ''writefln ("args[", i, "] = ", arg);'' instead of the printf in the example, but I haven't used it yet. [[User:SeeSchloss|&rarr; SeeSchloß]] 21:30, 10 Jul 2004 (UTC)
 
 
==The article reads like an advertisement for D==
 
I need to learn more before I can rework it, but for starters, "archaic features" is not [[Wikipedia:NPOV|NPOV]]. --[[User:Ardonik|Ardonik]] 00:43, Jul 16, 2004 (UTC)
 
: yes, the article ends up being an advertisement for D instead of an impartial explanation of what it is, it's history and it's capabilities. Maybe it has something to do with D being still under development and some purveyors of that language being quite active in the astroturfing department.
: A complete impartial re-write of this article is needed.
 
::Any input from a real-life D programmer would be more than welcome at this point. --[[User:Ardonik|[[User:Ardonik|Ardonik]]([[User talk:Ardonik|talk]])]] 03:23, Aug 31, 2004 (UTC)
 
:::I added the advertisement notice since:
:::* There's no criticism
:::* There are sentences like ''OOP is supported, of course!''
:::* There is a list of ''Enhancements over C++'', but many of them may or may not be considered enhancements, such as: ''all vars automatically initialized to 0''. Some developers do NOT want them initialized to 0 since its a waste of CPU.
:::Unfortunately I'm not a D programmer so I'm not qualified for a rewrite :( --[[User:Swalot|Swalot]] 22:55, 18 September 2006 (UTC)
 
::::I hope that I've cleaned up the issues you mentioned. However as for criticism, that might have to wait until v1.0 is released, which BTW is likely to be very soon. [[User:Derek Parnell|DerekP]] 23:42, 19 September 2006 (UTC)
 
 
Initialisation of variables is needed, becouse pointers can point to not existent objects, preventing GC from collecting. And if you Realy want not initialising, no problem: int x = void; And this is marginal (1% ?) fraction of execution time.
--[[User:149.156.67.102|149.156.67.102]] 14:23, 25 June 2007 (UTC)
 
Added a "problems and controversies" section. Reviews are welcome. --[[User:80.121.25.47|80.121.25.47]] 11:17, 10 October 2007 (UTC)
:Your ideas, noticible hidden behind anonymity, appear to be either grossly misinformed or delibrate lies. The gist of your assertion sounds like "because D does not behave as C++ does, it is self-evident that D is a flawed programming language". It simply looks like you just don't get it - D is not C++. It doesn't try to be or claim to be C++, in spite of your unsubstantiated quotation that 'D is often stated as being a "fixed and improved C++"'.
:You state that ''D operator overloads are significantly less powerful than the C++ counterparts.'' What evidence do you have to justify this? How is "powerful" to be measured? I'm sure that one could simply swap 'D' and 'C++' in that statement and use it as a counter argument. You state ''A popular example is the opIndex'' but how did you measure that this was 'popular'? You then go on to say that because opIndex does not do exactly the same as C++ that it must therefore be the flawed operand. That fails to acknowledge that opIndex is deliberately designed to have a different role than C++'s multifaceted indexing operand. You imply that opIndexAssign was later added to make up for the lack of functionality in opIndex. But this is not the case and is a distortion of the truth. opIndex was designed to be the RHS action and opIndexAssign was designed to be the LHS action.
:You believe that D structs are underpowered because they do not behave like classes. This position fails to see that D makes a distinct separation between classes and structs whereas C++ treats them almost as the same things. In D classes are reference types and structs are value types. They have different roles and are are meant to solve different problems.
:You state ''associative arrays which can be implemented easily in the standard library as STL-like maps'' like that would be a good thing. Again, the implication is that you see that when D does things in a manner that C++ does differently, that therefore necessarily D must be in the wrong. The built-in AA functionality lowers the entry barrier for new users and it does not prevent templated maps as alternate AA implementations from being created.
:You state ''On Windows systems, DLLs are currently not supported. Thus, writing plugins in D is currently not possible''. This is just wrong. DLLs are supported. One can create DLLs and one can use DLLs. Plugins, using the DLL interface, are perfectly possible.
:[[User:Derek Parnell|DerekP]] 04:38, 11 October 2007 (UTC)
 
::As said, D 2.0 will introduce an opIndexLvalue operator precisely to mimic C++'s one. You can still say that this is D's way of doing things, but then you are implying that D's [] operator is less powerful than C++'s one. One of the goals of D is to recast C++ in a sane and straightforward language; deliberately castrating one of C++'s most used abilities (operator overloading) is not a smart idea. A "opIndexAddAssign" operator has been proposed for the a[i] += b; problem in the past, which is yet another short-sighted solution. Logically, an opIndex returning a *reference* automatically fixes ALL of these cases.
::I know that D makes a distinct separation. But then I ask you: why can structs have methods, but not constructors? Why can't they have simple inheritance without support for vtables? They remain lightweight this way while becoming even more useful for metaprogramming.
::Also, I want to know how a simple "import std.containers.map;" and "my_map["A"] = b;" raises the entry barrier.
::I want to see code actually using D via DLLs. You are aware of the fact that currently, phobos is NOT a DLL, thus a DLL and a program have two different GCs, which leads to havoc? Or are you confusing them with DDL, which are something entirely different? Also, name your compiler. In case of DMD 2.x, you are using experimental software. --[[User:80.121.55.165|80.121.55.165]] 13:27, 11 October 2007 (UTC)
 
==There appears to be another growing language family called D==
Date & Darwen, in [[The Third Manifesto]], propose a category of pure-relational database languages called '''D'''. Their example language is called '''Tutorial D''', and there appear to be a number of implementations already under development. For one, see: http://dbappbuilder.sourceforge.net/Rel.html —[[User:Fubar Obfusco|FOo]] 04:01, 23 Sep 2004 (UTC)
 
== Proposed or possible ==
 
"Proposed or possible" successors to C++ is redundant. I'm going to change it back to just "proposed."
 
== Babel ==
 
I've added D to the [[Wikipedia:Babel]] project. Feel free to put it in your babelbox! -- [[User:Smjg|Smjg]] 09:33, 27 October 2005 (UTC)
 
==when created?==
When was it designed? [[User:71.96.234.140|71.96.234.140]] 04:20, 27 April 2006 (UTC)
 
:Perhaps in 2001, based on [http://www.digitalmars.com/drn-bin/wwwnews?D/2 this post] from August 2001 being the earliest one there. The earliest version of D I can find mention of in the changelog was from September 2002. &ndash;[[User:Tifego|<small>Tifego</small>]]<sup>[[User Talk:Tifego|(t)]]</sup><sub> 04:35, 27 April 2006 (UTC)</sub>
::However, if you mean when was it initially thought of, this might apply: ''"D was conceived in December 1999 by Walter Bright as a reengineering of C and C++"''. &ndash;[[User:Tifego|<small>Tifego</small>]]<sup>[[User Talk:Tifego|(t)]]</sup><sub> 04:38, 27 April 2006 (UTC)</sub>
 
== Example 3 ==
It's not clear in the comment which portions of Example 3 are or aren't part of C++ already. I don't know D at all, so could somebody clarify? [[User:Mkb218|matt kane&#39;s brain]] 13:50, 5 May 2006 (UTC)
 
== D does not "extend" C++ ==
 
To say that D extends C++ implies that D is C++ with more features. That's just wrong. Infact, that's the opposite of the spirit of D.
 
D does not "extend" C++; D re-engineers C++ in a better way.
D is a modern language that combines the robustness of modern languages (like Java and C#) with the power and features of C/C++.
 
:Hmmmmmm, ... mmmm?? At least this container/dictionary stuff is somewhat original for the C-family proper. I'm not quite sure what D does, but it reworks the C-family of language by incorporating constructions of minimalist alternative "interpretations" (in linguists' sense). If the classes per default are non-virtual (statically allocked), then the nearest language is C++; however, if the classes are virtual (dynallocked), then the nearest language is in fact Objective C. I think D is developed from the C-family using experiences from C, C++, Objective C, Java, C-sharp and some other inspirations. To be more precise than that is to provide an erroneous image. <span style="color: #800000; background-color: #FFFFA0; padding: 1px 2px 3px 2px">''Said: [[User talk:Rursus|Rursus]] [[User:Rursus/OTHITPWMEEENAE|☺]] [[User:Rursus|★]]''</span> 09:28, 14 June 2007 (UTC)
 
::Sorry, I think I spake balderdash! What I meant was that dynamical method lookup (by default) implies a nearer relationship with Obj-C, and statical same C++. Either way D is a general reelaboration on the basis of C-related PL:s, not more precize than that. <span style="color: #800000; background-color: #FFFFA0; padding: 1px 2px 3px 2px">''Said: [[User talk:Rursus|Rursus]] [[User:Rursus/OTHITPWMEEENAE|☺]] [[User:Rursus|★]]''</span> 13:47, 14 June 2007 (UTC)
 
== The current version is ... ==
 
There is no indication of the current version of either the compiler (or the tools). This information would be useful in determining how "ready is D for prime time." [[User:24.188.206.103|24.188.206.103]] 00:56, 13 July 2006 (UTC)Cacofonix
 
<small>—The preceding [[Wikipedia:Sign your posts on talk pages|unsigned]] comment was added by [[User:209.89.183.89|209.89.183.89]] ([[User talk:209.89.183.89|talk]] • [[Special:Contributions/209.89.183.89|contribs]]) {{{2|}}}.</small>
: So fix the article [[User:Mkb218|matt kane&#39;s brain]] 21:31, 12 June 2006 (UTC)
 
==DTrace==
The [[DTrace]] kernel tracing mechanism uses a "scripting language" also called "D", that appears to be a different language than the one covered in this article. I think there should be at least some mention of it, as DTrace is probably more current as a topic than this "older" language. More info on dtrace can be found [[http://www.opensolaris.org/os/community/dtrace/|here]], as well as some [[http://users.tpg.com.au/adsln4yb/DTrace/seeksize.d|sample code]]. --[[User:Booch|Booch]] 06:35, 8 November 2006 (UTC)
 
==Requested move==
[[D programming language]] → [[D (programming language)]]
– Conformance with WP naming conventions [[User:Atanamir|atanamir]]
{{Wikipedia talk:WikiProject Programming languages/Renaming poll}}
 
==D influenced by C#?==
Recently, C# was added to the list of influences of D ([http://en.wikipedia.org/w/index.php?title=D_%28programming_language%29&curid=243881&diff=87451030&oldid=87314214 diff]). However, I think that is not the case, since D got started before C# had gained a considerable momentum &ndash; I think the languages are similar since they merely have common ancestors. Any opinions? -- [[User:Intgr|intgr]] 10:41, 13 November 2006 (UTC)
:I added that because I recall discussions with Walter Bright saying things that indicated that some concepts now found in D are also found in C#. These were things not originally in D but have made their way into the current specification after being proposed for C# (3.0 from memory). I'll try to locate the discussions and post references.
 
Comment added by another reader: my attention was drawn to D by a recent Dr Dobbs newsletter item. Upon looking through the description of D on http://www.digitalmars.com/d/2.0/overview.html, my reaction is that D has a very large overlap with C# both in motivation and details. (I have no knowledge about who deserves credit for which features; perhaps C# & D both availed themselves of some ideas from Java.) The big difference is the aim of D to compile to machine code and to allow assembler code inline, so that it is a good candidate for systems programming. A lesser difference is D's dropping of the namespace concept. After being frustrated for some time by aspects of C++, I found C# to be a huge improvement. I expect that someone moving to D would be similarly appreciative. [[Special:Contributions/64.111.150.248|64.111.150.248]] ([[User talk:64.111.150.248|talk]]) 19:50, 3 February 2009 (UTC)
 
==IDE for D available==
I'm the author of Geany, a light IDE which supports the language D. Geany isn't a full-featured IDE and it's still in heavy development but it supports already D with some auto completion, folding and such things. Perhaps someone wants to add it. <small>—The preceding [[Wikipedia:Sign your posts on talk pages|unsigned]] comment was added by [[Special:Contributions/80.144.60.98|80.144.60.98]] ([[User talk:80.144.60.98|talk]]) 17:33, 8 December 2006 (UTC).</small><!-- HagermanBot Auto-Unsigned -->
 
Eclipse have good support of D language via Descent plugin.
 
== ...built making the DMD compiler front end... ==
 
I'm not a native English speaker, so I probably just don't get it.
<blockquote>''Gnu D Compiler (GDC): the GNU D Compiler, built making the DMD compiler front end and the GCC compiler back end work together.''</blockquote>
Is it correct that Gnu D uses part of the DMD compiler? I can not find a confirmation of that. - [[:ru:User:Saproj]] <small>—The preceding [[Wikipedia:Sign your posts on talk pages|unsigned]] comment was added by [[Special:Contributions/89.106.39.140|89.106.39.140]] ([[User talk:89.106.39.140|talk]]) 19:30, 15 January 2007 (UTC).</small><!-- HagermanBot Auto-Unsigned -->
:I haven't followed it for a little while, but from memory, the DMD release comes with source code for the compiler front end. DMD itself utilize the DMC compiler for the backend whose source are not release. GDC take that front end source and make it work with GCC, so yes is the answer to your question. -- [[User:KTC|KTC]] 17:37, 15 March 2007 (UTC)
 
== Changes are made regularly? ==
 
There is this in the article:
<blockquote> D is still under development, and changes to the language are made regularly. Although the design is almost frozen, it is possible that some of these changes could break D programs written for older versions of the language and compiler. </blockquote>
 
I find this strange, because, the article mentions that D already hit 1.0. Can somebody more knowledgeable about D verify this issue? [[User:JorgePeixoto|Jorge Peixoto]] 10:37, 15 March 2007 (UTC)
 
:That was written prior to the 1.0 release, and nobody has just changed it yet. -- [[User:Intgr|intgr]] 14:57, 15 March 2007 (UTC)
 
: In the end, 1.0 was little more than a symbolic milestone. Things haven't really changed since then. -- [[User:Smjg|Smjg]] 16:53, 15 March 2007 (UTC)
 
I changed the text to reflect was is in fact going on. --[[User:Marianocecowski|Mariano]]<small>([[User talk:Marianocecowski|t]]/[[Special:Contributions/Marianocecowski|c]])</small> 17:20, 15 March 2007 (UTC)
 
== Examples in RGB?? ==
OK, no trouble for me, because my color vision is virtually perfect, but there are color blindness out there. I suggest using other kind of highlight based on <span style="background-color: white">background</span> and '''font style'''! <span style="color: #800000; background-color: #FFFFA0; padding: 1px 2px 3px 2px">''Said: [[User talk:Rursus|Rursus]] [[User:Rursus/OTHITPWMEEENAE|☺]] [[User:Rursus|★]]''</span> 15:00, 14 June 2007 (UTC)
 
:Syntax highlighting with font color is a very established practice &mdash; anything else will probably appear unnatural and distracting to programmers; even the colors (blue for keywords, red for literals, green for comments) are a de facto standard for C-like languages.
:Do you really think there is a good reason to change this? -- [[user:intgr|intgr]]&nbsp;<sup>[[user talk:intgr|#%@!]]</sup> 10:06, 15 June 2007 (UTC)
 
:: The color scheme presently used to highlight code samples looks awful: bright red and dim yellow is not a good selection of colors to enhance readability. Also, consider the fact that in printed version of Wikipedia, the colors will most likely not be distinguished. I would propose to get rid of them alltogether, and merely mark the keywords in bold. This would suffice to highlight the syntax of the language and enhance readability without making anyone's eyes hurt. [[User:Int19h|-- int19h]] 14:44, 23 July 2007 (UTC)
 
::: I'm inclined to agree that some of the colours make it a little harder to read, but that doesn't strike me as a reason to get rid of the colours. Perhaps better would be to pick a few colours that are easy on the eyes, and combine this colouring with other means of formatting such as bold and italics (indeed, italics are already used for comments).
::: Removing the colours isn't in any way going to fix the problem of some users not being able to see them. As for colour-blind people, monochrome printouts and the like, you have a point, but being able to read the code easily is much more important than seeing the code in pretty colours. Moreover, a ''well-chosen'' colour scheme will be appreciated by those of us who can see the colours, while at the same time keeping the code legible to those who can and can't distinguish the colours alike. -- [[User:Smjg|Smjg]] 17:36, 23 July 2007 (UTC)
 
For the record, here is example 2 in [[TextPad]]'s default colour scheme:
<code>
<font color="blue">import</font> std.stdio; <font color="green">// for writefln()</font>
<font color="blue">int</font> main<font color="red">(</font>string<font color="red">[]</font> args<font color="red">)</font> <font color="green">// string is a type alias for const(char)[]</font>
<font color="red">{</font>
<font color="green">// Declare an associative array with string keys and
// arrays of strings as data</font>
<font color="red"><font color="blue">char</font>[][] [<font color="blue">char</font>[]]</font> container;
<font color="green">// Add some people to the container and let them carry some items</font>
container<font color="red">[<font color="teal">"Anya"</font>]</font> ~= <font color="teal">"scarf"</font>;
container<font color="red">[<font color="teal">"Dimitri"</font>]</font> ~= <font color="teal">"tickets"</font>;
container<font color="red">[<font color="teal">"Anya"</font>]</font> ~= <font color="teal">"puppy"</font>;
<font color="green">// Iterate over all the persons in the container</font>
<font color="blue">foreach</font> <font color="red">(<font color="blue">char</font>[]</font> person, <font color="blue">char</font><font color="red">[][]</font> items; container<font color="red">)</font>
display_item_count(person, items);
<font color="blue">return</font> 0;
<font color="red">}</font>
<font color="blue">void</font> display_item_count<font color="red">(<font color="blue">char</font>[]</font> person, <font color="blue">char</font><font color="red">[][]</font> items<font color="red">)</font>
<font color="red">{</font>
writefln<font color="red">(</font>person, <font color="teal">" is carrying "</font>, items.length, <font color="teal">" items."</font><font color="red">)</font>;
<font color="red">}</font></code>
 
Already easier to read than what we have now IMO. Here's a slightly modified version:
 
<code>
<font color="navy">'''import'''</font> std.stdio; <font color="green">''// for writefln()''</font>
<font color="navy">'''int'''</font> main<font color="red">(</font>string<font color="red">[]</font> args<font color="red">)</font> <font color="green">''// string is a type alias for const(char)[]''</font>
<font color="red">{</font>
<font color="green">''// Declare an associative array with string keys and
// arrays of strings as data''</font>
<font color="red"><font color="navy">'''char'''</font>[][] [<font color="navy">'''char'''</font>[]]</font> container;
<font color="green">''// Add some people to the container and let them carry some items''</font>
container<font color="red">[<font color="blue">"Anya"</font>]</font> ~= <font color="blue">"scarf"</font>;
container<font color="red">[<font color="blue">"Dimitri"</font>]</font> ~= <font color="blue">"tickets"</font>;
container<font color="red">[<font color="blue">"Anya"</font>]</font> ~= <font color="blue">"puppy"</font>;
<font color="green">''// Iterate over all the persons in the container''</font>
<font color="navy">'''foreach'''</font> <font color="red">(<font color="navy">'''char'''</font>[]</font> person, <font color="navy">'''char'''</font><font color="red">[][]</font> items; container<font color="red">)</font>
display_item_count(person, items);
<font color="navy">'''return'''</font> 0;
<font color="red">}</font>
<font color="navy">'''void'''</font> display_item_count<font color="red">(<font color="navy">'''char'''</font>[]</font> person, <font color="navy">'''char'''</font><font color="red">[][]</font> items<font color="red">)</font>
<font color="red">{</font>
writefln<font color="red">(</font>person, <font color="blue">" is carrying "</font>, items.length, <font color="blue">" items."</font><font color="red">)</font>;
<font color="red">}</font></code>
 
What do you think? -- [[User:Smjg|Smjg]] 19:58, 23 July 2007 (UTC)
 
== Features section, comments on backwards compatibility with C ==
 
Regarding the following quote from the Features section: "D is being designed with lessons learned from practical C++ usage rather than from a theoretical perspective. ''It uses many C++ concepts but discards some, such as strict backwards compatibility with C source code.''" [My emphasis.]
 
Could the person who wrote it clarify their meaning here? C++ is not strictly backwards compatible with C anyway. Consider e.g. the statement,
 
int *a = malloc(10*sizeof(int));
 
which is legitimate in C but not C++. Is the intent to mean compatibility with C system calls, or ability to link with C libraries, or is the paragraph just plain wrong? &mdash;[[User:WebDrake|WebDrake]] 18:17, 14 June 2007 (UTC)
 
:Good point. I think the intention was to say that while D is based on the concepts and their implementation in C++, and thus C to some large degree, it is not bound to the idea of strict backwards compatibility with either C or C++. [[User:Derek Parnell|DerekP]] 08:03, 18 June 2007 (UTC)
 
== Convert examples to 2.0-compatible syntax ==
 
How about converting the examples to be 2.0-compatible? This will probably involve simply replacing char[]s with strings, and will (somewhat) improve readability for those new to the language. --[[User:The CyberShadow|Vladimir]] 05:25, 5 July 2007 (UTC)
 
:And how about a section explaining the differences between 1.0 and 2.0? I can't find it on the D-site itself (or I must be blind), it would make a good addition here. [[User:Jalwikip|Jalwikip]] 11:59, 15 August 2007 (UTC)
 
 
No! Please revert examples to 1.0. D 2.0 is highly experimental and i don't see any good reason to put in Wikipedia. If some one is interested it can check webpage of D.<small><span class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:83.19.20.122|83.19.20.122]] ([[User talk:83.19.20.122|talk]] • [[Special:Contributions/83.19.20.122|contribs]]) </span></small><!-- Template:Unsigned -->
:The <code>string</code> alias is not only a part of D 2.0, but also D 1.0 (added retroactively when D 2.0 was introduced). Although it was mostly added as a transition feature, it is still a standard language feature (being included in object.d), and using it in the examples will help improve readability, especially for types such as <code>char[][][char[]]</code> (<code>string[][string]</code>). However, I do agree that using 2.0-''exclusive'' features in examples is inappropriate.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 04:29, 23 August 2007 (UTC)
 
== Imperative programming with D ==
 
== Purity of mySum function in the "Functional" section (1.1.4) ==
I strongly disagree with the claim that "imperative programming is almost identical to C". D is full of features not existing in C. An earlier section mentions features such as "design by contract, unit testing, true modules, automatic memory management (garbage collection), first class arrays, associative arrays, dynamic arrays, array slicing, nested functions, inner classes, limited form of closures, anonymous functions, compile time function execution, lazy evaluation and has a reengineered template syntax". Almost all of those features are applicable to imperative programming. So if your imperative D programs are almost identical to your C programs, that is because you have limited yourself to a subset of D which is almost identical to C.<small><span class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:85.225.42.48|85.225.42.48]] ([[User talk:85.225.42.48|talk]] • [[Special:Contributions/85.225.42.48|contribs]]) </span></small><!-- Template:Unsigned -->
 
I am not a D programmer, so I may misunderstand the language's semantics, but I am confused about how the mySum function could be considered pure:
== Too many examples ==
 
<syntaxhighlight lang="D">
There are presently 4 examples on this Encyclopedia page, when there probably be, ''at most'', 1 short example. There is a Wikibook for this content, and I suggest that the examples be moved. Certainly, some direct links from an "Example" section in this article could be made directly to those examples in the Wikibook. <tt>+<font color="#008000">[[User:Mwtoews|m]]</font><font color="#6B3FA0">[[User talk:Mwtoews|t]]</font></tt> 21:46, 23 September 2007 (UTC)
int main()
{
int[] a1 = [0,1,2,3,4,5,6,7,8,9];
int[] a2 = [6,7,8,9];
int pivot = 5;
pure int mysum(int a, int b) // pure function
{
if (b <= pivot) // ref to enclosing-scope
return a + b;
else
return a;
}
</syntaxhighlight>
 
The value mySum produces depends on the value of pivot from the enclosing scope. If the numerical value of pivot in mySum was fixed at the time mySum is defined, then mySum would be only depend on its arguments, and could arguably be called a pure function, but from what I infer from the section on nested functions on [http://www.digitalmars.com/d/2.0/function.htm the function page] of D's reference manual, the value of pivot in mySum is the value of pivot in the enclosing scope at the time mySum is called.
I agree. Also, better examples are possible. Particularly interesting would be to show D implementations of template patterns which require a lot more work in current C++, for example patterns where static_if like functionality and variadic parameter lists are used often. --[[User:80.121.25.47|80.121.25.47]] 10:34, 10 October 2007 (UTC)
 
So I would expect that:
:Yeah, I don't think anyone could argue against this. Just need someone to implement it all. -- [[user:intgr|intgr]]&nbsp;<small>[[user talk:intgr|[talk]]]</small> 03:11, 28 October 2007 (UTC)
 
<syntaxhighlight lang="D">
I agree, there are too many examples and they are too much long. Better to add explanations of why D avoids some of the problems of C++. <small>—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/87.19.202.63|87.19.202.63]] ([[User talk:87.19.202.63|talk]]) 17:17, 31 October 2007 (UTC)</small><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->
pivot = 4;
mySum(3, 5);
</syntaxhighlight>
would yield 3, but
 
<syntaxhighlight lang="D">
== Recent edits to examples and reversion thereof ==
pivot = 5;
mySum(3, 5);
</syntaxhighlight>
would yield 8
 
Unfortunately I don't have a D compiler installed on my computer, so I cannot check this myself. <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/67.168.77.169|67.168.77.169]] ([[User talk:67.168.77.169|talk]]) 08:16, 6 November 2010 (UTC)</span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->
{{user|87.18.200.81}} made a handful of stylistic edits to the code, which {{user|Intgr}} mass-reverted. The summary: "revert completely unnecessary style changes".
 
:The code indeed compiles. I think that the idea is that nested functions have a hidden argument - a pointer to their enclosing scope (main's local variables). However, that doesn't explain why the code continues to compile when pivot is moved outside main(), or if you add a call to a non-pure function in mySum - these sound like compiler bugs. --[[User:CyberShadow|Vladimir]] ([[User talk:CyberShadow|talk]]) 11:45, 6 November 2010 (UTC)
Firstly, just because they're unnecessary doesn't make it the best course of action to revert them. Indeed, if you believe otherwise, you're stuck because reverting the edits is also unnecessary.
 
But really, what we should be considering isn't so much what's necessary and what isn't as what sets the best example. With that in mind, here are my thoughts on the edits:
 
::It does compile, but by default functions are (weakly) pure if they don't access any global or static mutable data. They are free to access non-mutable (i.e. const, immutable, or static initialized module / class / thread data) and non-global-non-static data, this includes the parent function data. To ensure somehow functional safety, one need strong purity, this can be done by marking a function as immutable, as well not using transitively mutable references in input and output arguments.
; void main versus int main
: It seems silly to return a value from a function if this value's always going to be the same. As such, I generally prefer to use void main in such cases.
 
<syntaxhighlight lang="D">
; <nowiki>import std.stdio: writefln;</nowiki>
int[] a1 = [0,1,2,3,4,5,6,7,8,9];
: Self-documenting code is nice. Why add a comment to indicate which function from an imported module you're using when you can make the code speak for itself? It's a bit like how you'd write
int[] a2 = [6,7,8,9];
int width;
int pivot = 5;
: rather than
int x; // width
 
pure int mysum(int a, int b) immutable // pure function
; Moving display_item_count to above main
{
: This is one where I'm inclined to prefer what it's been reverted to, since it shows a neat feature of D, namely that you can define functions in any order and not need forward declarations.
if (b <= pivot) // ref to enclosing-scope
return a + b;
else
return a;
}
</syntaxhighlight>
::will not compile, and compiler will report the issue:
 
<syntaxhighlight lang="text">
; Parameter types in foreach
a.d:10:18: error: immutable function 'a.main.mysum' cannot access mutable data 'pivot'
: I'm not sure about this. Nowadays, I probably find myself omitting them about as often as not. There are probably a few competing points of view here.
10 | if (b <= pivot) // ref to enclosing-scope
</syntaxhighlight>
 
::If the pivot is made const or immutable, it will compile. In this sense the function will become strongly pure, but only during current execution of the scope. The context will be takes implicitly. https://dlang.org/spec/function.html#pure-functions provides some extra details, but details of pure functions inside other functions is not really well explained. [[Special:Contributions/81.6.34.172|81.6.34.172]] ([[User talk:81.6.34.172|talk]]) 20:15, 29 April 2020 (UTC)
; Spaces between a statement/declaration and its comment
: It's nice to have such comments lining up in a column to an extent. Changing it to just a single space makes it seem a bit too cluttered.
 
== Pull the C# reference until examples? ==
; Putting some statement comments on a line of their own
: I've mixed feelings about this. On one hand, having them all the same seems more consistent. On the other, it does make the layout too wide for some readers.
 
What does everyone else think? -- [[User:Smjg|Smjg]] 02:09, 15 November 2007 (UTC)
 
Given the way it reads, I'm not sure why C# is even listed without more direct examples as to what it inherited from C# that isn't already considered from Java (a predecessor).[[Special:Contributions/68.163.243.231|68.163.243.231]] ([[User talk:68.163.243.231|talk]]) 22:07, 12 November 2010 (UTC)
:I am the autor of the last little edits, I am not a vandal. I'm not an expert of Wikipedia, but I know D enough, I use it to write real code, and I post on its newsgroups regularly.
:
:;Regarding:
:import std.stdio: writefln;
:This the right way to program in D because that's enforced by the compiler, it imports just one name instead of polluting the namespace.
:
:;Moving display_item_count to above main: some people think that putting the main at the end helps you find it faster.
:
:; Spaces between a statement/declaration and its comment: the lines of that program (that I think is too much long for a Wikipedia page) are too much wide. <small>—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/87.16.87.90|87.16.87.90]] ([[User talk:87.16.87.90|talk]]) {{{2|}}}</small><!-- Template:UnsignedIP -->
 
== Misleading statement about C compatibility? ==
 
The second sentence under the Features section currently ends by saying "and as such [D] is not compatible with C/C++ source code". This sentence may be misleading given that D code can call libraries written in C. This is indeed discussed in more detail in the Interaction with Other Systems section. Should this statement be removed or clarified? [[User:Milez|Milez]] ([[User talk:Milez|talk]]) 20:57, 15 February 2013 (UTC)
==Multiple inheritance==
The sentance "C++ multiple inheritance is replaced by Java style single inheritance with interfaces and mixins." needs to be revised. Multiple inheritance and interfaces are different things. <small>—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/87.116.148.199|87.116.148.199]] ([[User talk:87.116.148.199|talk]]) 20:28, 20 December 2007 (UTC)</small><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->
 
== Explain the concurrent section ==
They are different things, but the defense for not implementing multiple inheritance is always that you can achieve almost the same using interfaces.[[Special:Contributions/85.235.250.110|85.235.250.110]] ([[User talk:85.235.250.110|talk]]) 14:04, 9 July 2008 (UTC)
 
The section about concurrent programming only contains source code. Should there not be some sort of explanation to ''why'' it is concurrent and what the code does (besides from the very thin information in the comments)? [[User:SBareSSomErMig|SBareSSomErMig]] ([[User talk:SBareSSomErMig|talk]]) 10:22, 6 March 2013 (UTC)
== Tango vs Phobos incompatibilities ==
 
== Another D programming language in the 1980ies ==
Whereas there certainly are differences in Tango's and Phobos' Object (less now after Tango's last release, 0.99.4), saying that these differences cause GC problems is wrong. The only differences in Object as of today, is a couple of aliases related to strings, and the notification methods (in both cases these are absent from Tango's Object). However, Tango's Thread (especially implementation, but also API) differs quite much from Phobos'. Also, the GCs have diverged over time, but aren't incompatible beyond the fact that some may have workarounds for bugs in either. Exception hierarchies are different, and are as such usually considered among the incompatibilities. Others are generally QOI issues in the runtime. FWIW, Tango developers are in a dialogue with Walter Bright et al to bring the runtimes in Tango and Phobos closer in the 2.0 timeframe of D. What will transpire from that, is still not certain. Note that I don't want to edit the article myself, considering I'm rather biased towards both D and Tango. -- [[User:Larsivi|Larsivi]] ([[User talk:Larsivi|talk]]) 23:27, 23 December 2007 (UTC)
I remembered - and found out that I remembered correctly - that there was a language "D" for TSX-11 PDP-11 OS with preemptive multitasking, very good OS for its time. I think "D" was used for writing Lex-11. I have added a link under talk for TSX-11 wikipedia page.
:Considering this comment was added a few months ago, I'd like to know what the status is on this now. I plan on cleaning up this article soon and would like to know what kind of progress has been made towards Phobos-Tango compatibility. All I know so far is that Tango has switched over to using toString and that Phobos has incorporated some of the GC differences from Tango, is there anything I'm missing?[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 18:31, 26 March 2008 (UTC)
--[[User:Donald j axel|d-axel]] ([[User talk:Donald j axel|talk]]) 04:13, 7 February 2016 (UTC)
Wikipedia mentions the other "D" programming language as "Filetab D".
--[[User:Donald j axel|d-axel]] ([[User talk:Donald j axel|talk]]) 04:15, 7 February 2016 (UTC)
 
== StillExternal toolinks many examplesmodified ==
 
Hello fellow Wikipedians,
Currently, the examples section is over half of this article! Which examples would people be willing to part with? Whichever ones we get rid of should probably be moved to a Wikibook on D, and if there isn't one, one should probably be created.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 18:37, 26 March 2008 (UTC)
:I removed the longest example and trimmed down two of the others, the section is still pretty long but much better. Perhaps the best course of action in the long run would be to provide brief examples of features in the article body rather than having a large examples section.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 02:08, 27 March 2008 (UTC)
 
I have just modified one external link on [[D (programming language)]]. Please take a moment to review [https://en.wikipedia.org/w/index.php?diff=prev&oldid=798650300 my edit]. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit [[User:Cyberpower678/FaQs#InternetArchiveBot|this simple FaQ]] for additional information. I made the following changes:
== Proposed move to "D programming language" ==
*Added archive https://web.archive.org/web/20070224161328/http://ddbg.mainia.de/ to http://ddbg.mainia.de/
 
When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.
The current title of this article, "D (programming language)", implies that the name of the language is simply "D" and that it has no other name, however [[Walter Bright]] himself has recommended referring to the language as the "D programming language". This is mostly to help search engines find articles on the language, but I feel that given this recommendation, "D programming language" would certainly qualify as an alternate name which is unambiguous (which "D" is not). [[WP:NC (CN)]] is pretty clear on what to call the article in this case.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 16:17, 27 March 2008 (UTC)
: The language is called D. Look on the website. "The D programming language" is just a description that's sometimes used for clarity. If this is going to be renamed "D programming language", so should the various other programming language articles in the same way. Moreover, from what I recall, the bibles of [[C (programming language)|C]] and [[C++]] were called "The C Programming Language" and "The C++ Programming Language" respectively; I don't think anybody took this as reflecting that the languages were named other than simply C and C++. -- [[User:Smjg|Smjg]] ([[User talk:Smjg|talk]]) 17:34, 27 March 2008 (UTC)
::I guess I wasn't completely clear. I'm not saying that the language isn't referred to as "D", but that the language is referred to as the "D programming language" ''in addition'' to "D", and that "D programming language" better meets Wikipedia's common names policy in that it is the most common name that does not conflict with the name of something else. Also, I have looked on [http://www.digitalmars.com/d/index.html the website] before, that's what gave me the idea that the more complete name is the "D programming language". As for renaming other language articles, I would support it only if a more complete name is needed for those languages and if one is available. This is why I suggested the D move. C++ on the other hand, doesn't need to be moved because it's name already conforms to [[WP:NC (CN)]].[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 21:06, 27 March 2008 (UTC)
I think that even a casual reading if the title is enough to understand that we are talking about the programming language, rather than the letter or the vitamin. Please keep the parentheses. [[User:Blowfish|Blowfish]] ([[User talk:Blowfish|talk]]) 21:48, 5 April 2008 (UTC)
:"D (programming language)" is just as clear as "D programming language", but the latter better meets the naming convention I linked to. Also, to add another point to this, I [http://www.google.com/search?q=D+programming+language&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a Google tested] the name "D programming language" and all the links on the first page are for this language, and nearly all of them refer to it as the D programming language.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 05:03, 12 April 2008 (UTC)
 
{{sourcecheck|checked=false|needhelp=}}
I disagree with the renaming. The "(computer language)" suffix is consistent with naming of articles about C, C# and E languages. D's website calls it just D in many many places. Please remove that obnoxious "inappropriate name" template from D's article. [[Special:Contributions/81.99.215.163|81.99.215.163]] ([[User talk:81.99.215.163|talk]]) 23:26, 12 April 2008 (UTC)
:Read my comments above. According to [[WP:NC (CN)]] we need to use the most common name that doesn't conflict with the name of something else. In other words, parentheses should only be used as a last resort if there is no common way to disambiguate a name. In this case, there is a common way to disambiguate the name "D", by using the more complete name: "D programming language". I'm not saying that this language is not called "D", but that the name "D programming language" better conforms to the common names policy. If other single-letter programming languages have an unambiguous common name, then they should probably be moved as well, I'm just focusing on this article for now.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 01:27, 13 April 2008 (UTC)
::The problem is that you are lumping a description in with the name. D is a programming language, the name of the programming language is "D". Same with "C". C Programming Language is not the name of the programming language, C is. Considering how bad the wikipedia search is, disambiguous usages are actually the best case in this case. Though it would be amusingly redundant to the APL article retitled as APL programming language. (APL stands for A Programming Language) Judging by the discussion on this page, if you continue and retitled the article, it would be without much support and most likely be reverted. - [[User:Uselesswarrior|Uselesswarrior]] ([[User talk:Uselesswarrior|talk]]) 14:24, 24 April 2008 (UTC)
:::"D programming language" is a term used to refer to this language, therefore, it is just as much a name for the language as "D", at least for the purposes of the article title. Look at the title of the article [[bread roll]], for example. Even though "bread roll" is nothing more than the real name (roll) "lumped together" with a description (bread), it is still located there and not at [[roll (bread)]]. That's just how disambiguation is done per [[WP:NC (CN)]]. Trust me, I went through a [[WP:SRNC|discussion]] a while back related to this same thing, and in the end we decided that the form that best meets Wikipedia's naming conventions is the form that avoids parentheses.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 15:54, 24 April 2008 (UTC)
::::Please see http://www.digitalmars.com/d/2.0/overview.html "What is D? D is a general purpose systems and applications programming language." Its name is just D (there's also a note on the site explaining the name origin). The fact that google gives you best results with "d programming language" rather than "d" is obvious. Personally, I don't care what title this article has, but I think it should be consistent with other articles, hence if we have "C (programming language)" and "C++ (programming language)" this should definitely be "D (programming language)". [[Special:Contributions/87.20.68.116|87.20.68.116]] ([[User talk:87.20.68.116|talk]]) 16:17, 10 May 2008 (UTC)
:::::And yet the ''title'' of that page, as shown in the title bar, is "Overview - '''D programming language''' 2.0 - Digital Mars". The titles of other articles on the Digital Mars site also have "D programming language" in them, and my Google search proves that "D programming language" is a common enough name to use for the title of this article, so I'm proposing we change the title of this article to match this commonly used convention. I'm not proposing we change all instances of "D" in this article to "D programming language" that would be pointless as the context is already clear. All that needs to be disambiguated is the title, and this is most naturally done by using the term "D programming language", not by using parentheses. Also, as I've said before, I'm only focusing on this article for now, if it's decided that "C programming language" is a common enough name for the language, then that page should be moved as well, "C++" is fine as it is already and unambiguous name.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 01:29, 11 May 2008 (UTC)
::::::Please check the FAQ too: "The original name was the Mars Programming Language. But my friends kept calling it D, and I found myself starting to call it D.". As I already noticed, the "google proof" you point out is almost totally useless: you just CAN'T search for "D" and hope to get accurate results, it is obvious that a search for "d programming language" works better. This is true for "C" too. I guess you know enough about search engines to understand what I'm talking about. As for the page title, D *is* a programming language, so I don't understand why the title should be different, considering the fact that people may still not know what "D" is. Being this a "naming convention" problem, and being a convention already in use in wikipedia (that is, with parentheses), I feel the "improper name" tag is silly and degrades the quality of the article. [[Special:Contributions/80.180.164.228|80.180.164.228]] ([[User talk:80.180.164.228|talk]]) 09:50, 18 May 2008 (UTC)
Wikipedia's [[WP:NC (CN)|naming convention]] is ''not'' to simply put parenthesis on an ambiguous title, but to disambiguate by using a clearer common name. The Google test was to show that "D programming language", a clearer name, is also a common name. Obviously it can't prove that it's a more common name than "D", but it doesn't need to. [[WP:NC (CN)]] says to use the most common name that ''doesn't conflict''. "D" conflicts, so we shouldn't use it, but "D programming language" doesn't conflict, therefore it meets the convention. Also, I wish people would stop providing proofs that the language is called "D", I already know that, but that name does not conform to the common names convention. It's common yes, but ambiguous, and [[WP:NC (CN)]] tells us what to do in that situation.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 16:38, 19 May 2008 (UTC)
:::The name is fine the way it is. If [[C (programming language)]] and [[Python (programming language)]] work, then so does [[D (programming language)]]. We have a redirect from [[D programming language]], that will catch anybody who searches on that term. -- [[User:RoySmith|RoySmith]] [[User Talk:RoySmith|(talk)]] 17:03, 19 May 2008 (UTC)
:I disagree with the claim that "D (programming language)" is a title that violates WP's naming convention policy. I didn't find anything in that article that would indicate the parenthetical clarification is inappropriate at all, and in fact, parenthetical disambiguation seems to be the convention throughout all of WP. And, as has been stated several times, the "(programming language)" suffix is universal among virtually all programming language articles, so if we're seeking a conventional name, then "D (programming language)" would be it. Not to mention that a Google search for "d programming language" turns up the WP article on the first hit anyway (Digital Mars's D page is #2). Finally, the argument that "D programming language" is a common name is mistaken; when you have a website that is explaining what D is, it's a little awkward to just refer to it as D, since D has so many other meanings. Stating "the D programming language" helps disambiguate what the author means by "D". WP has its own method for this kind of disambiguation: parenthetical disambiguation, and this is the convention that we should stick to. This discussion has gone for two months, and so far, nobody but the OP has agreed to changing the article's title to "D programming language". I'm removing notification from the main page. [[User:Rainault|Rainault]] ([[User talk:Rainault|talk]]) 16:43, 20 May 2008 (UTC)
::If "D programming language" is the name most websites use to clarify the name of the language, then I don't see why that isn't the "most common name that doesn't conflict". At the very least Wikipedia should follow that convention for the sake of consistency with other sites on this language. As for the argument that parentheses are how disambiguation is done on Wikipedia, that's both true and false. Parentheses are used if there is no other way to disambiguate a title, but if there ''is'' another way, such as a more complete/clear name, then we use that name. This is why we have [[bread roll]] not [[roll (bread)]], [[William C. C. Claiborne]] not [[William Claiborne (governor)]], [[Maryland Route 2]] not [[Route 2 (Maryland)]], [[Wilmington, Delaware]] not [[Wilmington (Delaware)]], etc. ''That'' is how disambiguation is done per [[WP:NC (CN)]]. If people are so worried about consistency with other language articles, then those articles should probably be moved as well, where applicable. I'm not sure what the more complete names for them are, the only one I can think off the top of my head would be [[C programming language]] for C considering a book with that name, referring to the language, exists. Also, the fact that someone took the time to create a redirect from [[C programming language]] to [[C (programming language)]] as well as an equivalent one for D, then it shows that these names are already considered common enough to be alternate names for the languages and should be considered as article titles.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 18:53, 20 May 2008 (UTC)
::Oops, my apologies, I didn't realize that someone removed the "does not conflict" part from the convention I've been citing. However, [[Wikipedia:Disambiguation#Specific topic]] perfectly states what I have been saying:
 
Cheers.—[[User:InternetArchiveBot|'''<span style="color:darkgrey;font-family:monospace">InternetArchiveBot</span>''']] <span style="color:green;font-family:Rockwell">([[User talk:InternetArchiveBot|Report bug]])</span> 03:22, 3 September 2017 (UTC)
<blockquote>
For disambiguating specific topic pages, several options are available:<br />
1. '''When there is another term (such as Pocket billiards instead of Pool) or more complete name that is equally clear (such as Delta rocket instead of Delta), that should be used'''.<br />
2. A disambiguating word or phrase can be added in parentheses. The word or phrase in parentheses should be:<br />
:* the generic class that includes the topic (for example, Mercury (element), Seal (mammal)); or
:* the subject or context to which the topic applies (for example, Union (set theory), Inflation (economics)).
3. Rarely, an adjective describing the topic can be used, but '''it is usually better to rephrase the title to avoid parentheses'''.
</blockquote>
 
== what became of the merger of the articles on gtkd and the d programming language? ==
[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 19:23, 20 May 2008 (UTC)
:::Ah, point well taken. After reading that snippet, I think I see your argument now, and I do agree that, in principle, "D programming language" is a more appropriate and conforming title than "D (programming language)". I noticed that this issue has come up before, and there was already a poll for adding the parentheses. This discussion appears to be a mirror image of a previous discussion (see the "Requested Move" section above). Given that this change has already occurred before, there's going to be a lot of inertia to getting the article titles changed back. At least that explains why the "X programming language" redirects exist now. For now, though, the consensus appears to be in favor of parenthetical disambiguation, and I have to admit, even though I agree that in principle you are right, I think that "X (programming language)" title styles feel more appropriate. In any case, I think that overall, this is a needless semantic issue. Both "X programming language" and "X (programming language)" allow for the pages to appear on the first page of a Google search, and one redirects to the other. If there were a more practical issue of concern due to the parentheses, I would be in favor of a mass title change, but for now, the parentheses should be fine where they are. There is no real disadvantage that I see to keeping them there. [[User:Rainault|Rainault]] ([[User talk:Rainault|talk]]) 20:04, 20 May 2008 (UTC)
:Jeff, please have a look at the green box near the top of this page. [[Special:Contributions/88.149.240.46|88.149.240.46]] ([[User talk:88.149.240.46|talk]]) 12:13, 27 May 2008 (UTC)
::I now realize that this was discussed before, but in that discussion the support votes seemed to be based on misunderstandings of [[WP:NC (CN)]]. One person said that we should use the common name, then disambiguate with parentheses, and another said that the non-parens version is "at odds with the rest of Wikipedia". This was despite the fact that WP:NC (CN) did not say simply to use the most common name and disambiguate with parentheses, but to use the most common name that doesn't conflict, and that [[WP:DAB#Specific topic]] directly states that parentheses in article titles should be avoided. Its more important to follow these consensus-based guidelines than to simply look and see how some other articles are doing it, because those articles might be using parentheses as a last resort. The oppose votes, in my opinion, had stronger arguments, such as the very guidelines I linked to, and the fact that this is how the language names are disambiguated outside of Wikipedia. I'm going to try to put some of my thoughts about disambiguation into an essay soon, so I'll leave it at that. I also hope to take this up with [[WP:COMPSCI]] soon and see what they think about using more complete names for programming languages.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 16:41, 27 May 2008 (UTC)
:I thought I would point out that the article was originally named D_Programming_Language and assume it changed from the [[Talk:D_(programming_language)#Requested_move|vote]], you can see it took place in 2006. [[user:nascent|-nascent]] <sup>[[user talk:nascent|(talk)]]</sup> 4:57, 8 March 2009 (UTC)
::[[WP:CCC]]. Also, like I pointed out, that discussion seems to have been filled with people who saw parentheses used in other titles and thought that's how ''all'' disambiguation should be done. Read [[User:Jeff02/How we disambiguate on Wikipedia]], yes it's an essay written by me, but it's based on existing Wikipedia guidelines so it's worth reading to understand how disambiguation should really be done. Probably the strongest argument of all for the move is that Walter Bright himself requested that the name "D programming language" be used to refer to the language. That certainly qualifies as a more complete name and therefore is a good alternative name for this article than simply "D", which is ambiguous and therefore requires parentheses. I don't plan on moving this article anytime soon, since there doesn't seem to be much support for the move, but if enough people do support it, I'd be happy to move it.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 04:48, 9 March 2009 (UTC)
 
At the top of the talk page, there's this prominent notice:
==Factorial==
'''The article GtkD was nominated for deletion. The discussion was closed on 23 August 2011 with a consensus to merge the content into D (programming language). If you find that such action has not been taken promptly, please consider assisting in the merger instead of re-nominating the article for deletion. To discuss the merger, please use this talk page.'''
 
August 23, 2011 is not quite 10 years ago. There's no mention of gtkd in the article, that i can see; the string 'gtkd' itself redirects to the article on gtk.
In the example about templates, sometimes "Factorial!" is written with an exclamation mark, and sometimes it isn't. Is this correct? If so, what does the exclamation mark mean? <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/91.115.182.40|91.115.182.40]] ([[User talk:91.115.182.40|talk]]) 19:07, 10 January 2009 (UTC)</span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->
:The exclamation mark means template instantiation. <code>Factorial</code> is declared as a template so it has to be instantiated with the syntax <code>Factorial!(number)</code>. The equivalent in C++ would be <code>Factorial<number></code>. <code>factorial</code> on the other hand, is just an ordinary function so it is called using function call syntax.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 22:24, 10 January 2009 (UTC)
:One other thing, when a template is ''declared'', no exclamation mark is used, so that part is also correct.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 22:27, 10 January 2009 (UTC)
 
Per the notice, this is the right place to discuss the merger. Did it ever happen, or was mention of gtkd just washed away through a string of edits over time?
 
[[User:Son of eugene|Son of eugene]] ([[User talk:Son of eugene|talk]]) 20:03, 25 June 2021 (UTC)
==Future support==
 
== Influenced Go? I do not think sol. ==
Version 2 states "Future support for pure functions which can only access immutable data and call other pure functions." It then goes on to explain what a "pure function" is, which is useful, but mostly irrelevant to this article. What it doesn't explain is what "Future support" means? Does this mean it is not currently supported by the compiler but officially part of the 2.0 spec? Does it mean this is really a version 3 feature of the language? Does it mean it is only for use writing software that enables time travel? <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/74.219.122.138|74.219.122.138]] ([[User talk:74.219.122.138|talk]]) 13:48, 23 January 2009 (UTC)</span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->
:Now a moot issue as I understand, D2 now supports pure functions. I'll update the article.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 16:15, 23 January 2009 (UTC)
 
In a top infobox, I see that D influenced Go.
 
I find this doubtful.
==Software written in D?==
 
D influenced some languages, including modern C++, Nim, etc. But I really doubt it influenced Go in anyway at all. Go has completely different execution model, typing system, syntax, no templates, different module system, different concurrency methods, different error control, no metaprogramming. I would be super hard to find ANY concept taken from D that got into Go.
Hi, I cannot find ANY examples of ANY *real* software written in D. Can anyone help shed some light on this? [[Special:Contributions/69.181.105.239|69.181.105.239]] ([[User talk:69.181.105.239|talk]]) 03:16, 27 March 2009 (UTC)
:There's lots of open-source software on [http://dsource.org/projects/ DSource]. Some more links are [http://www.digitalmars.com/d/dlinks.html here]. --[[User:The CyberShadow|Vladimir]] ([[User talk:The CyberShadow|talk]]) 11:59, 27 March 2009 (UTC)
 
The only thing vaguely similar is Go and D compilers speed, which were kind of new at the time (currently many other compiled languages like Zig and Nim are even faster in this regard). But modern D is much slower than Go in compilation area (partially due to D standard libraries growing big). Even if so, this is hardly an influence of any kind. [[Special:Contributions/2A02:168:F609:1:BEDA:2803:4006:38FD|2A02:168:F609:1:BEDA:2803:4006:38FD]] ([[User talk:2A02:168:F609:1:BEDA:2803:4006:38FD|talk]]) 17:38, 5 March 2023 (UTC)
== Difference between D and Objective-C ==
:After thinking a bit more about this. There is one feature in Go which is very similar to D. That pointer and reference dereferences, all use dot, instead of arrow for pointers and dot for references or values. I am not sure if this was influenced by D tho. [[Special:Contributions/2A02:168:F609:1:BEDA:2803:4006:38FD|2A02:168:F609:1:BEDA:2803:4006:38FD]] ([[User talk:2A02:168:F609:1:BEDA:2803:4006:38FD|talk]]) 18:34, 5 March 2023 (UTC)
 
== usage of 'mathematical corellaries' ==
I'm a bit confused about the differences between these two languages. It looks to me like they are both striving to be object oriented, C-compatible, compiled languages without the complexity of C++. I suppose D provides more emphasis on compile-time correctness?
 
the fifth paragraph under Features reads "Specific operators for string handling exist, '''visually''' distinct from '''mathematical corellaries'''".
Even C++ is only mentioned a couple of times in the article. I think it would help a lot to add a comparison section to Objective-C or C++, and perhaps talk about the fundamental design decisions that distinguish all of these languages, for someone who is not so familiar with the specifics. [[Special:Contributions/64.105.136.146|64.105.136.146]] ([[User talk:64.105.136.146|talk]]) 07:53, 29 March 2009 (UTC)
i believe this should be changed to something like "'''syntactically''' distinct from '''numerical operators'''", or just removed from the paragraph because:
 
- "visually" might be ableist. "syntactically" might also be more correct, as programming languages arent defined over what they visually look like, but in terms of (also) their syntax.
:No, unlike Objective C, D is incompatible with C; it's a completely different language. The only way to use C code in D is to compile the C code separately and write a D module that ''declares'' the functions defined in the C code (like a header file). The intro states that some features in D are completely redesigned, but maybe it should be made clearer that D code is incompatible with C code, and perhaps an example could be added to show the D-C "compatibility" that I mentioned.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 00:28, 30 March 2009 (UTC)
 
- the word "cor'''e'''llaries" seems to be a typo of "cor'''o'''llaries". a naive google search for "corellaries" turns up very few results (this page is the top result btw). wiktionary has no entry for it either.
== Vector operations ==
 
- even if we correct it to "corollary" the phrase still is wrong. "mathematical corollaries" have nothing to do with the rest of the paragraph or page. the reference material for the phrase does not contain the words "corollaries" or "corellaries". i have no idea how this word ended up here.
They are already available in D1 too, so listing them in the section about D2 is wrong. <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/79.37.196.221|79.37.196.221]] ([[User talk:79.37.196.221|talk]]) 20:34, 28 April 2009 (UTC)</span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->
 
- string operators, in a sense, can also be called "mathematical operators". strings of characters can be defined and studied mathematically. [[Special:Contributions/187.61.153.177|187.61.153.177]] ([[User talk:187.61.153.177|talk]]) 00:10, 15 January 2024 (UTC)
== In regards to the preprocessor section that keeps getting added ==
 
:@[[User:187.61.153.177|187.61.153.177]] - [[Help:Editing|Do it. There is nothing or no-one stopping you]], as long as you are trying to improve the encyclopedia. I would recommend implementing the first sentence of what you said. You probably won't see this, but [[WP:BOLD|you can do it]]. <span style="font-family:monospace;background:#368;padding:.2rem;color:white">''[[User:APenguinThatIsSilly|<span style="color:white">APenguinThatIsSilly</span>]]''(''[[User talk:APenguinThatIsSilly|<span style="color:#FEC">"talk"</span>]]'')</span> 21:13, 14 January 2025 (UTC)
There are several problems with it, it is [[WP:CITE|unreferenced]], uses [[WP:WEASEL|weasel words]], uses second-person pronouns, and even contains a note to the person who has been removing it (such discussions should take place here on the talk page). I would encourage the writer of this section to try and fix these problems, but there is one last issue with this section that makes it impossible to fix; it, by its very nature is not [[WP:NPOV|neutral]]. The lack of a preprocessor is in fact cited as an advantage of D on the Digital Mars site. Anything that can be done with the C/C++ preprocessor can be done with D constructs such as <code>enum</code>, <code>import</code>, <code>alias</code>, and <code>static if</code>, except for the things that the programmer shouldn't be doing in the first place such as redefining syntax. Also the example given in the section of changing a method call into a property can already be done in D as D allows for methods to be called as properties. So it really is unfair to say that D's lack of a preprocessor is a disadvantage.[[user:Jeff02|-Jeff]] <sup>[[user talk:Jeff02|(talk)]]</sup> 17:20, 23 August 2009 (UTC)