March 31, 2017
On Friday, March 31, 2017 17:49:48 Walter Bright via Digitalmars-d wrote:
> One of my longer term goals for DMD is to make it as lazy as possible - only parse and do semantic analysis if the result is actually needed. Not doing the parse for unused unittest blocks is a step in that direction.
>
> The code is still required to be correct, but the compiler isn't required to diagnose it.

There are certainly advantages to having the compiler skip over code where it can, but it's pretty weird for the language to require that something be valid and then have the compiler ignore it. That makes it really easy to have something compile on one compiler but not another. Granted, properly unit testing and testing code on a variety of platforms (so that all of the version blocks and static if branches are tested) should catch those issues regardless, but it does seem a bit off to me for the language to require something and for the compiler to not care - especially the reference compiler.

- Jonathan M Davis

March 31, 2017
On 3/31/2017 6:33 PM, Jonathan M Davis via Digitalmars-d wrote:
> There are certainly advantages to having the compiler skip over code where
> it can, but it's pretty weird for the language to require that something be
> valid and then have the compiler ignore it. That makes it really easy to
> have something compile on one compiler but not another. Granted, properly
> unit testing and testing code on a variety of platforms (so that all of the
> version blocks and static if branches are tested) should catch those issues
> regardless, but it does seem a bit off to me for the language to require
> something and for the compiler to not care - especially the reference
> compiler.

I know. But it is worth it. It should enable D compilers to scale to handling very large imports.

April 01, 2017
On Saturday, 1 April 2017 at 02:12:46 UTC, Walter Bright wrote:
> On 3/31/2017 6:33 PM, Jonathan M Davis via Digitalmars-d wrote:
>> [...]
>
> I know. But it is worth it. It should enable D compilers to scale to handling very large imports.

This should be optional and controlled via a switch like --fast-parse ?
April 01, 2017
On 4/1/2017 12:39 AM, Stefan Koch wrote:
> This should be optional and controlled via a switch like --fast-parse ?

Too many switches are a disease, and we already have an awful lot.

The non-parsing of unittests have been there for quite a while now, and have not caused any trouble. I see that as good evidence we're on a good path with this.
April 01, 2017
On Saturday, 1 April 2017 at 09:20:06 UTC, Walter Bright wrote:
> On 4/1/2017 12:39 AM, Stefan Koch wrote:
>> This should be optional and controlled via a switch like --fast-parse ?
>
> Too many switches are a disease, and we already have an awful lot.
>
> The non-parsing of unittests have been there for quite a while now, and have not caused any trouble. I see that as good evidence we're on a good path with this.

Indeed. There's no need for such a switch as there is already one -unittest.
April 01, 2017
On Sat, 01 Apr 2017 07:39:49 +0000, Stefan Koch wrote:

> On Saturday, 1 April 2017 at 02:12:46 UTC, Walter Bright wrote:
>> On 3/31/2017 6:33 PM, Jonathan M Davis via Digitalmars-d wrote:
>>> [...]
>>
>> I know. But it is worth it. It should enable D compilers to scale to handling very large imports.
> 
> This should be optional and controlled via a switch like --fast-parse ?

I wonder if `dmd -o-` should continue to parse everything (possibly including unittests, which it currently doesn't do) rather than parse lazily. Though it would benefit from a speed increase, it's used to syntax check and would be more useful if it actually does parse everything.
April 01, 2017
On Sat, Apr 01, 2017 at 02:14:25PM +0000, rjframe via Digitalmars-d wrote:
> On Sat, 01 Apr 2017 07:39:49 +0000, Stefan Koch wrote:
> 
> > On Saturday, 1 April 2017 at 02:12:46 UTC, Walter Bright wrote:
> >> On 3/31/2017 6:33 PM, Jonathan M Davis via Digitalmars-d wrote:
> >>> [...]
> >>
> >> I know. But it is worth it. It should enable D compilers to scale to handling very large imports.
> > 
> > This should be optional and controlled via a switch like --fast-parse ?
> 
> I wonder if `dmd -o-` should continue to parse everything (possibly including unittests, which it currently doesn't do) rather than parse lazily. Though it would benefit from a speed increase, it's used to syntax check and would be more useful if it actually does parse everything.

What's wrong with `dmd -unittest -o-`?


T

-- 
Unix is my IDE. -- Justin Whear
1 2 3
Next ›   Last »