June 17, 2022

On Friday, 17 June 2022 at 06:18:30 UTC, Paulo Pinto wrote:

>

Where is the DIP for ImportC

According to Walter in last DConf online ImportC is supposed to be compiler-specific thing, not part of the language. Of course this means it's description should not be in the spec. It belongs to the dmd manual.

>

or @live?

here, well not quite but kind of. The attribute itself is not part of that DIP but at least it describes an important part of @live.

But I get your point, that the language maintainers have not always gone through the DIP process when adding new functionality. IMO it should not be a requirement for them to do so when there is no reason to, but it should be the standard procedure when designing something major. I share your viewpoint that Walter has sometimes cowboyed past the process (or tried to) when it'd been better to write a DIP or at least discuss the issue before acting. His track record is not all bad though. The bottom type DIP Walter submitted was rejected, but a revision of that by Dennis was later accepted.

June 17, 2022
On 6/16/2022 4:45 AM, Olivier Pisano wrote:
> I am suggesting language design is hard.

Not the least of which is there is no such thing as a correct language design. There are only tradeoffs.
June 18, 2022
On Friday, 17 June 2022 at 21:40:58 UTC, Walter Bright wrote:
> On 6/16/2022 4:45 AM, Olivier Pisano wrote:
>> I am suggesting language design is hard.
>
> Not the least of which is there is no such thing as a correct language design. There are only tradeoffs.

There is an inconsistent language design. If the main paradigm the language is built around is class-based OOP, then it is reasonable to expect that 'private' is class-private (or at least there is a way to express class-private).
June 17, 2022
On 6/17/2022 10:14 PM, Max Samukha wrote:
> On Friday, 17 June 2022 at 21:40:58 UTC, Walter Bright wrote:
>> Not the least of which is there is no such thing as a correct language design. There are only tradeoffs.
> 
> There is an inconsistent language design. If the main paradigm the language is built around is class-based OOP, then it is reasonable to expect that 'private' is class-private (or at least there is a way to express class-private).

Consistency is a worthy goal, but as I explained in my recent Code Europe presentation, too much consistency leads to undesirable results, too.

For example:

    for (int i = 0; i; ++i);
    {
        ...
    }

D adds grammatical inconsistency to reject that.

And then there's that famously inconsistent symbol table lookup that D does that everyone but me insisted is intuitive :-)
June 18, 2022
On Saturday, 18 June 2022 at 05:14:20 UTC, Max Samukha wrote:
> On Friday, 17 June 2022 at 21:40:58 UTC, Walter Bright wrote:
>> On 6/16/2022 4:45 AM, Olivier Pisano wrote:
>>> I am suggesting language design is hard.
>>
>> Not the least of which is there is no such thing as a correct language design. There are only tradeoffs.
>
> There is an inconsistent language design. If the main paradigm the language is built around is class-based OOP, then it is reasonable to expect that 'private' is class-private (or at least there is a way to express class-private).

D is not built around a class-based OOP paradigm. D includes class OOP as one paradigm among many.
June 18, 2022

On Saturday, 18 June 2022 at 07:46:27 UTC, FeepingCreature wrote:

>

D is not built around a class-based OOP paradigm. D includes class OOP as one paradigm

It is breaks with the conventions for «class private». Most, if not all, class-based languages have OOP as a feature and not a paradigm. The inventors stressed that OOP was not a paradigm.

June 18, 2022

On Saturday, 18 June 2022 at 07:53:52 UTC, Ola Fosheim Grøstad wrote:

>

On Saturday, 18 June 2022 at 07:46:27 UTC, FeepingCreature wrote:

>

D is not built around a class-based OOP paradigm. D includes class OOP as one paradigm

It is breaks with the conventions for «class private». Most, if not all, class-based languages have OOP as a feature and not a paradigm. The inventors stressed that OOP was not a paradigm.

I mean, I think it's important in this case because aiui private is ignored in modules because modules are the more central unit of abstraction than classes; a function in a module is "on the same level" as a method in the class. So in that specific sense, it's more correct to call D a module-based language than a class-based one.

Aside: that's actually important if you consider that certain features do not work with class methods!

June 18, 2022

On Saturday, 18 June 2022 at 05:14:20 UTC, Max Samukha wrote:

>

On Friday, 17 June 2022 at 21:40:58 UTC, Walter Bright wrote:

>

On 6/16/2022 4:45 AM, Olivier Pisano wrote:

>

I am suggesting language design is hard.

Not the least of which is there is no such thing as a correct language design. There are only tradeoffs.

There is an inconsistent language design.

Is there for D; do you mean D! I think D Programming Language is consistent. Even from Walter's example I see no problem?

void main()
{
  for (int i = 1; i; --i)
  {
       //assert(i != 1); // error in loop block
  }
  // Equivalent:
  size_t singleLoopError = 1;
  do
  {
    assert(singleLoopError != 1);
  } while (--singleLoopError);
}

SDB@79

June 18, 2022

On Saturday, 18 June 2022 at 08:49:30 UTC, Salih Dincer wrote:

>

for (int i = 1; i; --i)
{

D supports this or the for (i = 0; i; i++) variant. Walter's example has a semicolon before the brace - that is an error as it's easy not to notice it!

June 18, 2022

On Saturday, 18 June 2022 at 08:04:55 UTC, FeepingCreature wrote:

>

I mean, I think it's important in this case because aiui private is ignored in modules because modules are the more central unit of abstraction than classes; a function in a module is "on the same level" as a method in the class. So in that specific sense, it's more correct to call D a module-based language than a class-based one.

I guess I understand what you mean, you can technically use a module as a singleton, but I would claim that modules primarily are namespaces.

But it is a fact that it is very unusual to provide many access control mechanisms, but not class-private. Even Python, that provides no access control, does at least do name mangling for class private fields. So being surprised about this is warranted.

(Not suggesting this is a pressing issue for D, as things like getting better memory management is much more important.)