Re: shared - i need it to be useful

2018-10-16 Thread Walter Bright via Digitalmars-d
On 10/15/2018 11:46 AM, Manu wrote: [...] Shared has one incredibly valuable feature - it allows you, the programmer, to identify data that can be accessed by multiple threads. There are so many ways that data can be shared, the only way to comprehend what is going on is to build a wall arou

Re: shared - i need it to be useful

2018-10-16 Thread Isaac S. via Digitalmars-d
On Wednesday, 17 October 2018 at 03:50:44 UTC, Manu wrote: On Tue, Oct 16, 2018 at 8:20 PM Isaac S. via Digitalmars-d wrote: *snip* Overloading for shared and unshared is my reason for not allowing implicit conversion on my types (I have no problems with implicit conversion being optional or

Re: shared - i need it to be useful

2018-10-16 Thread Manu via Digitalmars-d
On Tue, Oct 16, 2018 at 8:20 PM Isaac S. via Digitalmars-d wrote: > > On Tuesday, 16 October 2018 at 06:21:22 UTC, Manu wrote: > > On Mon, Oct 15, 2018 at 8:55 PM Isaac S. via Digitalmars-d > > wrote: > >> > >> On Tuesday, 16 October 2018 at 02:26:04 UTC, Manu wrote: > >> >> I understand your poi

Re: shared - i need it to be useful

2018-10-16 Thread Isaac S. via Digitalmars-d
On Tuesday, 16 October 2018 at 06:21:22 UTC, Manu wrote: On Mon, Oct 15, 2018 at 8:55 PM Isaac S. via Digitalmars-d wrote: On Tuesday, 16 October 2018 at 02:26:04 UTC, Manu wrote: >> I understand your point but I think the current shared (no >> implicit conversion) has its uses. >> *snip* >

Re: shared - i need it to be useful

2018-10-16 Thread Nicholas Wilson via Digitalmars-d
On Wednesday, 17 October 2018 at 00:29:04 UTC, Manu wrote: On Tue, Oct 16, 2018 at 3:25 PM Nicholas Wilson via Digitalmars-d wrote: On Tuesday, 16 October 2018 at 21:19:26 UTC, Steven Schveighoffer wrote: > There is in fact, no difference between: > > int *p; > shared int *p2 = p; > int *p3

Re: shared - i need it to be useful

2018-10-16 Thread Manu via Digitalmars-d
On Tue, Oct 16, 2018 at 3:25 PM Nicholas Wilson via Digitalmars-d wrote: > > On Tuesday, 16 October 2018 at 21:19:26 UTC, Steven Schveighoffer > wrote: > > There is in fact, no difference between: > > > > int *p; > > shared int *p2 = p; > > int *p3 = cast(int*)p2; > > > > and this: > > > > int *p;

Re: shared - i need it to be useful

2018-10-16 Thread Manu via Digitalmars-d
On Tue, Oct 16, 2018 at 2:20 PM Steven Schveighoffer via Digitalmars-d wrote: > > On 10/16/18 4:26 PM, Manu wrote: > > On Tue, Oct 16, 2018 at 11:30 AM Steven Schveighoffer via > > Digitalmars-d wrote: > >> > >> On 10/16/18 2:10 PM, Manu wrote: > >>> On Tue, Oct 16, 2018 at 6:35 AM Steven Schveig

Re: No D bindings in Atom editor

2018-10-16 Thread Jabari Zakiya via Digitalmars-d
On Tuesday, 16 October 2018 at 22:59:18 UTC, Soulsbane wrote: On Tuesday, 16 October 2018 at 02:34:47 UTC, Jabari Zakiya wrote: Just updated Atom editor and noticed D files read as plain .txt and no D bindings in list of programs. Maybe someone should bring that to Atom's devs attention. Inte

Re: automatically closing stale pull requests

2018-10-16 Thread tide via Digitalmars-d
On Tuesday, 16 October 2018 at 22:18:13 UTC, Walter Bright wrote: On 10/16/2018 1:16 PM, notna wrote: [...] We're not going to automatically close stale pull requests, nor are we going to arbitrarily close old unfixed bug reports. Agreed, then there won't be those 5+ year old reports we can

Re: No D bindings in Atom editor

2018-10-16 Thread Soulsbane via Digitalmars-d
On Tuesday, 16 October 2018 at 02:34:47 UTC, Jabari Zakiya wrote: Just updated Atom editor and noticed D files read as plain .txt and no D bindings in list of programs. Maybe someone should bring that to Atom's devs attention. Interesting, since my main editor, KDE's Kate, does have D file sy

Re: shared - i need it to be useful

2018-10-16 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 16 October 2018 at 21:19:26 UTC, Steven Schveighoffer wrote: There is in fact, no difference between: int *p; shared int *p2 = p; int *p3 = cast(int*)p2; and this: int *p; shared int *p2 = p; int *p3 = p; If I understand Manu correctly the first should compile, and the second sh

Re: shared - i need it to be useful

2018-10-16 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 16 October 2018 at 21:19:26 UTC, Steven Schveighoffer wrote: OK, so here is where I think I misunderstood your point. When you said a lock-free queue would be unusable if it wasn't shared, I thought you meant it would be unusable if we didn't allow the implicit cast. But I realize n

Re: automatically closing stale pull requests

2018-10-16 Thread Walter Bright via Digitalmars-d
On 10/16/2018 1:16 PM, notna wrote: [...] We're not going to automatically close stale pull requests, nor are we going to arbitrarily close old unfixed bug reports.

Re: A Friendly Challenge for D

2018-10-16 Thread Jabari Zakiya via Digitalmars-d
On Tuesday, 16 October 2018 at 21:12:39 UTC, welkam wrote: On Tuesday, 16 October 2018 at 20:58:54 UTC, Jabari Zakiya wrote: And they could be modded to catch semantics like this and produce faster code. Its hard to prove that you will only write 1 or 0 in the array and even if you write such

Re: automatically closing stale pull requests

2018-10-16 Thread H. S. Teoh via Digitalmars-d
On Tue, Oct 16, 2018 at 05:10:38PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d wrote: > On 10/16/18 4:16 PM, notna wrote: > > another interesting discussion [1]... and old/stale pull requests > > are also discussed here now and then... not sure if this [2] is > > known to many ppl?! > > >

Re: shared - i need it to be useful

2018-10-16 Thread Steven Schveighoffer via Digitalmars-d
On 10/16/18 4:26 PM, Manu wrote: On Tue, Oct 16, 2018 at 11:30 AM Steven Schveighoffer via Digitalmars-d wrote: On 10/16/18 2:10 PM, Manu wrote: On Tue, Oct 16, 2018 at 6:35 AM Steven Schveighoffer via Digitalmars-d wrote: On 10/16/18 9:25 AM, Steven Schveighoffer wrote: On 10/15/18 2:46

Re: A Friendly Challenge for D

2018-10-16 Thread welkam via Digitalmars-d
On Tuesday, 16 October 2018 at 20:58:54 UTC, Jabari Zakiya wrote: And they could be modded to catch semantics like this and produce faster code. Its hard to prove that you will only write 1 or 0 in the array and even if you write such pass it wont fire very often. So slower compile times for

Re: automatically closing stale pull requests

2018-10-16 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 10/16/18 4:16 PM, notna wrote: another interesting discussion [1]... and old/stale pull requests are also discussed here now and then... not sure if this [2] is known to many ppl?! - [1] https://marc.info/?t=15392665871&r=1&w=2 - [2] https://github.com/probot/stale I've encountered st

Re: No D bindings in Atom editor

2018-10-16 Thread welkam via Digitalmars-d
On Tuesday, 16 October 2018 at 17:48:42 UTC, Jabari Zakiya wrote: On Tuesday, 16 October 2018 at 02:34:47 UTC, Jabari Zakiya wrote: Just updated Atom editor and noticed D files read as plain .txt and no D bindings in list of programs. Maybe someone should bring that to Atom's devs attention.

Re: A Friendly Challenge for D

2018-10-16 Thread Jabari Zakiya via Digitalmars-d
On Tuesday, 16 October 2018 at 20:38:24 UTC, welkam wrote: On Tuesday, 16 October 2018 at 17:57:23 UTC, Jabari Zakiya wrote: This is the exact same behavior I found with the Nim compiler too. Well Nim compiler is more like translator. It translates Nim code to c or c++. Since gcc was responsi

Re: A Friendly Challenge for D

2018-10-16 Thread welkam via Digitalmars-d
On Tuesday, 16 October 2018 at 17:57:23 UTC, Jabari Zakiya wrote: This is the exact same behavior I found with the Nim compiler too. Well Nim compiler is more like translator. It translates Nim code to c or c++. Since gcc was responsible for optimizations and instruction selection it would be

Re: shared - i need it to be useful

2018-10-16 Thread Manu via Digitalmars-d
On Tue, Oct 16, 2018 at 11:30 AM Steven Schveighoffer via Digitalmars-d wrote: > > On 10/16/18 2:10 PM, Manu wrote: > > On Tue, Oct 16, 2018 at 6:35 AM Steven Schveighoffer via Digitalmars-d > > wrote: > >> > >> On 10/16/18 9:25 AM, Steven Schveighoffer wrote: > >>> On 10/15/18 2:46 PM, Manu wrot

automatically closing stale pull requests

2018-10-16 Thread notna via Digitalmars-d
another interesting discussion [1]... and old/stale pull requests are also discussed here now and then... not sure if this [2] is known to many ppl?! - [1] https://marc.info/?t=15392665871&r=1&w=2 - [2] https://github.com/probot/stale

Re: My statements related to terminating my SAoC relationship

2018-10-16 Thread Abdulhaq via Digitalmars-d
On Monday, 15 October 2018 at 21:26:52 UTC, solidstate1991 wrote: I have done two mistakes: I underestimated the scope of the project and overestimated my capabilities. This caused a chain reaction, which in turn made the first milestone unreachable. You've done the right thing by facing the s

Re: A Friendly Challenge for D

2018-10-16 Thread Jabari Zakiya via Digitalmars-d
On Tuesday, 16 October 2018 at 07:09:05 UTC, Vijay Nayar wrote: On Monday, 15 October 2018 at 22:17:57 UTC, Jabari Zakiya wrote: $ dub build --compiler=ldc2 -b=release && echo "30" | ./twinprimes Enter integer number: threads = 8 each thread segment is [1 x 65536] bytes array twinprime

Re: shared - i need it to be useful

2018-10-16 Thread Steven Schveighoffer via Digitalmars-d
On 10/16/18 2:10 PM, Manu wrote: On Tue, Oct 16, 2018 at 6:35 AM Steven Schveighoffer via Digitalmars-d wrote: On 10/16/18 9:25 AM, Steven Schveighoffer wrote: On 10/15/18 2:46 PM, Manu wrote: From there, it opens up another critical opportunity; T* -> shared(T)* promotion. Const would b

Re: shared - i need it to be useful

2018-10-16 Thread Manu via Digitalmars-d
On Tue, Oct 16, 2018 at 6:35 AM Steven Schveighoffer via Digitalmars-d wrote: > > On 10/16/18 9:25 AM, Steven Schveighoffer wrote: > > On 10/15/18 2:46 PM, Manu wrote: > > >>> From there, it opens up another critical opportunity; T* -> shared(T)* > >> promotion. > >> Const would be useless without

Re: shared - i need it to be useful

2018-10-16 Thread Manu via Digitalmars-d
On Tue, Oct 16, 2018 at 6:25 AM Timon Gehr via Digitalmars-d wrote: > > On 16.10.2018 13:04, Dominikus Dittes Scherkl wrote: > > On Tuesday, 16 October 2018 at 10:15:51 UTC, Timon Gehr wrote: > >> On 15.10.2018 20:46, Manu wrote: > >>> > >>> Assuming the rules above: "can't read or write to member

Re: A Friendly Challenge for D

2018-10-16 Thread Jabari Zakiya via Digitalmars-d
On Tuesday, 16 October 2018 at 16:57:12 UTC, welkam wrote: So I run profiler and 97% of time is spent in void twinsSieve function and hotspots are seg[k] = seg[k] | 1; lines. Since seg[k] can only be 1 or 0 I removed that or operation. And the results are. Queue the drum-roll... 5% slower. I

Re: No D bindings in Atom editor

2018-10-16 Thread Jabari Zakiya via Digitalmars-d
On Tuesday, 16 October 2018 at 02:34:47 UTC, Jabari Zakiya wrote: Just updated Atom editor and noticed D files read as plain .txt and no D bindings in list of programs. Maybe someone should bring that to Atom's devs attention. Interesting, since my main editor, KDE's Kate, does have D file sy

Re: A Friendly Challenge for D

2018-10-16 Thread Jon Degenhardt via Digitalmars-d
On Tuesday, 16 October 2018 at 07:09:05 UTC, Vijay Nayar wrote: D has multiple compilers, but for the speed of the finished binary, LDC2 is generally recommended. I used version 1.11.0. https://github.com/ldc-developers/ldc/releases/tag/v1.11.0 I was using DUB to manage the project, but to b

Re: shared - i need it to be useful

2018-10-16 Thread Manu via Digitalmars-d
On Tue, Oct 16, 2018 at 3:20 AM Timon Gehr via Digitalmars-d wrote: > > On 15.10.2018 20:46, Manu wrote: > > > > Assuming the rules above: "can't read or write to members", and the > > understanding that `shared` methods are expected to have threadsafe > > implementations (because that's the whole

Re: shared - i need it to be useful

2018-10-16 Thread Manu via Digitalmars-d
On Tue, Oct 16, 2018 at 2:25 AM Kagamin via Digitalmars-d wrote: > > On Monday, 15 October 2018 at 18:46:45 UTC, Manu wrote: > > Current situation where you can arbitrarily access shared > > members > > undermines any value it has. > > The value of shared is existence of thread-local data that's >

Re: A Friendly Challenge for D

2018-10-16 Thread welkam via Digitalmars-d
So I run profiler and 97% of time is spent in void twinsSieve function and hotspots are seg[k] = seg[k] | 1; lines. Since seg[k] can only be 1 or 0 I removed that or operation. And the results are. Queue the drum-roll... 5% slower. I thought that all of my studying was getting somewhere. That

Re: Norwich 2018-11-07

2018-10-16 Thread Gerald via Digitalmars-d
On Tuesday, 16 October 2018 at 03:42:13 UTC, Russel Winder wrote: Hi, I am doing a presentation looking at DVB, GTK+, GStreamer, C, C++, gtkmm, D, GtkD, GStreamerD, Rust, gtk-rs, and gstreamer-rs in Norwich 2018-11-07. Anyone who wants to come and heckle about ditching D and switching to Rust

Re: My statements related to terminating my SAoC relationship

2018-10-16 Thread Nemanja Boric via Digitalmars-d
On Monday, 15 October 2018 at 21:26:52 UTC, solidstate1991 wrote: I try to resume my work on improving mago, but on a much smaller scale and lower priority since I have to spend time finding a job, which is a very hard thing in this fascist country called Hungary, while also not supporting sa

Re: You don't like GC? Do you?

2018-10-16 Thread Stanislav Blinov via Digitalmars-d
On Tuesday, 16 October 2018 at 11:42:55 UTC, Tony wrote: On Monday, 15 October 2018 at 08:21:11 UTC, Eugene Wissner He doesn't argue against garbage collection. Thanks, Eugene, I was starting to lose hope in humanity. Well, can you state what he does argue against? I did state what I was

Re: My statements related to terminating my SAoC relationship

2018-10-16 Thread Guillaume Piolat via Digitalmars-d
On Monday, 15 October 2018 at 21:26:52 UTC, solidstate1991 wrote: I have done two mistakes: I underestimated the scope of the project and overestimated my capabilities. This caused a chain reaction, which in turn made the first milestone unreachable. Hello, Just to say you seem like a nice

Re: shared - i need it to be useful

2018-10-16 Thread Steven Schveighoffer via Digitalmars-d
On 10/16/18 9:25 AM, Steven Schveighoffer wrote: On 10/15/18 2:46 PM, Manu wrote: From there, it opens up another critical opportunity; T* -> shared(T)* promotion. Const would be useless without T* -> const(T)* promotion. Shared suffers a similar problem. If you write a lock-free queue for in

Re: shared - i need it to be useful

2018-10-16 Thread Steven Schveighoffer via Digitalmars-d
On 10/15/18 2:46 PM, Manu wrote: Okay, so I've been thinking on this for a while... I think I have a pretty good feel for how shared is meant to be. 1. shared should behave exactly like const, except in addition to inhibiting write access, it also inhibits read access. I think this is the found

Re: shared - i need it to be useful

2018-10-16 Thread Timon Gehr via Digitalmars-d
On 16.10.2018 13:04, Dominikus Dittes Scherkl wrote: On Tuesday, 16 October 2018 at 10:15:51 UTC, Timon Gehr wrote: On 15.10.2018 20:46, Manu wrote: Assuming the rules above: "can't read or write to members", and the understanding that `shared` methods are expected to have threadsafe implement

Re: shared - i need it to be useful

2018-10-16 Thread Stanislav Blinov via Digitalmars-d
On Tuesday, 16 October 2018 at 03:00:21 UTC, Manu wrote: I don't see how an *implicit* cast can be a restriction. At all. Because a shared pointer can't access anything. You can't do anything with a shared instance, so the can be no harm done. That just doesn't compute. You obviously *can*

Re: Passing $ as a function argument

2018-10-16 Thread Simen Kjærås via Digitalmars-d
On Sunday, 14 October 2018 at 15:27:07 UTC, Michael Coulombe wrote: On Sunday, 14 October 2018 at 14:35:36 UTC, lngns wrote: On Sunday, 14 October 2018 at 13:18:37 UTC, lngns wrote: That would require introducing a new type Or just use int with a negative number... That's how it's done in so

Re: You don't like GC? Do you?

2018-10-16 Thread Tony via Digitalmars-d
On Monday, 15 October 2018 at 08:21:11 UTC, Eugene Wissner wrote: On Monday, 15 October 2018 at 05:26:56 UTC, Tony wrote: Ideally you wouldn’t have chosen to even try D. You (and others who spend so much time arguing against garbage collection on a forum for a language designed with garbage

Re: shared - i need it to be useful

2018-10-16 Thread Dominikus Dittes Scherkl via Digitalmars-d
On Tuesday, 16 October 2018 at 10:15:51 UTC, Timon Gehr wrote: On 15.10.2018 20:46, Manu wrote: Assuming the rules above: "can't read or write to members", and the understanding that `shared` methods are expected to have threadsafe implementations (because that's the whole point), what are th

Re: shared - i need it to be useful

2018-10-16 Thread Timon Gehr via Digitalmars-d
On 15.10.2018 20:46, Manu wrote: Assuming the rules above: "can't read or write to members", and the understanding that `shared` methods are expected to have threadsafe implementations (because that's the whole point), what are the risks from allowing T* -> shared(T)* conversion? Unshared bec

Re: Question about D hirearchy and include directory

2018-10-16 Thread bioinfornatics via Digitalmars-d
On Sunday, 14 October 2018 at 12:14:06 UTC, bioinfornatics wrote: Dear, Some projects seem to have an extra directory for their include directory, such as: - stdx-allocator - containers - msgpack - dparse ... [...] up

Re: shared - i need it to be useful

2018-10-16 Thread Kagamin via Digitalmars-d
On Monday, 15 October 2018 at 18:46:45 UTC, Manu wrote: Current situation where you can arbitrarily access shared members undermines any value it has. The value of shared is existence of thread-local data that's guaranteed to be not shared, so you don't need to worry about thread-local data

Re: shared - i need it to be useful

2018-10-16 Thread Jacob Carlborg via Digitalmars-d
On 2018-10-15 20:46, Manu wrote: 1. traditional; assert that the object become thread-local by acquiring a lock, cast shared away Instead of having to explicitly cast away shared we could leverage the synchronized statement. It could be enhanced to allow the following: shared int a; Mutex m

Re: A Friendly Challenge for D

2018-10-16 Thread Vijay Nayar via Digitalmars-d
On Monday, 15 October 2018 at 22:17:57 UTC, Jabari Zakiya wrote: $ dub build --compiler=ldc2 -b=release && echo "30" | ./twinprimes Enter integer number: threads = 8 each thread segment is [1 x 65536] bytes array twinprime candidates = 175324676; resgroups = 1298702 each 135 threads has