<?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"
	>
<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>Chinese, Linguistics, Science, Cultural Observations and whatever else I feel like writing about</description>
	<pubDate>Fri, 22 Aug 2008 03:17:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Peter Gfader</title>
		<link>http://toshuo.com/2006/self-replicating-code-in-python/#comment-1858</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-1858</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-451</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-451</guid>
		<description>What does he mean by ".NET"?  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-446</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-446</guid>
		<description>Okay, here it is for Ruby:

s='s=%c%s%c; printf s,39,s,39'; printf s,39,s,39

Interestingly, it's identical to the perl solution, except the variable 's' doesn't need a '$' prefix.  (Ruby borrowed a fair bit from perl and a little from the C standard library).

I've recently become interested in the concept of the 'perfect' programming language.  Along these lines, &lt;a href="http://books.slashdot.org/article.pl?sid=06/02/01/1455213&#38;from=rss" rel="nofollow"&gt;Slashdot&lt;/a&gt; had a very provocative article reviewing the book &lt;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&#38;v=glance&#38;n=283155" rel="nofollow"&gt;Java&lt;/a&gt;.&lt;a href="" rel="nofollow"&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't java), PHP (too close to HTML), and LISP (not accessible).  The author really liks Ruby as the first choice, but didn't like the fact that Ruby doesn'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="http://www.pragmaticprogrammer.com/titles/ruby/index.html" rel="nofollow"&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't call it the 'perfect' language.  Even so, it seems like a step in the right direction.

I'll have to try some Python next, though.  JavaScript may have to wait a while.  There's also another language named &lt;a href="http://www.digitalmars.com/d/" rel="nofollow"&gt;'D'&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 &#8217;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: Mark</title>
		<link>http://toshuo.com/2006/self-replicating-code-in-python/#comment-445</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Wed, 22 Feb 2006 21:03:51 +0000</pubDate>
		<guid isPermaLink="false">http://toshuo.com/?p=117#comment-445</guid>
		<description>Ah!  I new &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 new <i>somebody</i> out there would contribute to this thread!  Good to hear from you, Matt.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://toshuo.com/2006/self-replicating-code-in-python/#comment-444</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-444</guid>
		<description>Same basic idea in perl:

$s = '$s = %c%s%c; printf $s, 39, $s, 39;'; 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-443</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-443</guid>
		<description>For the curious, here's basically the version that I wrote on the napkin:

void main(void) { char *s="void main(void) { char *x=%c%s%c; printf(s, 34, s, 34); }"; printf(s, 34, s, 34); }

(This is a C program that prints out it's source code)
On some systems, it will compile with warnings because 'printf' is not defined before use, and the 'main' function does not return type 'int'.  Even so, it will compile with gcc.

I'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: import this. &#187; Blog Archive &#187; Python quines</title>
		<link>http://toshuo.com/2006/self-replicating-code-in-python/#comment-384</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-384</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>
