<?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: Self-replicating Code in Python</title>
	<atom:link href="http://toshuo.com/2006/self-replicating-code-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://toshuo.com/2006/self-replicating-code-in-python/</link>
	<description>learning Chinese, teaching English, trying to understand more</description>
	<lastBuildDate>Fri, 03 Sep 2010 16:22:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Mark</title>
		<link>http://toshuo.com/2006/self-replicating-code-in-python/comment-page-1/#comment-5902</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Fri, 04 Jun 2010 00:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://toshuo.com/?p=117#comment-5902</guid>
		<description>And here&#039;s an attempt to make Matt&#039;s ruby example square:
&lt;code&gt;
p = &quot;p = %c%s%c
printf p,34,p,34&quot;
printf p,34,p,34
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>And here&#8217;s an attempt to make Matt&#8217;s ruby example square:<br />
<pre><code>
p = "p = %c%s%c
printf p,34,p,34"
printf p,34,p,34
</code></pre></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://toshuo.com/2006/self-replicating-code-in-python/comment-page-1/#comment-5898</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Thu, 03 Jun 2010 07:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://toshuo.com/?p=117#comment-5898</guid>
		<description>For ruby, using multi-line string literals:
&lt;code&gt;
def p(x)
  puts &quot;x=&lt;&lt;&#039;HERE&#039;\n&quot;+x+&quot;HERE\n&quot;
  puts &quot;puts x&quot;
  puts &quot;p(x)&quot;
end
x=&lt;&lt;&#039;HERE&#039;
def p(x)
  puts &quot;x=&lt;&lt;&#039;HERE&#039;\n&quot;+x+&quot;HERE\n&quot;
  puts &quot;puts x&quot;
  puts &quot;p(x)&quot;
end
HERE
puts x
p(x)
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>For ruby, using multi-line string literals:<br />
<pre><code>
def p(x)
  puts "x=&lt;&lt;'HERE'\n"+x+"HERE\n"
  puts "puts x"
  puts "p(x)"
end
x=&lt;&lt;'HERE'
def p(x)
  puts "x=&lt;&lt;'HERE'\n"+x+"HERE\n"
  puts "puts x"
  puts "p(x)"
end
HERE
puts x
p(x)
</code></pre></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Gfader</title>
		<link>http://toshuo.com/2006/self-replicating-code-in-python/comment-page-1/#comment-637</link>
		<dc:creator>Peter Gfader</dc:creator>
		<pubDate>Fri, 28 Apr 2006 14:09:40 +0000</pubDate>
		<guid isPermaLink="false">http://toshuo.com/?p=117#comment-637</guid>
		<description>I got one in c#
look there:

http://peitor.blogspot.com/2006/04/quine-in-csharp-c_28.html

but there are other good ones around

google for: quine c# main</description>
		<content:encoded><![CDATA[<p>I got one in c#<br />
look there:</p>
<p><a href="http://peitor.blogspot.com/2006/04/quine-in-csharp-c_28.html" rel="nofollow">http://peitor.blogspot.com/2006/04/quine-in-csharp-c_28.html</a></p>
<p>but there are other good ones around</p>
<p>google for: quine c# main</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://toshuo.com/2006/self-replicating-code-in-python/comment-page-1/#comment-636</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Wed, 22 Feb 2006 21:19:39 +0000</pubDate>
		<guid isPermaLink="false">http://toshuo.com/?p=117#comment-636</guid>
		<description>What does he mean by &quot;.NET&quot;?  C/C++, Java, C#, Perl, VB and a host of other languages can all be used in .NET development.</description>
		<content:encoded><![CDATA[<p>What does he mean by &#8220;.NET&#8221;?  C/C++, Java, C#, Perl, VB and a host of other languages can all be used in .NET development.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://toshuo.com/2006/self-replicating-code-in-python/comment-page-1/#comment-635</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Wed, 22 Feb 2006 21:04:19 +0000</pubDate>
		<guid isPermaLink="false">http://toshuo.com/?p=117#comment-635</guid>
		<description>Okay, here it is for Ruby:

s=&#039;s=%c%s%c; printf s,39,s,39&#039;; printf s,39,s,39

Interestingly, it&#039;s identical to the perl solution, except the variable &#039;s&#039; doesn&#039;t need a &#039;$&#039; prefix.  (Ruby borrowed a fair bit from perl and a little from the C standard library).

I&#039;ve recently become interested in the concept of the &#039;perfect&#039; programming language.  Along these lines, &lt;a href=&quot;http://books.slashdot.org/article.pl?sid=06/02/01/1455213&amp;from=rss&quot; rel=&quot;nofollow&quot;&gt;Slashdot&lt;/a&gt; had a very provocative article reviewing the book &lt;a href=&quot;http://www.amazon.com/gp/product/0596100949/qid=1140497502/sr=2-1/ref=pd_bbs_b_2_1/102-2441051-4653707?s=books&amp;v=glance&amp;n=283155&quot; rel=&quot;nofollow&quot;&gt;Java&lt;/a&gt;.&lt;a href=&quot;&quot; rel=&quot;nofollow&quot;&gt;Beyond Java&lt;/a&gt;.

This book mentions four programming languages that are the best candidates for replacing Java: Ruby, Python, Groovy, and .NET.  Secondary contenders are perl (too messy), Smalltalk (wasn&#039;t java), PHP (too close to HTML), and LISP (not accessible).  The author really liks Ruby as the first choice, but didn&#039;t like the fact that Ruby doesn&#039;t have a good Java VM implementation.  His second favorite was Python.

Another thing that piqued my interest in Ruby was that the &lt;a href=&quot;http://www.pragmaticprogrammer.com/titles/ruby/index.html&quot; rel=&quot;nofollow&quot;&gt;Pragmatic Programmers&lt;/a&gt; have written a book on ruby.  I went out and bought this book and have been busy reading it ever since.  It really does look a lot better than many languages, but I still can&#039;t call it the &#039;perfect&#039; language.  Even so, it seems like a step in the right direction.

I&#039;ll have to try some Python next, though.  JavaScript may have to wait a while.  There&#039;s also another language named &lt;a href=&quot;http://www.digitalmars.com/d/&quot; rel=&quot;nofollow&quot;&gt;&#039;D&#039;&lt;/a&gt; that might have some promise...</description>
		<content:encoded><![CDATA[<p>Okay, here it is for Ruby:</p>
<p>s=&#8217;s=%c%s%c; printf s,39,s,39&#8242;; printf s,39,s,39</p>
<p>Interestingly, it&#8217;s identical to the perl solution, except the variable &#8216;s&#8217; doesn&#8217;t need a &#8216;$&#8217; prefix.  (Ruby borrowed a fair bit from perl and a little from the C standard library).</p>
<p>I&#8217;ve recently become interested in the concept of the &#8216;perfect&#8217; programming language.  Along these lines, <a href="http://books.slashdot.org/article.pl?sid=06/02/01/1455213&amp;from=rss" rel="nofollow">Slashdot</a> had a very provocative article reviewing the book <a href="http://www.amazon.com/gp/product/0596100949/qid=1140497502/sr=2-1/ref=pd_bbs_b_2_1/102-2441051-4653707?s=books&amp;v=glance&amp;n=283155" rel="nofollow">Java</a>.<a href="" rel="nofollow">Beyond Java</a>.</p>
<p>This book mentions four programming languages that are the best candidates for replacing Java: Ruby, Python, Groovy, and .NET.  Secondary contenders are perl (too messy), Smalltalk (wasn&#8217;t java), PHP (too close to HTML), and LISP (not accessible).  The author really liks Ruby as the first choice, but didn&#8217;t like the fact that Ruby doesn&#8217;t have a good Java VM implementation.  His second favorite was Python.</p>
<p>Another thing that piqued my interest in Ruby was that the <a href="http://www.pragmaticprogrammer.com/titles/ruby/index.html" rel="nofollow">Pragmatic Programmers</a> have written a book on ruby.  I went out and bought this book and have been busy reading it ever since.  It really does look a lot better than many languages, but I still can&#8217;t call it the &#8216;perfect&#8217; language.  Even so, it seems like a step in the right direction.</p>
<p>I&#8217;ll have to try some Python next, though.  JavaScript may have to wait a while.  There&#8217;s also another language named <a href="http://www.digitalmars.com/d/" rel="nofollow">&#8216;D&#8217;</a> that might have some promise&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://toshuo.com/2006/self-replicating-code-in-python/comment-page-1/#comment-633</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Wed, 22 Feb 2006 21:03:12 +0000</pubDate>
		<guid isPermaLink="false">http://toshuo.com/?p=117#comment-633</guid>
		<description>Same basic idea in perl:

$s = &#039;$s = %c%s%c; printf $s, 39, $s, 39;&#039;; printf $s, 39, $s, 39;</description>
		<content:encoded><![CDATA[<p>Same basic idea in perl:</p>
<p>$s = &#8216;$s = %c%s%c; printf $s, 39, $s, 39;&#8217;; printf $s, 39, $s, 39;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://toshuo.com/2006/self-replicating-code-in-python/comment-page-1/#comment-632</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Wed, 22 Feb 2006 21:01:12 +0000</pubDate>
		<guid isPermaLink="false">http://toshuo.com/?p=117#comment-632</guid>
		<description>For the curious, here&#039;s basically the version that I wrote on the napkin:

void main(void) { char *s=&quot;void main(void) { char *x=%c%s%c; printf(s, 34, s, 34); }&quot;; printf(s, 34, s, 34); }

(This is a C program that prints out it&#039;s source code)
On some systems, it will compile with warnings because &#039;printf&#039; is not defined before use, and the &#039;main&#039; function does not return type &#039;int&#039;.  Even so, it will compile with gcc.

I&#039;ll skip the JavaScript version for now, but I might put up one for Ruby.  Stay tuned...</description>
		<content:encoded><![CDATA[<p>For the curious, here&#8217;s basically the version that I wrote on the napkin:</p>
<p>void main(void) { char *s=&#8221;void main(void) { char *x=%c%s%c; printf(s, 34, s, 34); }&#8221;; printf(s, 34, s, 34); }</p>
<p>(This is a C program that prints out it&#8217;s source code)<br />
On some systems, it will compile with warnings because &#8216;printf&#8217; is not defined before use, and the &#8216;main&#8217; function does not return type &#8216;int&#8217;.  Even so, it will compile with gcc.</p>
<p>I&#8217;ll skip the JavaScript version for now, but I might put up one for Ruby.  Stay tuned&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://toshuo.com/2006/self-replicating-code-in-python/comment-page-1/#comment-634</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Tue, 21 Feb 2006 12:08:51 +0000</pubDate>
		<guid isPermaLink="false">http://toshuo.com/?p=117#comment-634</guid>
		<description>Ah!  I knew &lt;i&gt;somebody&lt;/i&gt; out there would contribute to this thread!  Good to hear from you, Matt.</description>
		<content:encoded><![CDATA[<p>Ah!  I knew <i>somebody</i> out there would contribute to this thread!  Good to hear from you, Matt.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: import this. &#187; Blog Archive &#187; Python quines</title>
		<link>http://toshuo.com/2006/self-replicating-code-in-python/comment-page-1/#comment-631</link>
		<dc:creator>import this. &#187; Blog Archive &#187; Python quines</dc:creator>
		<pubDate>Mon, 13 Feb 2006 23:16:34 +0000</pubDate>
		<guid isPermaLink="false">http://toshuo.com/?p=117#comment-631</guid>
		<description>[...] Doubting to Shuo has a post about writing self-replicating code (i.e. quines) using Python. He was able to use Python to write a quick quine script and notes: For anyone that wants to try running that and see that it does indeed output its source, get a Python interpreter and try it out. My code above is not that impressive as quines go. I’m sure that in a powerful language like Python, somebody out there has already written a one-liner. What is impressive is that the language is powerful enough and convenient enough that writing a quine is easily doable for a complete beginner. [...]</description>
		<content:encoded><![CDATA[<p>[...] Doubting to Shuo has a post about writing self-replicating code (i.e. quines) using Python. He was able to use Python to write a quick quine script and notes: For anyone that wants to try running that and see that it does indeed output its source, get a Python interpreter and try it out. My code above is not that impressive as quines go. I’m sure that in a powerful language like Python, somebody out there has already written a one-liner. What is impressive is that the language is powerful enough and convenient enough that writing a quine is easily doable for a complete beginner. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
