const sucks

Dave Dave_member at pathlink.com
Sat Oct 18 13:29:21 PDT 2008


"Andrei Alexandrescu" <SeeWebsiteForEmail at erdani.org> wrote in message 
news:gdbrq5$272j$1 at digitalmars.com...
> Dave wrote:
>> "Andrei Alexandrescu" <SeeWebsiteForEmail at erdani.org> wrote in message
>> news:gd85n2$9rq$1 at digitalmars.com...
>>> Just got this from Eric Niebler:
>>>
>>> http://tinyurl.com/4apat7
>>>
>>> Guess what Anders Heljsberg and Guy Steele have to say about future of
>>> programming languages.
>>>
>>> Immutable and eliminating side effects are necessary. Quickly written 
>>> down
>>> from Anders: "...we need support for immutable data at the language
>>> level..." "...so that the compiler can infer that there is isolation..."
>>> "... formalization of immutability... we don't have them in the language
>>> and it's nontrivial to put them in... and that's the big challenge." He
>>> goes on and describes the difficulties... and mentions "pure functions"
>>> and "transitivity" and "functional extensions"!!! "Pure FP is not the
>>> solution... what we try to do is to have islands of purity in functional
>>> style and switch between default to functional in a hybrid style of
>>> programming... the answer is not at the extreme..."
>>>
>>> This is huge. You have to listen to it to hear just how huge it is. He 
>>> is
>>> essentially describing some of the difficulties we have encountered and
>>> already solved in D2, so it looks we have a strategic advantage.
>>>
>>> This is the confirmation I hoped was going to come someday. If it
>>> surprises me, it that it comes so early, so unequivocally, and so 
>>> aligned
>>> terminologically. I'm in Nirvana.
>>>
>>
>> Anders mentioned "... be clearer about where the mutation occurs and 
>> where the side-effects are, by in a sense switching the default to be 
>> more functional".
>>
>> Should D3 be the version that introduces default immutable storage and 
>> default pure functions?
>>
>> IIRC, this was discussed for D2 early on in the const discussion, but the 
>> consensus then was that it was too big of a leap for an imperative 
>> language.
>
> I'm very glad someone finally answered about the main thrust of the 
> interview. I was a tad let down by the thundering silence following my 
> post, which I attributed to its rather strident tone; in my defense, I 
> have to say I was in a state of euphoria caused by such a comprehensive 
> confirmation of beliefs and thinking patterns I held dear for years.
>

It is great to have these D2 design initiatives reaffirmed!

> That aside, I do highly recommend interested people to watch the video. It 
> is slow and boring at times, but some very interesting points are being 
> made, particularly about the relationship between manycores and 
> immutability (fortunately, that's also towards the beginning of the 
> interview). It sure makes D look like it placed a winning bet two (three?) 
> years ago when we started working on immutability.
>
> To answer your point, Dave, I think the alea has been jacta with regard to 
> D's flavor. We'll be unable to retire mutability as a matter of course, 
> otherwise we might as well call the new language E :o). What we

I'd like to read more opinions on D3 "default immutapurity"... IIRC, even 
though it was considered a stretch for D2 it was actually discussed for a 
time, and (again IIRC) I don't think Walter was neccessarily the one who put 
the kabosh on that direction of thought.

If D3 doesn't try it first, someone might get "E" right in the meantime <g>. 
Anders seemed to intimate that "E" is a direction he's considering, and 
hasn't MS Research already been experimenting with something like this (not 
F#, but with another C#-based, primarily imperative language)? Someone 
posted a link a while back...

Anyway, it kind of seems a logical progression to me, especially considering 
this from: http://www.digitalmars.com/d/2.0/const-faq.html#const

"Here's the biggie. Points 1..3 are insignificant in comparison. The future 
of programming will be multicore, multithreaded. Languages that make it easy 
to program them will supplant languages that don't. Transitive const is key 
to bringing D into this paradigm. The surge in use of Haskell and Erlang is 
evidence of this coming trend (the killer feature of those languages is they 
make it easy to do multiprogramming). C++ cannot be retrofitted to 
supporting multiprogramming in a manner that makes it accessible. D isn't 
there yet, but it will be, and transitive const will be absolutely 
fundamental to making it work."

Point is, what does D3 have to lose by at least exploring "default 
immutapurity" initially? Even if does turn out to be somewhat of a rabbit 
hole, it would probably either validate or serve to help improve the 
compiler and language design w.r.t. immutable storage and pure functions. 
And maybe along the way a lot of interesting things would be learned about 
porting the std. lib. perhaps?

Based on the video and where things are headed, a language that takes the 
best of imperative pragramatism and functional computer science might be 
just what we all need <g>

> can do is to simplify introduction of places and regions where 
> immutability is either a must, or the default. Also, we can better 
> separate the places where mutability is harmless (stack data) from places 
> where mutability causes problems (shared data). Walter is in fact working 
> on language changes in that general direction.
>

That's terrific to hear; perhaps if the changes make it into D2, and it 
turns out that developers find themselves making the majority of code 
"immutapure" anyhow, it may make sense to approach things from the other 
side for D3...

>
> Andrei




More information about the Digitalmars-d mailing list