Struggling to implement parallel foreach...

Manu turkeyman at gmail.com
Mon Jun 17 20:11:32 UTC 2019


On Mon, Jun 17, 2019 at 8:25 PM Ola Fosheim Grøstad via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Monday, 17 June 2019 at 09:47:30 UTC, Manu wrote:
> > I mean, if it comes to that... I really hope not.
> > It would make it 100x harder to make the case to my company if
> > I start
> > telling them that I couldn't produce a working demo without
> > forking the
> > language :/
>
> Is parallell for mandatory though? In C++ it is an add-on, isn't
> it?

Define 'mandatory'? ...because we currently use C++. But it would be a
powerful enabler, and one of the very specific challenges we have with
C++ implementations.
I mean, our project needs parallel-for without any question, and the
smooth implementation that D teases us with is very attractive!
If I hack some crappy implementation using meta and lambdas, then I
have written EXACTLY what you write in C++, and there is no case to be
made. I need to show advantages of D, but parity.
I have an unusual opportunity to make a very strong case for D, but I
can only do that with a great showcase. I spent hours in a meeting the
other day arguing various terribly ways to implement it in C++, and
the take-away from the meeting was basically "well I guess we have to
choose this crappy compromise", which mostly revolve around naming
conventions.

Everything I need to make a strong case revolves around shared; and
since nobody on this forum seems to know what to do with shared (we've
been arguing about it and doing exactly nothing for the 10 years I've
been watching), I think I'm uniquely positioned to move the bar
forward here and make something that's actually useful, and
demonstrated what shared is actually for.
Reality is, most people don't write highly multi-threaded code, maybe
they spin a worker thread or something, but that's not what the future
looks like.

> Anyway, I am back to toying with creating a unicode-syntax.
> Stuff like inheriting structs could easily be handled on the
> syntactical level, so it does not require a fork, but things like
> parallell for has to be done at the semantic level.

Inheriting structs doesn't block anything... I just started that
thread to re-iterate how unbelievably tired I am of not having that
tool. I hate the struct inheritance workaround so much.



More information about the Digitalmars-d mailing list