<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Fsharp on Martin_Trojer</title><link>http://martintrojer.github.io/categories/fsharp/</link><description>Recent content in Fsharp on Martin_Trojer</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 08 Nov 2014 00:00:00 +0000</lastBuildDate><atom:link href="http://martintrojer.github.io/categories/fsharp/index.xml" rel="self" type="application/rss+xml"/><item><title>F#'s strongest year yet</title><link>http://martintrojer.github.io/post/2014-11-08-fs-strongest-year-yet/</link><pubDate>Sat, 08 Nov 2014 00:00:00 +0000</pubDate><guid>http://martintrojer.github.io/post/2014-11-08-fs-strongest-year-yet/</guid><description>&lt;p&gt;Tradition demands that I write down some subjective thoughts on how my old friend F# is doing. So here we go again (for the 4th year running).&lt;/p&gt;
&lt;p&gt;All I can really say is this: wow, what a year.&lt;/p&gt;</description></item><item><title>This year in F#</title><link>http://martintrojer.github.io/post/2013-10-29-this-year-in-f/</link><pubDate>Tue, 29 Oct 2013 00:00:00 +0000</pubDate><guid>http://martintrojer.github.io/post/2013-10-29-this-year-in-f/</guid><description>&lt;p&gt;For the third year running, here&amp;rsquo;s my annual (and extremely subjective) review of the state of the F# language, its community and other loosely connected things. How would I sum up the noises coming from F# the last year? Pretty darn awesome. A lot of what&amp;rsquo;s been happening was on my wish-list outlined in &lt;a href="http://martintrojer.github.io/post/2012-10-24-the-future-of-net-lies-in-mono-the-future-of-f-lies-in-monodevelop/"&gt;last year&amp;rsquo;s post&lt;/a&gt;. What are the highlights?&lt;/p&gt;</description></item><item><title>Comparing FP REPL Sessions</title><link>http://martintrojer.github.io/post/2013-06-04-comparing-fp-repl-sessions/</link><pubDate>Tue, 04 Jun 2013 00:00:00 +0000</pubDate><guid>http://martintrojer.github.io/post/2013-06-04-comparing-fp-repl-sessions/</guid><description>&lt;p&gt;Functional programming is great; higher-order functions, closures, immutable data-structures, lazy sequences etc.&lt;/p&gt;
&lt;p&gt;Most languages comes with a REPL (or &amp;lsquo;interactive&amp;rsquo; prompt), where you can play with these features at your leisure. Dynamically typed languages are a bit more convenient in the REPL, but not by as much as you might think. Also, F# type providers closes the gap even further.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a typical, hit-a-JSON-endpoint-and-look-at-the-data session in Clojure;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-clojure" data-lang="clojure"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ lein repl
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;user=&amp;gt; (&lt;span style="color:#66d9ef"&gt;def &lt;/span&gt;res (slurp &lt;span style="color:#e6db74"&gt;&amp;#34;http://www.bbc.co.uk/tv/programmes/genres/drama/scifiandfantasy/schedules/upcoming.json&amp;#34;&lt;/span&gt;))
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;user=&amp;gt; (&lt;span style="color:#a6e22e"&gt;require&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;clojure.data.json&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;clojure.walk&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;user=&amp;gt; (&lt;span style="color:#66d9ef"&gt;def &lt;/span&gt;json (&lt;span style="color:#a6e22e"&gt;-&amp;gt;&amp;gt;&lt;/span&gt; res clojure.data.json/read-str
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; clojure.walk/keywordize-keys))
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;user=&amp;gt; (&lt;span style="color:#a6e22e"&gt;-&amp;gt;&amp;gt;&lt;/span&gt; json &lt;span style="color:#e6db74"&gt;:broadcasts&lt;/span&gt; (filter &lt;span style="color:#f92672"&gt;#&lt;/span&gt;(&amp;gt;= (&lt;span style="color:#e6db74"&gt;:duration&lt;/span&gt; %) &lt;span style="color:#ae81ff"&gt;6300&lt;/span&gt;))
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; (map &lt;span style="color:#e6db74"&gt;:programme&lt;/span&gt;) (map (&lt;span style="color:#a6e22e"&gt;juxt&lt;/span&gt; &lt;span style="color:#e6db74"&gt;:title&lt;/span&gt; &lt;span style="color:#e6db74"&gt;:pid&lt;/span&gt;)))
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;([&lt;span style="color:#e6db74"&gt;&amp;#34;Lady in the Water&amp;#34;&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;b00l5wdn&amp;#34;&lt;/span&gt;] [&lt;span style="color:#e6db74"&gt;&amp;#34;Lady in the Water&amp;#34;&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;b00l5wdn&amp;#34;&lt;/span&gt;] [&lt;span style="color:#e6db74"&gt;&amp;#34;Lady in the Water&amp;#34;&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;b00l5wdn&amp;#34;&lt;/span&gt;] [&lt;span style="color:#e6db74"&gt;&amp;#34;Lady in the Water&amp;#34;&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;b00l5wdn&amp;#34;&lt;/span&gt;])
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Nice, clean and very powerful, virtually zero ceremony. Doing the same in Scala, is just a little bit more awkward;&lt;/p&gt;</description></item><item><title>The future of .NET lies in Mono. The future of F# lies in MonoDevelop.</title><link>http://martintrojer.github.io/post/2012-10-24-the-future-of-net-lies-in-mono-the-future-of-f-lies-in-monodevelop/</link><pubDate>Wed, 24 Oct 2012 00:00:00 +0000</pubDate><guid>http://martintrojer.github.io/post/2012-10-24-the-future-of-net-lies-in-mono-the-future-of-f-lies-in-monodevelop/</guid><description>&lt;p&gt;It&amp;rsquo;s been a year since &lt;a href="http://martintrojer.github.io/post/2011-11-03-why-f-needs-mono-and-really-should-be-a-jvm-language/"&gt;I last wrote about F# and Mono&lt;/a&gt; - what&amp;rsquo;s happened since then?&lt;/p&gt;
&lt;p&gt;F# 3.0 has recently been released, bundled with the new &lt;a href="http://www.theregister.co.uk/2012/08/28/visual_studio_2012_review/"&gt;all-grey&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/b/visualstudio/archive/2012/06/05/a-design-with-all-caps.aspx"&gt;ALL-CAPS&lt;/a&gt; Visual Studio 2012. The biggest new feature is &lt;a href="http://msdn.microsoft.com/en-us/library/hh156509.aspx"&gt;type providers&lt;/a&gt;, bringing some of the benefits of dynamic languages into the type-safe world. Innovations like type providers deserve more industry attention. I really hope these ideas will spread and hopefully languages like Scala will pick them up so more developers (including me) can enjoy the benefits.&lt;/p&gt;</description></item><item><title>Parsing with Matches and Banana Clips</title><link>http://martintrojer.github.io/post/2011-12-03-parsing-with-matches-and-banana-clips/</link><pubDate>Sat, 03 Dec 2011 00:00:00 +0000</pubDate><guid>http://martintrojer.github.io/post/2011-12-03-parsing-with-matches-and-banana-clips/</guid><description>&lt;p&gt;I find myself working with DSLs quite a bit, and thus I write a few parsers. Some languages are better than others for parsers and pattern matching is a technique that makes writing parsers a true joy. I will not go over the &lt;a href="http://msdn.microsoft.com/en-us/library/dd547125.aspx"&gt;basics of pattern matching&lt;/a&gt; here, rather show how F#&amp;rsquo;s &lt;a href="http://msdn.microsoft.com/en-us/library/dd233248.aspx"&gt;active patterns&lt;/a&gt; can be used to take pattern matching to the next level.&lt;/p&gt;
&lt;p&gt;The traditional steps of a &amp;ldquo;parser&amp;rdquo; are roughly lexical analysis (tokenizer), syntactic analysis (parser) and then evaluator (interpreter). In this post we&amp;rsquo;ll focus on the parsing step of a simple DSL. A parser typically consume a list of tokens and produces an Abstract Syntax Tree (AST), ready to be passed on the evaluator/interpreter.&lt;/p&gt;</description></item><item><title>Why F# needs Mono (and really should be a JVM language)</title><link>http://martintrojer.github.io/post/2011-11-03-why-f-needs-mono-and-really-should-be-a-jvm-language/</link><pubDate>Thu, 03 Nov 2011 00:00:00 +0000</pubDate><guid>http://martintrojer.github.io/post/2011-11-03-why-f-needs-mono-and-really-should-be-a-jvm-language/</guid><description>&lt;p&gt;When people think about .NET development, they think of C#. Sure there are other languages (VB, ASP.NET etc) but .NET and C# are very tightly linked (just drop an .NET assembly in &lt;a href="http://www.reflector.net/"&gt;reflector&lt;/a&gt; for technical proof). If you&amp;rsquo;re writing a new Windows application (and it&amp;rsquo;s not a high performant game), chances are you are reading &lt;a href="http://en.wikipedia.org/wiki/Windows_Presentation_Foundation"&gt;WPF&lt;/a&gt; books right now.&lt;/p&gt;
&lt;p&gt;One of the promises of .NET when it was released was &amp;ldquo;the great language independent&amp;rdquo; runtime, making all these languages interoperate in joyful bliss. Technically this still holds, but in practice it&amp;rsquo;s all about C#.&lt;/p&gt;</description></item><item><title>Scheming in F#</title><link>http://martintrojer.github.io/post/2011-11-02-scheming-in-f/</link><pubDate>Wed, 02 Nov 2011 00:00:00 +0000</pubDate><guid>http://martintrojer.github.io/post/2011-11-02-scheming-in-f/</guid><description>&lt;p&gt;Given the fact that I worship at the &lt;a href="https://web.mit.edu/6.001/6.037/sicp.pdf"&gt;SICP&lt;/a&gt; altar, it should come as no surprise that I follow the recipe outlined in chapter 4 of said book; implementing a &lt;a href="http://en.wikipedia.org/wiki/Scheme_(programming_language)"&gt;Scheme&lt;/a&gt; interpreter in every language I am trying to learn. Over the years it has turned out to be a very useful exercise, since the problem is just &amp;ldquo;big enough&amp;rdquo; to force me to drill into what the languages have to offer.&lt;/p&gt;</description></item></channel></rss>