<?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 for Friendly patterns and algorithms</title>
	<atom:link href="http://www.palgorithm.co.uk/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.palgorithm.co.uk</link>
	<description>Discussion of algorithms for games, graphics and general engineering</description>
	<lastBuildDate>Fri, 16 Dec 2011 09:40:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>Comment on On parsing, regex, haskell and some other cool things by Kylia</title>
		<link>http://www.palgorithm.co.uk/2009/03/on-parsing-regex-haskell-and-some-other-cool-things/comment-page-1/#comment-12072</link>
		<dc:creator>Kylia</dc:creator>
		<pubDate>Fri, 16 Dec 2011 09:40:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.palgorithm.co.uk/?p=142#comment-12072</guid>
		<description>Your&#039;s is a point of view where real itnelliegcne shines through.</description>
		<content:encoded><![CDATA[<p>Your's is a point of view where real itnelliegcne shines through.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Proposal for a graphics pipeline DSL by Andy</title>
		<link>http://www.palgorithm.co.uk/2010/09/proposal-for-a-graphics-pipeline-dsl/comment-page-1/#comment-10862</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Thu, 15 Sep 2011 15:48:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.palgorithm.co.uk/?p=275#comment-10862</guid>
		<description>Good post Sam Martin, thanks for sharing. Look forward to reading more on this topic in the future.

Andy</description>
		<content:encoded><![CDATA[<p>Good post Sam Martin, thanks for sharing. Look forward to reading more on this topic in the future.</p>
<p>Andy</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The beauty of software development by Data Capture</title>
		<link>http://www.palgorithm.co.uk/2009/05/the-beauty-of-software-development/comment-page-1/#comment-10462</link>
		<dc:creator>Data Capture</dc:creator>
		<pubDate>Sat, 20 Aug 2011 04:02:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.palgorithm.co.uk/2009/05/the-beauty-of-software-development/#comment-10462</guid>
		<description>Great post, and an excellent site. Thank you Sam Martin !!!</description>
		<content:encoded><![CDATA[<p>Great post, and an excellent site. Thank you Sam Martin !!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on OpenCL - the compute intermediate language by Eddie Edwards</title>
		<link>http://www.palgorithm.co.uk/2011/02/opencl-the-compute-intermediate-language/comment-page-1/#comment-7588</link>
		<dc:creator>Eddie Edwards</dc:creator>
		<pubDate>Sat, 12 Feb 2011 13:44:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.palgorithm.co.uk/?p=209#comment-7588</guid>
		<description>PTX rocks (just researched it! Thanks for the link!)

But it solves a very specific problem, given it&#039;s programming model, which is essentially mapping Cg (+ pointers) to a single SIMD way ... similar to what Larrabee&#039;s shader compiler does in 16-way SIMD. But as-is it would not be suitable for writing the Larrabee renderer. It covers maybe half of the Larrabee ISA.

Still it goes a long way!</description>
		<content:encoded><![CDATA[<p>PTX rocks (just researched it! Thanks for the link!)</p>
<p>But it solves a very specific problem, given it's programming model, which is essentially mapping Cg (+ pointers) to a single SIMD way ... similar to what Larrabee's shader compiler does in 16-way SIMD. But as-is it would not be suitable for writing the Larrabee renderer. It covers maybe half of the Larrabee ISA.</p>
<p>Still it goes a long way!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on OpenCL - the compute intermediate language by Eddie Edwards</title>
		<link>http://www.palgorithm.co.uk/2011/02/opencl-the-compute-intermediate-language/comment-page-1/#comment-7587</link>
		<dc:creator>Eddie Edwards</dc:creator>
		<pubDate>Sat, 12 Feb 2011 12:27:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.palgorithm.co.uk/?p=209#comment-7587</guid>
		<description>Hey Sam,

Something like LLVM would be cool, but I don&#039;t see the necessity. Making a compiler output OpenCL or CUDA or Cg/HLSL is simple enough, just as the first C++ compilers output C. Then each vendor can implement those languages how they like.

I&#039;m sure LLVM will grow to support such use-cases. If the industry settles on PTX then LLVM may get simpler and smaller, but nothing fundamental will become possible that wasn&#039;t before. PTX is nice to have, that&#039;s all.

The focus should not be on the specifics here, but on the more general problems: how can I easily refactor code so that it runs on a different mix of coprocessors? When my console has 4 scalar cores with 4-way SIMD plus 32 cores of Larrabee plus a 2048-unit GPU, how can I retarget code when I find I need to change my occupancy profile?

The problem is the huge differences in architecture - exemplified by the fact that RenderTris(vertex[], index[], shader()) is implemented in hardware on a GPU but software on Larrabee. PTX covers the shader() part, but implementations of RenderTris, plus the API calls to actually trigger the call, are completely different and must be selected per architecture. It&#039;s there that PTX may break down as it may lack access to non-generic features per architecture (e.g. SPU channel registers or special Larrabee opcodes).

Still, food for thought!</description>
		<content:encoded><![CDATA[<p>Hey Sam,</p>
<p>Something like LLVM would be cool, but I don't see the necessity. Making a compiler output OpenCL or CUDA or Cg/HLSL is simple enough, just as the first C++ compilers output C. Then each vendor can implement those languages how they like.</p>
<p>I'm sure LLVM will grow to support such use-cases. If the industry settles on PTX then LLVM may get simpler and smaller, but nothing fundamental will become possible that wasn't before. PTX is nice to have, that's all.</p>
<p>The focus should not be on the specifics here, but on the more general problems: how can I easily refactor code so that it runs on a different mix of coprocessors? When my console has 4 scalar cores with 4-way SIMD plus 32 cores of Larrabee plus a 2048-unit GPU, how can I retarget code when I find I need to change my occupancy profile?</p>
<p>The problem is the huge differences in architecture - exemplified by the fact that RenderTris(vertex[], index[], shader()) is implemented in hardware on a GPU but software on Larrabee. PTX covers the shader() part, but implementations of RenderTris, plus the API calls to actually trigger the call, are completely different and must be selected per architecture. It's there that PTX may break down as it may lack access to non-generic features per architecture (e.g. SPU channel registers or special Larrabee opcodes).</p>
<p>Still, food for thought!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Why isn&#039;t Haskell popular in Industry? by Alexander Solla</title>
		<link>http://www.palgorithm.co.uk/2010/05/why-isnt-haskell-popular-in-industry/comment-page-1/#comment-7573</link>
		<dc:creator>Alexander Solla</dc:creator>
		<pubDate>Fri, 11 Feb 2011 23:09:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.palgorithm.co.uk/?p=240#comment-7573</guid>
		<description>I just ignore the &quot;line noise&quot;.  Line noise is &lt;i&gt;nearly always&lt;/i&gt; glue code.  I don&#039;t want that named.  I just want it done.  Yes, it can be hard to write from scratch.  But any sane Haskell development environment uses an interactive environment like GHCi.  If you use the type checker to guide you, writing the glue becomes trivial.  Encode logic in data types, and let the glue write itself.  If glue code type checks, it &lt;i&gt;works&lt;/i&gt;, guaranteed.  These are free theorems.  Focus on the important things:  the stuff you&#039;re gluing together.

And often, there is no natural name for a function that traverses multiple control structures.  The denotation is the most informative name.  What would you name a function that lifts a function into two nested functors, is partially applied, and is then lifted up into another functor?  This kind of stuff happens quite a bit.  And my code is easy to read, because nearly invisible glue code connects two concepts in a relationship that makes sense (typically in terms of products or direct sums implemented via functors).

Consider the expression: (num_shirts_in_factory_a + num_shirts_in_factory_b).  Which parts of that expression are the informative ones?  Obviously, it is the &quot;num_shirts&quot; variables.  And there is only one &quot;sensible&quot; way to put those quantities together.  Now push this idea to its limit.  It is more than there just being one sensible way to write glue.  There is exactly one glue function between glue-able types.

On the other hand, I have used some type classes to move some of the more repetitive glue away.  I have classes like:

class Monic a b where inject :: a -&gt; b -- to represent monic morphisms
class Epic a b   where surject :: a -&gt; b -- to represent epic morphisms

You can easily have a class like

class Glue a b where
        glue :: a -&gt; b

and hide all the line noise in there.  And then your client code will look like

blah :: StateT (MaybeT IO) (Integer) (Maybe Integer)
blah = glue . parseInt . glue . getLine
-- or
blah = glue $ parseInt $ glue $ getLine

This is how &quot;line noise&quot; glue code looks to me.  Except line noise is more maintainable. *fnord*  Note that these glue functions would each require their own distinct type class instance.  

The nicer the client code looks, the more complexity you have to shovel into the Glue instances.  But you are merely transferring complexity -- not creating or destroying it.  Complexity is created by data type definitions being glued.  There is the potential for a combinatorial explosion, since you can have unused Glue instances, whereas you cannot have unused &quot;line noise&quot; glue code.

Mathematicians don&#039;t care about mathematical symbols.  They care about the things the symbols &lt;i&gt;join&lt;/i&gt;, because the semantics of joining &quot;things&quot; is &lt;i&gt;dependent on -- and usually determined by -- the things being joined&lt;/i&gt;.</description>
		<content:encoded><![CDATA[<p>I just ignore the "line noise".  Line noise is <i>nearly always</i> glue code.  I don't want that named.  I just want it done.  Yes, it can be hard to write from scratch.  But any sane Haskell development environment uses an interactive environment like GHCi.  If you use the type checker to guide you, writing the glue becomes trivial.  Encode logic in data types, and let the glue write itself.  If glue code type checks, it <i>works</i>, guaranteed.  These are free theorems.  Focus on the important things:  the stuff you're gluing together.</p>
<p>And often, there is no natural name for a function that traverses multiple control structures.  The denotation is the most informative name.  What would you name a function that lifts a function into two nested functors, is partially applied, and is then lifted up into another functor?  This kind of stuff happens quite a bit.  And my code is easy to read, because nearly invisible glue code connects two concepts in a relationship that makes sense (typically in terms of products or direct sums implemented via functors).</p>
<p>Consider the expression: (num_shirts_in_factory_a + num_shirts_in_factory_b).  Which parts of that expression are the informative ones?  Obviously, it is the "num_shirts" variables.  And there is only one "sensible" way to put those quantities together.  Now push this idea to its limit.  It is more than there just being one sensible way to write glue.  There is exactly one glue function between glue-able types.</p>
<p>On the other hand, I have used some type classes to move some of the more repetitive glue away.  I have classes like:</p>
<p>class Monic a b where inject :: a -&gt; b -- to represent monic morphisms<br />
class Epic a b   where surject :: a -&gt; b -- to represent epic morphisms</p>
<p>You can easily have a class like</p>
<p>class Glue a b where<br />
        glue :: a -&gt; b</p>
<p>and hide all the line noise in there.  And then your client code will look like</p>
<p>blah :: StateT (MaybeT IO) (Integer) (Maybe Integer)<br />
blah = glue . parseInt . glue . getLine<br />
-- or<br />
blah = glue $ parseInt $ glue $ getLine</p>
<p>This is how "line noise" glue code looks to me.  Except line noise is more maintainable. *fnord*  Note that these glue functions would each require their own distinct type class instance.  </p>
<p>The nicer the client code looks, the more complexity you have to shovel into the Glue instances.  But you are merely transferring complexity -- not creating or destroying it.  Complexity is created by data type definitions being glued.  There is the potential for a combinatorial explosion, since you can have unused Glue instances, whereas you cannot have unused "line noise" glue code.</p>
<p>Mathematicians don't care about mathematical symbols.  They care about the things the symbols <i>join</i>, because the semantics of joining "things" is <i>dependent on -- and usually determined by -- the things being joined</i>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on OpenCL - the compute intermediate language by Vincent Hindriksen</title>
		<link>http://www.palgorithm.co.uk/2011/02/opencl-the-compute-intermediate-language/comment-page-1/#comment-7565</link>
		<dc:creator>Vincent Hindriksen</dc:creator>
		<pubDate>Fri, 11 Feb 2011 10:27:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.palgorithm.co.uk/?p=209#comment-7565</guid>
		<description>In two blog-articles of April and July last year, named &quot;Does GPGPU have a bright future?&quot; and &quot;The rise of the GPGPU-compilers&quot;, I spoke about the same. OpenCL is to low-level and therefore is going to be the hidden power of software, maintained in specialised libraries.

OpenCL has the most potential to be the hidden layer between software and compute-device, but it&#039;s not about innovation but about money.</description>
		<content:encoded><![CDATA[<p>In two blog-articles of April and July last year, named "Does GPGPU have a bright future?" and "The rise of the GPGPU-compilers", I spoke about the same. OpenCL is to low-level and therefore is going to be the hidden power of software, maintained in specialised libraries.</p>
<p>OpenCL has the most potential to be the hidden layer between software and compute-device, but it's not about innovation but about money.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Proposal for a graphics pipeline DSL by Sam Martin</title>
		<link>http://www.palgorithm.co.uk/2010/09/proposal-for-a-graphics-pipeline-dsl/comment-page-1/#comment-5955</link>
		<dc:creator>Sam Martin</dc:creator>
		<pubDate>Tue, 14 Sep 2010 16:04:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.palgorithm.co.uk/?p=275#comment-5955</guid>
		<description>Hi Andrew, thanks.

I agree. To get a DSL to a usable productised form is not a minor hurdle. I believe the best approach is to focus on a limited vertical slice, and expand sideways as you can demonstrate your utility. Allowing incremental adoption will always be a important factor to take into account. 

To pick something tangible, I think OptiX is a good example of the DSL approach. It is effectively a compiler, but delivers a reusable graphics technology that would be very hard to express by any other means.</description>
		<content:encoded><![CDATA[<p>Hi Andrew, thanks.</p>
<p>I agree. To get a DSL to a usable productised form is not a minor hurdle. I believe the best approach is to focus on a limited vertical slice, and expand sideways as you can demonstrate your utility. Allowing incremental adoption will always be a important factor to take into account. </p>
<p>To pick something tangible, I think OptiX is a good example of the DSL approach. It is effectively a compiler, but delivers a reusable graphics technology that would be very hard to express by any other means.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Proposal for a graphics pipeline DSL by Andrew Richards</title>
		<link>http://www.palgorithm.co.uk/2010/09/proposal-for-a-graphics-pipeline-dsl/comment-page-1/#comment-5952</link>
		<dc:creator>Andrew Richards</dc:creator>
		<pubDate>Tue, 14 Sep 2010 15:10:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.palgorithm.co.uk/?p=275#comment-5952</guid>
		<description>I think using a DSL makes a lot of sense. The advantages of a DSL are that an engine can understand the language and re-order the operations according to what best fits the architecture it is running on. The problem with a DSL is that it is hard to get to a point where you can write real software and rely on the DSL system to work. It&#039;s very hard to test a new language: for correctness, for performance and for completeness.

Impact: real-time graphics quality is starting to get stuck. We aren&#039;t moving much further, I don&#039;t think. I think that there is a problem of getting more programmable hardware, and actually being able to program the hardware. There is a problem that as you add more visual effects, there is a combinatorial explosion, because effects need to work together.</description>
		<content:encoded><![CDATA[<p>I think using a DSL makes a lot of sense. The advantages of a DSL are that an engine can understand the language and re-order the operations according to what best fits the architecture it is running on. The problem with a DSL is that it is hard to get to a point where you can write real software and rely on the DSL system to work. It's very hard to test a new language: for correctness, for performance and for completeness.</p>
<p>Impact: real-time graphics quality is starting to get stuck. We aren't moving much further, I don't think. I think that there is a problem of getting more programmable hardware, and actually being able to program the hardware. There is a problem that as you add more visual effects, there is a combinatorial explosion, because effects need to work together.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Why isn&#039;t Haskell popular in Industry? by Blaisorblade</title>
		<link>http://www.palgorithm.co.uk/2010/05/why-isnt-haskell-popular-in-industry/comment-page-1/#comment-5714</link>
		<dc:creator>Blaisorblade</dc:creator>
		<pubDate>Fri, 06 Aug 2010 13:33:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.palgorithm.co.uk/?p=240#comment-5714</guid>
		<description>About syntax: operator overloading is always controversial, but Guy Steele clearly stated he wanted it for Java, in his talk &quot;Growing a Language&quot;.
But yes, there are cases where overloads are not so natural, and a name should be provided (to be used as an operator possibly). But that is mostly about the second issue - completeness of existing libraries.
I&#039;m still a learner of Haskell, but I happened to find many half-finished projects for Haskell, or having only partial documentation.</description>
		<content:encoded><![CDATA[<p>About syntax: operator overloading is always controversial, but Guy Steele clearly stated he wanted it for Java, in his talk "Growing a Language".<br />
But yes, there are cases where overloads are not so natural, and a name should be provided (to be used as an operator possibly). But that is mostly about the second issue - completeness of existing libraries.<br />
I'm still a learner of Haskell, but I happened to find many half-finished projects for Haskell, or having only partial documentation.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

