Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Walter Bright via Digitalmars-d-announce
On 1/5/2021 9:57 PM, Timon Gehr wrote: Anyway, I wouldn't necessarily say occasional accidental correctness is the only upside, you also get better performance and simpler code generation on the deprecated x87. I don't see any further upsides though, and for me, it's a terrible trade-off,

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Timon Gehr via Digitalmars-d-announce
On 06.01.21 03:27, Walter Bright wrote: On 1/5/2021 5:30 AM, Guillaume Piolat wrote: It would be nice if no excess precision was ever used. It can sometimes gives a false sense of correctness. It has no upside except accidental correctness that can break when compiled for a different

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Walter Bright via Digitalmars-d-announce
On 1/5/2021 2:42 AM, 9il wrote: On Tuesday, 5 January 2021 at 09:47:41 UTC, Walter Bright wrote: On 1/4/2021 11:22 PM, 9il wrote: I can't reproduce the same DMD output as you. I did it on Windows 32 bit. I tried it on Linux 32, which does indeed show the behavior you mentioned. At the

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Walter Bright via Digitalmars-d-announce
On 1/5/2021 5:30 AM, Guillaume Piolat wrote: It would be nice if no excess precision was ever used. It can sometimes gives a false sense of correctness. It has no upside except accidental correctness that can break when compiled for a different platform. That same argument could be use to

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread welkam via Digitalmars-d-announce
On Tuesday, 5 January 2021 at 21:46:34 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 5 January 2021 at 21:43:09 UTC, welkam wrote: Replace alias Bar(T) = Foo!T; with alias Bar = Foo; struct Foo(T) {} alias Bar = Foo; void f(T)(Bar!T x) {} void main() { auto foo = Bar!int(); f(foo); }

Re: I'm creating a game purely written in D with the arsd library

2021-01-05 Thread Guillaume Piolat via Digitalmars-d-announce
On Tuesday, 5 January 2021 at 21:42:49 UTC, Murilo wrote: On Saturday, 2 January 2021 at 22:49:19 UTC, Guillaume Piolat wrote: On Saturday, 2 January 2021 at 04:12:29 UTC, Murilo wrote: Here is the link https://drive.google.com/file/d/1Il1xLN8b5rzghYLXTQqq2apv5YMKv7rx/view?usp=sharing I

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Tuesday, 5 January 2021 at 21:46:34 UTC, Ola Fosheim Grøstad wrote: It is very useful to create a simple alias from a complex type for export from a type library, then it breaks when people use that type library to write templated functions. People do this all the time in C++. Example:

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Tuesday, 5 January 2021 at 21:43:09 UTC, welkam wrote: Replace alias Bar(T) = Foo!T; with alias Bar = Foo; struct Foo(T) {} alias Bar = Foo; void f(T)(Bar!T x) {} void main() { auto foo = Bar!int(); f(foo); } The example was a reduced case. One can trivially construct examples

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread welkam via Digitalmars-d-announce
On Wednesday, 23 December 2020 at 22:13:09 UTC, Ola Fosheim Grøstad wrote: The big picture that the DIP suggested was that when stuff like this fails to compile: struct Foo(T) {} alias Bar(T) = Foo!T; void f(T)(Bar!T x) {} void main() { auto foo = Bar!int(); f(foo); }

Re: I'm creating a game purely written in D with the arsd library

2021-01-05 Thread Murilo via Digitalmars-d-announce
On Saturday, 2 January 2021 at 22:49:19 UTC, Guillaume Piolat wrote: On Saturday, 2 January 2021 at 04:12:29 UTC, Murilo wrote: Here is the link https://drive.google.com/file/d/1Il1xLN8b5rzghYLXTQqq2apv5YMKv7rx/view?usp=sharing I can't pass the first screen with a static photo and music.

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Tuesday, 5 January 2021 at 21:03:40 UTC, welkam wrote: This code compiles struct bar(T) {} void f(T)(bar!T x) {} void main() { alias fooInt = bar!int; alias foo = bar; assert(is(fooInt == bar!int)); assert(is(foo!int == bar!int)); assert(is(fooInt == foo!int)); }

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread welkam via Digitalmars-d-announce
On Tuesday, 5 January 2021 at 15:10:29 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 5 January 2021 at 15:04:34 UTC, welkam wrote: Also how "i'm like you" is an insult? I don't think I should reply to this… Then dont replay to this sentence. My post had more than one sentence. Also the

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Tuesday, 5 January 2021 at 18:48:06 UTC, ag0aep6g wrote: On Tuesday, 5 January 2021 at 18:06:32 UTC, Ola Fosheim Grøstad wrote: My main concern is that we need to attract more people with a strong comp.sci. background because as a language grow it becomes more tricky to improve and the most

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread ag0aep6g via Digitalmars-d-announce
On Tuesday, 5 January 2021 at 18:06:32 UTC, Ola Fosheim Grøstad wrote: My main concern is that we need to attract more people with a strong comp.sci. background because as a language grow it becomes more tricky to improve and the most difficult topics are the ones that remain unresolved (like

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Tuesday, 5 January 2021 at 17:13:01 UTC, ag0aep6g wrote: Sure. I've said in my first post in this thread that "issue 1807 is well worth fixing/implementing". Ok, if we have a majority for this, then all is good. A program has a bug when it doesn't behave as intended by its author. I think

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread ag0aep6g via Digitalmars-d-announce
On 05.01.21 11:44, Ola Fosheim Grøstad wrote: So, does that mean that you agree that having better unification would be a worthwhile item to have on a wish list for 2021? So, if somebody want to do a full implementation that performs well, then it would be an interesting option? Sure. I've

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Tuesday, 5 January 2021 at 15:04:34 UTC, welkam wrote: Also how "i'm like you" is an insult? I don't think I should reply to this…

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread welkam via Digitalmars-d-announce
On Monday, 4 January 2021 at 22:55:28 UTC, Ola Fosheim Grøstad wrote: It is a name, e.g.: alias BarInt = Bar!int; "BarInt", "Bar!int" and "Foo!int" are all names, or labels, if you wish. And they all refer to the same object: the nominal type. Which you can test easily by using

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Tuesday, 5 January 2021 at 13:30:50 UTC, Guillaume Piolat wrote: On Tuesday, 5 January 2021 at 09:47:41 UTC, Walter Bright wrote: The only D compiler that uses excess precision is DMD and only if -O flag is passed. The same example compiled with GDC uses write-read codes. LDC uses SSE

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Guillaume Piolat via Digitalmars-d-announce
On Tuesday, 5 January 2021 at 09:47:41 UTC, Walter Bright wrote: The only D compiler that uses excess precision is DMD and only if -O flag is passed. The same example compiled with GDC uses write-read codes. LDC uses SSE codes. DMD still supports baseline 32 bit Windows that does not have

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Atila Neves via Digitalmars-d-announce
On Monday, 4 January 2021 at 01:19:12 UTC, jmh530 wrote: On Sunday, 3 January 2021 at 20:31:41 UTC, welkam wrote: [snip] [snip[ Regardless, the DIP likely could have been improved by mentioning its inclusion in C++ 11 (and perhaps focused a bit less on implementation). Yes.

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Monday, 4 January 2021 at 17:48:50 UTC, ag0aep6g wrote: I think you're hitting the nail on the head here regarding the confusion. Such a rewrite makes intuitive sense, and it would be nice, but it doesn't happen. So, does that mean that you agree that having better unification would be a

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread 9il via Digitalmars-d-announce
On Tuesday, 5 January 2021 at 09:47:41 UTC, Walter Bright wrote: On 1/4/2021 11:22 PM, 9il wrote: I can't reproduce the same DMD output as you. I did it on Windows 32 bit. I tried it on Linux 32, which does indeed show the behavior you mentioned. At the moment I don't know why the different

Re: Printing shortest decimal form of floating point number with Mir

2021-01-05 Thread Walter Bright via Digitalmars-d-announce
On 1/4/2021 11:22 PM, 9il wrote: I can't reproduce the same DMD output as you. I did it on Windows 32 bit. I tried it on Linux 32, which does indeed show the behavior you mentioned. At the moment I don't know why the different behaviors. https://issues.dlang.org/show_bug.cgi?id=21526 It