<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.atalasoft.com/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Rick Minerich's Development Wonderland : functional, stm, haskell, F#, C#</title><link>http://www.atalasoft.com/cs/blogs/rickm/archive/tags/functional/stm/haskell/F_2300_/C_2300_/default.aspx</link><description>Tags: functional, stm, haskell, F#, C#</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Discoveries This Week 01/16/2009</title><link>http://www.atalasoft.com/cs/blogs/rickm/archive/2009/01/16/discoveries-this-week-01-16-2009.aspx</link><pubDate>Fri, 16 Jan 2009 16:17:00 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:17229</guid><dc:creator>RickM</dc:creator><slash:comments>3</slash:comments><comments>http://www.atalasoft.com/cs/blogs/rickm/comments/17229.aspx</comments><wfw:commentRss>http://www.atalasoft.com/cs/blogs/rickm/commentrss.aspx?PostID=17229</wfw:commentRss><wfw:comment>http://www.atalasoft.com/cs/blogs/rickm/rsscomments.aspx?PostID=17229</wfw:comment><description>&lt;p&gt;This week’s theme is functional programming.&amp;#160; Included are discussions on Software Transactional Memory, Functional Architecture and the impact of the CLR on functional Programming in .NET.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Blog: &lt;a href="http://www.brandonwerner.com/2009/01/01/software-transactional-memory-debunked/"&gt;Brandon Werner’s Software Transactional Memory: Debunked!&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;In starting with a title that is decidedly sensationalistic, Brandon effectively trashes STM over its expensive overhead based on a &lt;a href="http://portal.acm.org/citation.cfm?doid=1400214.1400228"&gt;paper published by ACM&lt;/a&gt;.&amp;#160; His position, and that of the researchers, is that most programmers see assignment as inexpensive and so would not understand that they need to optimize for atomic transactions when using STM.&amp;#160; &lt;/p&gt;  &lt;p&gt;Brian Hurt responded at length in his blog post &lt;a href="http://enfranchisedmind.com/blog/2009/01/02/the-problem-with-stm-your-languages-still-suck/"&gt;The Problem with STM: your languages still suck&lt;/a&gt;.&amp;#160; Brian’s view is that the fundamental issue here is that most programming languages encourage heavy use of mutable variables and so many expensive assignments and reads are happening when STM is used.&amp;#160; If instead one is using a functional programming language which discourages variable mutations, the high cost of STM is much less of an issue.&amp;#160; Brian then further flushes out his ideas in a &lt;a href="http://enfranchisedmind.com/blog/2009/01/10/responses-to-the-problem-with-stm/"&gt;follow up blog&lt;/a&gt; in which he responds to responses to his first.&lt;/p&gt;  &lt;p&gt;While I don’t agree that ACM’s analysis “puts a deep nail in the coffin of STM”, I also don’t think it’s reasonable to expect most programmers will be jumping on the functional programming bandwagon in the near future.&amp;#160; The main issue is that it’s just too different from what they are used to.&amp;#160; &lt;/p&gt;  &lt;p&gt;For now FP will remain the domain of the motivated and pragmatic programmer.&amp;#160; It will be necessary to slowly ease the majority into this new, different world via things like functional C# extensions.&amp;#160; I do think that some kind of STM with training wheels for mainstream programmers would be a good way to promote this over the long term.&amp;#160; However, it would be extremely important that the inherent overhead is explicitly stated.&lt;/p&gt;  &lt;p&gt;Finally, I wanted to note that &lt;a href="http://blogs.msdn.com/stmteam/archive/2009/01/02/transactional-memory-in-a-real-world.aspx"&gt;Sasha Dadiomov of the Microsoft STM team has an interesting piece on the difficulties involved in debugging STM&lt;/a&gt;.&amp;#160; It’s an informative glimpse of how Microsoft’s implementation of STM is shaping up.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Blog: &lt;a href="http://blogs.msdn.com/chrsmith/archive/2008/12/30/speech-recognition-is-gun-and-easy.aspx"&gt;Chris Smith’s Speech Recognition is gun [sic] and easy!&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;It’s possible he meant fun and easy but I can’t be sure.&amp;#160; &lt;/p&gt;  &lt;p&gt;A quick but fun piece on leveraging System.Speech.Dll inside of F#.&amp;#160; The result is a 10 line program that takes your speech as input and prints it to the console.&amp;#160; Very simple yet quite cool.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Blog: &lt;a href="http://weblogs.asp.net/podwysocki/archive/2009/01/13/how-would-the-clr-be-different.aspx"&gt;Matthew Podwysocki’s How would the CLR Be Different?&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;In this post Matthew discusses how the CLR might be better implemented to serve the needs of functional programming languages.&amp;#160; I especially like the idea of including some new functionality for type manipulation and construction.&lt;/p&gt;  &lt;p&gt;However, I would like to see specific examples of exactly what Matthew would like changed under the hood.&amp;#160; He mentions a lot of general goals with reasoning to back them up but not how they might be implemented.&amp;#160; I also feel that it would be inappropriate to implement some of these ideas at the CLR level instead of the language or API level.&lt;/p&gt;  &lt;p&gt;For example, non-null references.&amp;#160; I’m all for Spec# style pre and post conditions but why is it necessary that this be implemented at the CLR level?&amp;#160; This belongs in the language instead.&amp;#160; Also, the issue with immutability in .NET mostly has to do with Microsoft’s .NET API design.&amp;#160; The stack based nature of IL is completely compatible with the idea.&lt;/p&gt;  &lt;p&gt;The CLR should be designed with the most general case in mind and not with the slant towards any particular language.&amp;#160; If the CLR is to be viable long term, flexibility must be emphasized over specific optimizations.&amp;#160; &lt;/p&gt;  &lt;h3&gt;&amp;#160;&lt;/h3&gt;  &lt;h3&gt;Paper: &lt;a href="http://funct.org/wiki/#Building%20a%20Wiki%20in%20Haskell.html"&gt;Sebastiaan Visser’s Building a Wiki in Haskell&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;A study on implementing a Wiki in Haskell which is a purely functional programming language.&amp;#160; This paper is a must read for both those interested in functional project architecture and those who question the viability of using FP for large applications.&amp;#160; The complete source of the project is available for your viewing pleasure.&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.atalasoft.com/cs/blogs/rickm/archive/2009/01/16/discoveries-this-week-01-16-2009.aspx&amp;amp;;subject=Discoveries+This+Week+01%2f16%2f2009" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/01/16/discoveries-this-week-01-16-2009.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/01/16/discoveries-this-week-01-16-2009.aspx&amp;amp;;title=Discoveries+This+Week+01%2f16%2f2009" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/01/16/discoveries-this-week-01-16-2009.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/01/16/discoveries-this-week-01-16-2009.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/01/16/discoveries-this-week-01-16-2009.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/01/16/discoveries-this-week-01-16-2009.aspx&amp;amp;title=Discoveries+This+Week+01%2f16%2f2009" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/01/16/discoveries-this-week-01-16-2009.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/01/16/discoveries-this-week-01-16-2009.aspx&amp;amp;;title=Discoveries+This+Week+01%2f16%2f2009" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/01/16/discoveries-this-week-01-16-2009.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/01/16/discoveries-this-week-01-16-2009.aspx&amp;amp;;title=Discoveries+This+Week+01%2f16%2f2009&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/01/16/discoveries-this-week-01-16-2009.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.com/cs/aggbug.aspx?PostID=17229" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/F_2300_/default.aspx">F#</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/functional/default.aspx">functional</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/concurrency/default.aspx">concurrency</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/.NET/default.aspx">.NET</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/memory/default.aspx">memory</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/fsharp/default.aspx">fsharp</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/languages/default.aspx">languages</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/roundup/default.aspx">roundup</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/haskell/default.aspx">haskell</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/algorithms/default.aspx">algorithms</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/design/default.aspx">design</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/software+transactional+memory/default.aspx">software transactional memory</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/stm/default.aspx">stm</category></item></channel></rss>