October 09, 2021

On Monday, 4 October 2021 at 13:23:40 UTC, Paul Backus wrote:

>

I thought it might be fun to ask the D community: **which of the above values do you think are the most important to D?

A little while back I evaluated Go, Rust, D as a replacement for the
split python/C I'd been using for my day to day working language.
I wanted a compiled language, so that simple code was also fast. I
was still irritated with C++ template noise so, maybe unfairly, I ruled
that out.

In order not to sway my reasons, I haven't looked at the list of values,
but here's five aspects I appreciated.

  1. Humility - The language did not try to evangelize a one-right-way(tm)
    to do everything. It laid out a big tool box and trusted me* as the
    programmer to pick the best approach for the job.

  2. Compatibility - I still have a lot of C code lying around. Calling
    into C libraries is an absolute minimum requirement.

  3. Completeness - With operator overloading, associative arrays,
    classes, lambda functions and yes, garbage collection, I'm given
    a wide range of tools for turning ideas into code.

  4. Competence - After reading Andrei's book and browsing this forum I
    came to the opinion that seriously clever people were behind D.

  5. Fun - The community seemed to be having fun with D. That sentiment
    started with the name.

--
*probably more then it should, but hey, flattery is nice.

October 09, 2021

On Saturday, 9 October 2021 at 00:30:21 UTC, Adam Ruppe wrote:

>

D is realistically best suited to be a more fun C#.

Yes, absolutely! I made the move from C++ to C# about 15 years ago. The C# ecosystem is really a pretty good place to be. But its metaprogramming capabilities, while once competitive, are now pretty unimpressive. The programming language state-of-the-art has come a long way in the last 20 years (even if most people are still using old tech.) The D language's CFTE is really THE game changer. I know of nothing else like it, and I could make some really good use of that in my C# code base...

So I'm using D for some new projects. Of course, it has some other pretty innovative things too. For example, the scope(exit) construct. That's soooo much better than needing to enclose things in layer after layer of try-catch blocks. Other languages should all be copying this construct.

Anyway, yes, D is a very compelling option for experienced C# developers who want to be more on the cutting edge.

October 09, 2021

On Saturday, 9 October 2021 at 00:23:00 UTC, russhy wrote:

>

Why do you guys compare D to C#, if there is one language you should compare D is with
(actually 3) Go/Rust/Zig

C# appeals to Java people, it's not a native system language, it compiles to IL and requires a massive runtime

The more you look at C#, the faster you'll miss the biggest agendas of tomorrow, C# just like Java are slowing meeting with the graveyard of old and irrelevant tech

Mostly thinking about the language itself, syntax

October 09, 2021

On Saturday, 9 October 2021 at 00:59:42 UTC, Greg Strong wrote:

>

On Saturday, 9 October 2021 at 00:30:21 UTC, Adam Ruppe wrote:

>

D is realistically best suited to be a more fun C#.

Yes, absolutely! I made the move from C++ to C# about 15 years ago. The C# ecosystem is really a pretty good place to be. But its metaprogramming capabilities, while once competitive, are now pretty unimpressive. The programming language state-of-the-art has come a long way in the last 20 years (even if most people are still using old tech.) The D language's CFTE is really THE game changer. I know of nothing else like it, and I could make some really good use of that in my C# code base...

So I'm using D for some new projects. Of course, it has some other pretty innovative things too. For example, the scope(exit) construct. That's soooo much better than needing to enclose things in layer after layer of try-catch blocks. Other languages should all be copying this construct.

Anyway, yes, D is a very compelling option for experienced C# developers who want to be more on the cutting edge.

I still find Roslyn compiler plugins and the code generators quite good.

You can simulate scope(exit) with an helper struct.

using System;

#nullable enable

// ensure this is a stack only struct
ref struct ScopeExit {
    public ScopeExit(Action cleaner)
    {
        this.cleaner = cleaner;
    }

    public void Dispose()
    {
      try
      {
         cleaner();
      }
      catch {
         // maybe do something interesting here
      }
    }

    private Action cleaner;

}

public class Example {
    public static void Main() {
        using var netSocket = new ScopeExit(() => { /* clean somethig */});
    }
}

Naturally D's scope(exist) is cleaner to write.

October 09, 2021

On Saturday, 9 October 2021 at 00:23:00 UTC, russhy wrote:

>

Why do you guys compare D to C#, if there is one language you should compare D is with
(actually 3) Go/Rust/Zig

C# appeals to Java people, it's not a native system language, it compiles to IL and requires a massive runtime

The more you look at C#, the faster you'll miss the biggest agendas of tomorrow, C# just like Java are slowing meeting with the graveyard of old and irrelevant tech

So much disinformation.

Here the native code compilers for C#.

https://docs.microsoft.com/en-us/windows/uwp/dotnet-native/

https://docs.microsoft.com/en-us/dotnet/framework/tools/ngen-exe-native-image-generator

https://github.com/dotnet/designs/blob/main/accepted/2020/form-factors.md#native-aot-form-factors

https://docs.microsoft.com/en-us/xamarin/mac/internals/aot

https://docs.unity3d.com/Manual/IL2CPP.html

Running on production embedded hardware,

https://www.wildernesslabs.co

Apparently the majority of the games running in that Nintendo toy, that has broken all sale records, happen to use Unity in about 30% of their titles.

https://www.kelltontech.com/kellton-tech-blog/reasons-develop-nintendo-switch-games-in-unity-game-engine

Another graveyard irrelevant technology that besides Nintendo, is the tier 1 for Sony, Google and Microsoft gaming systems and AR/VR platforms, alongside Unreal.

Looks pretty much alive to me.

D also compiles to LDC bitcode and GCC gimple, and has a runtime.

Should we also consider it not a systems language then?

Don't let the hatred and lack of knowledge for other stacks cloud your judgement.

It steers people away from D when false statements are being done about the ecosystems they know quite well, turning on their defences and thus stop listening on what D is actually supposed to be better on.

October 09, 2021

On Saturday, 9 October 2021 at 06:50:19 UTC, Paulo Pinto wrote:

>

On Saturday, 9 October 2021 at 00:59:42 UTC, Greg Strong wrote:

>

[...]

I still find Roslyn compiler plugins and the code generators quite good.

You can simulate scope(exit) with an helper struct.

using System;

#nullable enable

// ensure this is a stack only struct
ref struct ScopeExit {
    public ScopeExit(Action cleaner)
    {
        this.cleaner = cleaner;
    }

    public void Dispose()
    {
      try
      {
         cleaner();
      }
      catch {
         // maybe do something interesting here
      }
    }

    private Action cleaner;

}

public class Example {
    public static void Main() {
        using var netSocket = new ScopeExit(() => { /* clean somethig */});
    }
}

Naturally D's scope(exist) is cleaner to write.

Omg my eyes. Don't rough up C#, use D instead 😅

Maybe like 5% of the C# community even uses structs and of them 0.5% would do ref struct and 0.1% would try to scope guard something, but nice experiment ofc 💕

October 09, 2021

On Saturday, 9 October 2021 at 00:59:42 UTC, Greg Strong wrote:

>

On Saturday, 9 October 2021 at 00:30:21 UTC, Adam Ruppe wrote:

>

D is realistically best suited to be a more fun C#.

Yes, absolutely! I made the move from C++ to C# about 15 years ago. The C# ecosystem is really a pretty good place to be. But its metaprogramming capabilities, while once competitive, are now pretty unimpressive. The programming language state-of-the-art has come a long way in the last 20 years (even if most people are still using old tech.) The D language's CFTE is really THE game changer. I know of nothing else like it, and I could make some really good use of that in my C# code base...

So I'm using D for some new projects. Of course, it has some other pretty innovative things too. For example, the scope(exit) construct. That's soooo much better than needing to enclose things in layer after layer of try-catch blocks. Other languages should all be copying this construct.

Anyway, yes, D is a very compelling option for experienced C# developers who want to be more on the cutting edge.

This is kinda where I'm at atm. The only thing holding me back is the ecosystem. If we find a bug in D, we can probably fix it. But, if we don't find a library, the cost of creating it might be too big 😢

Imo D is mature enough now. It's battle tested. It's flexible etc. Has great metaprogramming. The language itself doesn't need much change apart from testing what exists even more, especially since we're soon at 2.1 😱

Aim for stability and robustness.
Then focus on ecosystem.

I come in peace, I think

October 09, 2021

On Saturday, 9 October 2021 at 07:38:01 UTC, Imperatorn wrote:

>

Imo D is mature enough now. It's battle tested. It's flexible etc.

That's where I think there are room for improvements.

D is not flexible when it comes to choose memory management type because of lack of fat pointers.
The shared memory model is a disaster.

D is good but it has a few serious warts.

October 09, 2021

On Saturday, 9 October 2021 at 08:47:10 UTC, IGotD- wrote:

>

On Saturday, 9 October 2021 at 07:38:01 UTC, Imperatorn wrote:

>

Imo D is mature enough now. It's battle tested. It's flexible etc.

That's where I think there are room for improvements.

D is not flexible when it comes to choose memory management type because of lack of fat pointers.
The shared memory model is a disaster.

D is good but it has a few serious warts.

Agreed, but here I'm talking about the language aspect. There are some quirks - yes - but are those more important than ecosystem? If you had to choose?

Ideally one would want a 100% complete foundation before expanding the ecosystem, I totally agree. But if I would be forced to choose with a gun to my head, I would say the ecosystem is where it's at. And to build a great ecosystem you need people. And to get people you need some selling points and marketing etc. Otherwise, how would people even know it exists? https://www.sciencedirect.com/science/article/pii/S0950584921001051

I've talked to various devs and like none of them have even heard of D, but when I show it the reaction is often like "hmm, that actually looks kinda nice".

October 09, 2021

On Saturday, 9 October 2021 at 07:31:02 UTC, Imperatorn wrote:

>

On Saturday, 9 October 2021 at 06:50:19 UTC, Paulo Pinto wrote:

>

[...]

Omg my eyes. Don't rough up C#, use D instead 😅

Maybe like 5% of the C# community even uses structs and of them 0.5% would do ref struct and 0.1% would try to scope guard something, but nice experiment ofc 💕

Sure when D's ecosystem catches up.