Re: Garbage Collection in D

2018-04-02 Thread Kagamin via Digitalmars-d
AFAIK, precise GC was tried not long ago, but was only a little slower or something like that.

Re: Why toUTF8 not accept wchar[] as argument?

2018-04-02 Thread Seb via Digitalmars-d-learn
On Tuesday, 3 April 2018 at 02:46:51 UTC, Domain wrote: On Tuesday, 3 April 2018 at 02:31:15 UTC, Uknown wrote: On Tuesday, 3 April 2018 at 02:24:08 UTC, Domain wrote: wchar[10] buffer; toUTF8(buffer); Error: template `std.utf.toUTF8` cannot deduce function from argument types

Re: [OT] Unity migrating parts of their engine from C++ into High Performace C# (HPC#)

2018-04-02 Thread rikki cattermole via Digitalmars-d
On 03/04/2018 11:01 AM, Meta wrote: On Monday, 2 April 2018 at 22:55:58 UTC, Meta wrote: On Monday, 2 April 2018 at 20:19:17 UTC, rumbu wrote: On Monday, 2 April 2018 at 18:54:28 UTC, 12345swordy wrote: - Only structs are used, no classes; - .NET collections are replaced by native

[Issue 18711] New: Suggest to slice a static array when the called function would accept it

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18711 Issue ID: 18711 Summary: Suggest to slice a static array when the called function would accept it Product: D Version: D2 Hardware: All OS: All

Re: Deprecating this(this)

2018-04-02 Thread Jonathan M Davis via Digitalmars-d
On Monday, April 02, 2018 20:47:31 Marco Leise via Digitalmars-d wrote: > Am Mon, 2 Apr 2018 11:57:55 -0400 > > schrieb Andrei Alexandrescu : > > Problem is we don't have head-mutable in the language. Yes, for built-in > > slices the mechanism is simple - just change

Re: Why toUTF8 not accept wchar[] as argument?

2018-04-02 Thread bauss via Digitalmars-d-learn
On Tuesday, 3 April 2018 at 02:46:51 UTC, Domain wrote: On Tuesday, 3 April 2018 at 02:31:15 UTC, Uknown wrote: On Tuesday, 3 April 2018 at 02:24:08 UTC, Domain wrote: wchar[10] buffer; toUTF8(buffer); Error: template `std.utf.toUTF8` cannot deduce function from argument types

Re: [OT] Unity migrating parts of their engine from C++ into High Performace C# (HPC#)

2018-04-02 Thread rumbu via Digitalmars-d
On Monday, 2 April 2018 at 22:55:58 UTC, Meta wrote: On Monday, 2 April 2018 at 20:19:17 UTC, rumbu wrote: void foo(IRange someRange) { //do something with someRange even it's a struct //this includes code completion and other IDE specific stuff. } In D, template constrains are not

[Issue 18710] executable file not generated when -o- is used

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18710 Seb changed: What|Removed |Added CC||greensunn...@gmail.com ---

Re: Why toUTF8 not accept wchar[] as argument?

2018-04-02 Thread Domain via Digitalmars-d-learn
On Tuesday, 3 April 2018 at 02:31:15 UTC, Uknown wrote: On Tuesday, 3 April 2018 at 02:24:08 UTC, Domain wrote: wchar[10] buffer; toUTF8(buffer); Error: template `std.utf.toUTF8` cannot deduce function from argument types `!()(wchar[10])`, candidates are:

[Issue 12511] static overloaded function is not accessible

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12511 Domain changed: What|Removed |Added Status|RESOLVED|REOPENED

Re: Why toUTF8 not accept wchar[] as argument?

2018-04-02 Thread Uknown via Digitalmars-d-learn
On Tuesday, 3 April 2018 at 02:31:15 UTC, Uknown wrote: On Tuesday, 3 April 2018 at 02:24:08 UTC, Domain wrote: wchar[10] buffer; toUTF8(buffer); Error: template `std.utf.toUTF8` cannot deduce function from argument types `!()(wchar[10])`, candidates are:

Re: Why toUTF8 not accept wchar[] as argument?

2018-04-02 Thread Uknown via Digitalmars-d-learn
On Tuesday, 3 April 2018 at 02:24:08 UTC, Domain wrote: wchar[10] buffer; toUTF8(buffer); Error: template `std.utf.toUTF8` cannot deduce function from argument types `!()(wchar[10])`, candidates are: /dlang/dmd/linux/bin64/../../src/phobos/std/utf.d(2713): `std.utf.toUTF8(S)(S s) if

Why toUTF8 not accept wchar[] as argument?

2018-04-02 Thread Domain via Digitalmars-d-learn
wchar[10] buffer; toUTF8(buffer); Error: template `std.utf.toUTF8` cannot deduce function from argument types `!()(wchar[10])`, candidates are: /dlang/dmd/linux/bin64/../../src/phobos/std/utf.d(2713): `std.utf.toUTF8(S)(S s) if (isInputRange!S && !isInfinite!S &&

Re: What is the equivalent of C++'s std::optional and std::nullopt in D?

2018-04-02 Thread Uknown via Digitalmars-d-learn
On Tuesday, 3 April 2018 at 02:10:09 UTC, helxi wrote: For reference: https://en.cppreference.com/w/cpp/utility/optional Nullable!T would be the closest thing: https://dlang.org/phobos/std_typecons.html#Nullable I'm not sure how comparable they are though.

What is the equivalent of C++'s std::optional and std::nullopt in D?

2018-04-02 Thread helxi via Digitalmars-d-learn
For reference: https://en.cppreference.com/w/cpp/utility/optional

Re: Reactive data

2018-04-02 Thread crimaniak via Digitalmars-d-learn
On Saturday, 31 March 2018 at 16:08:36 UTC, lempiji wrote: --- import rx; auto firstWord = new BehaviorSubject!string("Change"); auto secondWord = new BehaviorSubject!string("me!"); auto bothWords = new BehaviorSubject!string(""); combineLatest!((a, b) => a ~ " " ~ b)(firstWord,

[Issue 17626] Same name variable assignment should raise a compile-time warning

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17626 Seb changed: What|Removed |Added Keywords||pull CC|

[Issue 12116] dmd -op -od broken

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12116 Mike Franklin changed: What|Removed |Added See Also|

[Issue 18710] executable file not generated when -o- is used

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18710 Mike Franklin changed: What|Removed |Added See Also|

[Issue 18710] New: executable file not generated when -o- is used

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18710 Issue ID: 18710 Summary: executable file not generated when -o- is used Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal

Re: Release: nanovega.d rendering lib like html5 canvas

2018-04-02 Thread Andrew Edwards via Digitalmars-d-announce
On Monday, 2 April 2018 at 07:55:26 UTC, drug wrote: 09.03.2018 18:38, Adam D. Ruppe пишет: Now also on dub: http://code.dlang.org/packages/arsd-official%3Ananovega Hasn't somebody started porting nanogui (https://github.com/wjakob/nanogui)? I'd like to do it, but don't want to duplicate

Re: Vtable for virtual functions in D

2018-04-02 Thread Laeeth Isharc via Digitalmars-d
On Wednesday, 7 March 2018 at 21:14:12 UTC, Henrik wrote: Many important libraries like ICU have C interfaces even when written in C++. The direct support of C headers would be very convenient in migrating parts of C/C++ projects to D. It would also open up POSIX which is used extensively

Re: [OT] Unity migrating parts of their engine from C++ into High Performace C# (HPC#)

2018-04-02 Thread Laeeth Isharc via Digitalmars-d
On Monday, 2 April 2018 at 20:19:17 UTC, rumbu wrote: On Monday, 2 April 2018 at 18:54:28 UTC, 12345swordy wrote: - Only structs are used, no classes; - .NET collections are replaced by native collections that manage their own memory - No code that would trigger GC is allowed - Compiler is

Re: [OT] Unity migrating parts of their engine from C++ into High Performace C# (HPC#)

2018-04-02 Thread Laeeth Isharc via Digitalmars-d
On Tuesday, 3 April 2018 at 01:31:12 UTC, Laeeth Isharc wrote: On Monday, 2 April 2018 at 20:19:17 UTC, rumbu wrote: On Monday, 2 April 2018 at 18:54:28 UTC, 12345swordy wrote: - Only structs are used, no classes; - .NET collections are replaced by native collections that manage their own

[Issue 18708] Flow analysis in constructors not done correctly for if, ||, &

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18708 --- Comment #1 from Walter Bright --- https://github.com/dlang/dmd/pull/8118 --

Re: Invading^W The Sydney C++ Meetup

2018-04-02 Thread finalpatch via Digitalmars-d
On Monday, 2 April 2018 at 07:15:22 UTC, sarn wrote: This feels like a long shot, but I figure it's worth a try. I'll be at the Sydney C++ Meetup this Thursday (and other Thursdays, no promises). If anyone lurking here is in Sydney and wants to talk about D with someone, come say hi. (I'm

Garbage Collection in D

2018-04-02 Thread Uknown via Digitalmars-d
The Garbage Collection page of the spec (https://dlang.org/spec/garbage.html) mentions that it is undefined behaviour to store pointers to GC memory in non pointer types. Is this a relic of the past? I've seen a lot of people here on the forum saying that the GC needs to be conservative

Re: Vtable for virtual functions in D

2018-04-02 Thread Mike Franklin via Digitalmars-d
On Wednesday, 7 March 2018 at 22:02:17 UTC, sarn wrote: When I wrote Xanthe a year ago, I rolled my own classes using alias this and explicit vtables: https://gitlab.com/sarneaud/xanthe/blob/master/src/game/rigid_body.d#L15 (I did this because normal D classes use the druntime library, and

Re: [OT] Unity migrating parts of their engine from C++ into High Performace C# (HPC#)

2018-04-02 Thread Meta via Digitalmars-d
On Monday, 2 April 2018 at 22:55:58 UTC, Meta wrote: On Monday, 2 April 2018 at 20:19:17 UTC, rumbu wrote: On Monday, 2 April 2018 at 18:54:28 UTC, 12345swordy wrote: - Only structs are used, no classes; - .NET collections are replaced by native collections that manage their own memory - No

Re: [OT] Unity migrating parts of their engine from C++ into High Performace C# (HPC#)

2018-04-02 Thread Meta via Digitalmars-d
On Monday, 2 April 2018 at 20:19:17 UTC, rumbu wrote: On Monday, 2 April 2018 at 18:54:28 UTC, 12345swordy wrote: - Only structs are used, no classes; - .NET collections are replaced by native collections that manage their own memory - No code that would trigger GC is allowed - Compiler is

[Issue 18709] DDOC_AUTO_PSYMBOL and friends are wrong

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18709 --- Comment #1 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/18406fccda4e129059b75b188a4b99d05b2be7ab fix DDOC_AUTO_{PSYMBOL,KEYWORD,PARAM} Fixes issue

[Issue 18709] DDOC_AUTO_PSYMBOL and friends are wrong

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18709 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 18672] Error in @safe transitive propagation with associative arrays

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18672 --- Comment #4 from Seb --- @RazvanN how about setting the opAssign to @trusted instead when we now that the dtor is @safe? The problem is that sd.dtor.isSafe() returns 0 :/ Maybe we need to go through semantic first before

Re: Vtable for virtual functions in D

2018-04-02 Thread Mike Franklin via Digitalmars-d
On Monday, 2 April 2018 at 07:02:07 UTC, sarn wrote: On Thursday, 8 March 2018 at 22:07:24 UTC, sarn wrote: On Thursday, 8 March 2018 at 04:37:08 UTC, Mike Franklin wrote: Nice! I was thinking about something almost exactly like this recently since 2.079.0 has features to further decouple

Re: D compiles fast, right? Right??

2018-04-02 Thread Jonathan M Davis via Digitalmars-d
On Monday, April 02, 2018 17:15:40 Steven Schveighoffer via Digitalmars-d wrote: > On 4/2/18 4:05 PM, Jonathan M Davis wrote: > > One concern I have is version(unittest) blocks. In order to avoid code > > breakage, those would need to still be compiled in. I know that I've > > personally used

Re: What's up with ddoc on dlang.org?

2018-04-02 Thread Seb via Digitalmars-d
On Monday, 2 April 2018 at 21:36:33 UTC, Steven Schveighoffer wrote: Was just perusing dlang's library documentation, and here is the description it has for std.experimental.allocator.make: Dynamically allocates (using ) and then creates in the memory allocated an object of type T, using (if

Re: What's up with ddoc on dlang.org?

2018-04-02 Thread ag0aep6g via Digitalmars-d
On 04/02/2018 11:36 PM, Steven Schveighoffer wrote: Was just perusing dlang's library documentation, and here is the description it has for std.experimental.allocator.make: Dynamically allocates (using ) and then creates in the memory allocated an object of type T, using (if any) for its

[Issue 18709] New: DDOC_AUTO_PSYMBOL and friends are wrong

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18709 Issue ID: 18709 Summary: DDOC_AUTO_PSYMBOL and friends are wrong Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Keywords: pull

[Issue 9665] Structure constant members can not be initialized if have opAssign

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9665 Walter Bright changed: What|Removed |Added See Also|

[Issue 18708] Flow analysis in constructors not done correctly for if, ||, &

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18708 Walter Bright changed: What|Removed |Added Keywords||accepts-invalid,

[Issue 18708] Flow analysis in constructors not done correctly for if, ||, &

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18708 Walter Bright changed: What|Removed |Added See Also|

What's up with ddoc on dlang.org?

2018-04-02 Thread Steven Schveighoffer via Digitalmars-d
Was just perusing dlang's library documentation, and here is the description it has for std.experimental.allocator.make: Dynamically allocates (using ) and then creates in the memory allocated an object of type T, using (if any) for its initialization. Initialization occurs in the memory

Re: How to destruct class instances allocated by a Region-allocator over a single GC block

2018-04-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/2/18 5:16 PM, Per Nordlöw wrote: On Monday, 2 April 2018 at 20:43:01 UTC, Alexandru Jercaianu wrote: I am not completely sure how to solve this, but maybe we can find some clues here [1]. It seems like we should use addRoot on the buffer returned by GC.instance.allocate to keep it alive.

[Issue 18705] dmd segmentation fault with duplicate class definition

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18705 ag0aep6g changed: What|Removed |Added Keywords||ice CC|

Re: D compiles fast, right? Right??

2018-04-02 Thread Seb via Digitalmars-d
On Monday, 2 April 2018 at 19:32:33 UTC, Steven Schveighoffer wrote: On 4/2/18 12:28 PM, Andrei Alexandrescu wrote: On 04/02/2018 12:22 PM, H. S. Teoh wrote: Lately this has been mentioned more and more frequently.  So what's the status on this?  Are we going to move forward with making it so

[Issue 18708] New: Flow analysis in constructors not done correctly for if, ||, &

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18708 Issue ID: 18708 Summary: Flow analysis in constructors not done correctly for if, ||, && Product: D Version: D2 Hardware: All OS: All Status: NEW

Re: How to destruct class instances allocated by a Region-allocator over a single GC block

2018-04-02 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 2 April 2018 at 20:43:01 UTC, Alexandru Jercaianu wrote: I am not completely sure how to solve this, but maybe we can find some clues here [1]. It seems like we should use addRoot on the buffer returned by GC.instance.allocate to keep it alive. Then, we can use addRange on each node

Re: D compiles fast, right? Right??

2018-04-02 Thread Steven Schveighoffer via Digitalmars-d
On 4/2/18 4:05 PM, Jonathan M Davis wrote: One concern I have is version(unittest) blocks. In order to avoid code breakage, those would need to still be compiled in. I know that I've personally used version(unittest) blocks that had package access level and were then imported in the unit tests

Re: D compiles fast, right? Right??

2018-04-02 Thread Steven Schveighoffer via Digitalmars-d
On 4/2/18 3:55 PM, H. S. Teoh wrote: On Mon, Apr 02, 2018 at 03:28:02PM -0400, Steven Schveighoffer via Digitalmars-d wrote: [...] We really need to change the unittest import strategy. [...] I think this has been established beyond reasonable doubt for the last little while. What about we

Re: How to destruct class instances allocated by a Region-allocator over a single GC block

2018-04-02 Thread Alexandru Jercaianu via Digitalmars-d-learn
On Monday, 2 April 2018 at 14:52:34 UTC, Per Nordlöw wrote: As a follow-up to https://forum.dlang.org/post/jfgpngdudtprzznrc...@forum.dlang.org [...] Hi, I am not completely sure how to solve this, but maybe we can find some clues here [1]. It seems like we should use addRoot on the buffer

Re: Invading^W The Sydney C++ Meetup

2018-04-02 Thread Manu via Digitalmars-d
On 2 April 2018 at 00:46, Nicholas Wilson via Digitalmars-d wrote: > On Monday, 2 April 2018 at 07:15:22 UTC, sarn wrote: >> >> This feels like a long shot, but I figure it's worth a try. >> >> I'll be at the Sydney C++ Meetup this Thursday (and other Thursdays, no >>

Re: Fix transposed ranges

2018-04-02 Thread Cym13 via Digitalmars-d-learn
On Monday, 2 April 2018 at 19:45:31 UTC, Steven Schveighoffer wrote: On 4/2/18 3:24 PM, Cym13 wrote: [...] Well, it's tough, because you can compose ranges in infinite ways. All you need to generate the warning is some code like this: [...] That makes sense, thanks.

Re: [OT] Unity migrating parts of their engine from C++ into High Performace C# (HPC#)

2018-04-02 Thread rumbu via Digitalmars-d
On Monday, 2 April 2018 at 18:54:28 UTC, 12345swordy wrote: - Only structs are used, no classes; - .NET collections are replaced by native collections that manage their own memory - No code that would trigger GC is allowed - Compiler is aware of Unity features and is able to explore SIMD, by

Re: D compiles fast, right? Right??

2018-04-02 Thread Jonathan M Davis via Digitalmars-d
On Monday, April 02, 2018 12:55:05 H. S. Teoh via Digitalmars-d wrote: > On Mon, Apr 02, 2018 at 03:28:02PM -0400, Steven Schveighoffer via > Digitalmars-d wrote: [...] > > > We really need to change the unittest import strategy. > > [...] > > I think this has been established beyond reasonable

Re: D compiles fast, right? Right??

2018-04-02 Thread H. S. Teoh via Digitalmars-d
On Mon, Apr 02, 2018 at 03:28:02PM -0400, Steven Schveighoffer via Digitalmars-d wrote: [...] > We really need to change the unittest import strategy. [...] I think this has been established beyond reasonable doubt for the last little while. What about we start hashing out a solution? AFAIK,

Re: Fix transposed ranges

2018-04-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/2/18 3:24 PM, Cym13 wrote: On Monday, 2 April 2018 at 18:33:25 UTC, Steven Schveighoffer wrote: On 3/30/18 4:45 PM, Cym13 wrote: On Friday, 30 March 2018 at 20:43:09 UTC, Cym13 wrote: Hi, I've got the following code that takes a list of files as argument and xor them together (demo

Re: D compiles fast, right? Right??

2018-04-02 Thread Steven Schveighoffer via Digitalmars-d
On 4/2/18 12:28 PM, Andrei Alexandrescu wrote: On 04/02/2018 12:22 PM, H. S. Teoh wrote: Lately this has been mentioned more and more frequently.  So what's the status on this?  Are we going to move forward with making it so that -unittest only applies to modules supplied on the command-line?

Re: D compiles fast, right? Right??

2018-04-02 Thread Steven Schveighoffer via Digitalmars-d
On 4/2/18 8:33 AM, Atila Neves wrote: No... that's ~11.583x with no unittests and ~43.75x with. The former number not being interesting to me in the slightest. Here is an interesting tidbit as well -- importing with -unittest takes 4x as long AND NO CODE IS GENERATED OR WILL EVER BE

Re: Fix transposed ranges

2018-04-02 Thread Cym13 via Digitalmars-d-learn
On Monday, 2 April 2018 at 18:33:25 UTC, Steven Schveighoffer wrote: On 3/30/18 4:45 PM, Cym13 wrote: On Friday, 30 March 2018 at 20:43:09 UTC, Cym13 wrote: Hi, I've got the following code that takes a list of files as argument and xor them together (demo example sufficient for that

Re: D compiles fast, right? Right??

2018-04-02 Thread Jonathan M Davis via Digitalmars-d
On Monday, April 02, 2018 18:52:14 Jonathan Marler via Digitalmars-d wrote: > On Monday, 2 April 2018 at 12:33:37 UTC, Atila Neves wrote: > > On Friday, 30 March 2018 at 16:41:42 UTC, Jonathan Marler wrote: > >> Seems like you're comparing apples to oranges. > > > > No, I'm comparing one type of

Re: Fast GC allocation of many small objects

2018-04-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/2/18 2:51 PM, Per Nordlöw wrote: On Monday, 2 April 2018 at 18:22:43 UTC, Steven Schveighoffer wrote: You may be interested in this proposal, which was inspired by trying to implement a reserve feature for AAs (requires a similar mechanism). https://issues.dlang.org/show_bug.cgi?id=17881

Re: D compiles fast, right? Right??

2018-04-02 Thread Jonathan Marler via Digitalmars-d
On Monday, 2 April 2018 at 12:33:37 UTC, Atila Neves wrote: On Friday, 30 March 2018 at 16:41:42 UTC, Jonathan Marler wrote: Seems like you're comparing apples to oranges. No, I'm comparing one type of apple to another with regards to weight in my shopping bag before I've even taken a bite.

Re: [OT] Unity migrating parts of their engine from C++ into High Performace C# (HPC#)

2018-04-02 Thread 12345swordy via Digitalmars-d
On Monday, 2 April 2018 at 17:30:20 UTC, Paulo Pinto wrote: A bit off topic, yet still relevant given the ongoing attempts for D to be usable on the games industry. At this year's GDC Unity had a few talks of the new subsystems being transitioning from internal engine code in C++ into upper

Re: Fast GC allocation of many small objects

2018-04-02 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 2 April 2018 at 18:22:43 UTC, Steven Schveighoffer wrote: You may be interested in this proposal, which was inspired by trying to implement a reserve feature for AAs (requires a similar mechanism). https://issues.dlang.org/show_bug.cgi?id=17881 Ok, thanks. I'll push for it. One

Re: Deprecating this(this)

2018-04-02 Thread Marco Leise via Digitalmars-d
Am Mon, 2 Apr 2018 11:57:55 -0400 schrieb Andrei Alexandrescu : > Problem is we don't have head-mutable in the language. Yes, for built-in > slices the mechanism is simple - just change qualifier(T[]) to > qualifier(T)[]. For a struct S, there is no way to convert

Re: Fix transposed ranges

2018-04-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/30/18 4:45 PM, Cym13 wrote: On Friday, 30 March 2018 at 20:43:09 UTC, Cym13 wrote: Hi, I've got the following code that takes a list of files as argument and xor them together (demo example sufficient for that discussion). [...] Forgot to mention but I'm also quite annoyed at the need

Re: Fast GC allocation of many small objects

2018-04-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/30/18 4:31 PM, Per Nordlöw wrote: I'm working on a graph database with tens of millions of small nodes containing typically around 8-64 bytes of member data. Is there a faster way of allocating many small class objects such as class Node {     // abstract members } class StrNode : Node

Re: Deprecating this(this)

2018-04-02 Thread Steven Schveighoffer via Digitalmars-d
On 4/2/18 1:08 PM, Andrei Alexandrescu wrote: On 04/02/2018 12:53 PM, Steven Schveighoffer wrote: As was mentioned, because postblit on an immutable (or const) is ONLY allowed for new data, there shouldn't be an issue. The problem with postblit is there's "double construction", one done by

[OT] Unity migrating parts of their engine from C++ into High Performace C# (HPC#)

2018-04-02 Thread Paulo Pinto via Digitalmars-d
A bit off topic, yet still relevant given the ongoing attempts for D to be usable on the games industry. At this year's GDC Unity had a few talks of the new subsystems being transitioning from internal engine code in C++ into upper layers written in C#. For that purpose they are introducing

Re: Deprecating this(this)

2018-04-02 Thread Jonathan M Davis via Digitalmars-d
On Monday, April 02, 2018 08:56:41 H. S. Teoh via Digitalmars-d wrote: > On Sun, Apr 01, 2018 at 02:31:06PM +, Nicholas Wilson via Digitalmars- d wrote: > > On Sunday, 1 April 2018 at 13:37:43 UTC, Jonathan M Davis wrote: > > > One issue is that postblit constructors fundamentally don't work >

Re: Deprecating this(this)

2018-04-02 Thread Andrei Alexandrescu via Digitalmars-d
On 04/02/2018 12:53 PM, Steven Schveighoffer wrote: On 4/2/18 11:57 AM, Andrei Alexandrescu wrote: On 04/02/2018 10:59 AM, ag0aep6g wrote: That wouldn't be possible if `innocent` were only head-mutable in the postblit function, instead of fully mutable as it is currently (bug). `innocent`

Re: Constructor qualifiers; bug or expected behavior?

2018-04-02 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Apr 02, 2018 at 10:26:32AM +, RazvanN via Digitalmars-d-learn wrote: > Hi all, > > Let's say we have this code: > > struct B > { > int a; > this(int a) immutable > { > this.a = 7; > } > > this(int a) > { > this.a = 10; > } > } > > void

Re: std/typecons.d(2010:36)[warn]: Left side of logical or is identical to right side.

2018-04-02 Thread Stefan Koch via Digitalmars-d
On Monday, 2 April 2018 at 16:46:39 UTC, Andrei Alexandrescu wrote: I'm seeing this in the CI runs, but the line is actually not in error: https://github.com/dlang/phobos/blob/master/std/typecons.d#L2010 Where would be the problem? Andrei I guess it's parsed as a comma expression, which

Re: Deprecating this(this)

2018-04-02 Thread Steven Schveighoffer via Digitalmars-d
On 4/2/18 11:57 AM, Andrei Alexandrescu wrote: On 04/02/2018 10:59 AM, ag0aep6g wrote: That wouldn't be possible if `innocent` were only head-mutable in the postblit function, instead of fully mutable as it is currently (bug). `innocent` would be typed as `immutable(int)[]`, and you could

std/typecons.d(2010:36)[warn]: Left side of logical or is identical to right side.

2018-04-02 Thread Andrei Alexandrescu via Digitalmars-d
I'm seeing this in the CI runs, but the line is actually not in error: https://github.com/dlang/phobos/blob/master/std/typecons.d#L2010 Where would be the problem? Andrei

Re: Deprecating this(this)

2018-04-02 Thread Andrei Alexandrescu via Digitalmars-d
On 04/02/2018 12:14 PM, Paolo Invernizzi wrote: On Monday, 2 April 2018 at 16:00:11 UTC, bachmeier wrote: On Monday, 2 April 2018 at 15:30:23 UTC, Paolo Invernizzi wrote: Andrei wrote in the message I am looking for folks to assist me in creating a DIP for that. There will be a _lot_ of

Re: D compiles fast, right? Right??

2018-04-02 Thread Andrei Alexandrescu via Digitalmars-d
On 04/02/2018 12:22 PM, H. S. Teoh wrote: Lately this has been mentioned more and more frequently. So what's the status on this? Are we going to move forward with making it so that -unittest only applies to modules supplied on the command-line? Has there been an investigation into how

Re: D compiles fast, right? Right??

2018-04-02 Thread H. S. Teoh via Digitalmars-d
On Mon, Apr 02, 2018 at 12:09:01PM -0400, Andrei Alexandrescu via Digitalmars-d wrote: > On 04/02/2018 08:35 AM, Atila Neves wrote: > > On Sunday, 1 April 2018 at 02:40:26 UTC, Walter Bright wrote: > > > On 3/30/2018 1:17 PM, Andrei Alexandrescu wrote: > > > > Could be faster. > > > > > > It's

Re: Deprecating this(this)

2018-04-02 Thread Paolo Invernizzi via Digitalmars-d
On Monday, 2 April 2018 at 16:00:11 UTC, bachmeier wrote: On Monday, 2 April 2018 at 15:30:23 UTC, Paolo Invernizzi wrote: Andrei wrote in the message I am looking for folks to assist me in creating a DIP for that. There will be a _lot_ of work involved, so don't take it lightly.

Re: D compiles fast, right? Right??

2018-04-02 Thread Andrei Alexandrescu via Digitalmars-d
On 04/02/2018 08:35 AM, Atila Neves wrote: On Sunday, 1 April 2018 at 02:40:26 UTC, Walter Bright wrote: On 3/30/2018 1:17 PM, Andrei Alexandrescu wrote: Could be faster. It's been a fair amount of time since somebody has done profiling of dmd. It needs to be done. There's probably plenty

Re: Deprecating this(this)

2018-04-02 Thread Andrei Alexandrescu via Digitalmars-d
On 04/02/2018 12:00 PM, bachmeier wrote: On Monday, 2 April 2018 at 15:30:23 UTC, Paolo Invernizzi wrote: Andrei wrote in the message I am looking for folks to assist me in creating a DIP for that. There will be a _lot_ of work involved, so don't take it lightly. So, let's keep the

Re: Deprecating this(this)

2018-04-02 Thread Andrei Alexandrescu via Digitalmars-d
On 04/02/2018 10:42 AM, ag0aep6g wrote: On Monday, 2 April 2018 at 14:01:22 UTC, Kagamin wrote: On Sunday, 1 April 2018 at 14:31:24 UTC, Andrei Alexandrescu wrote: 1. For immutable objects, typechecking in the presence of successive modifications of data (first assignment by the compiler, then

Re: Deprecating this(this)

2018-04-02 Thread bachmeier via Digitalmars-d
On Monday, 2 April 2018 at 15:30:23 UTC, Paolo Invernizzi wrote: Andrei wrote in the message I am looking for folks to assist me in creating a DIP for that. There will be a _lot_ of work involved, so don't take it lightly. So, let's keep the discussion factual. I'm pretty sure that every

Re: Deprecating this(this)

2018-04-02 Thread Andrei Alexandrescu via Digitalmars-d
On 04/02/2018 10:59 AM, ag0aep6g wrote: That wouldn't be possible if `innocent` were only head-mutable in the postblit function, instead of fully mutable as it is currently (bug). `innocent` would be typed as `immutable(int)[]`, and you could not assign it to the fully mutable `sneaky`.

[Issue 18474] Postblit not working in shared structs

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18474 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/3a0f75d959bd8e875a7d7767caed8ae3fa94ee8e Fix Issue 18474 - Postblit not working in shared structs

Re: Deprecating this(this)

2018-04-02 Thread H. S. Teoh via Digitalmars-d
On Sun, Apr 01, 2018 at 02:31:06PM +, Nicholas Wilson via Digitalmars-d wrote: > On Sunday, 1 April 2018 at 13:37:43 UTC, Jonathan M Davis wrote: > > One issue is that postblit constructors fundamentally don't work > > with const. The problem is that a postblit constructor works by > >

Re: D compiles fast, right? Right??

2018-04-02 Thread H. S. Teoh via Digitalmars-d
On Mon, Apr 02, 2018 at 12:35:03PM +, Atila Neves via Digitalmars-d wrote: > On Sunday, 1 April 2018 at 02:40:26 UTC, Walter Bright wrote: > > On 3/30/2018 1:17 PM, Andrei Alexandrescu wrote: > > > Could be faster. > > > > It's been a fair amount of time since somebody has done profiling of >

Re: Deprecating this(this)

2018-04-02 Thread Paolo Invernizzi via Digitalmars-d
On Monday, 2 April 2018 at 13:55:25 UTC, bachmeier wrote: No, the reason nothing gets done is because "that would break code" is used to kill every proposal that comes along. Someone that only responds to proposals with "write a DIP" proceeds to announce a major piece of the language will be

[Issue 18026] Stack overflow in ddmd/dtemplate.d:6241, TemplateInstance::needsCodegen()

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18026 Seb changed: What|Removed |Added CC||greensunn...@gmail.com ---

Re: @property for simple methods?

2018-04-02 Thread Dennis via Digitalmars-d-learn
On Monday, 2 April 2018 at 14:51:57 UTC, Vladimirs Nordholm wrote: Do you think I should I omit the @property tag, if the only wanted behaviour is to set a value (`foo.bar = "baz";`) ? You're probably fine either way, it's mostly for making your intention clear. Jonathan M Davis made a great

Re: @property for simple methods?

2018-04-02 Thread Seb via Digitalmars-d-learn
On Monday, 2 April 2018 at 14:51:57 UTC, Vladimirs Nordholm wrote: On Monday, 2 April 2018 at 14:20:49 UTC, Dennis wrote: On Monday, 2 April 2018 at 13:57:14 UTC, Vladimirs Nordholm wrote: Is there any reason for me to add the @property tags for the method? A list of things the @property tag

Re: Deprecating this(this)

2018-04-02 Thread Steven Schveighoffer via Digitalmars-d
On 4/2/18 10:24 AM, Nicholas Wilson wrote: On Monday, 2 April 2018 at 14:07:21 UTC, Steven Schveighoffer wrote: On 4/1/18 10:34 AM, ag0aep6g wrote: On Sunday, 1 April 2018 at 13:37:43 UTC, Jonathan M Davis wrote: One issue is that postblit constructors fundamentally don't work with const. The

Re: Deprecating this(this)

2018-04-02 Thread ag0aep6g via Digitalmars-d
On Monday, 2 April 2018 at 14:24:20 UTC, Nicholas Wilson wrote: On Monday, 2 April 2018 at 14:07:21 UTC, Steven Schveighoffer wrote: On 4/1/18 10:34 AM, ag0aep6g wrote: [...] I'm not so sure if that's fundamental. Can't we just say that the copy is head-mutable at the time when the postblit

Re: @property for simple methods?

2018-04-02 Thread Vladimirs Nordholm via Digitalmars-d-learn
On Monday, 2 April 2018 at 14:20:49 UTC, Dennis wrote: On Monday, 2 April 2018 at 13:57:14 UTC, Vladimirs Nordholm wrote: Is there any reason for me to add the @property tags for the method? A list of things the @property tag does can be found here:

How to destruct class instances allocated by a Region-allocator over a single GC block

2018-04-02 Thread Per Nordlöw via Digitalmars-d-learn
As a follow-up to https://forum.dlang.org/post/jfgpngdudtprzznrc...@forum.dlang.org I managed to put together the benchmark https://github.com/nordlow/phobos-next/blob/fa3526b15c746bda50a195f4e492ab2de9c15287/benchmarks/allocators/source/app.d which run (via ldc) dub run

Re: Deprecating this(this)

2018-04-02 Thread ag0aep6g via Digitalmars-d
On Monday, 2 April 2018 at 14:01:22 UTC, Kagamin wrote: On Sunday, 1 April 2018 at 14:31:24 UTC, Andrei Alexandrescu wrote: 1. For immutable objects, typechecking in the presence of successive modifications of data (first assignment by the compiler, then modification by the user) is very

[Issue 18707] New: Destructor of qualified objects not typechecked properly

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18707 Issue ID: 18707 Summary: Destructor of qualified objects not typechecked properly Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

Re: Deprecating this(this)

2018-04-02 Thread Nicholas Wilson via Digitalmars-d
On Monday, 2 April 2018 at 14:07:21 UTC, Steven Schveighoffer wrote: On 4/1/18 10:34 AM, ag0aep6g wrote: On Sunday, 1 April 2018 at 13:37:43 UTC, Jonathan M Davis wrote: One issue is that postblit constructors fundamentally don't work with const. The problem is that a postblit constructor

[Issue 18706] New: Documentation on default class member initializers could be improved

2018-04-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18706 Issue ID: 18706 Summary: Documentation on default class member initializers could be improved Product: D Version: D2 Hardware: Other OS: Other

Re: @property for simple methods?

2018-04-02 Thread Dennis via Digitalmars-d-learn
On Monday, 2 April 2018 at 13:57:14 UTC, Vladimirs Nordholm wrote: Is there any reason for me to add the @property tags for the method? A list of things the @property tag does can be found here: https://dlang.org/spec/function.html#property-functions This behavior is particularly useful for

  1   2   >