tag:blogger.com,1999:blog-1893218858608219953.post5132485084358160305..comments2008-11-13T21:51:01.299+10:00Comments on This is me: Erlang Binary MapPhilip Robinsonhttp://www.blogger.com/profile/17605642659657207381chlorophil@gmail.comBlogger4125tag:blogger.com,1999:blog-1893218858608219953.post-2770993976912579812008-11-13T21:51:00.000+10:002008-11-13T21:51:00.000+10:00"Really, what is the point of using Erlang if we d..."Really, what is the point of using Erlang if we don't spawn a few hundred processes for every trivial piece of code?"<BR/><BR/>lolMat Kelceyhttp://www.blogger.com/profile/09753104172437230389noreply@blogger.comtag:blogger.com,1999:blog-1893218858608219953.post-89159198133325465822007-06-30T20:23:00.000+10:002007-06-30T20:23:00.000+10:00Herrmann: I have been considering Haskell for som...Herrmann: I have been considering Haskell for some time now, but I get the feeling that the Erlang VM and OTP modules currently support more features that I [think I] need.<BR/><BR/>I am going to have to remember the concept of list fusions for a later project of mine (one in a list of many). I hope I will be able to incorporate the idea because it is definitely useful to have the compiler do it automatically for the developer.<BR/><BR/><BR/>Anonymous: Thank you for confirming my suspicion. A binary counterpart to list comprehensions is way too useful to be missing from the language. Time to update my code!Philip Robinsonhttp://www.blogger.com/profile/17605642659657207381noreply@blogger.comtag:blogger.com,1999:blog-1893218858608219953.post-34906023009681920432007-06-30T06:48:00.000+10:002007-06-30T06:48:00.000+10:00In recent erlangs there is an undocumented binary ...In recent erlangs there is an undocumented binary comprehension mechanism.<BR/><BR/>-module(blb).<BR/>-compile([binary_comprehension,export_all]).<BR/><BR/>double() -><BR/> [2 * N || &lt;&lt;N:16>> &lt;= &lt;&lt;1,2,3,4>>].<BR/><BR/>this evaluates to [516,1544] like one of your examples. You must remember to compile with the binary_comprehension option to enable this syntax. See the <A HREF="http://user.it.uu.se/~pergu/papers/erlang05.pdf" REL="nofollow">whitepaper</A> for more information...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1893218858608219953.post-38503115635356067472007-06-30T02:46:00.000+10:002007-06-30T02:46:00.000+10:00There's a technique called List Fusion which helps...There's a technique called List Fusion which helps avoiding the problem with intermediate lists you described. In Haskell:<BR/><BR/>http://www.haskell.org/ghc/docs/latest/html/users_guide/rewrite-rules.html#id3159016<BR/><BR/>'If a "good consumer" consumes an intermediate list constructed by a "good producer", the intermediate list should be eliminated entirely.'Herrmannhttp://www.blogger.com/profile/02120395714813400613noreply@blogger.com