www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Functional Programming Use Case

reply Paul D. Anderson <paul.d.removethis.anderson comcast.andthis.net> writes:
At the risk of starting a debate, I found this blog post interesting regarding
the utility of functional programming.

http://weblogs.java.net/blog/cayhorstmann/archive/2008/10/know_when_to_fo.html

"De gustibus non est disputandum"

Paul
Oct 10 2008
next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Paul D. Anderson wrote:
 At the risk of starting a debate, I found this blog post interesting
 regarding the utility of functional programming.
 
 http://weblogs.java.net/blog/cayhorstmann/archive/2008/10/know_when_to_fo.html
 
 
 "De gustibus non est disputandum"
& de coloribus neither. I like fold (aka std.algorithm.reduce) but probably this is a poor introduction to it and the values of FP. Andrei
Oct 10 2008
prev sibling parent bearophile <bearophileHUGS lycos.com> writes:
Paul D. Anderson:

From that blog post:

I use Scala to implement the interpreters and compilers because of its nifty
“combinator parser” library. (This and this blog have nice introductions into
Scala combinator parsers.) Why not just lex and yacc, the Model T of parser
generators? My colleague is doing just that, and it is a good thing because it
gives students much-needed experience with C programming. But I don't have the
heart to see students suffer with pointer errors. With Scala, we can implement
an interpreter for a simple language that supports arithmetic, if/else, and
closures, in < 150 lines of code.<
Why use Scala for that job when you can use something modern like OMeta (like Pymeta https://launchpad.net/pymeta )? Bye, bearophile
Oct 10 2008