<?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: Lisp is Changing My C++</title>
	<atom:link href="http://www.jakevoytko.com/blog/2008/10/06/lisp-is-changing-my-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jakevoytko.com/blog/2008/10/06/lisp-is-changing-my-c/</link>
	<description>Ye Olde Computer Science Blogge</description>
	<lastBuildDate>Mon, 18 Jan 2010 23:12:49 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Harry</title>
		<link>http://www.jakevoytko.com/blog/2008/10/06/lisp-is-changing-my-c/comment-page-1/#comment-9845</link>
		<dc:creator>Harry</dc:creator>
		<pubDate>Wed, 08 Oct 2008 07:40:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=167#comment-9845</guid>
		<description>&gt; check out the chapters on optimization in both
&gt; Graham’s ANSI Common Lisp and Norvig’s Paradigms
&gt; of Artificial Intelligence Programming.

I recall skimming thru ACL a while back and not finding anything unusual in the &#039;optimization&#039; chapter... unusual in terms of advice or things I did not already know or appreciate. But PAIP... I&#039;ve never checked out. I hopefully will be able to soon. Thanks much, Gary!</description>
		<content:encoded><![CDATA[<p>&gt; check out the chapters on optimization in both<br />
&gt; Graham’s ANSI Common Lisp and Norvig’s Paradigms<br />
&gt; of Artificial Intelligence Programming.</p>
<p>I recall skimming thru ACL a while back and not finding anything unusual in the &#8216;optimization&#8217; chapter&#8230; unusual in terms of advice or things I did not already know or appreciate. But PAIP&#8230; I&#8217;ve never checked out. I hopefully will be able to soon. Thanks much, Gary!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary Johnson</title>
		<link>http://www.jakevoytko.com/blog/2008/10/06/lisp-is-changing-my-c/comment-page-1/#comment-9844</link>
		<dc:creator>Gary Johnson</dc:creator>
		<pubDate>Tue, 07 Oct 2008 16:36:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=167#comment-9844</guid>
		<description>Hey Harry,

  Compiled CL code can definitely keep up with compiled C/C++ code IF YOU OPTIMIZE CORRECTLY.  The biggest reason that CL keeps this stigma for being slow is because the language makes it easy for you to write relatively inefficient (albeit very elegant) solutions quickly.  The problem is that many Lisp programmers then stop with this version of their program.

  The flexibility and robustness gained by manifest typing, implicitly polymorphic functions, and automatic memory management have to be traded for some overhead in terms of CPU cycles and memory usage.

  HOWEVER - and this is the big however -, where you are pretty much stuck with this situation in languages such as Perl/Python/Ruby/etc, in CL you can add type declarations, use type-specific and destructive functions, and even manage your memory explicitly to gain back all the speed and space benefits that C/C++ gets.

  The really key piece to remember though is code profiling.  I cannot stress this enough.  All CL implementations come with some suite of profiling tools, and by running these on your initial elegant/functional solution, you can find exactly which functions are the runtime bottlenecks in your code.  You then step into those functions and make the changes I mentioned above.  Remember that &quot;Premature optimization is the root of all evil&quot; and 90% of a program&#039;s runtime is typically localized in 10% of the code.

  So good luck with the imaging library, Jake (I&#039;m doing some similar stuff myself), and Harry, check out the chapters on optimization in both Graham&#039;s ANSI Common Lisp and Norvig&#039;s Paradigms of Artificial Intelligence Programming.</description>
		<content:encoded><![CDATA[<p>Hey Harry,</p>
<p>  Compiled CL code can definitely keep up with compiled C/C++ code IF YOU OPTIMIZE CORRECTLY.  The biggest reason that CL keeps this stigma for being slow is because the language makes it easy for you to write relatively inefficient (albeit very elegant) solutions quickly.  The problem is that many Lisp programmers then stop with this version of their program.</p>
<p>  The flexibility and robustness gained by manifest typing, implicitly polymorphic functions, and automatic memory management have to be traded for some overhead in terms of CPU cycles and memory usage.</p>
<p>  HOWEVER &#8211; and this is the big however -, where you are pretty much stuck with this situation in languages such as Perl/Python/Ruby/etc, in CL you can add type declarations, use type-specific and destructive functions, and even manage your memory explicitly to gain back all the speed and space benefits that C/C++ gets.</p>
<p>  The really key piece to remember though is code profiling.  I cannot stress this enough.  All CL implementations come with some suite of profiling tools, and by running these on your initial elegant/functional solution, you can find exactly which functions are the runtime bottlenecks in your code.  You then step into those functions and make the changes I mentioned above.  Remember that &#8220;Premature optimization is the root of all evil&#8221; and 90% of a program&#8217;s runtime is typically localized in 10% of the code.</p>
<p>  So good luck with the imaging library, Jake (I&#8217;m doing some similar stuff myself), and Harry, check out the chapters on optimization in both Graham&#8217;s ANSI Common Lisp and Norvig&#8217;s Paradigms of Artificial Intelligence Programming.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harry</title>
		<link>http://www.jakevoytko.com/blog/2008/10/06/lisp-is-changing-my-c/comment-page-1/#comment-9843</link>
		<dc:creator>Harry</dc:creator>
		<pubDate>Tue, 07 Oct 2008 06:59:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=167#comment-9843</guid>
		<description>Hello Jake - Would like to learn more from you (and others) about speed issues, if any, you&#039;ve had (or are having) in doing things such as imaging(!!) with CL?

Now I know very little CL as I write this, but I somehow somewhat unscientifically suspect that even compiled CL code may not be able to beat its imperative, side-effect ridden C/C++ counterpart. Even with my little exposure to CL, I will give CL very high marks for its elegance, completeness, and the code writing techniques it makes possible (via macros, lambdas, and any and all FP-style enabling facilities) but I&#039;m not so convinced if it can generate the same type of speed-efficient object code as C/C++. Would like to hear more on this from you / others.</description>
		<content:encoded><![CDATA[<p>Hello Jake &#8211; Would like to learn more from you (and others) about speed issues, if any, you&#8217;ve had (or are having) in doing things such as imaging(!!) with CL?</p>
<p>Now I know very little CL as I write this, but I somehow somewhat unscientifically suspect that even compiled CL code may not be able to beat its imperative, side-effect ridden C/C++ counterpart. Even with my little exposure to CL, I will give CL very high marks for its elegance, completeness, and the code writing techniques it makes possible (via macros, lambdas, and any and all FP-style enabling facilities) but I&#8217;m not so convinced if it can generate the same type of speed-efficient object code as C/C++. Would like to hear more on this from you / others.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: user</title>
		<link>http://www.jakevoytko.com/blog/2008/10/06/lisp-is-changing-my-c/comment-page-1/#comment-9842</link>
		<dc:creator>user</dc:creator>
		<pubDate>Tue, 07 Oct 2008 03:46:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=167#comment-9842</guid>
		<description>read streams chapter in sicp book for some enlightenment</description>
		<content:encoded><![CDATA[<p>read streams chapter in sicp book for some enlightenment</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Moynihan</title>
		<link>http://www.jakevoytko.com/blog/2008/10/06/lisp-is-changing-my-c/comment-page-1/#comment-9841</link>
		<dc:creator>Rick Moynihan</dc:creator>
		<pubDate>Mon, 06 Oct 2008 23:27:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=167#comment-9841</guid>
		<description>There is an obvious improvement in readability in your example, but there&#039;s another improvement to.

The second example has stronger encapsulation, as it doesn&#039;t expose a needless variable into the scope of the enclosing function/method.

I always try and minimize state in my objects, which is especially important if you need to write concurrent code.  Any state left, should if possible be made immutable.

Reducing the scope of variables, and removing them altogether (where possible) is often a great way to improve code.  

Learning functional languages can definitely make the nature of these improvements clearer.</description>
		<content:encoded><![CDATA[<p>There is an obvious improvement in readability in your example, but there&#8217;s another improvement to.</p>
<p>The second example has stronger encapsulation, as it doesn&#8217;t expose a needless variable into the scope of the enclosing function/method.</p>
<p>I always try and minimize state in my objects, which is especially important if you need to write concurrent code.  Any state left, should if possible be made immutable.</p>
<p>Reducing the scope of variables, and removing them altogether (where possible) is often a great way to improve code.  </p>
<p>Learning functional languages can definitely make the nature of these improvements clearer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SH</title>
		<link>http://www.jakevoytko.com/blog/2008/10/06/lisp-is-changing-my-c/comment-page-1/#comment-9840</link>
		<dc:creator>SH</dc:creator>
		<pubDate>Mon, 06 Oct 2008 20:42:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=167#comment-9840</guid>
		<description>don&#039;t worry about the feeling of enlightenment.  if you aren&#039;t the type who&#039;s impressed by metacircularity and other tomfoolery then it probably won&#039;t come</description>
		<content:encoded><![CDATA[<p>don&#8217;t worry about the feeling of enlightenment.  if you aren&#8217;t the type who&#8217;s impressed by metacircularity and other tomfoolery then it probably won&#8217;t come</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Normand</title>
		<link>http://www.jakevoytko.com/blog/2008/10/06/lisp-is-changing-my-c/comment-page-1/#comment-9839</link>
		<dc:creator>Eric Normand</dc:creator>
		<pubDate>Mon, 06 Oct 2008 20:27:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=167#comment-9839</guid>
		<description>You mention not grokking macros.  Have you checked out On Lisp?  It principally focuses on macros and how they can make your code smaller.</description>
		<content:encoded><![CDATA[<p>You mention not grokking macros.  Have you checked out On Lisp?  It principally focuses on macros and how they can make your code smaller.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Haugeland</title>
		<link>http://www.jakevoytko.com/blog/2008/10/06/lisp-is-changing-my-c/comment-page-1/#comment-9838</link>
		<dc:creator>John Haugeland</dc:creator>
		<pubDate>Mon, 06 Oct 2008 20:06:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=167#comment-9838</guid>
		<description>You needed lisp to teach you to write functions with clear names, not to keep temporaries in locals and to make deterministic mappings out of algorithms instead of loops?

Methinks you might want to take a tour through the algorithm header.  Seems like learning C++ would teach you the same things learning Lisp would.</description>
		<content:encoded><![CDATA[<p>You needed lisp to teach you to write functions with clear names, not to keep temporaries in locals and to make deterministic mappings out of algorithms instead of loops?</p>
<p>Methinks you might want to take a tour through the algorithm header.  Seems like learning C++ would teach you the same things learning Lisp would.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://www.jakevoytko.com/blog/2008/10/06/lisp-is-changing-my-c/comment-page-1/#comment-9837</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Mon, 06 Oct 2008 19:11:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=167#comment-9837</guid>
		<description>What I&#039;ve been doing for awhile now is I ask myself if I&#039;ve ever written or needed whatever logic I&#039;m about to write before in some other part of the program.  If the answer is yes, I pull it out into a general tool/function/class or whatever instead of writing it (or something very similar) again.  While sometimes that makes the projects feel like they are getting bigger (especially if the re-used pattern is pretty small and I&#039;m making whole new .cpp/.h files for the new class or whatever - depending on language), it helps with mental organization rather dramatically.

As an added bonus, often when I realize I&#039;ve used some pattern at least twice, I find there are several other places I could use the newly created pattern to condense and simplify code in ways I didn&#039;t originally consider.  It&#039;s a wonderful feeling.  :)</description>
		<content:encoded><![CDATA[<p>What I&#8217;ve been doing for awhile now is I ask myself if I&#8217;ve ever written or needed whatever logic I&#8217;m about to write before in some other part of the program.  If the answer is yes, I pull it out into a general tool/function/class or whatever instead of writing it (or something very similar) again.  While sometimes that makes the projects feel like they are getting bigger (especially if the re-used pattern is pretty small and I&#8217;m making whole new .cpp/.h files for the new class or whatever &#8211; depending on language), it helps with mental organization rather dramatically.</p>
<p>As an added bonus, often when I realize I&#8217;ve used some pattern at least twice, I find there are several other places I could use the newly created pattern to condense and simplify code in ways I didn&#8217;t originally consider.  It&#8217;s a wonderful feeling.  <img src='http://www.jakevoytko.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://www.jakevoytko.com/blog/2008/10/06/lisp-is-changing-my-c/comment-page-1/#comment-9836</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Mon, 06 Oct 2008 18:28:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=167#comment-9836</guid>
		<description>If you haven&#039;t already, read Practical Common Lisp, available online at http://gigamonkeys.com/book/ . It was the book that made me &quot;get&quot; the power of macros, and then come to resent C++ templates for being utterly anemic by comparison. :)</description>
		<content:encoded><![CDATA[<p>If you haven&#8217;t already, read Practical Common Lisp, available online at <a href="http://gigamonkeys.com/book/" rel="nofollow">http://gigamonkeys.com/book/</a> . It was the book that made me &#8220;get&#8221; the power of macros, and then come to resent C++ templates for being utterly anemic by comparison. <img src='http://www.jakevoytko.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
