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

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

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

Which Docker to use?

2018-10-16 Thread Ky-Anh Huynh via Digitalmars-d-learn
Hi, I need to build some static binaries with LDC. I also need to execute builds on both platform 32-bit and 64-bit. From Docker Hub there are two image groups: * language/ldc (last update 5 months ago) * dlang2/ldc-ubuntu (updated recently) Which one do you suggest? Thanks a lot.

Re: longjmp [still] crashes on windows?

2018-10-16 Thread tipdbmp via Digitalmars-d-learn
SrMordred had already figured it (setjmp vs _setjmp(..., null)) out: https://forum.dlang.org/post/abrjmdvvlqdmmnpxc...@forum.dlang.org

[Issue 19309] New: [Reg 2.080.0] Unicode char reference in a comment causes warning

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19309 Issue ID: 19309 Summary: [Reg 2.080.0] Unicode char reference in a comment causes warning Product: D Version: D2 Hardware: x86_64 OS: Linux Status:

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* >

how to get UDA only for methods

2018-10-16 Thread test via Digitalmars-d-learn
I need get the Route UDA only for method without (static methods, property, constructor, destructor), dont know how to do it. Route[] getRoutes(T)(){ Route[] routes; foreach(int i, m; __traits(allMembers, T) ){ pragma(msg, m.stringof); static

Re: Why doesn't foreach support iterating?

2018-10-16 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 01:17:40 UTC, Chris Katko wrote: I finally noticed in the docs it says "for arrays only." The question is, why? foreach for user-defined types only allow arguments that match what the user defined. Ranges typically do not define this (since it generally

Why doesn't foreach support iterating?

2018-10-16 Thread Chris Katko via Digitalmars-d-learn
int [50]data; foreach(i, datum; data){} // works File file("gasdgasd"); foreach(i, line; file.byLine){} //NOPE. foreach(line; file.byLine){} //works. I finally noticed in the docs it says "for arrays only." The question is, why? Every language that I used previously (as far as I can

[Issue 19308] Optimize std.string.stripLeft

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19308 --- Comment #1 from Nathan S. --- Pull request: https://github.com/dlang/phobos/pull/6727 --

[Issue 19308] New: Optimize std.string.stripLeft

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19308 Issue ID: 19308 Summary: Optimize std.string.stripLeft Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1

Do D's std.signals check for already-connected slot and simply ignore the call?

2018-10-16 Thread Enjoys Math via Digitalmars-d-learn
If they don't, I have to wrap it like so: import std.signals; class Signal(T) { protected: mixin Signal!(T); }; class Changed(T) : Signal!T { protected: void delegate(T)[] slots; public: override void connect(void delegate(T) slot) { foreach (s; slots) { if (s == slot)

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

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

[Issue 18681] std.random.XorshiftEngine has opEquals but no toHash

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18681 Nathan S. changed: What|Removed |Added CC||n8sh.second...@hotmail.com --- Comment #1 from

[Issue 18680] std.random.LinearCongruentialEngine has opEquals but no toHash

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18680 Nathan S. changed: What|Removed |Added CC||n8sh.second...@hotmail.com --- Comment #1 from

Re: Dealing with ranges where front and popFront do the same logic / eager ranges

2018-10-16 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Oct 16, 2018 at 10:59:50PM +, Dennis via Digitalmars-d-learn wrote: > I've always been curious around the design choice of ranges to make > front and popFront separate functions, instead of having popFront > return the front. I suppose it is useful sometimes to be able to > access

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.

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

Dealing with ranges where front and popFront do the same logic / eager ranges

2018-10-16 Thread Dennis via Digitalmars-d-learn
I've always been curious around the design choice of ranges to make front and popFront separate functions, instead of having popFront return the front. I suppose it is useful sometimes to be able to access front multiple times without having to save it temporarily (can't think of a specific

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

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

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

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

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=1=2 - [2] https://github.com/probot/stale I've encountered

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

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: Is this a bug?

2018-10-16 Thread Márcio Martins via Digitalmars-d-learn
On Tuesday, 16 October 2018 at 13:09:34 UTC, Steven Schveighoffer wrote: On 10/15/18 4:36 PM, Márcio Martins wrote: [...] Hm... didn't realize that. It seems to me like an odd limitation, but I can see how it's ambiguous. The solution is to double-template: template incx(Args...) {

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

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

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=1=2 - [2] https://github.com/probot/stale

Re: Wed Oct 7 - Avoiding Code Smells by Walter Bright

2018-10-16 Thread Walter Bright via Digitalmars-d-announce
On 10/16/2018 1:50 AM, Dukc wrote: On Monday, 15 October 2018 at 21:23:13 UTC, Walter Bright wrote: I'm giving a presentation at: Is there a video about your talk "taking advantage of D in existing C codebases" at Code Europe? I recall that you were going to share it. They've still never

longjmp [still] crashes on windows?

2018-10-16 Thread tipdbmp via Digitalmars-d-learn
An old thread about the same problem: https://forum.dlang.org/thread/mmxwhdypncaeikknl...@forum.dlang.org struct jmp_buf { byte[256] data; } jmp_buf my_jmp_buf; extern(C) { int setjmp(ref jmp_buf env); void longjmp(ref jmp_buf env, int); } void second() { writefln("second");

Re: Wed Oct 7 - Avoiding Code Smells by Walter Bright

2018-10-16 Thread Walter Bright via Digitalmars-d-announce
On 10/16/2018 3:26 AM, Dennis wrote: Will it be streamed live? No. It will be recorded, and posted later.

[Issue 19205] [REG 2.081] Cannot call superclass ctor after end of switch statement

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19205 Stingertough changed: What|Removed |Added CC||stingerto...@gmx.com --

[Issue 14149] Bad std.algorithm error messages

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14149 Nathan S. changed: What|Removed |Added Status|REOPENED|RESOLVED CC|

[Issue 9998] RefCounted is impure

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9998 Nathan S. changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 7691] std.math.floor at compile-time too

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7691 Nathan S. changed: What|Removed |Added Status|NEW |RESOLVED CC|

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

[Issue 12540] Algebraic recursive alias declaration when a class contains an Algebraic member that can accept itself

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12540 Nathan S. changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 11319] std.range.zip should be nothrow

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11319 Nathan S. changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 11605] Cannot print const classes

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11605 Nathan S. changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 12404] Zip.back is wrong

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12404 Nathan S. changed: What|Removed |Added CC||n8sh.second...@hotmail.com --- Comment #5 from

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

[Issue 12358] Make BinaryHeap an input range

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12358 Nathan S. changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 12139] AA.update

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12139 Nathan S. changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 9792] length field of a const SortedRange

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9792 Nathan S. changed: What|Removed |Added CC||n8sh.second...@hotmail.com See Also|

[Issue 7521] Add const inference for templated method and delegate parameters

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7521 Nathan S. changed: What|Removed |Added See Also||https://issues.dlang.org/sh |

[Issue 11580] A unittest of std.stdio.rawRead cannot run and some unittests in std.stdio must run on Win64.

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11580 Nathan S. changed: What|Removed |Added Status|NEW |RESOLVED CC|

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

[Issue 11407] can't move struct with disabled default constructor

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11407 Nathan S. changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 9598] Cannot use moveFront on MapResult!(lambda, ByLine!(char, char))

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9598 Nathan S. changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 11185] Win64: std.stdio.tmpFile does not work

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11185 Nathan S. changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 10784] Cannot initialize Nullable std.typecons.Tuple!(float,"x",float,"y",float,"z")

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10784 Nathan S. changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 10239] Efficient bitcount for std.bitmanip.BitArray

2018-10-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10239 Nathan S. changed: What|Removed |Added Status|NEW |RESOLVED CC|

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

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

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.

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

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

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

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: Is there a way to use std.regex at compile-time?

2018-10-16 Thread drug via Digitalmars-d-learn
16.10.2018 17:47, cosinus пишет: On Tuesday, 16 October 2018 at 14:42:32 UTC, cosinus wrote: Is there a way to use std.regex at compile-time? I would like to `mixin()` the result of this function: ```D string generateVertexStruct() {     auto reVertex =

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.

Re: Is there a way to use std.regex at compile-time?

2018-10-16 Thread Stefam Koch via Digitalmars-d-learn
On Tuesday, 16 October 2018 at 14:47:19 UTC, cosinus wrote: On Tuesday, 16 October 2018 at 14:42:32 UTC, cosinus wrote: Is there a way to use std.regex at compile-time? I would like to `mixin()` the result of this function: ```D string generateVertexStruct() { auto reVertex =

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

Re: Reading binary streams with decoding to Unicode

2018-10-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/16/18 11:42 AM, Vinay Sajip wrote: On Monday, 15 October 2018 at 22:49:31 UTC, Nicholas Wilson wrote: Oh, sorry I missed that. Take a look at https://github.com/schveiguy/iopipe Great, thanks. Let me know if anything doesn't work there. The text processing is pretty robust, but

Re: Reading binary streams with decoding to Unicode

2018-10-16 Thread Vinay Sajip via Digitalmars-d-learn
On Monday, 15 October 2018 at 22:49:31 UTC, Nicholas Wilson wrote: Oh, sorry I missed that. Take a look at https://github.com/schveiguy/iopipe Great, thanks.

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

Re: Is there a way to use std.regex at compile-time?

2018-10-16 Thread cosinus via Digitalmars-d-learn
On Tuesday, 16 October 2018 at 14:42:32 UTC, cosinus wrote: Is there a way to use std.regex at compile-time? I would like to `mixin()` the result of this function: ```D string generateVertexStruct() { auto reVertex = ctRegex!(`in\s+(?P\w+)\s+(?P\w+)\s*;`); const vertexStruct =

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

Is there a way to use std.regex at compile-time?

2018-10-16 Thread cosinus via Digitalmars-d-learn
Is there a way to use std.regex at compile-time?

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

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

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

Re: Is this a bug?

2018-10-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/15/18 4:36 PM, Márcio Martins wrote: On Monday, 15 October 2018 at 16:46:34 UTC, Steven Schveighoffer wrote: On 10/15/18 12:40 PM, Márcio Martins wrote: import std.stdio; void incx(T, Args...)(ref T t) { ++t.x; } static struct Test(T) { T x; } void main() { Test!uint t;

Re: When does GC run?

2018-10-16 Thread Stanislav Blinov via Digitalmars-d-learn
On Tuesday, 16 October 2018 at 09:38:44 UTC, John Burton wrote: The information I have found indicates that it runs to free memory when the system runs out of memory to allocate. No, that is incorrect. By default, here's what's happening: 1) At startup (or first 'new' or GC.malloc) the GC

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

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

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

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

Re: is there something like `stm32-rs` in D?

2018-10-16 Thread wiffel via Digitalmars-d-learn
On Wednesday, 26 September 2018 at 08:51:11 UTC, Radu wrote: On Wednesday, 26 September 2018 at 05:55:49 UTC, dangbinghoo wrote: On Wednesday, 26 September 2018 at 05:24:08 UTC, Radu wrote: On Wednesday, 26 September 2018 at 03:46:21 UTC, dangbinghoo wrote: hi,

Re: ref tidy way to defreference or is something else going on ?

2018-10-16 Thread rikki cattermole via Digitalmars-d-learn
On 16/10/2018 11:36 PM, Codifies wrote: I've a bunch of 4x4 matrix routines in C, in order to avoid copying around multiple 4x4 matrices I pass pointers... I'm assuming that in D it would make sense to use ref ? what's going on behind the scenes with ref is it just a nice way of passing

ref tidy way to defreference or is something else going on ?

2018-10-16 Thread Codifies via Digitalmars-d-learn
I've a bunch of 4x4 matrix routines in C, in order to avoid copying around multiple 4x4 matrices I pass pointers... I'm assuming that in D it would make sense to use ref ? what's going on behind the scenes with ref is it just a nice way of passing pointers with automagical dereferencing or is

Re: Wed Oct 7 - Avoiding Code Smells by Walter Bright

2018-10-16 Thread Dennis via Digitalmars-d-announce
On Monday, 15 October 2018 at 21:23:13 UTC, Walter Bright wrote: I'm giving a presentation at: http://nwcpp.org/ See you there! Will it be streamed live?

Re: Access violation connecting a signal / slot

2018-10-16 Thread Enjoys Math via Digitalmars-d-learn
Solved: I forgot to initialize some member variable along the way, which is a class so needed to be new'd. Thanks.

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

Re: When does GC run?

2018-10-16 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 16 October 2018 at 09:38:44 UTC, John Burton wrote: Is there any documentation or information about the specifics of the garbage collector? The information I have found indicates that it runs to free memory when the system runs out of memory to allocate. But will this try to use

Re: When does GC run?

2018-10-16 Thread rikki cattermole via Digitalmars-d-learn
On 16/10/2018 10:38 PM, John Burton wrote: Is there any documentation or information about the specifics of the garbage collector? The information I have found indicates that it runs to free memory when the system runs out of memory to allocate. But will this try to use all the system memory

When does GC run?

2018-10-16 Thread John Burton via Digitalmars-d-learn
Is there any documentation or information about the specifics of the garbage collector? The information I have found indicates that it runs to free memory when the system runs out of memory to allocate. But will this try to use all the system memory or some other amount before trying to

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: Is there an efficient byte buffer queue?

2018-10-16 Thread John Burton via Digitalmars-d-learn
On Sunday, 14 October 2018 at 13:07:30 UTC, Heromyth wrote: On Monday, 8 October 2018 at 09:39:55 UTC, John Burton wrote: My use case is sending data to a socket. We have ported some containers from JAVA. ByteBuffer is a basic container interface and widely used in JAVA. See also:

  1   2   >