September 15, 2022

On Thursday, 15 September 2022 at 08:40:22 UTC, Dukc wrote:

>

What features could be removed from D if it were up to you? Please consider the breakage that would result from the removal, don't settle on thinking what shouldn't have been added in the first place.

  • Identifier-delimited string literals (https://dlang.org/dips/1026)
  • Typesafe variadic arguments (https://github.com/dlang/dmd/pull/11124)
  • lazy
  • alias this inside a class
  • old alias type identifier notation instead of alias identifier = type
  • extern(C++, identifier) (Mathias Lang did not manage to convince Walter at DConf 2022 though)
  • __FUNCTION__ and __PRETTY_FUNCTION__
  • this(this) (postblit is superseded by copy constructor, though there are still a lot of bugs)
  • Redundant __traits such as isFloating, isIntegral, isScalar, isStaticArray, isUnsigned

Not 100% sure about each one, but these are my candidates

September 15, 2022

ImportC, betterC, @nogc, nothrow, @safe, @property, nested comments, delimited strings, case labels, new alias syntax.

The new alias syntax works well for simple symbol alias, but feels less natural for more complex types so I actually went to the old syntax for all my aliases.

September 15, 2022

On Thursday, 15 September 2022 at 13:43:01 UTC, Dennis wrote:

>

On Thursday, 15 September 2022 at 08:40:22 UTC, Dukc wrote:

>

What features could be removed from D if it were up to you? Please consider the breakage that would result from the removal, don't settle on thinking what shouldn't have been added in the first place.

  • alias this inside a class

I would be all for this if we could get something like opImplCast() which would basically be the same as opCast() but without requiring cast.

I believe the operator overloads must be static for it to work properly with ex. Foo foo = 100;.

Foo foo = 100; // Would trigger static void opImplCast(T)(T value) where T is int.
int a = foo; // Would trigger ex. static T opImplCast(T)(Foo instance) where T is int

You should of course be able to be explicit about types like int opImplCast(Foo instance);

September 15, 2022

On Thursday, 15 September 2022 at 14:10:07 UTC, bauss wrote:

>
Foo foo = 100; // Would trigger static void opImplCast(T)(T value) where T is int.

Minor typo here, it should be:

Foo foo = 100; // Would trigger static Foo opImplCast(T)(T value) where T is int.
September 15, 2022

On Thursday, 15 September 2022 at 12:20:51 UTC, IGotD- wrote:

>

On Thursday, 15 September 2022 at 12:19:28 UTC, ryuukk_ wrote:

>

You have then to import the module everywhere, wich makes the feature i want a painful nightmare

Another thing for D3, global imports. The list is getting longer :).

Global import is not what i want, it's actually a very bad idea, it encourages poor practices, it'll lead to poor build speed and bloated global scope

What i want is modernizing the builtin types instead of keeping imaginary english names that originate from C era

September 15, 2022

On Thursday, 15 September 2022 at 13:43:01 UTC, Dennis wrote:

>

The non-array forms should be deprecated. What is (int i...) even useful for?

>
  • lazy

With or without Walter's idea of a delegate parameter returning T automatically wrapping an argument of type T into a delegate? That doesn't seem to be implemented:

implicitlazy.d(10): Error: function implicitlazy.f(int delegate() d) is not callable using argument types (int)

>
  • alias this inside a class

It's fine if the class is final.

>
  • old alias type identifier notation instead of alias identifier = type

+1

>
  • __FUNCTION__ and __PRETTY_FUNCTION__

Are there traits for these instead?

>
  • this(this) (postblit is superseded by copy constructor, though there are still a lot of bugs)

The docs have:
WARNING: The postblit is considered legacy and is not recommended for new code

So we could probably add it to the deprecate.dd list for future deprecation when copy ctor is robust enough.

>
  • Redundant __traits such as isFloating, isIntegral, isScalar, isStaticArray, isUnsigned

Redundant because of Phobos? Isn't that going to cause lots of template instantiations?

September 15, 2022
On Thu, Sep 15, 2022 at 01:18:30PM +0000, bauss via Digitalmars-d wrote:
> On Thursday, 15 September 2022 at 12:19:28 UTC, ryuukk_ wrote:
> > On Thursday, 15 September 2022 at 11:24:07 UTC, bauss wrote:
> > > alias uint = u32;
> > 
> > You have then to import the module everywhere, wich makes the feature i want a painful nightmare
> 
> Could be added to the runtime module and then simply over a couple years the aliases will be deprecated.

That still requires basically *every single D project on the planet* to be rewritten to the new type names over the deprecation period.

Not practical.

And seriously, guys, these are just *arbitrary names* for built-in types. At the cost of wholesale breakage of all existing code? Bikeshedding at its finest. This is DOA.


T

-- 
Verbing weirds language. -- Calvin (& Hobbes)
September 15, 2022
On 15.09.22 15:43, Dennis wrote:
> - `extern(C++, identifier)` (Mathias Lang did not manage to convince Walter at DConf 2022 though)

+1. This is a great example of both unnecessary language and user complexity:

- It's basically never what you want (the same namespace imported from different D modules will clash with itself).

- It clashes with actually useful features, now people sometimes have to write the unsightly `extern(C++, (identifier))` to hack around the existence of a feature that does not need to exist in the first place.

- It introduces new unexpected scoping rules.

Kill it. (Or fix it I guess, but don't just leave it the way it is.)
September 15, 2022

On Thursday, 15 September 2022 at 17:56:57 UTC, Nick Treleaven wrote:

> >
  • lazy

With or without Walter's idea of a delegate parameter returning T automatically wrapping an argument of type T into a delegate?

For my part, without.

> >
  • __FUNCTION__ and __PRETTY_FUNCTION__

Are there traits for these instead?

I think there's __traits(parent, {}) inside a function body.

September 15, 2022

On Thursday, 15 September 2022 at 19:19:13 UTC, Dennis wrote:

>

I think there's __traits(parent, {}) inside a function body.

Why on this god-forsaken piece of rock do we need this abomination while we could easily have a self, __self, scope, __scope, __traits(scope) or whatever to refer to the current scope?