Fully transitive const is not necessary

Craig Black craigblack2 at cox.net
Tue Apr 1 12:16:01 PDT 2008


>
> If D did move the way of C++ it would be a lot better off than it is now. 
> But, that being said, I agree with you... there's such a huge opportunity 
> here!  Instead of going the way C++ did, or the way D is going now (which 
> is even worse), why not take the time to find a really good, simple and 
> effective solution?
>

The D community has been working on this problem for about a year now.  I'm 
don't know if such a "simple effective" solution exists as you imply.  And 
even if it does, if it takes us another year to figure it out, then that's a 
year that we could be doing more productive things.

> For large parallel projects, I have seen some successful uses of Erlang, 
> but most of the parallel development these days is done in Fortran and C++ 
> because of OpenMP (even some big distributed apps are moving to OpenMP via 
> Intel's clustering OpenMP compiler).  C++ also has a nice join calculus 
> module available in Boost, not to mention Boost's [new] MPI support.
>
> People aren't using C++ and Fortan because they're the best suited 
> languages... and parallel people are always looking for something better 
> because, like you said, in theory there should be a lot better choices 
> available to us.  Functional languages promise neat and tidy 
> parallelization with no side affects, etc, but in reality they're too slow 
> and don't produce optimized code on the machines that parallel developers 
> need to write code for.
>
> What we want is a fast, system level language, that can be targeted by an 
> optimizing compiler, but that is also quick and enjoyable to write code 
> in.

Yes, I think the solution to scalable concurrency will probably be a systems 
programming language that supports multiple paradigms.  D is a good 
candidate here, being very multi-paradigm.  I still don't think writing 
scalable multithreaded apps will ever be easy.

> If D did have some support for parallel programming I think it would be a 
> major selling point, and I don't think it would need to complicate the 
> language at all.  The whole problem here isn't that adding parallel 
> support automatically makes a language ridiculously complex.
>
> The real issue is Walter's wacky and complex const system.  Somehow he 
> thinks it's going to help with parallel development, so the issues are 
> getting mixed, but in reality they're completely unrelated.

I'm not so sure it's any more complex than C++ const, but from a developer 
perspective, I think it may be considered wacky, because it's more difficult 
to work with.  This is due to the fact that it has a completely different 
design goal from C++'s const, based on a hypothetical compiler optimization 
benefit that no one seems to fully understand.

My suggestion would be to implement a C++-like "logical const" system using 
the const keyword, and use the invariant keyword for Walter/Andrei's 
transitive const.  Maybe that would give us the best of both worlds.

-Craig 




More information about the Digitalmars-d mailing list