September 15, 2022
On Wednesday, 14 September 2022 at 05:58:53 UTC, Walter Bright wrote:
> On 9/13/2022 7:56 PM, Steven Schveighoffer wrote:
>> But it doesn't disprove the fact that *sometimes*, hex digits aren't as clear.
>
> Does sometimes justify a language feature, when there are other ways?

"When there are other ways" doesn't always justify removing a language feature, to turn your question around. One can write switch statements with if-then-else chains, so why not remove switch? The obvious answer is that *sometimes* switch is a better way to say what needs to be said. There's overlap in all languages, programming and otherwise, for exactly this reason.

Again, since you have said there isn't a compelling compiler reason to remove binary literals, I see no good reason to remove them. The simplification benefit is just too small to justify the cost in upset users.
September 15, 2022
On 14.09.22 21:30, Walter Bright wrote:
> On 9/14/2022 4:00 AM, jmh530 wrote:
>> You argue about compiler-complexity AND user-complexity on this topic. Sometimes one, sometimes the other. It's not always consistent and some can find it confusing.
> 
> These things do not have right and wrong answers, and aspects are often contradictory.
> 
> It's true of most non-trivial things.
> 

This is a trivial issue with an obvious correct answer.
September 17, 2022
Honestly every time I need to use binary literals there always is a better approach (hex literals, enums, bitfields, ...) that does the job. Bit counting can be done very well with hex literals with little practice too, it's not so hard.

The point is that a lot of people comes from C/C++ and they're used to use binary literals and they want it in D too. If tomorrow binary literals will be dropped from every programming language on the surface of earth I would simply say "Ok."

On the other hand removing it seems useless, I'd prefer to issue a warning during compilation every time a binary literal is used and to allow user to disable these warnings with a compiler flag if you really need to use these literals.


September 17, 2022
On Wednesday, 14 September 2022 at 05:58:53 UTC, Walter Bright wrote:
> People often complain that D has too many features.

Do they really complain about “too many features”?
Isn’t it rather “too many *incompatible* features” most of the time?

Also: how often is do people actually mean “too many attributes” instead?

September 17, 2022
On Wednesday, 14 September 2022 at 19:34:00 UTC, Walter Bright wrote:
> On 9/12/2022 7:48 AM, jmh530 wrote:
>> I don't recall anyone mentioning the removal of complex/imaginary numbers, but the issues are the same.
> I was surprised at the pretty much non-existent pushback on removing them, even though it did carry with it the loss of the convenient syntax for them.

I’ve *seen* complex numbers being used in real-world D code exactly once (in an example of the Dplug framework, I think).

That’s where the huge difference comes in: binary literals on the other hand are a feature I’ve actually used myself.

And I’d think the same applies to others.
September 17, 2022
On Saturday, 17 September 2022 at 17:22:33 UTC, Loara wrote:
> 
> On the other hand removing it seems useless, I'd prefer to issue a warning during compilation every time a binary literal is used and to allow user to disable these warnings with a compiler flag if you really need to use these literals.

This idea sounds good. Since Walter is determined, he should give us a compiler flag.

SDB@79
September 17, 2022
On Saturday, 17 September 2022 at 19:33:50 UTC, Salih Dincer wrote:
> On Saturday, 17 September 2022 at 17:22:33 UTC, Loara wrote:
>> 
>> On the other hand removing it seems useless, I'd prefer to issue a warning during compilation every time a binary literal is used and to allow user to disable these warnings with a compiler flag if you really need to use these literals.
>
> This idea sounds good. Since Walter is determined, he should give us a compiler flag.
>
> SDB@79

I fail to see the value of such a flag. If there were no plan to remove or deprecate them, why issue a warning in the first place?!

There’s nothing wrong with binary literals (as in potential pitfalls), isnt’t there?
September 17, 2022
On Saturday, 17 September 2022 at 19:23:58 UTC, 0xEAB wrote:
> On Wednesday, 14 September 2022 at 05:58:53 UTC, Walter Bright wrote:
>> People often complain that D has too many features.
>
> Do they really complain about “too many features”?

There’s also an essential difference between “too many features available” and “too many unfinished features WIP” (shared, DIP1000, @live, importC, … to name a few)
September 17, 2022
On 9/17/2022 10:22 AM, Loara wrote:
> The point is that a lot of people comes from C/C++ and they're used to use binary literals

Not really. C11 doesn't have binary literals. C++ added them quite recently.


September 17, 2022

On Saturday, 17 September 2022 at 21:39:59 UTC, Walter Bright wrote:

>

On 9/17/2022 10:22 AM, Loara wrote:

>

The point is that a lot of people comes from C/C++ and they're used to use binary literals

Not really. C11 doesn't have binary literals. C++ added them quite recently.

FWIW, C#, Java, JavaScript, Python and Ruby all have binary literals.