<?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 : testing, concurrency</title><link>http://www.atalasoft.com/cs/blogs/rickm/archive/tags/testing/concurrency/default.aspx</link><description>Tags: testing, concurrency</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Discoveries This Week 02/13/2009</title><link>http://www.atalasoft.com/cs/blogs/rickm/archive/2009/02/13/discoveries-this-week-02-13-2009.aspx</link><pubDate>Fri, 13 Feb 2009 15:43:25 GMT</pubDate><guid isPermaLink="false">647108ca-f046-4d8d-9feb-a7fbd2049b37:17479</guid><dc:creator>RickM</dc:creator><slash:comments>1</slash:comments><comments>http://www.atalasoft.com/cs/blogs/rickm/comments/17479.aspx</comments><wfw:commentRss>http://www.atalasoft.com/cs/blogs/rickm/commentrss.aspx?PostID=17479</wfw:commentRss><wfw:comment>http://www.atalasoft.com/cs/blogs/rickm/rsscomments.aspx?PostID=17479</wfw:comment><description>&lt;p&gt;A wide range of subjects this week including testing, concurrent performance, exception handing and data structures.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Software – &lt;a href="http://www.codeplex.com/fsstory"&gt;FsStory, a library for writing executable user stories in F#&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;I feel that F#, with it’s concise syntax, is an ideal framework for writing tests.&amp;#160; Combined with FsStory F# is made much more powerful in this regard as it becomes possible to write user case tests and have them read very much like simple English.&amp;#160;&amp;#160; F# has a huge advantage here over C# as it has much less syntactic cruft and so much less for your brain to process while reading.&amp;#160;&amp;#160; For example:&lt;/p&gt;  &lt;pre style="border-right:#cecece 1px solid;padding-right:5px;border-top:#cecece 1px solid;padding-left:5px;min-height:40px;padding-bottom:5px;overflow:auto;border-left:#cecece 1px solid;width:480px;padding-top:5px;border-bottom:#cecece 1px solid;background-color:#fbfbfb;"&gt;&lt;pre style="font-size:12px;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#fbfbfb;"&gt;  1: [&amp;lt;Fact&amp;gt;]
&lt;/pre&gt;&lt;pre style="font-size:12px;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;"&gt;  2: let MoveTurtleToPosition() = 
&lt;/pre&gt;&lt;pre style="font-size:12px;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#fbfbfb;"&gt;  3:        given ATurtle
&lt;/pre&gt;&lt;pre style="font-size:12px;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;"&gt;  4:     |&amp;gt; andGiven IsRotated90DegreesToTheRight
&lt;/pre&gt;&lt;pre style="font-size:12px;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#fbfbfb;"&gt;  5:     |&amp;gt; whens (TurtleWalksSteps 9)
&lt;/pre&gt;&lt;pre style="font-size:12px;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#ffffff;"&gt;  6:     |&amp;gt; thens (TurtleIsLocatedAt (0,9))   
&lt;/pre&gt;&lt;pre style="font-size:12px;margin:0em;width:100%;font-family:consolas,'Courier New',courier,monospace;background-color:#fbfbfb;"&gt;  7:     |&amp;gt; endStory&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;It’s obvious exactly what this is testing and how.&amp;#160; Yet, it takes very little time to read.&amp;#160; Very impressive.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Blog –Jan Varwig’s &lt;a href="http://jan.varwig.org/archiv/f-sharp-observations"&gt;F# Observations&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;While this post is rather old, I was very excited by Jan’s analysis of an article on comparing C# and F# using the distributed .NET computing framework &lt;a href="http://sourceforge.net/projects/alchemi"&gt;Alchemi&lt;/a&gt;.&amp;#160; &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Optimizing this application showed that F# would finish in 1.5 seconds while C# would not complete any faster than 2.6 seconds.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It’s important to note that these results are a year old now and that with newer F# optimization the results might be even better. &lt;/p&gt;

&lt;p&gt;The other interesting thing in this post is the discussion of the cost of heavyweight threads on the CLR.&amp;#160; Which is directly related to our next discovery:&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Blog – Daniel Moth’s &lt;a href="http://www.danielmoth.com/Blog/2008/11/new-and-improved-clr-4-thread-pool.html"&gt;New and Improved CLR 4 Thread Pool Engine&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;A first glimpse of that is in store for us in the next iterating of the Thread Pool.&amp;#160; Not surprisingly, the optimizations seem to focus on sharing work across multiple threads.&amp;#160; &lt;/p&gt;

&lt;p&gt;With F#’s thread-friendly nature and new the optimized thread pool, I'm very excited to see how .NET compares to other grid computing platforms after it’s 4.0 release.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Blog – Arthur Herczeg’s &lt;a href="http://techiethings.blogspot.com/2009/02/f-exceptions.html"&gt;F# Exceptions&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;An informational post on managing and throwing both F# native and general .NET exceptions in F#.&amp;#160; Included are examples of imperative style try, catch and try, finally patterns.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Blog – Karl Krukow’s &lt;a href="http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/"&gt;Understanding Clojure’s PersistentVector&lt;/a&gt; &lt;/h3&gt;

&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Rich_Hickey"&gt;Rich Hickey&lt;/a&gt;, the father of the &lt;a href="http://clojure.org/"&gt;Clojure&lt;/a&gt; language, has gone out of his way to optimize Clojure’s structures for data sharing with immutability.&amp;#160; I was very impressed with Clojure when, back last march, &lt;a href="http://www.atalasoft.com/cs/blogs/rickm/archive/2008/03/21/clojure-impressions.aspx"&gt;Rich Hickey came to Northampton and presented it in a talk&lt;/a&gt;.&amp;#160; While, Clojure runs on the JVM and so comes along with all of the baggage that it entails, it’s a fantastic language and people in the java community are flocking to it. &lt;/p&gt;

&lt;p&gt;I would love to see some of these data structures ported to the .NET framework so that F# could take advantage of them.&amp;#160; As far as I am currently aware, F# data structures are instead implemented via binary trees and so are much less efficient in terms of the amount of data shared. &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/02/13/discoveries-this-week-02-13-2009.aspx&amp;amp;;subject=Discoveries+This+Week+02%2f13%2f2009" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/02/13/discoveries-this-week-02-13-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/02/13/discoveries-this-week-02-13-2009.aspx&amp;amp;;title=Discoveries+This+Week+02%2f13%2f2009" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/02/13/discoveries-this-week-02-13-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/02/13/discoveries-this-week-02-13-2009.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/02/13/discoveries-this-week-02-13-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/02/13/discoveries-this-week-02-13-2009.aspx&amp;amp;title=Discoveries+This+Week+02%2f13%2f2009" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/02/13/discoveries-this-week-02-13-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/02/13/discoveries-this-week-02-13-2009.aspx&amp;amp;;title=Discoveries+This+Week+02%2f13%2f2009" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/02/13/discoveries-this-week-02-13-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/02/13/discoveries-this-week-02-13-2009.aspx&amp;amp;;title=Discoveries+This+Week+02%2f13%2f2009&amp;amp;;top=1" target="_blank" title = "Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/02/13/discoveries-this-week-02-13-2009.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.com/cs/aggbug.aspx?PostID=17479" width="1" height="1"&gt;</description><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/clojure/default.aspx">clojure</category><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/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/fsharp/default.aspx">fsharp</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/testing/default.aspx">testing</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/.NET+4.0/default.aspx">.NET 4.0</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/grid/default.aspx">grid</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/stories/default.aspx">stories</category><category domain="http://www.atalasoft.com/cs/blogs/rickm/archive/tags/exceptions/default.aspx">exceptions</category></item></channel></rss>