June 08, 2020
On Sunday, 7 June 2020 at 18:12:57 UTC, Avrina wrote:
> On Saturday, 6 June 2020 at 07:00:57 UTC, Walter Bright wrote:
>> On 6/5/2020 10:16 PM, Manu wrote:
>>> Initialisation and `ref` emit errors?
>>> They're absolutely show stoppers. Values must be initialised, and code has `ref` in it all the time.
>>> You can't write code without those things.
>>
>> You can declare them with =void; and set them with the atomics. That's inconvenient, but NOT a showstopper.
>>
>> You can use pointers instead of ref, inconvenient, not a showstopper.
>
> Do you really believe this, or are you just making up an excuse?
>
> Putting @safe on declarations is inconvenient, but NOT a showstopper.
>
> How much multi-threading work do you do on a daily basis? I think it would be best to leave what is and isn't a "showstopper" to the experts that do the work on a daily basis.

#DIP1028
June 08, 2020
On Sat, Jun 6, 2020 at 11:21 PM H. S. Teoh via Digitalmars-d < digitalmars-d@puremagic.com> wrote:

> On Sat, Jun 06, 2020 at 01:11:46PM +0000, matheus via Digitalmars-d wrote:
> > On Saturday, 6 June 2020 at 05:16:59 UTC, Manu wrote:
> > > ... and, tragically, the reason for that is mostly because we wrote this thing in C++! I've been having a really un-fun time at work because I failed to make a pitch for D in the ~18 months window we had, and now I have to suffer that failure :(
> >
> > I'm really curious, if you had those features (Shared for example) the
> > way you liked... you could pitched the company (Blizzard) to develop
> > games for videogames in D?
> >
> > What about the GC? Wouldn't that be a bottleneck or it would be without GC?
>
> Wasn't Manu one of the people who pushed for @nogc and eventually got it in?
>

Yes, @nogc is totally my meddling, and it's a very valuable tool! If only we could get a robust ARC solution over the line... ;)

Outside the realtime code though, GC can be useful. It's not bad the language has GC, but it would be nice if @nogc existed much earlier so there was a better culture of writing libraries to support it. Most libraries I've written recently work with or without GC.


June 08, 2020
On Sun, Jun 7, 2020 at 8:00 AM Walter Bright via Digitalmars-d < digitalmars-d@puremagic.com> wrote:

> On 6/6/2020 2:14 PM, Steven Schveighoffer wrote:
> > To continue the "show" analogy, consider a theater show where all the
> show light
> > bulbs burn out simultaneously. You could say "Well, they can do it by flashlight," and yes, it could happen. People wouldn't be able to see
> it, but
> > the show would *happen*. So one could argue that not having significant
> lighting
> > is not a showstopper in the way you are saying "just use void
> initialization".
>
> On the other hand, how many shared local variables does one have in a program?
>
> Every shared variable is a risk of threading problems, and one should try
> to
> minimize their use.
>

Not how our ecosystem works... practically everything is shared. The whole gig is about declaring access control, and mechanisms which schedule appropriately synchronised access to shared things. Without type-safety, mistakes are way too easy to make.

Shared is a really big deal for D that it's never truly capitalised on.


June 08, 2020
On Monday, 8 June 2020 at 06:51:59 UTC, Manu wrote:
> On Sat, Jun 6, 2020 at 11:21 PM H. S. Teoh via Digitalmars-d < digitalmars-d@puremagic.com> wrote:
>
>> On Sat, Jun 06, 2020 at 01:11:46PM +0000, matheus via Digitalmars-d wrote:
>> > On Saturday, 6 June 2020 at 05:16:59 UTC, Manu wrote:
>> > > [...]
>> >
>> > I'm really curious, if you had those features (Shared for example) the
>> > way you liked... you could pitched the company (Blizzard) to develop
>> > games for videogames in D?
>> >
>> > What about the GC? Wouldn't that be a bottleneck or it would be without GC?
>>
>> Wasn't Manu one of the people who pushed for @nogc and eventually got it in?
>>
>
> Yes, @nogc is totally my meddling, and it's a very valuable tool! If only we could get a robust ARC solution over the line... ;)
Sounds like...I got @nogc into D but meh, don't wan it anymore.


June 08, 2020
On 6/7/2020 7:18 AM, Steven Schveighoffer wrote:
> Good. Sometimes statements like "well you shouldn't be doing that anyway" can make things unclear what the expectation is.

I still think that having lots of shared variables is not a good sign, like having lots of globals is not a good sign.
June 08, 2020
On Mon, Jun 8, 2020 at 6:35 PM aberba via Digitalmars-d < digitalmars-d@puremagic.com> wrote:

> On Monday, 8 June 2020 at 06:51:59 UTC, Manu wrote:
> > On Sat, Jun 6, 2020 at 11:21 PM H. S. Teoh via Digitalmars-d < digitalmars-d@puremagic.com> wrote:
> >
> >> On Sat, Jun 06, 2020 at 01:11:46PM +0000, matheus via Digitalmars-d wrote:
> >> > On Saturday, 6 June 2020 at 05:16:59 UTC, Manu wrote:
> >> > > [...]
> >> >
> >> > I'm really curious, if you had those features (Shared for
> >> > example) the
> >> > way you liked... you could pitched the company (Blizzard) to
> >> > develop
> >> > games for videogames in D?
> >> >
> >> > What about the GC? Wouldn't that be a bottleneck or it would be without GC?
> >>
> >> Wasn't Manu one of the people who pushed for @nogc and eventually got it in?
> >>
> >
> > Yes, @nogc is totally my meddling, and it's a very valuable tool! If only we could get a robust ARC solution over the line... ;)
> Sounds like...I got @nogc into D but meh, don't wan it anymore.


Ummm, no... that's not even remotely what I said.


June 08, 2020
On Monday, 8 June 2020 at 09:09:52 UTC, Walter Bright wrote:
> On 6/7/2020 7:18 AM, Steven Schveighoffer wrote:
>> Good. Sometimes statements like "well you shouldn't be doing that anyway" can make things unclear what the expectation is.
>
> I still think that having lots of shared variables is not a good sign, like having lots of globals is not a good sign.

I think for Manu shared means: "We don't know who owns this. This has to go through the scheduler".
I'd expect almost everything to have to go through the scheduler.

Because core counts are rising! I have 32 cores with 2 hyper-threads per core.
Giving me 64 logical cores.
There's no way I can just dedicate certain threads to certain tasks.
It's unmanageable.
June 08, 2020
On Wednesday, 3 June 2020 at 17:59:37 UTC, Jan Hönig wrote:
> On Wednesday, 3 June 2020 at 11:14:13 UTC, aberba wrote:
>>
>> Oops, what about you?
>
> As a PhD Student I do lot of coding in Python. We use it (and other languages) to generate high performant C/C++ code.
>
> Why am I curious about D and like working with it?
> 1) Using Python and other dynamic typed languages makes me forget how to program with statically typed languages. I don't like being tied up to only functional (Haskell), to weird templates (C++) or to the JVM (Kotlin). Go doesn't have the expressiveness and I haven't really tried Rust, but I suspect the same.
>
> 2) I think D's motto "write fast, read fast, run fast" describes the language pretty well. The syntax is nice. Once you understood "you want to use structs" and "ranges are cool" it really is nice to look at.
>
> 3) D's compile time capabilities are fantastic (CTFE, Templates)
>
> 4) Community. Lot's of nice and most notably competent people here.
>
> 5) I hope to get rid of Python -> C++ some day.


You should just learn D, it is not difficult. Then you can make the decision.

If you already know several languages you should be able to pick up D quite naturally, specially if you can program in C\C++. Just learn it. As a language, for the most part, it is quite easy. Templates are quite natural. They are sort of just an extension of a typed language. That is, "templates" types are just abstract types.

You can always use D for certain things that you find natural once you have learned it. Don't expect much and you won't have any problems.

D can be used in other languages so once you know enough about it you'll have an additional tool. I don't use D mainly because the ecosystem, but I have little problem with the language itself. There are a few hairballs but overall it's worth learning. Far better than python, C, C++.  Of course, a language is a tool. Ultimately you must use the right tool for the job... but if you have no idea how to use a tool how can you possibly know if it's right?

For me, D is good at small utilities. Not much more. Any time I try to write a large app I always come to some issues that makes me want to kill myself. I always think "Man, I'll be able to use all the amazing meta programming to do really cool stuff" and I do but then something basic that I need always destroys any progress I made with meta programming. D is a special language for special people... kinda anal retentive autistics.

June 08, 2020
On Wednesday, 3 June 2020 at 11:12:08 UTC, aberba wrote:
> What are you?

Little late to the party.

I feel the language is reasonable and there are very rarely any surprises. Compared to PHP or C++ for instance:
- PHP language design is horrible and bad decisions made long ago affect the language even today.
- C++ has weird syntax, like `std::something<here, there<more>>` and still catches me with its include system.

And I love the community. The forum's "Learn" is so helpful, and I have never had a bad experience there.
June 08, 2020
On Wednesday, 3 June 2020 at 11:14:13 UTC, aberba wrote:
> Oops, what about you?

I first got into D as I was looking for an object-oriented programming language, that is easier to get into quickly with a Java background than C++. If I had a few more months, I probably have tried C++ instead.

Then I stuck with it. It was way more fun to develop with it than any other language I've learned, and somewhat I enjoy writing my own libraries too for stuff that already exists in other programming languages. I've learned way more through them than any class in college.