Re: DMD Symbol Reference Analysis Pass

2015-06-01 Thread via Digitalmars-d
On Monday, 1 June 2015 at 03:49:39 UTC, Andrei Alexandrescu wrote: Destroyed. -- Andrei Thx

Re: DMD Symbol Reference Analysis Pass

2015-05-31 Thread Andrei Alexandrescu via Digitalmars-d
On 5/28/15 2:23 PM, Per =?UTF-8?B?Tm9yZGzDtnci?= per.nord...@gmail.com wrote: BTW, Andrei, there's a new lazy range PR for Phobos on GitHub awaiting review... ;) Destroyed. -- Andrei

Re: DMD Symbol Reference Analysis Pass

2015-05-29 Thread Martin Nowak via Digitalmars-d
On Thursday, 28 May 2015 at 21:23:59 UTC, Per Nordlöw wrote: https://github.com/nordlow/justd/blob/79cc8bf0766282368f05314d00566e7d234988bd/bylinefast.d#L207 which is currently deactivated. It has worked flawlessly in my applications, so none AFAIK. Could this replace the stuck

Re: DMD Symbol Reference Analysis Pass

2015-05-29 Thread via Digitalmars-d
On Thursday, 28 May 2015 at 21:27:06 UTC, Per Nordlöw wrote: Speed-up varies between 2.0 and 2.7 according to recent experiments done using new unittest at The test file http://downloads.dbpedia.org/3.9/en/instance_types_en.nt.bz2 contains 15.9 Mlines :) /Per

Re: DMD Symbol Reference Analysis Pass

2015-05-29 Thread via Digitalmars-d
On Friday, 29 May 2015 at 08:48:59 UTC, Martin Nowak wrote: https://github.com/D-Programming-Language/phobos/pull/2794? That's a massive discussion. Is it possible to describe in shorter terms what the problem is and how it relates to byLine? Please.

Re: DMD Symbol Reference Analysis Pass

2015-05-29 Thread via Digitalmars-d
On Friday, 29 May 2015 at 09:17:17 UTC, Per Nordlöw wrote: That's a massive discussion. Is it possible to describe in shorter terms what the problem is and how it relates to byLine? Would the problem be solved if `byLine` was changed to not use `readln()`?

Re: DMD Symbol Reference Analysis Pass

2015-05-28 Thread Andrei Alexandrescu via Digitalmars-d
On 5/28/15 2:05 PM, Per =?UTF-8?B?Tm9yZGzDtnci?= per.nord...@gmail.com wrote: How faster is bylinefast compared to byline (after the recent improvements)? -- Andrei About 3 times in my measurements. Cool! What are the incompatibilities keeping it from replacing byLine? -- Andrei

Re: DMD Symbol Reference Analysis Pass

2015-05-28 Thread via Digitalmars-d
On Thursday, 28 May 2015 at 20:54:59 UTC, Andrei Alexandrescu wrote: Cool! What are the incompatibilities keeping it from replacing byLine? -- Andrei Speed-up varies between 2.0 and 2.7 according to recent experiments done using new unittest at

Re: DMD Symbol Reference Analysis Pass

2015-05-28 Thread via Digitalmars-d
How faster is bylinefast compared to byline (after the recent improvements)? -- Andrei About 3 times in my measurements.

Re: DMD Symbol Reference Analysis Pass

2015-05-28 Thread via Digitalmars-d
On Thursday, 28 May 2015 at 21:23:59 UTC, Per Nordlöw wrote: On Thursday, 28 May 2015 at 20:54:59 UTC, Andrei Alexandrescu wrote: Cool! What are the incompatibilities keeping it from replacing byLine? -- Andrei Speed-up varies between 2.0 and 2.7 according to recent experiments done using

Re: DMD Symbol Reference Analysis Pass

2015-05-28 Thread via Digitalmars-d
On Wednesday, 27 May 2015 at 15:21:38 UTC, weaselcat wrote: I might be wrong, but I thought dip25 was only enabled in @safe annotated code? I updated bylinefast at https://github.com/nordlow/justd/blob/master/bylinefast.d#L188 to make the unittest @safe and members of @trusted. DMD (2.067

Re: DMD Symbol Reference Analysis Pass

2015-05-28 Thread via Digitalmars-d
On Thursday, 28 May 2015 at 11:38:25 UTC, Per Nordlöw wrote: DMD (2.067 and git master) with -dip25 still doesn't complain about ... My guess is that this passes because the internal storage is GC-allocated. I'm sensing we need a new qualifier for this or that there is more logic to come in

Re: DMD Symbol Reference Analysis Pass

2015-05-28 Thread Andrei Alexandrescu via Digitalmars-d
On 5/28/15 5:38 AM, Per =?UTF-8?B?Tm9yZGzDtnci?= per.nord...@gmail.com wrote: On Wednesday, 27 May 2015 at 15:21:38 UTC, weaselcat wrote: I might be wrong, but I thought dip25 was only enabled in @safe annotated code? I updated bylinefast at

Re: DMD Symbol Reference Analysis Pass

2015-05-27 Thread via Digitalmars-d
On Wednesday, 27 May 2015 at 08:38:48 UTC, Per Nordlöw wrote: AFAIK, in current DMD, I can't get any help in avoiding patterns such as char[] saved_line; foreach (line; File(foo.txt).byLine) { saved_line = line; // should give error } If I understand you correctly, a

Re: DMD Symbol Reference Analysis Pass

2015-05-27 Thread via Digitalmars-d
On Wednesday, 27 May 2015 at 10:53:48 UTC, Per Nordlöw wrote: On Wednesday, 27 May 2015 at 09:54:33 UTC, Marc Schütz wrote: Yes. First of all, `File.byLine.front` is the function that needs to get annotated, like this: char[] front() return { // ... return buffer; } The

Re: DMD Symbol Reference Analysis Pass

2015-05-27 Thread via Digitalmars-d
On Tuesday, 26 May 2015 at 21:22:38 UTC, Per Nordlöw wrote: No, DMD cannot currently handle scope on foreach elements. It errors as Error: basic type expected, not scope Quite possible, didn't test it. Anyway, my point was that it simply isn't necessary to ever mark a local variable

Re: DMD Symbol Reference Analysis Pass

2015-05-27 Thread via Digitalmars-d
On Wednesday, 27 May 2015 at 08:43:07 UTC, Per Nordlöw wrote: On Wednesday, 27 May 2015 at 08:38:48 UTC, Per Nordlöw wrote: AFAIK, in current DMD, I can't get any help in avoiding patterns such as char[] saved_line; foreach (line; File(foo.txt).byLine) { saved_line = line; //

Re: DMD Symbol Reference Analysis Pass

2015-05-27 Thread via Digitalmars-d
On Wednesday, 27 May 2015 at 08:30:33 UTC, Marc Schütz wrote: See above. Conceptually, you can of course treat it as if it were marked with `scope`, but an actual annotation should not be necessary. But now you're talking about an upcoming feature in DMD, right? AFAIK, in current DMD, I

Re: DMD Symbol Reference Analysis Pass

2015-05-27 Thread via Digitalmars-d
On Wednesday, 27 May 2015 at 08:38:48 UTC, Per Nordlöw wrote: On Wednesday, 27 May 2015 at 08:30:33 UTC, Marc Schütz wrote: See above. Conceptually, you can of course treat it as if it were marked with `scope`, but an actual annotation should not be necessary. But now you're talking about an

Re: DMD Symbol Reference Analysis Pass

2015-05-27 Thread via Digitalmars-d
On Wednesday, 27 May 2015 at 09:54:33 UTC, Marc Schütz wrote: Yes. First of all, `File.byLine.front` is the function that needs to get annotated, like this: char[] front() return { // ... return buffer; } The `return` keyword here means the same thing as in DIP25, Is

Re: DMD Symbol Reference Analysis Pass

2015-05-27 Thread weaselcat via Digitalmars-d
On Wednesday, 27 May 2015 at 11:02:24 UTC, Per Nordlöw wrote: On Wednesday, 27 May 2015 at 10:53:48 UTC, Per Nordlöw wrote: On Wednesday, 27 May 2015 at 09:54:33 UTC, Marc Schütz wrote: Yes. First of all, `File.byLine.front` is the function that needs to get annotated, like this: char[]

Re: DMD Symbol Reference Analysis Pass

2015-05-27 Thread via Digitalmars-d
On Wednesday, 27 May 2015 at 14:13:03 UTC, Marc Schütz wrote: I general, `return` is supposed to work (with -dip25), but only in combination with `ref`, not slices or pointers. DMD probably ignores it here instead of printing an error message. So, *should* it error for slices or not?

Re: DMD Symbol Reference Analysis Pass

2015-05-27 Thread via Digitalmars-d
On Wednesday, 27 May 2015 at 11:02:24 UTC, Per Nordlöw wrote: On Wednesday, 27 May 2015 at 10:53:48 UTC, Per Nordlöw wrote: On Wednesday, 27 May 2015 at 09:54:33 UTC, Marc Schütz wrote: Yes. First of all, `File.byLine.front` is the function that needs to get annotated, like this: char[]

Re: DMD Symbol Reference Analysis Pass

2015-05-27 Thread via Digitalmars-d
On Wednesday, 27 May 2015 at 15:21:38 UTC, weaselcat wrote: I might be wrong, but I thought dip25 was only enabled in @safe annotated code? Does this mean that I have to @safe-qualify `ByLineFast.front()` or the function iterating over it or both? Or does it suffice to @trusted-qualify

Re: DMD Symbol Reference Analysis Pass

2015-05-26 Thread via Digitalmars-d
On Monday, 25 May 2015 at 12:43:04 UTC, Per Nordlöw wrote: Does DMD currently do any analysis of references to a symbol in a given scope? If not where could this information be extracted (in which visitor/callback) and in what structure should it, if so, be stored? Reason: After having read

Re: DMD Symbol Reference Analysis Pass

2015-05-26 Thread via Digitalmars-d
On Tuesday, 26 May 2015 at 15:21:04 UTC, Marc Schütz wrote: On Tuesday, 26 May 2015 at 14:59:38 UTC, Per Nordlöw wrote: On Tuesday, 26 May 2015 at 10:19:52 UTC, Marc Schütz wrote: ... to be used in templates and for enforcing these rules:

Re: DMD Symbol Reference Analysis Pass

2015-05-26 Thread via Digitalmars-d
On Tuesday, 26 May 2015 at 10:19:52 UTC, Marc Schütz wrote: ... to be used in templates and for enforcing these rules: http://wiki.dlang.org/User:Schuetzm/scope3#.40safe-ty_violations_with_borrowing There's at least a plan. Nice! One thing, though. I'm lacking a section in the document linked

Re: DMD Symbol Reference Analysis Pass

2015-05-26 Thread via Digitalmars-d
On Tuesday, 26 May 2015 at 14:59:38 UTC, Per Nordlöw wrote: On Tuesday, 26 May 2015 at 10:19:52 UTC, Marc Schütz wrote: ... to be used in templates and for enforcing these rules: http://wiki.dlang.org/User:Schuetzm/scope3#.40safe-ty_violations_with_borrowing There's at least a plan. Nice!

DMD Symbol Reference Analysis Pass

2015-05-25 Thread via Digitalmars-d
Does DMD currently do any analysis of references to a symbol in a given scope? If not where could this information be extracted (in which visitor/callback) and in what structure should it, if so, be stored? Reason: After having read about Rust's data-flow (and in turn escape) analysis I'm very

Re: DMD Symbol Reference Analysis Pass

2015-05-21 Thread via Digitalmars-d-learn
On Wednesday, 20 May 2015 at 09:41:09 UTC, Per Nordlöw wrote: On Wednesday, 20 May 2015 at 09:27:06 UTC, Per Nordlöw wrote: Ping!?

Re: DMD Symbol Reference Analysis Pass

2015-05-21 Thread John Colvin via Digitalmars-d-learn
On Thursday, 21 May 2015 at 11:52:34 UTC, Per Nordlöw wrote: On Wednesday, 20 May 2015 at 09:41:09 UTC, Per Nordlöw wrote: On Wednesday, 20 May 2015 at 09:27:06 UTC, Per Nordlöw wrote: Ping!? I think you'd be more likely to get responses to this sort of question in the main group, not

Re: DMD Symbol Reference Analysis Pass

2015-05-20 Thread via Digitalmars-d-learn
On Wednesday, 20 May 2015 at 08:52:23 UTC, Per Nordlöw wrote: Does DMD currently do any analysis of references to a symbol in a given scope? If not where could this information be extracted (in which visitor/callback) and in what structure should it, if so, be stored? I'm guessing

DMD Symbol Reference Analysis Pass

2015-05-20 Thread via Digitalmars-d-learn
Does DMD currently do any analysis of references to a symbol in a given scope? If not where could this information be extracted (in which visitor/callback) and in what structure should it, if so, be stored? Reason: After having read about Rust's data-flow (and in turn escape) analysis I'm

Re: DMD Symbol Reference Analysis Pass

2015-05-20 Thread via Digitalmars-d-learn
On Wednesday, 20 May 2015 at 09:27:06 UTC, Per Nordlöw wrote: Two cases come to my mind: A: Non-Templated Function: must be @safe (or perhaps @trusted) pure and parameter must qualified as const (or in). B: Templated Function: Usage of parameter in body must be non-mutating; meaning no lhs of