Re: C#7 features

2016-05-06 Thread Steven Schveighoffer via Digitalmars-d-announce

On 5/7/16 1:29 AM, Timon Gehr wrote:

On 06.05.2016 18:58, Kagamin wrote:

On Friday, 6 May 2016 at 14:33:22 UTC, Andrei Alexandrescu wrote:

Added a comment:

https://www.reddit.com/r/programming/comments/4i3h77/some_new_c7_features/d2v5lu6




D has ref variables? Not for a long time though.


D actually does not support ref local variables in most contexts (one
can have ref locals declared by foreach). There is an explicit check
ruling them out, but I'm pretty sure DMD supports them internally, they
are useful for lowering.


Of COURSE D supports local ref variables:

struct RefVar(T)
{
  private T * var;
  this(ref T v) { var =  }
  auto get() { return *var; }
  alias this get;
}

;)

-Steve


Re: C#7 features

2016-05-06 Thread Timon Gehr via Digitalmars-d-announce

On 06.05.2016 18:58, Kagamin wrote:

On Friday, 6 May 2016 at 14:33:22 UTC, Andrei Alexandrescu wrote:

Added a comment:

https://www.reddit.com/r/programming/comments/4i3h77/some_new_c7_features/d2v5lu6



D has ref variables? Not for a long time though.


D actually does not support ref local variables in most contexts (one 
can have ref locals declared by foreach). There is an explicit check 
ruling them out, but I'm pretty sure DMD supports them internally, they 
are useful for lowering.


Re: C#7 features

2016-05-06 Thread Kagamin via Digitalmars-d-announce

On Friday, 6 May 2016 at 14:33:22 UTC, Andrei Alexandrescu wrote:

Added a comment:

https://www.reddit.com/r/programming/comments/4i3h77/some_new_c7_features/d2v5lu6


D has ref variables? Not for a long time though.


Re: GSoC 2016 - Precise GC

2016-05-06 Thread Leandro Lucarella via Digitalmars-d-announce

On Tuesday, 3 May 2016 at 18:15:20 UTC, Jeremy DeHaan wrote:
Not sure if it is something I can get to in the course of my 
project though. Scanning only unions conservatively is still 
pretty good.


And the stack, and the CPU registers, but yeah, it should be a 
minority.


DConf video news

2016-05-06 Thread Andrei Alexandrescu via Digitalmars-d-announce
Hot off the press from the video producers: "just a heads-up! as a quick 
fix [a colleague] will add chapter markers in the ustream videos so that 
one can see who is talking when and directly jump to the talk in 
question! actually pretty nice i guess. everything else will come later 
(in better quality)." -- Andrei


C#7 features

2016-05-06 Thread Andrei Alexandrescu via Digitalmars-d-announce

Most of them are also present in D, yay.

https://www.reddit.com/r/programming/comments/4i3h77/some_new_c7_features/

Added a comment:

https://www.reddit.com/r/programming/comments/4i3h77/some_new_c7_features/d2v5lu6


Andrei


Re: GSoC 2016 - Precise GC

2016-05-06 Thread Steven Schveighoffer via Digitalmars-d-announce

On 5/6/16 11:06 AM, Dmitry Olshansky wrote:

On 06-May-2016 05:37, Jeremy DeHaan wrote:

On Wednesday, 4 May 2016 at 12:42:30 UTC, jmh530 wrote:

On Wednesday, 4 May 2016 at 02:50:08 UTC, Jeremy DeHaan wrote:


I'm not sure, but one would think that @safe code wouldn't need any
extra information about the union. I wouldn't know how to
differentiate between them though during runtime. Probably someone
with more experience with the compiler would know more about that
kind of thing.


You can identify safe functions with
https://dlang.org/phobos/std_traits.html#isSafe
or
https://dlang.org/phobos/std_traits.html#functionAttributes


All I meant was that I don't know enough about what the compiler does
with built in types to make this work. It almost sounds like we would
need a safe union and unsafe union type and do some extra stuff for the
unsafe union, but I'm just starting to learn about this stuff.


I'd note that a union without pointers doesn't hurt precise scanner,
it's only the ones with pointers that are bad.



Ones that have only pointers are probably OK too. Though I'm not sure if 
a precise scanner takes into account the type of the pointer. I would 
expect it to use embedded typeinfo in target block.


-Steve


Re: GSoC 2016 - Precise GC

2016-05-06 Thread Dmitry Olshansky via Digitalmars-d-announce

On 06-May-2016 05:37, Jeremy DeHaan wrote:

On Wednesday, 4 May 2016 at 12:42:30 UTC, jmh530 wrote:

On Wednesday, 4 May 2016 at 02:50:08 UTC, Jeremy DeHaan wrote:


I'm not sure, but one would think that @safe code wouldn't need any
extra information about the union. I wouldn't know how to
differentiate between them though during runtime. Probably someone
with more experience with the compiler would know more about that
kind of thing.


You can identify safe functions with
https://dlang.org/phobos/std_traits.html#isSafe
or
https://dlang.org/phobos/std_traits.html#functionAttributes


All I meant was that I don't know enough about what the compiler does
with built in types to make this work. It almost sounds like we would
need a safe union and unsafe union type and do some extra stuff for the
unsafe union, but I'm just starting to learn about this stuff.


I'd note that a union without pointers doesn't hurt precise scanner, 
it's only the ones with pointers that are bad.


--
Dmitry Olshansky