Thread overview
FP in D (today)
Feb 23, 2012
Gour
Feb 23, 2012
deadalnix
Feb 23, 2012
Walter Bright
Feb 24, 2012
Gour
Feb 25, 2012
Walter Bright
February 23, 2012
Hello!

After posting about "how to resolve "object-relational impedance
mismatch" using D" dilemma, I did some more homework and today finally
(after being advised in sqlite group) went through The Vietnam of
Computer Science
(http://blogs.tedneward.com/2006/06/26/The+Vietnam+Of+Computer+Science.aspx)

which confirmed that for our application the best course of action is to forget about any attempt to fix mismtach between relational and object-oriented model by using ORM and to simply skip OOP code in our application and focus more towards FP.

Interestingly enough, here is intriguing sentence in the http://en.wikipedia.org/wiki/Functional_programming article stating: "Among imperative programming languages, the D programming language's solid support for functional programming stands out." so I'm curious if anyone more experienced with using FP paradigm in D can comment what works nicely and is there anything important missing in today's implementation of D?


Sincerely,
Gour

-- 
Everyone is forced to act helplessly according to the qualities he has acquired from the modes of material nature; therefore no one can refrain from doing something, not even for a moment.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810


February 23, 2012
Le 23/02/2012 15:50, Gour a écrit :
> Hello!
>
> After posting about "how to resolve "object-relational impedance
> mismatch" using D" dilemma, I did some more homework and today finally
> (after being advised in sqlite group) went through The Vietnam of
> Computer Science
> (http://blogs.tedneward.com/2006/06/26/The+Vietnam+Of+Computer+Science.aspx)
>
> which confirmed that for our application the best course of action is to
> forget about any attempt to fix mismtach between relational and
> object-oriented model by using ORM and to simply skip OOP code in our
> application and focus more towards FP.
>
> Interestingly enough, here is intriguing sentence in the
> http://en.wikipedia.org/wiki/Functional_programming article stating:
> "Among imperative programming languages, the D programming language's
> solid support for functional programming stands out." so I'm curious if
> anyone more experienced with using FP paradigm in D can comment what
> works nicely and is there anything important missing in today's
> implementation of D?
>
>
> Sincerely,
> Gour
>

Search for immutability and pure functions. You'll find what you need to do FP in D.
February 23, 2012
On 2/23/2012 6:50 AM, Gour wrote:
> I'm curious if
> anyone more experienced with using FP paradigm in D can comment what
> works nicely and is there anything important missing in today's
> implementation of D?

The main issue with FP in D today is it needs to be pervasively used in Phobos. A large part of Phobos should be marked as pure, but is not, making it difficult to use Phobos from FP code.

For example, Object.opEquals should be pure, nothrow, @safe.

The inheriting purity thing helps significantly with that.
February 24, 2012
On Thu, 23 Feb 2012 10:45:38 -0800
Walter Bright <newshound2@digitalmars.com> wrote:

> The main issue with FP in D today is it needs to be pervasively used in Phobos. A large part of Phobos should be marked as pure, but is not, making it difficult to use Phobos from FP code.

Heh, that's interesting...

> For example, Object.opEquals should be pure, nothrow, @safe.

This is scheduled for the next release?

> The inheriting purity thing helps significantly with that.

Good...we're enthusiastic to put FP's in D on the severe test...hoping to use D as 'the world's most practical FP language'. ;)


Sincerely,
Gour

-- 
But those who, out of envy, disregard these teachings and do not follow them are to be considered bereft of all knowledge, befooled, and ruined in their endeavors for perfection.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810


February 25, 2012
On 2/24/2012 12:20 PM, Gour wrote:
> On Thu, 23 Feb 2012 10:45:38 -0800
> Walter Bright<newshound2@digitalmars.com>  wrote:
>
>> The main issue with FP in D today is it needs to be pervasively used
>> in Phobos. A large part of Phobos should be marked as pure, but is
>> not, making it difficult to use Phobos from FP code.
>
> Heh, that's interesting...
>
>> For example, Object.opEquals should be pure, nothrow, @safe.
>
> This is scheduled for the next release?

Not sure yet, but you should certainly be marking all your opEquals that way now.

>
>> The inheriting purity thing helps significantly with that.
>
> Good...we're enthusiastic to put FP's in D on the severe test...hoping
> to use D as 'the world's most practical FP language'. ;)
>
>
> Sincerely,
> Gour
>