Where are the GSOC 2020 ideas?

2020-02-27 Thread mark via Digitalmars-d-learn
On https://wiki.dlang.org I can find GSOC ideas 2011-2019, but not 2020. I know the 2020 one's haven't been accepted, but I'd like to know what they are in case I feel like having a go at one as part of learning D.

Re: Strange counter-performance in an alternative `decimalLength9` function

2020-02-27 Thread Basile B. via Digitalmars-d-learn
On Thursday, 27 February 2020 at 04:44:56 UTC, Basile B. wrote: On Thursday, 27 February 2020 at 03:58:15 UTC, Bruce Carneal wrote: Maybe you talked about another implementation of decimalLength9 ? Yes. It's one I wrote after I saw your post. Psuedo-code here: auto d9_branchless(uint v)

Re: Strange counter-performance in an alternative `decimalLength9` function

2020-02-27 Thread Dennis Cote via Digitalmars-d-learn
On Wednesday, 26 February 2020 at 00:50:35 UTC, Basile B. wrote: So after reading the translation of RYU I was interested too see if the decimalLength() function can be written to be faster, as it cascades up to 8 CMP. Perhaps you could try something like this. int decimalDigitLength(ulong n

Re: Strange counter-performance in an alternative `decimalLength9` function

2020-02-27 Thread Basile B. via Digitalmars-d-learn
On Thursday, 27 February 2020 at 09:33:28 UTC, Dennis Cote wrote: On Wednesday, 26 February 2020 at 00:50:35 UTC, Basile B. wrote: So after reading the translation of RYU I was interested too see if the decimalLength() function can be written to be faster, as it cascades up to 8 CMP. Perhaps

Re: Strange counter-performance in an alternative `decimalLength9` function

2020-02-27 Thread Basile B. via Digitalmars-d-learn
On Thursday, 27 February 2020 at 09:41:20 UTC, Basile B. wrote: On Thursday, 27 February 2020 at 09:33:28 UTC, Dennis Cote wrote: [...] Sorry but no. I think that you have missed how this has changed since the first message. 1. the way it was tested initially was wrong because LLVM was optim

Re: DMD 2.090.1: SIGILL, Illegal instruction on (ahem) intel Pentium III

2020-02-27 Thread kdevel via Digitalmars-d-learn
On Thursday, 27 February 2020 at 07:44:57 UTC, Seb wrote: On Thursday, 27 February 2020 at 00:36:49 UTC, kdevel wrote: [...] Program received signal SIGILL, Illegal instruction. [...] Does this exception relate to [1] and shall I file a bug or do I have to decommission my PIII? [...]

Re: Where are the GSOC 2020 ideas?

2020-02-27 Thread JN via Digitalmars-d-learn
On Thursday, 27 February 2020 at 08:16:32 UTC, mark wrote: On https://wiki.dlang.org I can find GSOC ideas 2011-2019, but not 2020. I know the 2020 one's haven't been accepted, but I'd like to know what they are in case I feel like having a go at one as part of learning D. I don't know wher

can't run D app on VS 2019

2020-02-27 Thread Greatsam4aure via Digitalmars-d-learn
I have install Vs 2019 and install the C++ package together with Visual-D bundle with DMD and LDC. But by project refuse to run -- Build started: Project: DLangOne, Configuration: Debug Win32 -- Building Win32\Debug\DLangOne.exe... LINK : fatal error LNK1181: cannot open input file 'us

How to copy const object?

2020-02-27 Thread Mitacha via Digitalmars-d-learn
I've a const struct object and I'd like to make a mutable copy of it. Struct definition contains string and an array of structs. ``` struct A { string a; B[] b; } struct B { string a; string b; } ``` As far as I can tell copy constructor isn't generated for struct `A` because it

Re: How to copy const object?

2020-02-27 Thread Simen Kjærås via Digitalmars-d-learn
On Thursday, 27 February 2020 at 11:28:11 UTC, Mitacha wrote: I've a const struct object and I'd like to make a mutable copy of it. Struct definition contains string and an array of structs. ``` struct A { string a; B[] b; } struct B { string a; string b; } ``` As far as I can t

Re: Strange counter-performance in an alternative `decimalLength9` function

2020-02-27 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 26 February 2020 at 22:07:30 UTC, Johan wrote: On Wednesday, 26 February 2020 at 00:50:35 UTC, Basile B. wrote: [...] Hi Basile, I recently saw this presentation: https://www.youtube.com/watch?v=Czr5dBfs72U Andrei made a talk about this too a few years ago. It has some idea

How to sum multidimensional arrays?

2020-02-27 Thread p.shkadzko via Digitalmars-d-learn
I'd like to sum 2D arrays. Let's create 2 random 2D arrays and sum them. ``` import std.random : Xorshift, unpredictableSeed, uniform; import std.range : generate, take, chunks; import std.array : array; static T[][] rndMatrix(T)(T max, in int rows, in int cols) { Xorshift rnd; rnd.seed

Re: Strange counter-performance in an alternative `decimalLength9` function

2020-02-27 Thread Bruce Carneal via Digitalmars-d-learn
On Thursday, 27 February 2020 at 08:52:09 UTC, Basile B. wrote: On Thursday, 27 February 2020 at 04:44:56 UTC, Basile B. wrote: On Thursday, 27 February 2020 at 03:58:15 UTC, Bruce Carneal wrote: Maybe you talked about another implementation of decimalLength9 ? Yes. It's one I wrote after

Re: How to sum multidimensional arrays?

2020-02-27 Thread p.shkadzko via Digitalmars-d-learn
On Thursday, 27 February 2020 at 14:15:26 UTC, p.shkadzko wrote: This works but it does not look very efficient considering we flatten and then calling array twice. It will get even worse with 3D arrays. And yes, benchmarks show that summing 2D arrays like in the example above is significantl

Re: Strange counter-performance in an alternative `decimalLength9` function

2020-02-27 Thread Basile B. via Digitalmars-d-learn
On Thursday, 27 February 2020 at 14:12:35 UTC, Basile B. wrote: On Wednesday, 26 February 2020 at 22:07:30 UTC, Johan wrote: On Wednesday, 26 February 2020 at 00:50:35 UTC, Basile B. wrote: [...] Hi Basile, I recently saw this presentation: https://www.youtube.com/watch?v=Czr5dBfs72U And

Re: How to sum multidimensional arrays?

2020-02-27 Thread bachmeier via Digitalmars-d-learn
On Thursday, 27 February 2020 at 14:15:26 UTC, p.shkadzko wrote: [...] This works but it does not look very efficient considering we flatten and then calling array twice. It will get even worse with 3D arrays. Is there a better way without relying on mir.ndslice? Is there a reason you can't

Re: How to sum multidimensional arrays?

2020-02-27 Thread 9il via Digitalmars-d-learn
On Thursday, 27 February 2020 at 14:15:26 UTC, p.shkadzko wrote: Is there a better way without relying on mir.ndslice? ndslice Poker Face /+dub.sdl: dependency "mir-algorithm" version="~>3.7.17" dependency "mir-random" version="~>2.2.10" +/ import mir.ndslice; import mir.random: threadLocal; i

Re: How to sum multidimensional arrays?

2020-02-27 Thread jmh530 via Digitalmars-d-learn
On Thursday, 27 February 2020 at 15:28:01 UTC, p.shkadzko wrote: On Thursday, 27 February 2020 at 14:15:26 UTC, p.shkadzko wrote: This works but it does not look very efficient considering we flatten and then calling array twice. It will get even worse with 3D arrays. And yes, benchmarks show

Re: Strange counter-performance in an alternative `decimalLength9` function

2020-02-27 Thread Bruce Carneal via Digitalmars-d-learn
On Thursday, 27 February 2020 at 15:29:02 UTC, Bruce Carneal wrote: big snip TL;DR for the snipped: Unsurprisingly, different inputs will lead to different timing results. The equi-probable values supplied by a standard PRNG differ significantly from an equi-probable digit input. In particul

Re: How to sum multidimensional arrays?

2020-02-27 Thread 9il via Digitalmars-d-learn
On Thursday, 27 February 2020 at 16:31:49 UTC, jmh530 wrote: On Thursday, 27 February 2020 at 15:28:01 UTC, p.shkadzko wrote: On Thursday, 27 February 2020 at 14:15:26 UTC, p.shkadzko wrote: This works but it does not look very efficient considering we flatten and then calling array twice. It w

Re: How to sum multidimensional arrays?

2020-02-27 Thread Andrea Fontana via Digitalmars-d-learn
On Thursday, 27 February 2020 at 14:15:26 UTC, p.shkadzko wrote: void main() { int[][] m1 = rndMatrix(10, 2, 3); int[][] m2 = rndMatrix(10, 2, 3); auto c = m1[] + m2[]; } I think you're trying to do this: int[][] m1 = rndMatrix(10, 2, 3); int[][] m2 = rndMatrix(10, 2, 3); int[][]

Re: Strange counter-performance in an alternative `decimalLength9` function

2020-02-27 Thread Basile B. via Digitalmars-d-learn
On Thursday, 27 February 2020 at 15:29:02 UTC, Bruce Carneal wrote: On Thursday, 27 February 2020 at 08:52:09 UTC, Basile B. wrote: I will post my code if there is any meaningful difference in your subsequent results. give me something I can compile and verify. I'm not there to steal, if you

Re: Strange counter-performance in an alternative `decimalLength9` function

2020-02-27 Thread Bruce Carneal via Digitalmars-d-learn
On Thursday, 27 February 2020 at 17:11:48 UTC, Basile B. wrote: On Thursday, 27 February 2020 at 15:29:02 UTC, Bruce Carneal wrote: On Thursday, 27 February 2020 at 08:52:09 UTC, Basile B. wrote: I will post my code if there is any meaningful difference in your subsequent results. give me som

Re: can't run D app on VS 2019

2020-02-27 Thread Rainer Schuetze via Digitalmars-d-learn
On 27/02/2020 12:29, Greatsam4aure wrote: > I have install Vs 2019 and install the C++ package together with > Visual-D bundle with DMD and LDC. But by project refuse to run > > -- Build started: Project: DLangOne, Configuration: Debug Win32 -- > Building Win32\Debug\DLangOne.exe... > L

Re: DMD 2.090.1: SIGILL, Illegal instruction on (ahem) intel Pentium III

2020-02-27 Thread Rainer Schuetze via Digitalmars-d-learn
On 27/02/2020 11:30, kdevel wrote: > On Thursday, 27 February 2020 at 07:44:57 UTC, Seb wrote: >> On Thursday, 27 February 2020 at 00:36:49 UTC, kdevel wrote: > > [...] > >>> Program received signal SIGILL, Illegal instruction. > > [...] > >>> Does this exception relate to [1] and shall I fi

Re: How to sum multidimensional arrays?

2020-02-27 Thread jmh530 via Digitalmars-d-learn
On Thursday, 27 February 2020 at 16:39:15 UTC, 9il wrote: [snip] Few performances nitpick for your example to be fair with benchmarking againt the test: 1. Random (default) is slower then Xorfish. 2. double is twice larger then int and requires twice more memory, so it would be twice slower th

Re: DMD 2.090.1: SIGILL, Illegal instruction on (ahem) intel Pentium III

2020-02-27 Thread Johan via Digitalmars-d-learn
On Thursday, 27 February 2020 at 18:07:40 UTC, Rainer Schuetze wrote: On 27/02/2020 11:30, kdevel wrote: On Thursday, 27 February 2020 at 07:44:57 UTC, Seb wrote: On Thursday, 27 February 2020 at 00:36:49 UTC, kdevel wrote: [...] Program received signal SIGILL, Illegal instruction. [...

Re: Strange counter-performance in an alternative `decimalLength9` function

2020-02-27 Thread Basile B. via Digitalmars-d-learn
On Thursday, 27 February 2020 at 17:17:32 UTC, Bruce Carneal wrote: On Thursday, 27 February 2020 at 17:11:48 UTC, Basile B. wrote: On Thursday, 27 February 2020 at 15:29:02 UTC, Bruce Carneal wrote: On Thursday, 27 February 2020 at 08:52:09 UTC, Basile B. wrote: I will post my code if there is

Re: Strange counter-performance in an alternative `decimalLength9` function

2020-02-27 Thread Bruce Carneal via Digitalmars-d-learn
On Thursday, 27 February 2020 at 19:46:23 UTC, Basile B. wrote: Yes please, post the benchmark method. You see the benchmarks I run with your version are always slowest. I'm aware that rndGen (and generaly any uniform rnd func) is subject to a bias but I dont thing this bias maters much in the

Re: DMD 2.090.1: SIGILL, Illegal instruction on (ahem) intel Pentium III

2020-02-27 Thread kdevel via Digitalmars-d-learn
On Thursday, 27 February 2020 at 18:07:40 UTC, Rainer Schuetze wrote: "If this is an issue, please file a bug report." Issue 20621 - Since DMD 2.087.0: 32 Bit Linux now uses XMM registers: SIGILL, Illegal instruction on intel Pentium III

Re: How to sum multidimensional arrays?

2020-02-27 Thread p.shkadzko via Digitalmars-d-learn
On Thursday, 27 February 2020 at 16:31:07 UTC, 9il wrote: On Thursday, 27 February 2020 at 14:15:26 UTC, p.shkadzko wrote: Is there a better way without relying on mir.ndslice? ndslice Poker Face /+dub.sdl: dependency "mir-algorithm" version="~>3.7.17" dependency "mir-random" version="~>2.2.1

Re: How to sum multidimensional arrays?

2020-02-27 Thread p.shkadzko via Digitalmars-d-learn
On Thursday, 27 February 2020 at 15:48:53 UTC, bachmeier wrote: On Thursday, 27 February 2020 at 14:15:26 UTC, p.shkadzko wrote: [...] This works but it does not look very efficient considering we flatten and then calling array twice. It will get even worse with 3D arrays. Is there a better w

Re: How to sum multidimensional arrays?

2020-02-27 Thread 9il via Digitalmars-d-learn
On Thursday, 27 February 2020 at 23:15:28 UTC, p.shkadzko wrote: And it works effortlessly! Sum of two 5000 x 6000 int arrays is just 0.105 sec! (on a Windows machine though but with weaker CPU). I bet using mir.ndslice instead of D arrays would be even faster. Yes, the output for the follo

Call method if declared only

2020-02-27 Thread Виталий Фадеев via Digitalmars-d-learn
Searching solution for idea ! Goal is to get System message, dispatch/route to method ! If method implemented only ! I dream on in future write clean code of a derived widgets like this : class Base { // dispatch void On( message ... ) { // call On()

Re: Strange counter-performance in an alternative `decimalLength9` function

2020-02-27 Thread 9il via Digitalmars-d-learn
On Wednesday, 26 February 2020 at 00:50:35 UTC, Basile B. wrote: So after reading the translation of RYU I was interested too see if the decimalLength() function can be written to be faster, as it cascades up to 8 CMP. [...] bsr can be done in one/two CPU operation, quite quick. But core.bi