<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dysfunctional Programming &#187; repost</title>
	<atom:link href="http://ra3s.com/wordpress/dysfunctional-programming/category/repost/feed/" rel="self" type="application/rss+xml" />
	<link>http://ra3s.com/wordpress/dysfunctional-programming</link>
	<description>(λ (a b) a) vs (λ (a b) b)</description>
	<lastBuildDate>Wed, 25 Jan 2012 17:05:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PDC10: Future of C# and Visual Basic</title>
		<link>http://ra3s.com/wordpress/dysfunctional-programming/pdc10-future-of-c-and-visual-basic/</link>
		<comments>http://ra3s.com/wordpress/dysfunctional-programming/pdc10-future-of-c-and-visual-basic/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 03:00:09 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Csharp]]></category>
		<category><![CDATA[repost]]></category>

		<guid isPermaLink="false">http://ra3s.com/wordpress/dysfunctional-programming/?p=268</guid>
		<description><![CDATA[Anders Hejlsberg talking on the new C# and VB features for the version to follow C# 4.0 (timecode 48:10): [Async methods] allow you to compose asynchronous stuff using normal flow of control and using all of the statements that you &#8230; <a href="http://ra3s.com/wordpress/dysfunctional-programming/pdc10-future-of-c-and-visual-basic/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://player.microsoftpdc.com/Session/1b127a7d-300e-4385-af8e-ac747fee677a">Anders Hejlsberg talking on the new C# and VB features</a> for the version to follow C# 4.0 (timecode 48:10):</p>
<blockquote><p>[Async methods] allow you to compose asynchronous stuff using normal flow of control and using all of the statements that you know already.</p></blockquote>
<p>Pretty sweet. The first (longer) portion of the presentation is on the new asynchronous programming features for C# and VB. A hidden gem at the end (starting at timecode 50:40) is the &#8220;Compiler as a Service&#8221; status report. They&#8217;re experimenting with providing compiler front end, back end, and intermediate transformations as a run-time library.</p>
<p>It&#8217;s curious that there was no mention of the async transformations (first section) during his discussion of general purpose syntax transformations (second section). It would be interesting to see whether the &#8220;Compiler as a Service&#8221; libraries provide sufficient support as to be able to extend C# with things like &#8216;iterator syntax&#8217; or &#8216;async methods&#8217;, without having to wait for a new compiler.</p>
<p>(A nod of course to Lisp&#8217;s <a href="http://en.wikipedia.org/wiki/Macro_%28computer_science%29#Lisp_macros">macros</a>, Scheme&#8217;s <a href="http://schematics.sourceforge.net/scheme-uk/continuations.html#node_sec_5.2">continuations</a>, and Haskell&#8217;s use of <a href="http://doi.acm.org/10.1145/143165.143169">monads</a>; for defining new control flow primitives)</p>
]]></content:encoded>
			<wfw:commentRss>http://ra3s.com/wordpress/dysfunctional-programming/pdc10-future-of-c-and-visual-basic/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FAIC: CPS Revisited</title>
		<link>http://ra3s.com/wordpress/dysfunctional-programming/faic-cps-revisited/</link>
		<comments>http://ra3s.com/wordpress/dysfunctional-programming/faic-cps-revisited/#comments</comments>
		<pubDate>Thu, 21 Oct 2010 21:46:38 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[functional programming]]></category>
		<category><![CDATA[repost]]></category>

		<guid isPermaLink="false">http://ra3s.com/wordpress/dysfunctional-programming/?p=258</guid>
		<description><![CDATA[Eric Lippert of Fabulous Adventures In Coding has posted a series on CPS tranformation and different control flow abstractions. Good stuff &#8212; recommended reading for translating the crazy stuff I talk about into &#8216;normal&#8217; code. Continuation Passing Style Revisited, Part &#8230; <a href="http://ra3s.com/wordpress/dysfunctional-programming/faic-cps-revisited/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Eric Lippert of Fabulous Adventures In Coding has posted a series on CPS tranformation and different control flow abstractions. Good stuff &#8212; recommended reading for translating the crazy stuff I talk about into &#8216;normal&#8217; code.</p>
<ul>
<li><a href="http://blogs.msdn.com/b/ericlippert/archive/2010/10/21/continuation-passing-style-revisited-part-one.aspx">Continuation Passing Style Revisited, Part One</a>.</li>
<li><a href="http://blogs.msdn.com/b/ericlippert/archive/2010/10/22/continuation-passing-style-revisited-part-two-handwaving-about-control-flow.aspx">Continuation  Passing Style Revisited Part Two: Handwaving about control flow</a>.</li>
<li><a href="http://blogs.msdn.com/b/ericlippert/archive/2010/10/25/continuation-passing-style-revisited-part-three-musings-about-coroutines.aspx">Continuation Passing Style Revisited Part Three: Musings about coroutines</a>.</li>
<li><a href="http://blogs.msdn.com/b/ericlippert/archive/2010/10/26/continuation-passing-style-revisited-part-four-turning-yourself-inside-out.aspx">Continuation Passing Style Revisited Part Four: Turning yourself inside out</a>.</li>
<li><a href="http://blogs.msdn.com/b/ericlippert/archive/2010/10/27/continuation-passing-style-revisited-part-five-cps-and-asynchrony.aspx">Continuation Passing Style Revisited Part Five: CPS and Asynchrony</a>.</li>
</ul>
<p><span id="more-258"></span><span style="text-decoration: line-through;">I bet part 2 will cover exception handling. That, or call/cc, then EH in part 3. We&#8217;ll see <img src='http://ra3s.com/wordpress/dysfunctional-programming/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </span></p>
<p>Update (10/22): Yay, I was right, EH is up next.  He also writes &#8220;<strong>Next time:</strong> handwaving about coroutines&#8221;.  I&#8217;m sure call/cc will be in part 3.</p>
<p>Update (10/25): Part 3 is up &#8212; skips call/cc (makes sense, as Eric it talking about writing CPS explicitly) moving straight to one application of CPS: coroutines. Ominiously ends with &#8220;<strong>Next time</strong>: if Continuation Passing Style is so awesome then why don’t we all use this technique every day?&#8221; Presumably he will be talking about the specific implementation technique he&#8217;s chosen, as various runtime environments (usually Scheme implementations) *do* use CPS for compilation all the time, and a few do so with no ill effect.</p>
<p>Update (10/27): Part 4 and 5 are up.  Part 4 notes that CPS is generally *hard* to understand for most folks, but that CPS is ultimately general purpose, making for quick implementation of a wide variety of programming language control flow constructs.</p>
<p>Part 5 further talks about the explicit use of CPS in designing asynchronous programming APIs. I&#8217;m somewhat disappointed that Eric skips over the CPS to model for loops, instead resorting to a state machine like the C# compiler uses when compiling iterator syntax. It&#8217;s a fine implementation technique, but it seems like a missed opportunity to me, and it would have avoided the &#8220;definite assignment problem&#8221; he mentioned. And lastly, while the invocation of the continuation was straightforward in CPS, a lot of synchronization work has been glossed over in &#8216;SetContinuation&#8217; &#8212; the continuation may not always be ready by the time that &#8216;AsyncFetch&#8217; goes to invoke it. This seems unnecessarily wasteful, as the caller always knows the continuation they&#8217;re about to set &#8212; the caller code is simplified only by reordering, at the expense of runtime cost and added complexity in AsyncFetch.</p>
<p>I think the switch to use &#8216;SetContinuation/GetResults&#8217; is done too early. It makes it easier to connect his example to .Net&#8217;s <a href="http://msdn.microsoft.com/en-us/library/dd460717.aspx">Task Parallel Library</a>, but now there isn&#8217;t a single example in direct CPS style that demonstrates asynchrony.</p>
<p>I&#8217;m only so critical of Part 5 as I think Eric Lippert has done quite well in the rest of this series. To be balanced, many programmers will find the state machine model easier to read. As a CPS topic, I find Part 5 lacking; It shines as an explaination of asynchrony in .Net.  It a very good piece, but is an ugly duckling in a CPS series.</p>
<p>Again, I appreciate his work here.  Please take the time to give this series a read.</p>
<p><a href="http://blogs.msdn.com/b/ericlippert/archive/2010/10/22/continuation-passing-style-revisited-part-two-handwaving-about-control-flow.aspx"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ra3s.com/wordpress/dysfunctional-programming/faic-cps-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle sues Google over Android and Java</title>
		<link>http://ra3s.com/wordpress/dysfunctional-programming/oracle-sues-google-over-android-and-java-relevant-results-cnet-news/</link>
		<comments>http://ra3s.com/wordpress/dysfunctional-programming/oracle-sues-google-over-android-and-java-relevant-results-cnet-news/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 03:11:37 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[repost]]></category>

		<guid isPermaLink="false">http://ra3s.com/wordpress/dysfunctional-programming/?p=254</guid>
		<description><![CDATA[Oracle sues Google over Android and Java &#124; CNET News. Wow. Sun may have open-sourced Java in the past, but at this moment, the JVM seems like a more hostile platform than .Net.]]></description>
			<content:encoded><![CDATA[<p><a href="http://news.cnet.com/8301-30684_3-20013546-265.html">Oracle sues Google over Android and Java | CNET News</a>.</p>
<p>Wow. Sun may have open-sourced Java in the past, but at this moment, the JVM seems like a more hostile platform than .Net.</p>
]]></content:encoded>
			<wfw:commentRss>http://ra3s.com/wordpress/dysfunctional-programming/oracle-sues-google-over-android-and-java-relevant-results-cnet-news/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Island/Lake recursion</title>
		<link>http://ra3s.com/wordpress/dysfunctional-programming/islandlake-recursion/</link>
		<comments>http://ra3s.com/wordpress/dysfunctional-programming/islandlake-recursion/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 17:23:15 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[humor]]></category>
		<category><![CDATA[repost]]></category>

		<guid isPermaLink="false">http://ra3s.com/wordpress/dysfunctional-programming/?p=251</guid>
		<description><![CDATA[The Island and Lake Combination. For those who are curious which is the largest (island in a lake on an)^2 on an island. Because recursion isn&#8217;t just for programmers and computers.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.elbruz.org/islands/Islands%20and%20Lakes.htm">The Island and Lake Combination</a>.</p>
<p>For those who are curious which is the largest (island in a lake on an)^2 on an island. Because recursion isn&#8217;t just for programmers and computers.</p>
]]></content:encoded>
			<wfw:commentRss>http://ra3s.com/wordpress/dysfunctional-programming/islandlake-recursion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Functional Programming, Reductio</title>
		<link>http://ra3s.com/wordpress/dysfunctional-programming/functional-programming-reductio/</link>
		<comments>http://ra3s.com/wordpress/dysfunctional-programming/functional-programming-reductio/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 23:29:03 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[repost]]></category>

		<guid isPermaLink="false">http://ra3s.com/wordpress/dysfunctional-programming/?p=224</guid>
		<description><![CDATA[Came across a slide deck via Reddit with an excellent point, cutting across the various functional programming diciplines: Central to the thesis of FP is the notion of referential transparency. Referential transparency leads to program compositionality. // #1 X x = function(); &#8230; <a href="http://ra3s.com/wordpress/dysfunctional-programming/functional-programming-reductio/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Came across a <a href="http://projects.tmorris.net/public/what-does-fp-mean/artifacts/0.3/chunk-html/index.html">slide deck</a> via <a href="http://www.reddit.com/comments/chjpg/are_you_a_functional_programmer_come_work_at_a/c0ssonn">Reddit</a> with an excellent point, cutting across the various functional programming diciplines:</p>
<blockquote><p>Central to the thesis of FP is the notion of <em>referential transparency</em>.</p>
<p>Referential transparency leads to <em>program compositionality</em>.</p>
<p><code>// #1<br />
X x = function();<br />
R r1 = arbitrary(x);<br />
R r2 = arbitrary(x);</code></p>
<p><code>// #2<br />
R r1 = arbitrary(function());<br />
R r2 = arbitrary(function());</code></p>
<p>If these two programs produce the same outcome then <code>function</code> is <em>referentially transparent</em>.</p></blockquote>
<p>Well put. Back to the Reddit thread, functional programming and imperative programming are not a true dichotomy, but they one does need to mix carefully.</p>
<p>I find it most useful to build imperative programs on top a functional base, a foundation if you will. Taking the previous example, the function &#8216;arbitrary&#8217; may not be a true function; it may modify persistent state, the values r1 and r2 being unequal. But building on top of the referentially transparent &#8216;function&#8217;, i can later refactor my program from #1 to #3:</p>
<p><code>// #3<br />
void part1() {<br />
    R r1 = arbitrary(function()); /*...*/<br />
}<br />
void part2() {<br />
    R r2 = arbitrary(function()); /*...*/<br />
}</code></p>
<p>And be able to rely on r1 and r2 being unchanged from their meaning in #1.  </p>
<p>Referential transparency can be explained as the property that a function <em>means the same thing<em> every time you call it, no matter where or when you call it. That&#8217;s a very useful property to have in understanding and refactoring programs.</p>
]]></content:encoded>
			<wfw:commentRss>http://ra3s.com/wordpress/dysfunctional-programming/functional-programming-reductio/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GOTOs inconvenient</title>
		<link>http://ra3s.com/wordpress/dysfunctional-programming/gotos-inconvenient/</link>
		<comments>http://ra3s.com/wordpress/dysfunctional-programming/gotos-inconvenient/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 15:03:12 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[functional programming]]></category>
		<category><![CDATA[repost]]></category>

		<guid isPermaLink="false">http://ra3s.com/wordpress/dysfunctional-programming/?p=200</guid>
		<description><![CDATA[From &#8220;The Discovery of Continuations&#8221; The talk actually had one direct and important consequence for computing. Under the inspiration of the notion of the unnecessity of goto’s, Dijkstra spent that evening constructing realistic examples of programs without goto’s, … So &#8230; <a href="http://ra3s.com/wordpress/dysfunctional-programming/gotos-inconvenient/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>From &#8220;<a href="http://www.brics.dk/~hosc/vol06/contents.html">The Discovery of Continuations</a>&#8221;</p>
<blockquote><p>The talk actually had one direct and important consequence for computing. Under the inspiration of the notion of the unnecessity of goto’s, Dijkstra spent that evening constructing realistic examples of programs without goto’s, … So while van Wijngaarden said that goto’s were unnecessary … , Dijkstra stretched the point to say that goto’s were inconvenient. The latter lesson stuck. &#8212; McIlroy</p></blockquote>
<p>The <a href="http://en.wikipedia.org/wiki/Continuation-passing_style">continuation passing transformation </a>grew out an attempt to formalize <a href="http://en.wikipedia.org/wiki/Goto_statement">GOTO</a>, and ended up both obsoleting it as well as producing new, better structured control primitives (for example, <a href="http://en.wikipedia.org/wiki/Break_statement#Early_exit_from_loops">break</a>).  It&#8217;s strange to me that I could have gone as far as I have, as a programmer, without having a good understanding of this concept. We use it implicitly all the time &#8212; the <a href="http://en.wikipedia.org/wiki/Call_stack">call stack </a>of course &#8212; but rarely consider all of the ramifications (threading) and certainly not all of the utility (coroutines, exception handling, etc).</p>
]]></content:encoded>
			<wfw:commentRss>http://ra3s.com/wordpress/dysfunctional-programming/gotos-inconvenient/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trouble with OOP</title>
		<link>http://ra3s.com/wordpress/dysfunctional-programming/trouble-with-oop/</link>
		<comments>http://ra3s.com/wordpress/dysfunctional-programming/trouble-with-oop/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 18:37:05 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[object oriented]]></category>
		<category><![CDATA[repost]]></category>

		<guid isPermaLink="false">http://ra3s.com/wordpress/dysfunctional-programming/?p=209</guid>
		<description><![CDATA[Subtyping, Subclassing, and Trouble with OOP. Excerpt: What makes this problem more unsettling is that both you and I tried to do everything by the book. We wrote a safe, typechecked code. We eschewed casts. g++ (2.95.2) compiler with flags &#8230; <a href="http://ra3s.com/wordpress/dysfunctional-programming/trouble-with-oop/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://okmij.org/ftp/Computation/Subtyping/">Subtyping, Subclassing, and Trouble with OOP</a>.</p>
<p>Excerpt:</p>
<blockquote><p>What makes this problem more unsettling is that both you and I tried to do everything by the book. We wrote a safe, typechecked code. We eschewed casts. g++ (2.95.2) compiler with flags -W and -Wall issued not a single warning. […] And yet, despite all my efforts to separate interface and implementation, I failed. Should a programming language or the methodology take at least a part of the blame?</p></blockquote>
<p>A lot of people miss the point with Object Oriented Programming (OOP) – this author gets it.</p>
<p><span id="more-209"></span>Painfully few programmers are aware of the <a href="http://en.wikipedia.org/wiki/Liskov_substitution_principle">Liskov Substitution Principle</a> (LSP), and its violations incur the wrath of some distant cousin of the the side effect monster, the violated invariant monster. LSP is incredibly tricky to apply – generally, the object metaphor actually gets in the way of verifying LSP properties. The general guidance of OO spends far too little time on these implications. Inevitably, a programmer does something totally reasonable but everything breaks anyway.</p>
<p>I try to follow the LSP when designing green-field. This rarely permits me to use inheritance of implementation. Rather, <a href="http://en.wikipedia.org/wiki/Composite_pattern">composition</a> dominates my designs.</p>
<p>For the curious, the author&#8217;s program strengthened a precondition – the derived class CSet required the element be unique for insert to &#8216;succeed&#8217;, where CBag required nothing. As such, LSP predicts that CSets cannot be transparently substituted where CBags are predicted; if they are, different behavior may (and did) result.</p>
]]></content:encoded>
			<wfw:commentRss>http://ra3s.com/wordpress/dysfunctional-programming/trouble-with-oop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

