View mode: basic / threaded / horizontal-split · Log in · Help
October 16, 2008
const sucks
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.


Andrei

P.S. Guy Steele mentions Unicode operators favorably too. Nyuk-nyuk.
October 16, 2008
Re: const sucks
Andrei Alexandrescu:
> P.S. Guy Steele mentions Unicode operators favorably too. Nyuk-nyuk.

That's not surprising, because I think he has designed most of Fortress, that's unicode-based.

Bye,
bearophile
October 17, 2008
Re: const sucks
Andrei Alexandrescu wrote:
> 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.

It sure looks like they're going down the same path we did about a year ago.
October 18, 2008
Re: const sucks
"Andrei Alexandrescu" <SeeWebsiteForEmail@erdani.org> wrote in message
news:gd85n2$9rq$1@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.
October 18, 2008
Re: const sucks
Dave wrote:
> "Andrei Alexandrescu" <SeeWebsiteForEmail@erdani.org> wrote in message
> news:gd85n2$9rq$1@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.

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 
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.


Andrei
October 18, 2008
Re: const sucks
On Sat, Oct 18, 2008 at 2:22 PM, Andrei Alexandrescu
<SeeWebsiteForEmail@erdani.org> wrote:
> Dave wrote:
>>
>> "Andrei Alexandrescu" <SeeWebsiteForEmail@erdani.org> wrote in message
>> news:gd85n2$9rq$1@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.
>
> 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.

I watched it yesterday.  It was pretty interesting, but also kinda
boring in the sense that it was like watching a video version of the D
Programming Language newsgroup from a year ago.  Thanks for the link.
I didn't really have anything to say other than agree with what you
posted, so I didn't post.  :-)

Probably the most fun for me was seeing what Anders and Guy are like,
since I've heard their names many times, but never their faces or
their speaking.

--bb
October 18, 2008
Re: const sucks
On Sat, 18 Oct 2008 00:22:18 -0500, Andrei Alexandrescu wrote:

> Dave wrote:
>> "Andrei Alexandrescu" <SeeWebsiteForEmail@erdani.org> wrote in message
>> news:gd85n2$9rq$1@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.
> 
> 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
> 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.
> 
> 
> Andrei

I am with Bill, I didn't have much to comment on so saying, "Go D!" would 
be too much like digg, "up voted for awesomeness." I say take the silence 
as lack of disagreement.

With respect to "default immutable" I like the direction D is taking, 
where you are able to know only a small piece of the "const" and continue 
to program in a better C++. I think being able to "hide" the feature will 
be good in expanding its popularity and seems that it is being done in a 
way that is still easy to use.

And the mutable stack, great idea.
October 18, 2008
Re: const sucks
"Andrei Alexandrescu" <SeeWebsiteForEmail@erdani.org> wrote in message 
news:gdbrq5$272j$1@digitalmars.com...
> Dave wrote:
>> "Andrei Alexandrescu" <SeeWebsiteForEmail@erdani.org> wrote in message
>> news:gd85n2$9rq$1@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
October 18, 2008
Re: const sucks
Hello Dave,

> 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
> 


I have extremely limited experience with const, so my opinion bears very 
little weight on the matter... but, for what's its worth, I agree with Dave. 
I think it would great to explore "immutability by default" regardless of 
the precedent set by original D and C++ (Hah! Throw caution to the wind!). 
"Explore" being the key word: "after trying it for a bit, we might get used 
to it." :-D

I was just reading the link above too, and I notice that this would fix consistancy 
with "Why aren't function parameters const by default?"  I imagine that's 
already been brought up multiple times before, though.

Any chance that we might see an experimental version of this?  I'm surprised 
it hasn't been tried with D considering all the other attempts made with 
const already. 

Are there any other drawbacks with default immutability other than breaking 
with the norm?

-JJR
October 18, 2008
Re: const sucks
John Reimer wrote:
> Are there any other drawbacks with default immutability other than 
> breaking with the norm?

Well for one thing much of OO style involves creating few objects that 
hold their state and evolve in well-defined ways. Many objects are
"entity" objects, meaning that holding a reference to a particular 
object is the way to stay in touch. In FP style new objects are being 
created all the time, so the programming styles are very different.

But by and large I find it very interesting that the tide has changed to 
the extent that this option is being discussed. It's good progress from 
the const-should-die-a-gruesome-death view :o).


Andrei
« First   ‹ Prev
1 2 3
Top | Discussion index | About this forum | D home