www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Map/Reduce/Filter

reply Walter Bright <newshound1 digitalmars.com> writes:
We could sure use an article like this for D:

http://www.25hoursaday.com/weblog/2008/06/16/FunctionalProgrammingInC30HowMapReduceFilterCanRockYourWorld.aspx

Anyone game?
Jun 17 2008
next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
Walter Bright:
 We could sure use an article like this for D:
 http://www.25hoursaday.com/weblog/2008/06/16/FunctionalProgrammingInC30HowMapReduceFilterCanRockYourWorld.aspx
 Anyone game?
You know that I have spent many months to write a large group of mostly functional-style open source libs for D 1.x (quite more complete and smarter than the stuff in std.algorithm of 2.x, but possibly a bit slower), and on my blog I have discussed many times about this topic, showing usage examples too. So writing another smallish article about such usages seems possible. But that article looks mostly about LINQ, that's much better (mostly because it's more integrated and pervasive in the language and systems usable from it, like the DBMS) than anything I can create with D. So maybe a comparison will not show many advantages compared to that LINQ code... If someone else has some suggestions I'll willing to listen to them. Bye and thank you for the suggestion, bearophile
Jun 18 2008
next sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
bearophile wrote:
 Walter Bright:
 We could sure use an article like this for D: 
 http://www.25hoursaday.com/weblog/2008/06/16/FunctionalProgrammingInC30HowMapReduceFilterCanRockYourWorld.aspx
  Anyone game?
You know that I have spent many months to write a large group of mostly functional-style open source libs for D 1.x (quite more complete and smarter than the stuff in std.algorithm of 2.x, but possibly a bit slower), and on my blog I have discussed many times about this topic, showing usage examples too.
Writing about it in your blog is important, but writing articles will reach a much wider audience.
 So writing another
 smallish article about such usages seems possible. But that article
 looks mostly about LINQ, that's much better (mostly because it's more
 integrated and pervasive in the language and systems usable from it,
 like the DBMS) than anything I can create with D. So maybe a
 comparison will not show many advantages compared to that LINQ
 code...
 
 If someone else has some suggestions I'll willing to listen to them.
 
 Bye and thank you for the suggestion, bearophile
Jun 18 2008
parent reply Sean Kelly <sean invisibleduck.org> writes:
== Quote from Walter Bright (newshound1 digitalmars.com)'s article
 bearophile wrote:
 Walter Bright:
 We could sure use an article like this for D:
http://www.25hoursaday.com/weblog/2008/06/16/FunctionalProgrammingInC30HowMapReduceFilter CanRockYourWorld.aspx
  Anyone game?
You know that I have spent many months to write a large group of mostly functional-style open source libs for D 1.x (quite more complete and smarter than the stuff in std.algorithm of 2.x, but possibly a bit slower), and on my blog I have discussed many times about this topic, showing usage examples too.
Writing about it in your blog is important, but writing articles will reach a much wider audience.
But the thing you linked is a blog. And the DDJ "articles" are blog entries too. Or am I missing something? Sean
Jun 18 2008
next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
Sean Kelly:
 But the thing you linked is a blog.  And the DDJ "articles" are blog entries
 too.  Or am I missing something?
You can write articles on a blog too, but the problem is that it's a lot of time I don't write a "real" article on D, and that my blog has just 3 readers ;-) Bye, bearophile
Jun 18 2008
parent janderson <askme me.com> writes:
bearophile wrote:
 Sean Kelly:
 But the thing you linked is a blog.  And the DDJ "articles" are blog entries
 too.  Or am I missing something?
You can write articles on a blog too, but the problem is that it's a lot of time I don't write a "real" article on D, and that my blog has just 3 readers ;-) Bye, bearophile
Where is your blog?
Jun 18 2008
prev sibling parent Walter Bright <newshound1 digitalmars.com> writes:
Sean Kelly wrote:
 But the thing you linked is a blog.  And the DDJ "articles" are blog entries
 too.  Or am I missing something?
I tend to regard a "blog" entry as something rather short and superficial, and an "article" as something that's longer and gives a more thorough treatment. Articles can also be placed where the readership is high, blog entries generally cannot be.
Jun 19 2008
prev sibling next sibling parent superdan <super dan.org> writes:
bearophile Wrote:

 Walter Bright:
 We could sure use an article like this for D:
 http://www.25hoursaday.com/weblog/2008/06/16/FunctionalProgrammingInC30HowMapReduceFilterCanRockYourWorld.aspx
 Anyone game?
You know that I have spent many months to write a large group of mostly functional-style open source libs for D 1.x (quite more complete and smarter than the stuff in std.algorithm of 2.x, but possibly a bit slower)
better said 8x slower and quite a bit dumber too. great deal.
Jun 18 2008
prev sibling parent Robert Fraser <fraserofthenight gmail.com> writes:
bearophile Wrote:

 Walter Bright:
 We could sure use an article like this for D:
 http://www.25hoursaday.com/weblog/2008/06/16/FunctionalProgrammingInC30HowMapReduceFilterCanRockYourWorld.aspx
 Anyone game?
You know that I have spent many months to write a large group of mostly functional-style open source libs for D 1.x (quite more complete and smarter than the stuff in std.algorithm of 2.x, but possibly a bit slower), and on my blog I have discussed many times about this topic, showing usage examples too. So writing another smallish article about such usages seems possible. But that article looks mostly about LINQ, that's much better (mostly because it's more integrated and pervasive in the language and systems usable from it, like the DBMS) than anything I can create with D. So maybe a comparison will not show many advantages compared to that LINQ code... If someone else has some suggestions I'll willing to listen to them. Bye and thank you for the suggestion, bearophile
LINQ should actually be possible in D without language integration. For example, with CTFE/templates this should be possible in D right now: struct Employee { string name; int id; } Employee[] employees; //... auto rows = mixin(query("SELECT name, id FROM employees WHERE id > 5")); foreach(row; rows) writefln("%d - %s", row.id, row.name);
Jun 19 2008
prev sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
superdan:
 better said 8x slower and quite a bit dumber too. great deal.
Feel free to suggest how to make parts of the code more enlightened. Andrei Alexandrescu has lot of more experience than me in C++-like languages, and this is my first lib in in D. Regarding speed, there are things faster too, like sorting, some string operations, or you can benchmark the levenshtein distance present in the std.algorithm, compared to the version you can find in my libs. Bye, bearophile
Jun 19 2008
parent superdan <super dan.org> writes:
bearophile Wrote:

 superdan:
 better said 8x slower and quite a bit dumber too. great deal.
Feel free to suggest how to make parts of the code more enlightened. Andrei Alexandrescu has lot of more experience than me in C++-like languages, and this is my first lib in in D.
less braggin' goes a long way. you keep on goin' about ur lib as if it is the next avatar of freakin' buddha. also wtf is wrong with u man. did u swear to use only the zip format for the rest of ur life??? to read the doc of ur lib i need to download it then unzip and then freakin' grep the god damn html. wtf! put the damn html on ur website and let google take care of the rest.
 Regarding speed, there are things faster too, like sorting, some string
operations, or you can benchmark the levenshtein distance present in the
std.algorithm, compared to the version you can find in my libs.
sorting may be faster only with default comparison. also it's the most ass-backward sorting api i've ever seen. ur levenshtein may be the fastest in the world but is useless as it doesn't give u the path. thanks for nothin'.
Jun 19 2008