Re: DConf 2019 AGM Livestream

2019-05-12 Thread Aurélien Plazzotta via Digitalmars-d-announce

On Saturday, 11 May 2019 at 07:53:36 UTC, Mike Parker wrote:
Anyone interested in the AGM can watch it at the following 
link. You can leave feedback there, in IRC, or in Discord.


https://youtu.be/cpTAtiboIDs


Will there be a plan to revive the dip 1017 - add a Bottom type 
and submit a stronger proposal thanks to the Human Resource Fund?


Re: bool (was DConf 2019 AGM Livestream)

2019-05-12 Thread H. S. Teoh via Digitalmars-d-announce
On Sun, May 12, 2019 at 01:20:16PM +, Mike Franklin via 
Digitalmars-d-announce wrote:
[...]
> If anyone's looking for a challenge, I welcome them to propose a new
> `Bool` type (note the capital B) for inclusion in my new library.
[...]

As long as && and || continue to evaluate to a 1-bit integer, all
library efforts to implement Bool will be futile.


T

-- 
Never ascribe to malice that which is adequately explained by incompetence. -- 
Napoleon Bonaparte


Re: bool (was DConf 2019 AGM Livestream)

2019-05-12 Thread Exil via Digitalmars-d-announce

On Sunday, 12 May 2019 at 10:58:49 UTC, Andrei Alexandrescu wrote:
Bringing it up over and over again, like a perennial fight in a 
marriage, with the hope of finally convincing the spouse on the 
wrongness of their views - that all is wasted time.


There's a bunch of big rocks to move.


I take it from this response you mean, once a DIP is rejected it 
would never be looked at again, even if a second DIP was created 
for the same purpose with different arguments?


So changes like this one should be reversed then? 
https://github.com/dlang/phobos/pull/5343


And isIntegral should also be updated to include bool? Where is 
the line drawn? Should it be treated like an integral only in the 
language but not in phobos?


Re: bool (was DConf 2019 AGM Livestream)

2019-05-12 Thread Nicholas Wilson via Digitalmars-d-announce

On Sunday, 12 May 2019 at 14:50:33 UTC, Andrei Alexandrescu wrote:

On 5/12/19 1:34 PM, Nicholas Wilson wrote:
However in this case the community consensus is that the chain 
of reasoning you have used to arrive at your decision is wrong.


It's a simple enough matter to be understood, and reasonable to 
assume Walter is not missing any important facts or details. 
Poking holes in his explanations is, I confess, attractive, but 
ultimately are about debate skills rather than technical. I do 
agree that the way explanations on DIP decisions go could and 
should be improved a lot.


Then let me rephrase my complaints as a question (to you, Walter 
and the community):


At what level of egregiousness of the degree to which the 
unanimous community consensus believes both your decision and 
chain of reasoning are fundamentally wrong, do we, the community, 
decide to reject your position completely and implement the 
community consensus?


Re: bool (was DConf 2019 AGM Livestream)

2019-05-12 Thread Jon Degenhardt via Digitalmars-d-announce

On Sunday, 12 May 2019 at 17:08:49 UTC, Jonathan M Davis wrote:

... snip ...
Fortunately, in the grand scheme of things, while this issue 
does matter, it's still much smaller than almost all of the 
issues that we have to worry about and consider having DIPs for.


Personally, I'm not at all happy that this DIP was rejected, 
but I think that continued debate on it is a waste of 
everyone's time.


Agreed. I too have never liked numeric values equated to 
true/false, in any programming language. However, it is very 
common. And, relative to other the big ticket items on the table, 
of minor importance. Changing the current behavior won't 
materially affect the usability of D or its future. This is a 
case where the best course is to make a decision move on.


--Jon



Re: bool (was DConf 2019 AGM Livestream)

2019-05-12 Thread Jonathan M Davis via Digitalmars-d-announce
On Sunday, May 12, 2019 8:50:33 AM MDT Andrei Alexandrescu via Digitalmars-
d-announce wrote:
> On 5/12/19 1:34 PM, Nicholas Wilson wrote:
> > However in this case the community consensus is that the chain of
> > reasoning you have used to arrive at your decision is wrong.
>
> It's a simple enough matter to be understood, and reasonable to assume
> Walter is not missing any important facts or details. Poking holes in
> his explanations is, I confess, attractive, but ultimately are about
> debate skills rather than technical. I do agree that the way
> explanations on DIP decisions go could and should be improved a lot.

Really, what it comes down to is that Walter has a very different view on
what a bool is and what it means than many in the community. His explanation
makes it clear why he made the decision that he made. Many of us don't agree
with the decision, because we view bool and its purpose very differently,
but unless someone has an argument that would actually convince Walter to
look at bools differently, it's a pretty pointless discussion. It's
frustrating, and many of us do think that D is worse than it could be
because of the decision, but ultimately, Walter is the one in charge, and
that's just how it goes. This just highlights how the language is ultimately
controlled by the one or two people at the top and not by the community at
large. It's not a democracy, which on the whole is a good thing. If all
language decisions were made by majority vote, the language would be an
utter mess. But that does have the downside that sometimes something that
many people want doesn't happen, because those in charge don't agree. Such
is life. Fortunately, in the grand scheme of things, while this issue does
matter, it's still much smaller than almost all of the issues that we have
to worry about and consider having DIPs for.

Personally, I'm not at all happy that this DIP was rejected, but I think
that continued debate on it is a waste of everyone's time.

- Jonathan M Davis





Re: bool (was DConf 2019 AGM Livestream)

2019-05-12 Thread Andrei Alexandrescu via Digitalmars-d-announce

On 5/12/19 1:34 PM, Nicholas Wilson wrote:
However in this case the community consensus is that the chain of 
reasoning you have used to arrive at your decision is wrong.


It's a simple enough matter to be understood, and reasonable to assume 
Walter is not missing any important facts or details. Poking holes in 
his explanations is, I confess, attractive, but ultimately are about 
debate skills rather than technical. I do agree that the way 
explanations on DIP decisions go could and should be improved a lot.


Re: bool (was DConf 2019 AGM Livestream)

2019-05-12 Thread Mike Franklin via Digitalmars-d-announce

On Saturday, 11 May 2019 at 20:35:40 UTC, Exil wrote:

Sure it is convenient to have some properties of bool also be 
similar to an integer, but it can definitely not be swapped in 
to be used like a 1-bit integer and there are already plenty of 
special rules for it.


Thanks for that analysis.  So we have a bool that is neither a 
boolean nor a bit.  That stinks.


Walter and Andrei have made their decision, so it doesn't look 
like we'll be able to do anything about it unless maybe Atila 
feels that it's something that needs to be addressed.


Anyway, I'm of the mind that the language should just provide a 
set of powerful, composable primitives and delegate 
course-grained features and specializations to the library.  I've 
been re-imagining druntime and phobos at lot lately and I'm more 
confident that we can define a wrapper around `bool` to give it 
proper boolean semantics.  Maybe, if Walter would support it, we 
could then fix bool to make it a proper `bit`.  Then in the 
library `alias bit = bool;` and live happily ever after.


If anyone's looking for a challenge, I welcome them to propose a 
new `Bool` type (note the capital B) for inclusion in my new 
library.


Mike


Re: bool (was DConf 2019 AGM Livestream)

2019-05-12 Thread Nicholas Wilson via Digitalmars-d-announce

On Sunday, 12 May 2019 at 10:58:49 UTC, Andrei Alexandrescu wrote:
Rejected D Improvement Proposals on small matters that D 
language's leader thinks strongly about should allow everybody 
to move on to larger, better things.


We are unable to, and should not be required to, provide 
argumentation when making a decision on a DIP that will be to 
the satisfaction of everybody involved.


No no no, no. No.

You have rejected the DIP to the annoyance of the community, That 
is fine. You have a decision making process.


However in this case the community consensus is that the chain of 
reasoning you have used to arrive at your decision is wrong.


Of course, pressure does exist on making the right decision and 
on framing it properly;


Indeed, you should be making the right decisions _ for the right 
reasons_. I note that this is uncorrelated with wether or not we 
want the feature, c.f. refcounting before we had copy 
constructors (wanted it but couldn't have it because memory 
safety reasons) and opPostMove (didn't want to have to have it 
but e.g. couldn't interface with GCC's std::string).


otherwise, one poor decision after another, we end up with a 
bad language that people will not want to use.


Yes, but for the completely opposite reason. If the community 
believe the reasoning you provide for the decision you have made 
is wrong then we will end up with a language we not as satisfied 
with.



[Because reasons] that all is wasted time.

There's a bunch of big rocks to move.


Jut because we have a bunch of other large problems does not mean 
that we shouldn't be fixing other problems in the language that 
you happen to disagree with.




Re: bool (was DConf 2019 AGM Livestream)

2019-05-12 Thread Andrei Alexandrescu via Digitalmars-d-announce

On 5/12/19 11:27 AM, Isaac S. wrote:
This is the crux of the argument: *How* does making bool an integer add 
to the language?


The crux of the argument is there was a D Improvement Proposal on a 
small language change, and it was rejected.


Rejected D Improvement Proposals on small matters that D language's 
leader thinks strongly about should allow everybody to move on to 
larger, better things.


We are unable to, and should not be required to, provide argumentation 
when making a decision on a DIP that will be to the satisfaction of 
everybody involved. Of course, pressure does exist on making the right 
decision and on framing it properly; otherwise, one poor decision after 
another, we end up with a bad language that people will not want to use.


Walter's last argument in this thread is poorly made and has several 
factual errors. He's traveling and with a bunch of stuff going on right 
after DConf. But the larger point is it doesn't matter - the DIP was 
looked at and rejected (I should add I concurred with the decision and 
still do). Bringing it up over and over again, like a perennial fight in 
a marriage, with the hope of finally convincing the spouse on the 
wrongness of their views - that all is wasted time.


There's a bunch of big rocks to move.


Re: bool (was DConf 2019 AGM Livestream)

2019-05-12 Thread Isaac S. via Digitalmars-d-announce

On Sunday, 12 May 2019 at 05:43:01 UTC, Walter Bright wrote:

On 5/11/2019 7:27 PM, Mike Franklin wrote:
I understand. Every programmer, sooner or later, decides to 
step up and take a swing at inventing boolean. (I have too - 
did you know that D used to have a `bit` builtin type?)


Yes, D did have a bit type that was removed since it required 
special casing for something that didn't provide much of a 
benefit.


The programming landscape is littered with the corpses of one 
after another.


You say the programming landscape, yet give very limited 
examples. It would help to give examples in languages that did 
not have a hindered boolean type. In languages with a 
non-hindered boolean (e.g. Java) I've only ever seen custom 
booleans for overloading or to flag intent when named arguments 
are unsupported.



Phobos has multiple ones


Well... yes, this is Phobos; Phobos is in need of a cleanup.


RefCountedAutoInitialize .yes and .no


Something like this is probably a remnant of code made before 
std.typecons.Flag. It shouldn't have gotten into Phobos 
(regardless of if it was before or after std.typecons.Flag).



and even a struct Yes and a struct No.


The structs Flag, Yes, and No should not be considered by 
themselves as they are all apart of the same concept. The Flag 
concept is to force a caller to explicitly state what true/false 
mean. This is desired due to the lack of named arguments in D.


std.bitmanip has an enum A{True,False}. std.json has enum 
E{True=true}.


In unittests they do. The std.bitmanip is most likely 
overzealously testing something (1-bit sized enum?). The std.json 
one is obviously testing if an enum with an underlying boolean 
value is correctly converted.



std.typecons has the bizarre enum issue10647_isAlwaysTrue=true;.


Yes, that is bizarre. Considering its a enum constant of type 
bool, this doesn't pertain to custom boolean types.


The C++ Committee currently is fiercely debating adding a 
"Boolean" construct in one of the longest threads I've ever 
seen. One of their problems is it conflicts with the endless 
"Boolean" types added to existing C++ code, along with every 
variation "Bool", "Bool", "boolean", etc.


All this effort strongly implies that there's no such thing as 
a satisfactory bool type.


No, this implies C++ had a boolean type that was lacking; which 
it *severely* is in type safety.


There are multiple booleans in C++ because programmers are not 
going to unite on one *non-standard* boolean type. Even if the 
committee added one, it will take years for the damage to be 
undone (if ever).



Will you succeed where 10,000 other programmers have failed?
Seems unlikely. But I doubt I will dissuade you from trying.


Well other than the overstatement on reinventing the boolean; I 
do agree here that success is unlikely, but not for the same 
reason. A custom boolean type will be used infrequently (I'm 
certainly not depending on a dub package just for a boolean 
type), will have to be imported in *every* file it is used in, 
and will inevitably fracture whenever someone copies the code to 
their codebase.



So what does work reasonably?
Treating it like a small integer.


So mixing the concepts of true/false and numerical data is 
"reasonable". I'll have to remember that if I ever have a 
true/false test; 1's and 0's are quicker to write than T's and 
F's.


Jokes aside, I have yet to see how making it a "small integer" 
improves this supposed reinventing-the-bool-wheel problem or 
makes it anymore useful than a normal boolean. In fact, it seems 
more-so like you've made a oval wheel: technically functional but 
not really.


I know the operator ++ difference, and it is my fault that I 
succumbed to a moment of boolean madness and allowed that in. 
(++ on D bool is saturation arithmetic, unlike the overflow 
semantics in every other integer type. It is a mistake, please 
don't use that as justification for adding more quirky 
behaviors.)


I don't have to justify other quirky behavior with ++ being 
saturated arithmetic because you said:



Treating it like a small integer.


If bool is going to be a 1-bit integer with saturated arithmetic 
semantics, then it should act like one. +=, -=, *=, ^^=, /=, and 
%= should be allowed as it is a "small integer". Sure /= and %= 
would largely be a divide-by-zero operation, but at least bool 
would be the type unsafe "integer" it is suppose to be.


We know what the various integer semantics are, and it fits 
right in with that.


I have yet to see where bool fits into integer semantics 
reasonably without causing problems and annoyances (as well as 
having just generally weird behavior).


On a final note, C++ added a std::vector special case, 
which works unlike any other vector type. Years of experience 
have shown that to have been a mistake, just like all the 
others, and it is widely derided as a complete failure.


That isn't a fault of bool by any means, that is the fault of 
making an unnecessary 

Re: bool (was DConf 2019 AGM Livestream)

2019-05-12 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-announce

On 5/12/19 1:43 AM, Walter Bright wrote:

On 5/11/2019 7:27 PM, Mike Franklin wrote:
I think Walter is conflating how bool is stored in memory with its 
semantics.


That's exactly what I'm deliberately doing.

I'm currently considering using D's rich modeling features to create a 
new boolean type that behaves more like a boolean and less like a 
bit.  But it's unfortunate and disappointing we have to resort to 
something like that.


I understand. Every programmer, sooner or later, decides to step up and 
take a swing at inventing boolean.


No, not really. Only the ones using languages that either lack a 
high-level notion of boolean or conflate it with an integer.


(I have too - did you know that D 
used to have a `bit` builtin type?)


Yes. I remember those days. It was renamed "bool" to better reflect its 
actual real-world use-cases.


The programming landscape is 
littered with the corpses of one after another.


Only in languages that either lack a built-in bool or conflate it with 
integers.


Phobos has multiple ones 
- RefCountedAutoInitialize .yes and .no,


Basically the same as the "struct Yes and No" below...(and if it's 
somehow *diffe rent* from the normal struct yes/no, then that sounds 
like a very clear Phobos failing...)


and even a struct Yes and a 
struct No.


Which Andrei *intentionally* created as a library-based substitute for 
*named arguments*, if you'll recall without contorting the true history.


std.bitmanip has an enum A{True,False}. std.json has enum 
E{True=true}. std.typecons has the bizarre enum 
issue10647_isAlwaysTrue=true;.

> (One wonders what would happen if it was
> set to false. Would it cause a rip in the fabric of space-time? I dare
> not experiment with that!)


Yet more examples of how D either sucks at bool and/or needs named 
arguments. Thus, completely failing to provide support for the patently 
false "Every programmer, sooner or later, decides to [...] take a swing 
at inventing boolean" claim.


The C++ Committee currently is fiercely debating adding a "Boolean" 
construct in one of the longest threads I've ever seen. One of their 
problems is it conflicts with the endless "Boolean" types added to 
existing C++ code, along with every variation "Bool", "Bool", "boolean", 
etc.


Alex, I'll take "Languages which conflate boolean with integer" for 
$500, please...


Daily double

All this effort strongly implies that there's no such thing as a 
satisfactory bool type.


Correction:

All this effort strongly implies that there's no such thing as a 
satisfactory bool type *in languages which conflate booleans with integers*


On a final note, C++ added a std::vector special case, which works 
unlike any other vector type. Years of experience have shown that to 
have been a mistake, just like all the others, and it is widely derided 
as a complete failure.


Ohh, I see..So...you're saying that special-casing an *aggregate* of a 
type **cough**char**cough** is bad. And furthermore, that in turn, 
demonstrates that the element type of a special-cased aggregate must 
therefore be unsound as well.


Or is it that applying correct semantics to a type's aggregate without 
also applying them to the type itself is a recipe for disaster?