April 15, 2012
Why is complex being phased out?
What happened to all this? http://dlang.org/cppcomplex.html
April 15, 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.html

It's being replaced with a library implementation of it. I doubt it will be deprecated before the library implementation is ready.
April 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.html

Where does it say it's being phased out?
April 15, 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:
> > Why is complex being phased out?
> > What happened to all this? http://dlang.org/cppcomplex.html
> 
> Where does it say it's being phased out?

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=7875
April 15, 2012
On Sunday, April 15, 2012 05:50:33 Kapps wrote:
> 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.html
> 
> It's being replaced with a library implementation of it. I doubt it will be deprecated before the library implementation is ready.

It was probably the same reasoning that lead to moving the AA implementation into druntime, but I don't remember any specifics.

- Jonathan M Davis
April 15, 2012
On 4/14/12 10:54 PM, Jonathan M Davis wrote:
> On Saturday, April 14, 2012 22:27:19 Caligo wrote:
>> 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.html
>>
>> Where does it say it's being phased out?
>
> 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=7875

I just submitted a fix.

Andrei
April 15, 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.html

I 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
April 15, 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.
April 15, 2012
On 15/04/2012 04:10, Mehrdad wrote:
> Why is complex being phased out?
> What happened to all this? http://dlang.org/cppcomplex.html

There 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.
April 15, 2012
On 15/04/12 14:29, Stewart Gordon wrote:
> On 15/04/2012 04:10, Mehrdad wrote:
>> Why is complex being phased out?
>> What happened to all this? http://dlang.org/cppcomplex.html
>
> There 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).

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.

-Lars
« First   ‹ Prev
1 2 3 4
Top | Discussion index | About this forum | D home