Re: auto ref is on the docket

On Sunday, 28 June 2015 at 05:46:11 UTC, Manu wrote:
> On 28 June 2015 at 08:50, Jonathan M Davis via Digitalmars-d 
> <digitalmars-d <at> puremagic.com> wrote:
>>>
>>> [..]
>>
>>
>> That's what auto ref was originally introduced to do. The 
>> reason that it works only with templates is because Walter 
>> misunderstood what Andrei was proposing. So, it makes sense to 
>> use it for what it was originally intended for and implement 
>> it as proposed with non-templated functions. Now, that has the 
>> downside that we can't use it with templated functions in a 
>> fashion that avoids template bloat,
>
> Stop repeating that. It's not got anything to do with code 
> bloat, you
> can't use it because template auto ref doesn't pass rvalues by 
> ref, it
> passes them by value, which means it's not a ref in any way, 
> and it's
> not what the user wants.
> I can easily get the same behaviour by not-typing 'auto ref', 
> which I
> happily do in all cases that I want something to be passed by 
> value.
> But we're not talking about by-val, we're talking about ref.
>
> It's simple; I want to pass something by value, or I want it to 
> pass by ref... there is no middle ground, it's an explicit 
(Continue reading)

rsw0x via Digitalmars-d | 28 Jun 03:41 2015

Looking for GC intensive D programs

Does anyone know of any GC intensive D programs that can 
preferably be ran with little to no setup?

Mike via Digitalmars-d | 28 Jun 00:55 2015

What's the story with -property?

There's a regression involving `-property` at 
https://issues.dlang.org/show_bug.cgi?id=14564.  In that issue, 
it's stated by a reputable source that `-property` is going away. 
  It was also stated in IRC that it never worked anyway.

So, what's the story on `-property`? Is it going away?  Is the 
regression worth investing time in?

There's also a DMD pull request that, unfortunately, was not 
followed through on: 
https://github.com/D-Programming-Language/dmd/pull/2305

Please advise.

Thanks,
Mike

Re: Question about Walter's Memory DisAllocation pattern

On 6/26/2015 7:45 PM, Parke via Digitalmars-d wrote:
> Or, perhaps more precisely:  Does the caller of toString need to know
> the size of the struct that toString will return?

Yes.

> In the above example, buf's length is uint.sizeof * 3.  But what if
> buf's length was a function of u (and therefore only known at
> run-time), rather than a function of uint.sizeof?

In cases where the size cannot be known in advance, the returned struct can 
malloc/free the extra space.

bitwise via Digitalmars-d | 27 Jun 18:13 2015

D on Windows Phone

Has anyone tried it?

   Bit

Kagamin via Digitalmars-d | 27 Jun 13:57 2015

Re: End of life for Windows Server 2003 R2 is July 14, 2015

On Saturday, 27 June 2015 at 06:39:18 UTC, Iain Buclaw wrote:
>> Also, does cv2pdb support converting D specific CV symbols?
>
> Ping, is there any program that understands these symbols?
>
> http://dlang.org/abi.html#codeview
>
> Ddbg is a dead link, and all I can find is a dead 'Ddbg 
> successor' on Dsource.

https://issues.dlang.org/show_bug.cgi?id=11368
I suppose it's mostly visuald folks, who use it that way, try to 
ask them.

thedeemon via Digitalmars-d | 27 Jun 06:57 2015

Re: Question about Walter's Memory DisAllocation pattern

On Saturday, 27 June 2015 at 02:51:18 UTC, Parke wrote:

> In the above example, buf's length is uint.sizeof * 3.  But 
> what if buf's length was a function of u (and therefore only 
> known at run-time), rather than a function of uint.sizeof?

In this case you have two options:
1) do not store result in a buffer but calculate data in the 
range methods (front() and popFront())
2) allocate and give up this disallocation pattern

Re: Question about Walter's Memory DisAllocation pattern

On 2015-06-26 22:45, Parke via Digitalmars-d wrote:
> Hi,
>
> I have a question about Walter's DConf keynote and the Memory
> DisAllocation pattern.
>
> http://dconf.org/2015/talks/bright.html
>
> The following example is from the slides of Walter's talk.
>
> ----
>
> auto toString(uint u) {
>    static struct Result {
>      this(uint u) {
>        idx = buf.length;
>        do {
>          buf[--idx] = (u % 10) + '0';
>          u /= 10;
>        } while (u);
>      }
>       <at> property bool empty() { return idx == buf.length; }
>       <at> property char front() { return buf[idx]; }
>      void popFront() { ++idx; }
>      char[uint.sizeof * 3] buf;
>      size_t idx;
>    }
>    return Result(u);
> }
>
(Continue reading)

Parke via Digitalmars-d | 27 Jun 04:45 2015

Question about Walter's Memory DisAllocation pattern

Hi,

I have a question about Walter's DConf keynote and the Memory
DisAllocation pattern.

http://dconf.org/2015/talks/bright.html

The following example is from the slides of Walter's talk.

----

auto toString(uint u) {
  static struct Result {
    this(uint u) {
      idx = buf.length;
      do {
        buf[--idx] = (u % 10) + '0';
        u /= 10;
      } while (u);
    }
     <at> property bool empty() { return idx == buf.length; }
     <at> property char front() { return buf[idx]; }
    void popFront() { ++idx; }
    char[uint.sizeof * 3] buf;
    size_t idx;
  }
  return Result(u);
}

import std.stdio;
(Continue reading)

Heisenbug involving Destructors & GC - Help Needed

I seem to have run into a heisenbug involving destructors and the 
GC. I'm kind of stuck at this point and need help tracking down 
the issue.

I put the broken code in a branch called heisenbug on github:
https://github.com/higgsjs/Higgs/tree/heisenbug

The problem manifests itself on runs of `make test` (my 
unittests), but only some of the time. I wrote a script to run 
`make test` repeatedly to try and find a solution:
https://github.com/higgsjs/Higgs/blob/heisenbug/source/repeatmaketest.py

The problem usually manifests itself after 5 to 15 runs on my 
machine. I get a segmentation fault, not always in the same 
place. The randomness seems to stem from address space 
randomization.

It seems the issue is caused by my freeing/reinitializing the VM 
during unit tests. More specifically, commenting out this line 
makes the problem go away:
https://github.com/higgsjs/Higgs/blob/heisenbug/source/runtime/vm.d#L741

Higgs can run all of my benchmarks without ever failing, but 
restarting the VM during `make test` seems to be causing this 
problem to happen. It's not impossible that there could be 
another underlying issue, such as the JITted code I generate 
corrupting some memory location, but it would seem that if this 
were the case, the issue would likely show up outside of unit 
tests. Any help would be appreciated.

(Continue reading)

jmh530 via Digitalmars-d | 26 Jun 18:53 2015

Re: What D Needs…

On Friday, 26 June 2015 at 09:12:04 UTC, Russel Winder wrote:
>
> I think I may not be doing that review now as I have started on 
> trying to get Chapel working well with Python 3. C++, D, Rust, 
> Go are millennia behind Chapel in terms of managing local and 
> cluster parallelism: Chapel is a PGAS language so handles 
> clusters of muli -multicore processors in a single program.

I'm not really that familiar with Chapel (I read your thread a 
few weeks ago here and a simple tutorial but that's it). What do 
you think it does better?


Gmane