<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Strachey, referential transparency, Haskell</title>
	<atom:link href="http://therning.org/magnus/archives/1093/feed" rel="self" type="application/rss+xml" />
	<link>http://therning.org/magnus/archives/1093</link>
	<description>Incoherent mumblings</description>
	<lastBuildDate>Wed, 08 Aug 2012 00:21:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Thiago Negri</title>
		<link>http://therning.org/magnus/archives/1093/comment-page-1#comment-251642</link>
		<dc:creator>Thiago Negri</dc:creator>
		<pubDate>Wed, 08 Aug 2012 00:21:01 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/?p=1093#comment-251642</guid>
		<description><![CDATA[&lt;p&gt;IMO&lt;/p&gt;

&lt;p&gt;All that buzz about RT is going nowhere.&lt;/p&gt;

&lt;p&gt;Maybe, I&#039;ve learned it wrong. But I&#039;ve never heard of RT when I was absorbed in an imperative world.
RT is a common term in functional programming. I&#039;ve read the term and it&#039;s &quot;definition&quot; just after a couple of Haskell&#039;s tutorials.&lt;/p&gt;

&lt;p&gt;To me, it&#039;s simple as that: RT is the ability to switch sentences that refer to the same thing without changing the result.&lt;/p&gt;

&lt;p&gt;In Haskell, you can do that freely. Even inside IO monad! If you do anything wrong, the compiler won&#039;t let you continue.
In Java, you can do that too, but you need to be aware of all the environment and sequencing in order to preserve the result.&lt;/p&gt;

&lt;p&gt;Sequencing in the IO monad is enforced by the types, an IO String will not fit as a valid argument for a function that needs a String, so you will not be able to inline an IO String value, you are enforced to use the bind operator.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>IMO</p>

<p>All that buzz about RT is going nowhere.</p>

<p>Maybe, I&#8217;ve learned it wrong. But I&#8217;ve never heard of RT when I was absorbed in an imperative world.
RT is a common term in functional programming. I&#8217;ve read the term and it&#8217;s &#8220;definition&#8221; just after a couple of Haskell&#8217;s tutorials.</p>

<p>To me, it&#8217;s simple as that: RT is the ability to switch sentences that refer to the same thing without changing the result.</p>

<p>In Haskell, you can do that freely. Even inside IO monad! If you do anything wrong, the compiler won&#8217;t let you continue.
In Java, you can do that too, but you need to be aware of all the environment and sequencing in order to preserve the result.</p>

<p>Sequencing in the IO monad is enforced by the types, an IO String will not fit as a valid argument for a function that needs a String, so you will not be able to inline an IO String value, you are enforced to use the bind operator.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AntC</title>
		<link>http://therning.org/magnus/archives/1093/comment-page-1#comment-251439</link>
		<dc:creator>AntC</dc:creator>
		<pubDate>Sun, 05 Aug 2012 21:43:19 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/?p=1093#comment-251439</guid>
		<description><![CDATA[&lt;p&gt;Hi Magnus, Re: &quot;An open question (to me) is if anyone has built on Strachey’s work in this area ...&quot;&lt;/p&gt;

&lt;p&gt;At the time of his writing, Strachey was heavily involved with the team developing the language CPL.&lt;/p&gt;

&lt;p&gt;The most rigorous use of L-values and R-values was (is) BCPL (Martin Richards) -- which some claims stands for &quot;Basically Christopher&#039;s Programming Language&quot;. BCPL inspired C, and the rest is history.&lt;/p&gt;

&lt;p&gt;Regarding IO and side effects, CPL, and BCPL were conventional for their day (and followed ALGOL 60) in leaving IO as being &#039;implementation dependent&#039;. These were all in the von Neumann/Turing/procedural model of computing. They all used destructive assignment.&lt;/p&gt;

&lt;p&gt;BCPL supports assignment to L-values. In particular, the R-values of functions/procedures are just static cells holding pointers to the code body. Function application is just entering that code point using the current stack frame. So you can put an arbitrary expression to yield the code point:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(x &gt; y -&gt; SIN, COS) (z)                        // ... -&gt; ... , ... is conditional expression, apply to z
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or put function calls on the LHS of assignments:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Array (x, y) := z                              // array update (note that arrays are not native)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or change a function to point to a different code point:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;TRIG := (x &gt; y -&gt; SIN, COS)                    // excellent way to perplex any reader
                                               // but can achieve something like anonymous funs
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Strachey died tragically young. Oh, that he could have continued, and collaborated with the wealth of PL research going on at the time.&lt;/p&gt;

&lt;p&gt;AntC&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Hi Magnus, Re: &#8220;An open question (to me) is if anyone has built on Strachey’s work in this area &#8230;&#8221;</p>

<p>At the time of his writing, Strachey was heavily involved with the team developing the language CPL.</p>

<p>The most rigorous use of L-values and R-values was (is) BCPL (Martin Richards) &#8212; which some claims stands for &#8220;Basically Christopher&#8217;s Programming Language&#8221;. BCPL inspired C, and the rest is history.</p>

<p>Regarding IO and side effects, CPL, and BCPL were conventional for their day (and followed ALGOL 60) in leaving IO as being &#8216;implementation dependent&#8217;. These were all in the von Neumann/Turing/procedural model of computing. They all used destructive assignment.</p>

<p>BCPL supports assignment to L-values. In particular, the R-values of functions/procedures are just static cells holding pointers to the code body. Function application is just entering that code point using the current stack frame. So you can put an arbitrary expression to yield the code point:</p>

<pre><code>(x &gt; y -&gt; SIN, COS) (z)                        // ... -&gt; ... , ... is conditional expression, apply to z
</code></pre>

<p>Or put function calls on the LHS of assignments:</p>

<pre><code>Array (x, y) := z                              // array update (note that arrays are not native)
</code></pre>

<p>Or change a function to point to a different code point:</p>

<pre><code>TRIG := (x &gt; y -&gt; SIN, COS)                    // excellent way to perplex any reader
                                               // but can achieve something like anonymous funs
</code></pre>

<p>Strachey died tragically young. Oh, that he could have continued, and collaborated with the wealth of PL research going on at the time.</p>

<p>AntC</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TuukkaH</title>
		<link>http://therning.org/magnus/archives/1093/comment-page-1#comment-251414</link>
		<dc:creator>TuukkaH</dc:creator>
		<pubDate>Sun, 05 Aug 2012 13:57:53 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/?p=1093#comment-251414</guid>
		<description><![CDATA[&lt;p&gt;I think we have to carefully consider the language level whose RT we&#039;re talking about: do we include statements, function calls, embedded languages, and the language runtime?&lt;/p&gt;

&lt;p&gt;Monadic expressions (of Haskell) are a RT way of encoding an imperative language that isn&#039;t necessarily RT. The potential side effects lie in the semantics of the encoded language (which isn&#039;t Haskell, although you could consider it a part of Haskell). Similarily, the underlying implementation of a monad might or might not rely on unsafe/non-RT constructions.&lt;/p&gt;

&lt;p&gt;From that point of view, Haskell with the IO monad is RT, but the execution of Haskell with IO is not RT.&lt;/p&gt;

&lt;p&gt;In a similar manner, you might claim that C is RT and the side effects lie on a different level. But as a programmer, you don&#039;t have separate access to the RT level so its existence is theoretical. In C, you just can&#039;t replace the expression random() + random() with 2 * random() but in (non-unsafe) Haskell you can. In the end, you can twist the terms in various ways but you shouldn&#039;t hide the clear differences between C and Haskell.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>I think we have to carefully consider the language level whose RT we&#8217;re talking about: do we include statements, function calls, embedded languages, and the language runtime?</p>

<p>Monadic expressions (of Haskell) are a RT way of encoding an imperative language that isn&#8217;t necessarily RT. The potential side effects lie in the semantics of the encoded language (which isn&#8217;t Haskell, although you could consider it a part of Haskell). Similarily, the underlying implementation of a monad might or might not rely on unsafe/non-RT constructions.</p>

<p>From that point of view, Haskell with the IO monad is RT, but the execution of Haskell with IO is not RT.</p>

<p>In a similar manner, you might claim that C is RT and the side effects lie on a different level. But as a programmer, you don&#8217;t have separate access to the RT level so its existence is theoretical. In C, you just can&#8217;t replace the expression random() + random() with 2 * random() but in (non-unsafe) Haskell you can. In the end, you can twist the terms in various ways but you shouldn&#8217;t hide the clear differences between C and Haskell.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
