digitalmars.D - Why is complex being deprecated again?
- Mehrdad (2/2) Apr 14 2012 Why is complex being phased out?
- Kapps (3/5) Apr 14 2012 It's being replaced with a library implementation of it. I doubt
- Jonathan M Davis (4/10) Apr 14 2012 It was probably the same reasoning that lead to moving the AA implementa...
- Stewart Gordon (8/10) Apr 15 2012 No. The AA implementation was moved into druntime because that's where ...
- Mehrdad (5/7) Apr 15 2012 Thanks but that just repeated my question...
- Caligo (2/4) Apr 14 2012 Where does it say it's being phased out?
- Jonathan M Davis (5/10) Apr 14 2012 It says so here: http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel
- Andrei Alexandrescu (3/13) Apr 14 2012 I just submitted a fix.
- Andrei Alexandrescu (4/6) Apr 14 2012 I don't think that page makes a compelling argument, but I'm not an
- Don Clugston (12/18) Apr 16 2012 I agree, I think that page should be killed.
- Andrei Alexandrescu (4/14) Apr 16 2012 Done.
- Stewart Gordon (13/15) Apr 15 2012 There was a brief discussion about it back in 2008
- Lars T. Kyllingstad (13/22) Apr 15 2012 I absolutely do not think it does. There is nothing you can do with a
- Caligo (3/6) Apr 15 2012 How about Quaternions?
- Lars T. Kyllingstad (4/11) Apr 15 2012 If such were to be added, I think it would be better to put them in a
- Somedude (2/16) Apr 16 2012 Or rather std.math.quaternion
- Tove (4/16) Apr 15 2012 The quote on the 'Semantics' section has a counter example...
- Lars T. Kyllingstad (3/22) Apr 15 2012 See my reply to Stewart.
-
Stewart Gordon
(11/18)
Apr 15 2012
- Lars T. Kyllingstad (64/78) Apr 15 2012 For any standard type (built-in or library) to be useful, it has to
- Lars T. Kyllingstad (9/16) Apr 16 2012 Sorry, that would be eight. I forgot
- Stewart Gordon (23/37) Apr 16 2012 You mean someone has to use it in order to prove that it's usable and th...
- Lars T. Kyllingstad (11/63) Apr 16 2012 This is why I said: "[...] if anyone can demonstrate that the
- Stewart Gordon (13/20) Apr 16 2012 They've been working for decades in the hope of finding aliens. In the ...
- bearophile (8/10) Apr 15 2012 You have seen std.math.expi, that returns a creal using the
- Stewart Gordon (6/9) Apr 15 2012 I'd never imagined that x86 CPUs had such an instruction built in, but I...
- bearophile (4/5) Apr 15 2012 That module should be named core.intrinsics.
- =?UTF-8?B?QWxleCBSw7hubmUgUGV0ZXJzZW4=?= (6/14) Apr 15 2012 I assume you meant druntime? I think we really need to isolate these
- Lars T. Kyllingstad (4/10) Apr 15 2012 You're right, expi() should be added. I remember that being on my to-do...
- Mehrdad (24/26) Apr 15 2012 So we're removing it to reduce the number of keywords? ...Why?
- Daniel Murphy (5/8) Apr 15 2012 No. Complex types are special-cased in a lot of places in the dmd front...
- Norbert Nemec (8/11) Apr 17 2012 Not problems, but serious eye sores: Personally, I am really happy that
- Lars T. Kyllingstad (7/21) Apr 17 2012 Hear, hear! These names have always made me me cringe. (Similar,
Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.html
Apr 14 2012
On Sunday, 15 April 2012 at 03:10:25 UTC, Mehrdad wrote:Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.htmlIt's being replaced with a library implementation of it. I doubt it will be deprecated before the library implementation is ready.
Apr 14 2012
On Sunday, April 15, 2012 05:50:33 Kapps wrote:On Sunday, 15 April 2012 at 03:10:25 UTC, Mehrdad wrote:It was probably the same reasoning that lead to moving the AA implementation into druntime, but I don't remember any specifics. - Jonathan M DavisWhy is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.htmlIt's being replaced with a library implementation of it. I doubt it will be deprecated before the library implementation is ready.
Apr 14 2012
On 15/04/2012 04:56, Jonathan M Davis wrote: <snip>It was probably the same reasoning that lead to moving the AA implementation into druntime, but I don't remember any specifics.No. The AA implementation was moved into druntime because that's where it belongs. Under D1, stuff like that is in std.internal. Under D2, code along those lines has been moved into druntime. The basic idea is that a D compiler will not generate calls to code in Phobos, and druntime will call code only within itself. This also lessens the effect of the Phobos/Tango schism. Stewart.
Apr 15 2012
Thanks but that just repeated my question... "Kapps" wrote in message news:wedxqokomlaoagkssupc forum.dlang.org... On Sunday, 15 April 2012 at 03:10:25 UTC, Mehrdad wrote:Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.htmlIt's being replaced with a library implementation of it. I doubt it will be deprecated before the library implementation is ready.
Apr 15 2012
On Sat, Apr 14, 2012 at 10:10 PM, Mehrdad <wfunction hotmail.com> wrote:Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.htmlWhere does it say it's being phased out?
Apr 14 2012
On Saturday, April 14, 2012 22:27:19 Caligo wrote:On Sat, Apr 14, 2012 at 10:10 PM, Mehrdad <wfunction hotmail.com> wrote:It says so here: http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel It's also supposed to say at dlang.org, but the page for it isn't being generated properly at the moment: http://d.puremagic.com/issues/show_bug.cgi?id=7875Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.htmlWhere does it say it's being phased out?
Apr 14 2012
On 4/14/12 10:54 PM, Jonathan M Davis wrote:On Saturday, April 14, 2012 22:27:19 Caligo wrote:I just submitted a fix. AndreiOn Sat, Apr 14, 2012 at 10:10 PM, Mehrdad<wfunction hotmail.com> wrote:It says so here: http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel It's also supposed to say at dlang.org, but the page for it isn't being generated properly at the moment: http://d.puremagic.com/issues/show_bug.cgi?id=7875Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.htmlWhere does it say it's being phased out?
Apr 14 2012
On 4/14/12 10:10 PM, Mehrdad wrote:Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.htmlI don't think that page makes a compelling argument, but I'm not an expert. If Walter and Don agree, I'd remove the page. Andrei
Apr 14 2012
On 15/04/12 06:20, Andrei Alexandrescu wrote:On 4/14/12 10:10 PM, Mehrdad wrote:I agree, I think that page should be killed. The efficiency argument is valid but reduces to this: The complier *MUST* be able to generate equally good from a library type, as from a built-in language type. Once we've reached that point, we can remove the built-in type. The correctness issue is a good argument for implementing complex functions correctly (basically, you should do your branch cuts on the negative real axis, whenever possible). But to go from there to requiring that the language has a pure imaginary type is not convincing. We don't have a 'negint' type for negative integers, why have a pure imaginary type?Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.htmlI don't think that page makes a compelling argument, but I'm not an expert. If Walter and Don agree, I'd remove the page. Andrei
Apr 16 2012
On 4/16/12 4:21 AM, Don Clugston wrote:On 15/04/12 06:20, Andrei Alexandrescu wrote:Done. Thanks, AndreiOn 4/14/12 10:10 PM, Mehrdad wrote:I agree, I think that page should be killed.Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.htmlI don't think that page makes a compelling argument, but I'm not an expert. If Walter and Don agree, I'd remove the page. Andrei
Apr 16 2012
On 15/04/2012 04:10, Mehrdad wrote:Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.htmlThere was a brief discussion about it back in 2008 http://www.digitalmars.com/d/archives/digitalmars/D/Replacing_built-in_complex_What_s_this_about_81214.html My impression was that the plan is to deprecate it once the stuff in std.complex is complete. std.complex has clearly grown since that discussion, but it still needs a pure imaginary type (and I don't know what else at the moment). From what I gathered, the reason is that it's an unnecessary complexity (pardon the pun) in the language that relatively few programmers are going to use. The only thing it really gains by being built in is complex/imaginary literals. Even a library complex constructor doesn't need to be as cumbersome as the C++ example code on the comparison page. Though it does seem that complex numbers, quite ironically, aren't really that complex a feature.... Stewart.
Apr 15 2012
On 15/04/12 14:29, Stewart Gordon wrote:On 15/04/2012 04:10, Mehrdad wrote:I absolutely do not think it does. There is nothing you can do with a pure imaginary type that you cannot do with a complex type. Furthermore, the imaginary numbers have the unfortunate property of not being closed under multiplication and division, which is troublesome for generic code: ireal x; x *= x; // boom It seems nobody noticed, but I did in fact rewrite all of std.complex two years ago (almost to the day) in preparation for the deprecation of the built-in types. If there is anything missing from the module, I will be happy to add it. -LarsWhy is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.htmlThere was a brief discussion about it back in 2008 http://www.digitalmars.com/d/archives/digitalmars/D/Replacing_built-in_complex_What_s_this_about_81214.html My impression was that the plan is to deprecate it once the stuff in std.complex is complete. std.complex has clearly grown since that discussion, but it still needs a pure imaginary type (and I don't know what else at the moment).
Apr 15 2012
On Sun, Apr 15, 2012 at 4:09 PM, Lars T. Kyllingstad <public kyllingen.net> wrote:=A0If there is anything missing from the module, I will be happy to add it. -LarsHow about Quaternions?
Apr 15 2012
On 15/04/12 23:37, Caligo wrote:On Sun, Apr 15, 2012 at 4:09 PM, Lars T. Kyllingstad <public kyllingen.net> wrote:If such were to be added, I think it would be better to put them in a separate std.quaternion module. -LarsIf there is anything missing from the module, I will be happy to add it. -LarsHow about Quaternions?
Apr 15 2012
Le 16/04/2012 08:09, Lars T. Kyllingstad a écrit :On 15/04/12 23:37, Caligo wrote:Or rather std.math.quaternionOn Sun, Apr 15, 2012 at 4:09 PM, Lars T. Kyllingstad <public kyllingen.net> wrote:If such were to be added, I think it would be better to put them in a separate std.quaternion module. -LarsIf there is anything missing from the module, I will be happy to add it. -LarsHow about Quaternions?
Apr 16 2012
On Sunday, 15 April 2012 at 21:09:13 UTC, Lars T. Kyllingstad wrote:I absolutely do not think it does. There is nothing you can do with a pure imaginary type that you cannot do with a complex type. Furthermore, the imaginary numbers have the unfortunate property of not being closed under multiplication and division, which is troublesome for generic code: ireal x; x *= x; // boom It seems nobody noticed, but I did in fact rewrite all of std.complex two years ago (almost to the day) in preparation for the deprecation of the built-in types. If there is anything missing from the module, I will be happy to add it. -LarsThe quote on the 'Semantics' section has a counter example... http://dlang.org/cppcomplex.html
Apr 15 2012
On 15/04/12 23:37, Tove wrote:On Sunday, 15 April 2012 at 21:09:13 UTC, Lars T. Kyllingstad wrote:See my reply to Stewart. -LarsI absolutely do not think it does. There is nothing you can do with a pure imaginary type that you cannot do with a complex type. Furthermore, the imaginary numbers have the unfortunate property of not being closed under multiplication and division, which is troublesome for generic code: ireal x; x *= x; // boom It seems nobody noticed, but I did in fact rewrite all of std.complex two years ago (almost to the day) in preparation for the deprecation of the built-in types. If there is anything missing from the module, I will be happy to add it. -LarsThe quote on the 'Semantics' section has a counter example... http://dlang.org/cppcomplex.html
Apr 15 2012
On 15/04/2012 22:09, Lars T. Kyllingstad wrote:On 15/04/12 14:29, Stewart Gordon wrote:<snip><snip> What proof have you of this - and in particular, that the rationale for pure imaginary types on the comparison page is wrong? And apparently C99 has pure imaginary types to interface.... http://digitalmars.com/d/1.0/interfaceToC.html http://www.cprogrammingreference.com/Tutorials/Basic_Tutorials/Ckeywordsindiviusual/z_Imaginary.php (At the moment, in the D2 docs the complex/imaginary types are totally absent from that page....) Stewart.My impression was that the plan is to deprecate it once the stuff in std.complex is complete. std.complex has clearly grown since that discussion, but it still needs a pure imaginary type (and I don't know what else at the moment).I absolutely do not think it does. There is nothing you can do with a pure imaginary type that you cannot do with a complex type.
Apr 15 2012
On 15/04/12 23:56, Stewart Gordon wrote:On 15/04/2012 22:09, Lars T. Kyllingstad wrote:For any standard type (built-in or library) to be useful, it has to actually be used for something. And in all my years of using D, I have never seen a *single* real-world use of the pure imaginary types. The reason the imaginaries are so seldomly used is precisely because there are so few things you can do with them. Basically, if you do anything beyond addition and subtraction, and multiplication with a real number, you are back in the complex plane. And if those operations are all you need, the real line is just as good as the imaginary line, and you might as well fake it with a real floating-point type. Yes, complex and imaginary numbers have some quirks and subtleties that need to be taken into consideration, but I see this as an implementation issue with the complex type, and not a justification for the existence a pure imaginary type. All that said, however, if anyone can demonstrate that the pure imaginary types are in fact used in a substantial body of real-world code, I will be happy to change my stance on the above. Now, to address the rationale for pure imaginary types on http://dlang.org/cppcomplex.html. Firstly, in light of what I've said above (and given that I am not wrong <g>), the efficiency issue would appear moot. That leaves the semantic issues. The quote by prof. Kahan mentions that the identities sqrt(conj(z))==conj(sqrt(z)) and log(conj(z))==conj(log(z)) should hold even when z is a negative real number. IIRC, f(conj(z))==conj(f(z)) holds when f is analytic, but both sqrt and log (conventionally) have branch cuts along the negative real axis. Case in point: Neither of these identities hold in Mathematica, which is considered the state of the art in mathematical software: Conjugate[Log[-1]] evaluates to -I Pi Log[Conjugate[-1]] evaluates to I Pi Conjugate[Sqrt[-1]] evaluates to -I Sqrt[Conjugate[-1]] evaluates to I The page also mentions some identity involving infinities which is supposed to hold. This is not obviously true. An IEEE infinity has very little to do with mathematical infinity, it is just a special value which means either "this number is too large to be represented by the given number of bits", or "this is a result of a divide by positive zero". (The signedness of zero is another quirk of IEEE floats. Basically, -0.0 means "a negative number which is arbitrarily close to zero", and dividing by it yields an arbitrarily large negative number, i.e. -double.infinity. Mathematically, something/0 makes no sense at all. Personally, I think IEEE made a mistake in defining FP numbers in this way.) It is true that the real line can be extended with elements called plus and minus infinity (affinely extended real line, see https://en.wikipedia.org/wiki/Extended_real_number), and the IEEE floats can be said to approximate this system, but this does not generalise directly to complex numbers. The extended complex plane (see https://en.wikipedia.org/wiki/Riemann_sphere) only has one "infinity". How should the IEEE system be extended to the complex plane, anyway? If we look at the problem in terms of the cartesian representation, we may want four infinities, namely: infinity + i * infinity -infinity + i * infinity infinity - i * infinity -infinity - i * infinity If, on the other hand, we take a polar view of things, there are MANY possibilies: infinity * exp(i * r) // where r is any real number Now, we may invent our own rules for operations with complex numbers involving infinities, if nothing else for predictability in calculations. (And maybe such rules are well established already?) But it does not justify the existence of a pure imaginary type. -LarsOn 15/04/12 14:29, Stewart Gordon wrote:<snip><snip> What proof have you of this - and in particular, that the rationale for pure imaginary types on the comparison page is wrong?My impression was that the plan is to deprecate it once the stuff in std.complex is complete. std.complex has clearly grown since that discussion, but it still needs a pure imaginary type (and I don't know what else at the moment).I absolutely do not think it does. There is nothing you can do with a pure imaginary type that you cannot do with a complex type.
Apr 15 2012
On Monday, 16 April 2012 at 06:06:12 UTC, Lars T. Kyllingstad wrote:How should the IEEE system be extended to the complex plane, anyway? If we look at the problem in terms of the cartesian representation, we may want four infinities, namely: infinity + i * infinity -infinity + i * infinity infinity - i * infinity -infinity - i * infinitySorry, that would be eight. I forgot infinity -infinity i * infinity -i * infinity which seems to be what the comparison page calls for. -Lars
Apr 16 2012
On 16/04/2012 07:06, Lars T. Kyllingstad wrote: <snip>For any standard type (built-in or library) to be useful, it has to actually be used for something.You mean someone has to use it in order to prove that it's usable and therefore useful? Well, if a feature isn't usable, it's probably due to something wrong with its design. And in many cases it's a reason to rethink the design, rather than throw the feature out of the window.And in all my years of using D, I have never seen a *single* real-world use of the pure imaginary types.How many of those years you spent "using" D did you spend looking at other people's real-world applications written in it? Of these, how many have a focus on number crunching? And of these, how many use complex numbers? It's bound to be a rarely used feature. But "nobody's using it" is a prime example of a self-fulfilling prophecy if it leads to the feature's removal. Do you feel the SETI Institute should have given up years ago?The reason the imaginaries are so seldomly used is precisely because there are so few things you can do with them. Basically, if you do anything beyond addition and subtraction, and multiplication with a real number, you are back in the complex plane. And if those operations are all you need, the real line is just as good as the imaginary line, and you might as well fake it with a real floating-point type.This doesn't cover the case of multiplying a complex number by an imaginary number. In the absence of imaginary types, one would have to use complex(-z.im * k, z.re * k), just because z * complex(0, k) isn't guaranteed to produce the correct result. Seems a bit silly. Or have you another suggestion for dealing with this? <snip>It is true that the real line can be extended with elements called plus and minus infinity (affinely extended real line, see https://en.wikipedia.org/wiki/Extended_real_number), and the IEEE floats can be said to approximate this system, but this does not generalise directly to complex numbers. The extended complex plane (see https://en.wikipedia.org/wiki/Riemann_sphere) only has one "infinity".<snip> But the Riemann sphere is only one of the various possible extended complex planes. You could just as well use the polar circle of infinities, the cartesian square of infinities, or the real projective plane model (by which -∞ = ∞, but ∞i, ∞(2+i), etc. are distinct). Stewart.
Apr 16 2012
On Monday, 16 April 2012 at 11:27:29 UTC, Stewart Gordon wrote:On 16/04/2012 07:06, Lars T. Kyllingstad wrote: <snip>This is why I said: "[...] if anyone can demonstrate that the pure imaginary types are in fact used in a substantial body of real-world code, I will be happy to change my stance [...]"For any standard type (built-in or library) to be useful, it has to actually be used for something.You mean someone has to use it in order to prove that it's usable and therefore useful? Well, if a feature isn't usable, it's probably due to something wrong with its design. And in many cases it's a reason to rethink the design, rather than throw the feature out of the window.And in all my years of using D, I have never seen a *single* real-world use of the pure imaginary types.How many of those years you spent "using" D did you spend looking at other people's real-world applications written in it? Of these, how many have a focus on number crunching? And of these, how many use complex numbers?It's bound to be a rarely used feature. But "nobody's using it" is a prime example of a self-fulfilling prophecy if it leads to the feature's removal.I'm not saying it is *never* useful. I'm saying I don't think it's useful *enough* to warrant inclusion in the standard library.Do you feel the SETI Institute should have given up years ago?I don't really see the similarity between SETI and Phobos.Yes: Define Complex!T so it produces the desired result in each case.The reason the imaginaries are so seldomly used is precisely because there are so few things you can do with them. Basically, if you do anything beyond addition and subtraction, and multiplication with a real number, you are back in the complex plane. And if those operations are all you need, the real line is just as good as the imaginary line, and you might as well fake it with a real floating-point type.This doesn't cover the case of multiplying a complex number by an imaginary number. In the absence of imaginary types, one would have to use complex(-z.im * k, z.re * k), just because z * complex(0, k) isn't guaranteed to produce the correct result. Seems a bit silly. Or have you another suggestion for dealing with this?<snip>My point exactly. -LarsIt is true that the real line can be extended with elements called plus and minus infinity (affinely extended real line, see https://en.wikipedia.org/wiki/Extended_real_number), and the IEEE floats can be said to approximate this system, but this does not generalise directly to complex numbers. The extended complex plane (see https://en.wikipedia.org/wiki/Riemann_sphere) only has one "infinity".<snip> But the Riemann sphere is only one of the various possible extended complex planes. You could just as well use the polar circle of infinities, the cartesian square of infinities, or the real projective plane model (by which -∞ = ∞, but ∞i, ∞(2+i), etc. are distinct).
Apr 16 2012
On 16/04/2012 12:42, Lars T. Kyllingstad wrote: <snip>They've been working for decades in the hope of finding aliens. In the same way, imaginary types have been put into D in the hope that they would be useful. To leap to the conclusion that they aren't useful, just because they haven't been put to any real use _yet_, would be like SETI leaping to the conclusion that aliens don't exist and therefore abandoning the project. <snip>Do you feel the SETI Institute should have given up years ago?I don't really see the similarity between SETI and Phobos.<snip> You mean define complex multiplication and division with a special case so that, when ±0 occurs as the real part of a number, it just pretends there's no real part at all? I can see this slowing down almost any program that does complex arithmetic.... Stewart.This doesn't cover the case of multiplying a complex number by an imaginary number. In the absence of imaginary types, one would have to use complex(-z.im * k, z.re * k), just because z * complex(0, k) isn't guaranteed to produce the correct result. Seems a bit silly. Or have you another suggestion for dealing with this?Yes: Define Complex!T so it produces the desired result in each case.
Apr 16 2012
Lars T. Kyllingstad:If there is anything missing from the module, I will be happy to add it.You have seen std.math.expi, that returns a creal using the instructions sincos plus a registers swap (so it returns complex(cos,sin)). Maybe it's worth adding to Phobos a fully inlinable core.bitop.sincos intrinsic that performs just the sincos. Bye, bearophile
Apr 15 2012
On 15/04/2012 23:31, bearophile wrote: <snip>You have seen std.math.expi, that returns a creal using the instructions sincos plus a registers swap (so it returns complex(cos,sin)). Maybe it's worth adding to Phobos a fully inlinable core.bitop.sincos intrinsic that performs just the sincos.I'd never imagined that x86 CPUs had such an instruction built in, but I can begin to imagine why. But in what way are trig functions bit-level operations? Stewart.
Apr 15 2012
Stewart Gordon:But in what way are trig functions bit-level operations?That module should be named core.intrinsics. Bye, bearophile
Apr 15 2012
On 16-04-2012 00:31, bearophile wrote:Lars T. Kyllingstad:I assume you meant druntime? I think we really need to isolate these intrinsic 'hacks' in the runtime. There should be *no* magic surrounding Phobos in an ideal world - it should just be a plain library. -- - AlexIf there is anything missing from the module, I will be happy to add it.You have seen std.math.expi, that returns a creal using the instructions sincos plus a registers swap (so it returns complex(cos,sin)). Maybe it's worth adding to Phobos a fully inlinable core.bitop.sincos intrinsic that performs just the sincos. Bye, bearophile
Apr 15 2012
On 16/04/12 00:31, bearophile wrote:Lars T. Kyllingstad:You're right, expi() should be added. I remember that being on my to-do list, but I don't know why I skipped it. -LarsIf there is anything missing from the module, I will be happy to add it.You have seen std.math.expi, that returns a creal using the instructions sincos plus a registers swap (so it returns complex(cos,sin)). Maybe it's worth adding to Phobos a fully inlinable core.bitop.sincos intrinsic that performs just the sincos.
Apr 15 2012
So we're removing it to reduce the number of keywords? ...Why? Is the keyword-ness of "cdouble" and "ifloat", etc. causing problems for people? "Stewart Gordon" wrote in message news:jmeevc$o3m$1 digitalmars.com... On 15/04/2012 04:10, Mehrdad wrote:Why is complex being phased out? What happened to all this? http://dlang.org/cppcomplex.htmlThere was a brief discussion about it back in 2008 http://www.digitalmars.com/d/archives/digitalmars/D/Replacing_built-in_complex_What_s_this_about_81214.html My impression was that the plan is to deprecate it once the stuff in std.complex is complete. std.complex has clearly grown since that discussion, but it still needs a pure imaginary type (and I don't know what else at the moment). From what I gathered, the reason is that it's an unnecessary complexity (pardon the pun) in the language that relatively few programmers are going to use. The only thing it really gains by being built in is complex/imaginary literals. Even a library complex constructor doesn't need to be as cumbersome as the C++ example code on the comparison page. Though it does seem that complex numbers, quite ironically, aren't really that complex a feature.... Stewart.
Apr 15 2012
"Mehrdad" <wfunction hotmail.com> wrote in message news:jmg3ak$147c$1 digitalmars.com...So we're removing it to reduce the number of keywords? ...Why? Is the keyword-ness of "cdouble" and "ifloat", etc. causing problems for people?No. Complex types are special-cased in a lot of places in the dmd frontend, and considering the number of backend bugs I've found, nobody is using them with the dmd backend anyway. (especially not on x64)
Apr 15 2012
On 16.04.2012 05:22, Mehrdad wrote:So we're removing it to reduce the number of keywords? ...Why? Is the keyword-ness of "cdouble" and "ifloat", etc. causing problems for people?Not problems, but serious eye sores: Personally, I am really happy that "ireal" and "creal" are going to drop out of the language specs. Now D finally has the chance of being taken seriously by mathematicians... (Anyone, who does not get it: imagine a language that calls floating point values "fint" because they are "fractional integers". The same language would probably also have the keywords "cvar" for "constant variable" and "ntrue" for "not true"... :-) )
Apr 17 2012
On Tuesday, 17 April 2012 at 18:46:13 UTC, Norbert Nemec wrote:On 16.04.2012 05:22, Mehrdad wrote:Hear, hear! These names have always made me me cringe. (Similar, though not nearly as annoying, is the use of "enum" to declare manifest constants.) However, I suspect that when the builtins get removed, aliases will be introduced in their place in std.complex. -LarsSo we're removing it to reduce the number of keywords? ...Why? Is the keyword-ness of "cdouble" and "ifloat", etc. causing problems for people?Not problems, but serious eye sores: Personally, I am really happy that "ireal" and "creal" are going to drop out of the language specs. Now D finally has the chance of being taken seriously by mathematicians... (Anyone, who does not get it: imagine a language that calls floating point values "fint" because they are "fractional integers". The same language would probably also have the keywords "cvar" for "constant variable" and "ntrue" for "not true"... :-) )
Apr 17 2012