Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread Walter Bright via Digitalmars-d
On 8/4/2016 11:05 PM, Fool wrote: I understand your point of view. However, there are (probably rare) situations where one requires more control. I think that simulating double-double precision arithmetic using Veltkamp split was mentioned as a resonable example, earlier. There are cases where

Re: [DIP] In-place struct initialization

2016-08-05 Thread deadalnix via Digitalmars-d
On Friday, 5 August 2016 at 06:27:04 UTC, ketmar wrote: besides, all this thread looks like a thing that is curing symptoms for me. by introducing general named arguments support, structure ctors with arbitrary fields comes naturally then (not without some code, but it will *look* naturally).

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread Ilya Yaroshenko via Digitalmars-d
On Friday, 5 August 2016 at 06:59:21 UTC, Walter Bright wrote: On 8/4/2016 11:05 PM, Fool wrote: I understand your point of view. However, there are (probably rare) situations where one requires more control. I think that simulating double-double precision arithmetic using Veltkamp split was me

Re: [DIP] In-place struct initialization

2016-08-05 Thread ketmar via Digitalmars-d
On Friday, 5 August 2016 at 07:04:55 UTC, deadalnix wrote: Also, there are nice library solution for named argument already. i know. but it is a weird hack involving abusing lambdas for something that should be language's core feature. i did a PoC patch for named args a while ago (and still m

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread deadalnix via Digitalmars-d
On Friday, 5 August 2016 at 07:43:19 UTC, Ilya Yaroshenko wrote: On Friday, 5 August 2016 at 06:59:21 UTC, Walter Bright wrote: On 8/4/2016 11:05 PM, Fool wrote: I understand your point of view. However, there are (probably rare) situations where one requires more control. I think that simulati

Re: Things that make writing a clean binding system more difficult

2016-08-05 Thread Ethan Watson via Digitalmars-d
On Thursday, 4 August 2016 at 11:41:00 UTC, Jacob Carlborg wrote: That works for me [1]. It was reported by Manu and fixed in 2012 [2]. I did some more experimenting, and it turns out that the problem is when the declaration and definition have different linkage. Being C++ functions means tha

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread Ilya Yaroshenko via Digitalmars-d
On Friday, 5 August 2016 at 07:59:15 UTC, deadalnix wrote: On Friday, 5 August 2016 at 07:43:19 UTC, Ilya Yaroshenko wrote: You are wrong that there are far fewer of those cases. This is naive point of view. A lot of netlib math functions require exact IEEE arithmetic. Tinflex requires it. Pyth

Re: Things that make writing a clean binding system more difficult

2016-08-05 Thread ketmar via Digitalmars-d
On Friday, 5 August 2016 at 08:15:37 UTC, Ethan Watson wrote: So that's technically a bug. But. Before I go running off to the Bugzilla Walter made. Should a user declaring and then later defining a function be forced to 100% replicate that function definition before defining it? If yes, then t

Re: Things that make writing a clean binding system more difficult

2016-08-05 Thread ketmar via Digitalmars-d
On Friday, 5 August 2016 at 08:40:04 UTC, ketmar wrote: p.s. the only "gotcha" i see is if prototyp declaration is found *after* the actual function was declared. as D code should not depend of declaration order, this should be either error, or (better!) use prototype to "fix" previous definiti

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread deadalnix via Digitalmars-d
On Friday, 5 August 2016 at 08:17:00 UTC, Ilya Yaroshenko wrote: 1. Could you please provide an assembler example with clang or recent gcc? I have better: compile your favorite project with -Wdouble-promotion and enjoy the rain of warnings. But try it yourself: float foo(float a, float b) {

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread Ilya Yaroshenko via Digitalmars-d
On Friday, 5 August 2016 at 08:43:48 UTC, deadalnix wrote: On Friday, 5 August 2016 at 08:17:00 UTC, Ilya Yaroshenko wrote: 1. Could you please provide an assembler example with clang or recent gcc? I have better: compile your favorite project with -Wdouble-promotion and enjoy the rain of war

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread Walter Bright via Digitalmars-d
On 8/5/2016 12:43 AM, Ilya Yaroshenko wrote: You are wrong that there are far fewer of those cases. This is naive point of view. A lot of netlib math functions require exact IEEE arithmetic. Tinflex requires it. Python C backend and Mir library require exact IEEE arithmetic. Atmosphere package re

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread Walter Bright via Digitalmars-d
On 8/5/2016 1:17 AM, Ilya Yaroshenko wrote: 2. C compilers not promote double to 80-bit reals anyway. Java originally came out with an edict that floats will all be done in float precision, and double in double. Sun had evidently never used an x87 before, because it soon became obvious that

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread John Colvin via Digitalmars-d
On Friday, 5 August 2016 at 08:43:48 UTC, deadalnix wrote: On Friday, 5 August 2016 at 08:17:00 UTC, Ilya Yaroshenko wrote: 1. Could you please provide an assembler example with clang or recent gcc? I have better: compile your favorite project with -Wdouble-promotion and enjoy the rain of war

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread Walter Bright via Digitalmars-d
On 8/5/2016 12:43 AM, Ilya Yaroshenko wrote: You are wrong that there are far fewer of those cases. This is naive point of view. A lot of netlib math functions require exact IEEE arithmetic. Tinflex requires it. Python C backend and Mir library require exact IEEE arithmetic. Atmosphere package re

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread Ilya Yaroshenko via Digitalmars-d
On Friday, 5 August 2016 at 09:24:49 UTC, Walter Bright wrote: On 8/5/2016 12:43 AM, Ilya Yaroshenko wrote: You are wrong that there are far fewer of those cases. This is naive point of view. A lot of netlib math functions require exact IEEE arithmetic. Tinflex requires it. Python C backend and

Re: Things that make writing a clean binding system more difficult

2016-08-05 Thread Manu via Digitalmars-d
On 5 August 2016 at 03:33, Seb via Digitalmars-d wrote: > On Thursday, 4 August 2016 at 12:44:49 UTC, Manu wrote: >> >> On 29 July 2016 at 16:51, Jonathan M Davis via Digitalmars-d >> wrote: >>> >>> [...] >> >> >> Bingo! But it's much deeper than that. ref is a disaster. Use it to >> any real ext

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread Ilya Yaroshenko via Digitalmars-d
On Friday, 5 August 2016 at 09:40:23 UTC, Walter Bright wrote: On 8/5/2016 12:43 AM, Ilya Yaroshenko wrote: You are wrong that there are far fewer of those cases. This is naive point of view. A lot of netlib math functions require exact IEEE arithmetic. Tinflex requires it. Python C backend and

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread Fool via Digitalmars-d
Here is a relevant example: https://hal.inria.fr/inria-00171497v1/document It is used in at least one real world geometric modeling system.

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread Seb via Digitalmars-d
On Friday, 5 August 2016 at 09:40:59 UTC, Ilya Yaroshenko wrote: On Friday, 5 August 2016 at 09:24:49 UTC, Walter Bright wrote: On 8/5/2016 12:43 AM, Ilya Yaroshenko wrote: You are wrong that there are far fewer of those cases. This is naive point of view. A lot of netlib math functions require

Re: [DIP] In-place struct initialization

2016-08-05 Thread Chris Wright via Digitalmars-d
On Fri, 05 Aug 2016 06:12:24 +, ZombineDev wrote: > I was actually looking for design issues. Assuming this bug gets fixed, > and S s = { a: var1, b: var2 }, becomes equivalent to: > S s = void; > s.a = var1; /* calls s.a postblit if necessary */ > s.b = var2; /* calls s.b postblit if necessary

Re: The Computer Language Benchmarks Game

2016-08-05 Thread qznc via Digitalmars-d
On Thursday, 4 August 2016 at 20:15:35 UTC, Ali Çehreli wrote: We don't hear about the following site here any more: http://benchmarksgame.alioth.debian.org/ How relevant is that site for us? Should D be represented there as well? Would someone (you? :p) be interested in adding D to the lan

Re: The Computer Language Benchmarks Game

2016-08-05 Thread Seb via Digitalmars-d
On Friday, 5 August 2016 at 05:22:07 UTC, ZombineDev wrote: On Thursday, 4 August 2016 at 20:15:35 UTC, Ali Çehreli wrote: We don't hear about the following site here any more: http://benchmarksgame.alioth.debian.org/ How relevant is that site for us? Should D be represented there as well?

Re: The Computer Language Benchmarks Game

2016-08-05 Thread H.Loom via Digitalmars-d
On Thursday, 4 August 2016 at 20:15:35 UTC, Ali Çehreli wrote: We don't hear about the following site here any more: http://benchmarksgame.alioth.debian.org/ How relevant is that site for us? Should D be represented there as well? Would someone (you? :p) be interested in adding D to the lan

Re: Documented unittests & code coverage

2016-08-05 Thread Atila Neves via Digitalmars-d
On Friday, 5 August 2016 at 02:37:35 UTC, Walter Bright wrote: In adding some overflow detection to Phobos, I discovered that some allocations were never called by the unittests. Adding a unittest for those paths, I discovered those paths didn't work at all for any cases. I'm not giving up co

Re: The Computer Language Benchmarks Game

2016-08-05 Thread H.Loom via Digitalmars-d
On Friday, 5 August 2016 at 15:44:54 UTC, H.Loom wrote: On Thursday, 4 August 2016 at 20:15:35 UTC, Ali Çehreli wrote: We don't hear about the following site here any more: http://benchmarksgame.alioth.debian.org/ How relevant is that site for us? Should D be represented there as well? Woul

Re: The Computer Language Benchmarks Game

2016-08-05 Thread H.Loom via Digitalmars-d
On Friday, 5 August 2016 at 15:46:15 UTC, H.Loom wrote: On Friday, 5 August 2016 at 15:44:54 UTC, H.Loom wrote: On Thursday, 4 August 2016 at 20:15:35 UTC, Ali Çehreli wrote: We don't hear about the following site here any more: http://benchmarksgame.alioth.debian.org/ How relevant is that

Re: D safety! New Feature?

2016-08-05 Thread H.Loom via Digitalmars-d
On Thursday, 4 August 2016 at 18:22:52 UTC, Mark "J" Twain wrote: Marking a widget immutable is not the same as having an ImmutableWidget. Can you see the difference? Yes, you're thinking here of logical vs physical immutability. I assure you there is. The immutable keyword only prevents data

Re: D safety! New Feature?

2016-08-05 Thread H.Loom via Digitalmars-d
On Thursday, 4 August 2016 at 18:22:52 UTC, Mark "J" Twain wrote: Building immutability in to the type system itself allows the programmer to make immutable smarter and control exactly what it does. once again it is in the type system: °° st

Re: Is dmd fast?

2016-08-05 Thread Kagamin via Digitalmars-d
BTW, anybody tested LLD? They claim it's faster than gold http://lld.llvm.org/NewLLD.html

Re: Vision for the D language - stabilizing complexity?

2016-08-05 Thread Kagamin via Digitalmars-d
On Monday, 11 July 2016 at 18:57:51 UTC, deadalnix wrote: Alright, but keep in mind that is an example, not the actual problem I'm talking about. There are many reasonable way to make the example above safe: disallow dereferencing pointers from unknown source, do a bound check on .ptr, disallow

Re: The Computer Language Benchmarks Game

2016-08-05 Thread Isaac Gouy via Digitalmars-d
On Thursday, 4 August 2016 at 20:15:35 UTC, Ali Çehreli wrote: but the measurement code is available for others to use: Someone had those benchmarks game measurement scripts working with D - a couple of years ago - but then … ? https://forum.dlang.org/post/lvajbi$1477$1...@digitalmars.com

Re: Things that make writing a clean binding system more difficult

2016-08-05 Thread Steven Schveighoffer via Digitalmars-d
On 8/5/16 6:17 AM, Manu via Digitalmars-d wrote: On 5 August 2016 at 03:33, Seb via Digitalmars-d wrote: On Thursday, 4 August 2016 at 12:44:49 UTC, Manu wrote: On 29 July 2016 at 16:51, Jonathan M Davis via Digitalmars-d wrote: [...] Bingo! But it's much deeper than that. ref is a disa

Re: The Computer Language Benchmarks Game

2016-08-05 Thread Isaac Gouy via Digitalmars-d
On Friday, 5 August 2016 at 05:22:07 UTC, ZombineDev wrote: ... It seems that this one has a more active community around it... ? https://alioth.debian.org/activity/?group_id=100815 ;-)

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread deadalnix via Digitalmars-d
On Friday, 5 August 2016 at 09:21:53 UTC, Ilya Yaroshenko wrote: On Friday, 5 August 2016 at 08:43:48 UTC, deadalnix wrote: On Friday, 5 August 2016 at 08:17:00 UTC, Ilya Yaroshenko wrote: 1. Could you please provide an assembler example with clang or recent gcc? I have better: compile your f

Re: Documented unittests & code coverage

2016-08-05 Thread Jonathan M Davis via Digitalmars-d
On Thursday, August 04, 2016 19:37:35 Walter Bright via Digitalmars-d wrote: > In adding some overflow detection to Phobos, I discovered that some > allocations were never called by the unittests. Adding a unittest for those > paths, I discovered those paths didn't work at all for any cases. > > I'

Re: D safety! New Feature?

2016-08-05 Thread Mark J Twain via Digitalmars-d
On Thursday, 4 August 2016 at 18:58:18 UTC, ag0aep6g wrote: On 08/04/2016 08:22 PM, Mark J Twain wrote: The problem is that you have fixated on the *array* and not the general principle. The Array was an example. I'm having trouble understanding what you're getting at, so I'm trying to get i

Re: For the Love of God, Please Write Better Docs!

2016-08-05 Thread poliklosio via Digitalmars-d
On Tuesday, 2 August 2016 at 20:26:06 UTC, Jack Stouffer wrote: (...) I cannot agree more with that. In my opinion open source community massively underestimates the importance of high-level examples, articles and tutorials. To most library authors (judging from projects I've seen) source co

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread Walter Bright via Digitalmars-d
Thanks for finding these. On 8/5/2016 3:22 AM, Ilya Yaroshenko wrote: 1. https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz mathmodule.c, math_fsum has comment: Depends on IEEE 754 arithmetic guarantees and half-even rounding. The same algorithm also available in Mir. And it does not wo

Re: For the Love of God, Please Write Better Docs!

2016-08-05 Thread H.Loom via Digitalmars-d
On Friday, 5 August 2016 at 19:52:19 UTC, poliklosio wrote: On Tuesday, 2 August 2016 at 20:26:06 UTC, Jack Stouffer wrote: (...) I cannot agree more with that. In my opinion open source community massively underestimates the importance of high-level examples, articles and tutorials. To most

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread Walter Bright via Digitalmars-d
On 8/5/2016 4:27 AM, Seb wrote: 1) There are some function (exp, pow, log, round, sqrt) for which using llvm_intrinsincs significantly increases your performance. It's a simple benchmark and might be flawed, but I hope it shows the point. Speed is not the only criteria. Accuracy is as well. I'

Re: Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

2016-08-05 Thread Walter Bright via Digitalmars-d
On 8/5/2016 2:40 AM, Ilya Yaroshenko wrote: No. For example std.math.log requires it! But you don't care about other compilers which not use yl2x and about making it template (real version slows down code for double and float). I'm interested in correct to the last bit results first, and perfor

Re: Documented unittests & code coverage

2016-08-05 Thread Walter Bright via Digitalmars-d
On 8/5/2016 12:10 PM, Jonathan M Davis via Digitalmars-d wrote: [...] Yes, I pretty much agree with your entire post.

Re: D safety! New Feature?

2016-08-05 Thread ag0aep6g via Digitalmars-d
On 08/05/2016 09:39 PM, Mark J Twain wrote: In the case of ImmutableQueue, There is no Enqueue! See, there is a difference between "not callable" and "does not exists". Ok, but what cool stuff is enabled by "does not exist" that doesn't work (as nicely) with "not callable"? As far as I can te

Re: Recommended procedure to upgrade DMD installation

2016-08-05 Thread A D dev via Digitalmars-d
On Friday, 5 August 2016 at 00:07:36 UTC, Mike Parker wrote: If you're running the installer, it will uninstall the previous version for you. If you are doing it manually, I recommend you delete the existing folder rather than overwriting it. Thanks for the info. If you are compiling 64-bit p

Re: Recommended procedure to upgrade DMD installation

2016-08-05 Thread A D dev via Digitalmars-d
On Thursday, 4 August 2016 at 22:20:12 UTC, Seb wrote: OT: 2.071.0 has been released in April - you may check more often ;-) That - 2.071.0 - was actually a typo - I meant to type 2.071.1 - which I read (probably on a recent edition of This Week in D) has been released recently. I never

Re: Documented unittests & code coverage

2016-08-05 Thread Jonathan M Davis via Digitalmars-d
On Friday, August 05, 2016 14:10:02 Walter Bright via Digitalmars-d wrote: > On 8/5/2016 12:10 PM, Jonathan M Davis via Digitalmars-d wrote: > > [...] > > Yes, I pretty much agree with your entire post. I just wish that you'd agree that issues like these https://issues.dlang.org/show_bug.cgi?id=1

Re: Recommended procedure to upgrade DMD installation

2016-08-05 Thread Mike Parker via Digitalmars-d
On Friday, 5 August 2016 at 21:36:07 UTC, A D dev wrote: What Microsoft tools are you referring to? Do you mean C toolchain build tools, like the linker, librarian, (N)MAKE, etc.? Does D depend on those on Windows? (I do remember reading a D doc, maybe the overview, that said something like th

Re: D safety! New Feature?

2016-08-05 Thread Chris Wright via Digitalmars-d
On Fri, 05 Aug 2016 23:12:06 +0200, ag0aep6g wrote: > On 08/05/2016 09:39 PM, Mark J Twain wrote: >> In the case of ImmutableQueue, There is no Enqueue! >> >> See, there is a difference between "not callable" and "does not >> exists". > > Ok, but what cool stuff is enabled by "does not exist" tha

Re: D safety! New Feature?

2016-08-05 Thread Mark J Twain via Digitalmars-d
On Friday, 5 August 2016 at 21:12:06 UTC, ag0aep6g wrote: On 08/05/2016 09:39 PM, Mark J Twain wrote: In the case of ImmutableQueue, There is no Enqueue! See, there is a difference between "not callable" and "does not exists". Ok, but what cool stuff is enabled by "does not exist" that does

Re: D safety! New Feature?

2016-08-05 Thread Chris Wright via Digitalmars-d
On Sat, 06 Aug 2016 01:57:50 +, Mark "J" Twain wrote: > wow, that seems like a huge design issues. In practice, it's not a problem. In a language supporting low-level operations, you do sometimes need a reinterpret_cast. And since there's no other useful cast you can do with a D struct... T

Re: Vision for the D language - stabilizing complexity?

2016-08-05 Thread Timon Gehr via Digitalmars-d
On 15.07.2016 22:29, Walter Bright wrote: On 7/15/2016 12:55 PM, Jack Stouffer wrote: On Friday, 15 July 2016 at 19:06:15 UTC, Walter Bright wrote: 4. making use of asserts to provide information to the optimizer Do dmd/ldc/gdc actually do this? dmd doesn't. I don't know about other compile

Re: D safety! New Feature?

2016-08-05 Thread ag0aep6g via Digitalmars-d
On 08/06/2016 03:38 AM, Chris Wright wrote: Some reflection stuff is a bit inconvenient: class A { int foo() { return 1; } } void main() { auto a = new immutable(A); // This passes: static assert(is(typeof(a.foo))); // This doesn't: static assert(__traits(compiles, () { a.foo; }));

Re: D safety! New Feature?

2016-08-05 Thread ag0aep6g via Digitalmars-d
On 08/06/2016 03:57 AM, Mark J Twain wrote: On Friday, 5 August 2016 at 21:12:06 UTC, ag0aep6g wrote: [...] struct MutableSomething { int value; void mutate(int newValue) { value = newValue; } } struct ImmutableSomething { int value; /* no mutate method here */ } void mai