July 27, 2022

On Wednesday, 27 July 2022 at 03:42:07 UTC, Walter Bright wrote:

>

On 7/26/2022 3:52 AM, Andrey Zherikov wrote:

>

But how should I check that a specific feature is added to compiler/phobos or a specific bug is fixed?

Create a single "configuration module", which has a section for each version:

module config;

version (DigitalMars)
{
    import digitalmars;
}
else version (LDC)
{
    import ldc;
}
else version (GDC)
{
    import gdc;
}
else
{
    static assert(0, "unsupported system");
}

Now, in digitalmars.d and ldc.d and gdc.d, do what it takes to make that configuration work for your code.

This makes it really easy to concentrate, say, in ldc.d, just on ldc's characteristics. Rather than having to constantly confuse yourself with which configuration is compiling what code.

What's your recommendation about how I should check for a specific feature/bugfix? Should I use static if(__VERSION__ ...), static if(__traits(compiles, { ... })) or something else?

July 27, 2022
On 7/27/2022 7:24 AM, Andrey Zherikov wrote:
> What's your recommendation about how I should check for a specific feature/bugfix? Should I use `static if(__VERSION__ ...)`, `static if(__traits(compiles, { ... }))` or something else?

__VERSION__ is certainly more convenient.

Though, since upgrades to the compiler are free, a simpler strategy would be to just require a __VERSION__ past a certain point.

July 28, 2022

On Wednesday, 27 July 2022 at 17:16:30 UTC, Walter Bright wrote:

>

On 7/27/2022 7:24 AM, Andrey Zherikov wrote:

>

What's your recommendation about how I should check for a specific feature/bugfix? Should I use static if(__VERSION__ ...), static if(__traits(compiles, { ... })) or something else?

VERSION is certainly more convenient.

Though, since upgrades to the compiler are free, a simpler strategy would be to just require a VERSION past a certain point.

Did I get you right that you discourage using static if for versioning the code (according to this post) with an exception for static if(__VERSION__ ...)?

July 28, 2022
On 7/28/2022 7:57 AM, Andrey Zherikov wrote:
> Did I get you right that you discourage using `static if` for versioning the code (according to [this post](https://forum.dlang.org/post/tbair7$2ltc$1@digitalmars.com)) with an exception for `static if(__VERSION__ ...)`?

Yes, you did.

Mainly, because the compiler doesn't generate a predefined version for every change, which is impractical.

Frankly, what you're trying to do is hopeless, hence the suggestion to simply pick a minimum __VERSION__ to support.

July 29, 2022
On Friday, 29 July 2022 at 01:04:42 UTC, Walter Bright wrote:
> On 7/28/2022 7:57 AM, Andrey Zherikov wrote:
>> Did I get you right that you discourage using `static if` for versioning the code (according to [this post](https://forum.dlang.org/post/tbair7$2ltc$1@digitalmars.com)) with an exception for `static if(__VERSION__ ...)`?
>
> Yes, you did.
>
> Mainly, because the compiler doesn't generate a predefined version for every change, which is impractical.
>
> Frankly, what you're trying to do is hopeless, hence the suggestion to simply pick a minimum __VERSION__ to support.

I'm just trying to clarify your recommendations as a language author. Whether I like it or not is different question but making things clear is important IMO. Thanks for your answers!
April 16, 2023

On Tuesday, 26 July 2022 at 19:25:14 UTC, Dennis wrote:

>

On Thursday, 21 July 2022 at 03:57:31 UTC, Walter Bright wrote:

>

Yes, the numbers are a failed idea of mine. I'd endorse deprecating them.

They are now deprecated:

https://github.com/dlang/dmd/pull/14330

You misquoted, and debug(number) wasn't discussed. If dependencies can't use numbers, it doesn't mean that nothing can use numbers. All version statements don't work for dependencies, because those can be compiled in a different way, which manifested for phobos in practice. In case of debug statement it can mean debugging fidelity, which is meaningful and can span dependencies, if they are compiled with the same settings.

1 2 3 4 5 6 7
Next ›   Last »