| Thread overview | |||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
April 04, 2008 Grafting Functional Support on Top of an Imperative Language | ||||
|---|---|---|---|---|
| ||||
Andrei Alexandrescu's talk just given at ACCU: http://www.digitalmars.com/d/2.0/accu-functional.pdf | ||||
April 04, 2008 Re: Grafting Functional Support on Top of an Imperative Language | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | This is a great set of slides and I think it explains really clearly the "why" of D 2.0's const/invariant system. I wish there was a video of Andrei giving the presentation available. I'm a systems/web programmer but I have a heavy background in FP, and I *love* where D 2.0 is going. To me the automatic multiprogramming, while awesome, is really just another side benefit. Even single-threaded code will see a huge benefit from the guarantees of purity that the compiler can give with this pure/invariant/const system in place. Reading through these slides has just make me even more excited. | |||
April 04, 2008 Re: Grafting Functional Support on Top of an Imperative Language | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright:
> Andrei Alexandrescu's talk just given at ACCU: http://www.digitalmars.com/d/2.0/accu-functional.pdf
The pages of this talk are interesting, and simple enough.
Page 2: >As convenient as a scripting language<
This is a myth/lie. D seems more 'convenient' than C++ and C in some applications, but dynamic languages like Python are probably more 'productive' than D still.
P.6: >Ideal language—allow:<
I'm sure lot of people (like functional programming lovers) don't think that mix as the ideal situation :-)
P.14 >Defining a transitive const<
That's one possible D 2.x, the current one, but it may change. This talk presents such things like they are already finished and set in stone (FP programming in D 2.x too).
P. 31: >writeln(i);<
Can you put (temporary) debugging writeln/putr inside a pure function?
P. 35: >It all rests on an efficient machine model!<
I don't understand :-)
Bye,
bearophile
| |||
April 04, 2008 Re: Grafting Functional Support on Top of an Imperative Language | ||||
|---|---|---|---|---|
| ||||
Posted in reply to bearophile | bearophile wrote:
> P. 31: >writeln(i);<
>
> Can you put (temporary) debugging writeln/putr inside a pure function?
That's always bothered me about this stuff. I don't want to lose debugging/logging ability!
| |||
April 04, 2008 Re: Grafting Functional Support on Top of an Imperative Language | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jason House | On Sat, 05 Apr 2008 01:09:14 +0200, Jason House <jason.james.house@gmail.com> wrote:
> bearophile wrote:
>> P. 31: >writeln(i);<
>>
>> Can you put (temporary) debugging writeln/putr inside a pure function?
>
> That's always bothered me about this stuff. I don't want to lose
> debugging/logging ability!
Just use multiple return types, and have the caller do the printing.
--Simen
| |||
April 05, 2008 Re: Grafting Functional Support on Top of an Imperative Language | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Simen Kjaeraas | Simen Kjaeraas wrote:
> On Sat, 05 Apr 2008 01:09:14 +0200, Jason House <jason.james.house@gmail.com> wrote:
>
>> bearophile wrote:
>>> P. 31: >writeln(i);<
>>>
>>> Can you put (temporary) debugging writeln/putr inside a pure function?
>>
>> That's always bothered me about this stuff. I don't want to lose
>> debugging/logging ability!
>
>
> Just use multiple return types, and have the caller do the printing.
>
> --Simen
Monads!
Or at least I think that's what I read somewhere. I can't understand the buggers for the life of me. I think maybe it's just a fancy word for "loophole". If someone here has a good explanation for what a monad is and how it allows mutable state in FP without making thing non-FP, I'd love to hear it. Because I just don't get it.
--bb
| |||
April 05, 2008 Re: Grafting Functional Support on Top of an Imperative Language | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | == Quote from Walter Bright (newshound1@digitalmars.com)'s article
> Andrei Alexandrescu's talk just given at ACCU: http://www.digitalmars.com/d/2.0/accu-functional.pdf
It's unfortunate that he won't talk to any of us about this.
Sean
| |||
April 05, 2008 Re: Grafting Functional Support on Top of an Imperative Language | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jason House | Surely there would be some sort of (detectable) cast or some such to "escape" a pure function for debugging? Or maybe this just plain ol' relies on running a debugger (not so much fun.)
-[Unknown]
Jason House wrote:
> bearophile wrote:
>> P. 31: >writeln(i);<
>>
>> Can you put (temporary) debugging writeln/putr inside a pure function?
>
> That's always bothered me about this stuff. I don't want to lose
> debugging/logging ability!
| |||
April 05, 2008 Re: Grafting Functional Support on Top of an Imperative Language | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jason House | Jason House, el 4 de abril a las 19:09 me escribiste: > bearophile wrote: > > P. 31: >writeln(i);< > > > > Can you put (temporary) debugging writeln/putr inside a pure function? > > That's always bothered me about this stuff. I don't want to lose debugging/logging ability! You can't have all. If you functions have side effects, you can't do a lot of things (like a rollback & retry with STM). -- Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/ ---------------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------------- RENUNCIO PARA IR A REZARLE A SAN CAYETANO -- Crónica TV | |||
April 05, 2008 Re: Grafting Functional Support on Top of an Imperative Language | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Sean Kelly | Sean Kelly:
> It's unfortunate that he won't talk to any of us about this.
Through that document he is talking to you. There are just less ways to push information the opposite direction :-)
Bye,
bearophile
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply