<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-35708717</id><updated>2011-07-28T20:56:22.351-07:00</updated><category term='econding'/><category term='media'/><category term='mapcar'/><category term='favorite primes'/><category term='Ruby'/><category term='encoding'/><category term='lambda calculus'/><category term='memoization'/><category term='Quine'/><category term='U combinator'/><category term='information'/><category term='self-application'/><category term='biojokes'/><category term='Lisp'/><category term='closures'/><category term='Gaia'/><category term='Scheme'/><category term='Y combinator'/><category term='recursion'/><category term='life'/><title type='text'>Rubycond</title><subtitle type='html'>A Passion Play on Ruby.&lt;br&gt;
Be led within temptation by this gem of a language and
get your daily blood-red aluminum oxide dose.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rubycond.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rubycond.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rubycond</name><uri>http://www.blogger.com/profile/00461194134453001594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-35708717.post-3790939754528371218</id><published>2009-08-07T14:14:00.000-07:00</published><updated>2009-08-08T06:34:27.748-07:00</updated><title type='text'>The Arrow of Time --- Thesis Offense</title><content type='html'>No sane intelligent being would use a non-positional encoding of information when a positional one is available. Well, no intelligent being that can sense the passage of time.&lt;br /&gt;&lt;br /&gt;Order is intimately tied to time. To think of a sequence you need an intuition of time.&lt;br /&gt;&lt;br /&gt;Actually, imagining all the basic data structures of mathematics requires a certain such intuition.&lt;br /&gt;To imagine a set, you need an intuition of difference between arbitrary objects --- the elements --- as in element A is different from element B. So, an intuition of individuality.&lt;br /&gt;To imagine a multiset, you need an intuition of similarity between objects, so you can think of 2 objects of type A and 3 objects of type B, for instance. This could be called an intuition of plurality.&lt;br /&gt;To imagine a sequence, you need an intuition of time, which is a dimension of the space-time continuum that we inhabit. This can be identified with an intuition of order.&lt;br /&gt;To imagine a matrix, you need an intuition of dimension or co-ordinates. &lt;br /&gt;Note that a matrix is also a (hyper)graph. A graph is a generalization of a sequence in the sense that if, in the case of a sequence when referring to an element you can think of its predecessor and successor, in a graph, for every vertex you can think of a set of predecessors and successors.&lt;br /&gt;&lt;br /&gt;Seems interesting that all these intuitions seem less and less justifiable as we understand more about the "real world". They all seem to belong in Plato's world of Forms. &lt;br /&gt;&lt;br /&gt;How can you even ask if A is different from B, when it's impossible to separate A from the not-A? Where does Something become Another? And then further more how can you pretend that A1 and A2 are of the same kind? About the intuition of dimension, current ideas suggest that there are actually 10 or more dimensions, but that the supplemental ones only manifest themselves at a very small scale. Even though time and its arrow do have some strong backing in physics, the conceptual symmetry alone make it tempting me to consider the possibility of the non-existence of time. There is also the tantalizing possibility of (intelligent) beings that do not perceive time, or the passage thereof. And no, I am not thinking of programmers with a deadline or PhD students, but of beings that do not make the cognitive compromise of "time" just so they can imagine they're making some more sense of the world.&lt;br /&gt;&lt;br /&gt;All the intuitions required for imagining sets. multisets, sequences and so on, are, in this view, merely notions of limited usefulness or range of applicability that allow us not to despair in the face of the cold, limitless and ultimately incomprehensible reality.&lt;br /&gt;&lt;br /&gt;How can we be sure that the behind that blank stare of the baby that never learns to speak and doesn't even seem to interact with the surrounding world there isn't an uncompromising mental process that refuses to ingest "chunks" of the reality, and instead incessantly looks for the continuation of the message? EEG might help, but does it always?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35708717-3790939754528371218?l=rubycond.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubycond.blogspot.com/feeds/3790939754528371218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35708717&amp;postID=3790939754528371218' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/3790939754528371218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/3790939754528371218'/><link rel='alternate' type='text/html' href='http://rubycond.blogspot.com/2009/08/arrow-of-time.html' title='The Arrow of Time --- Thesis Offense'/><author><name>Rubycond</name><uri>http://www.blogger.com/profile/00461194134453001594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35708717.post-5682836544528834562</id><published>2007-07-02T11:53:00.000-07:00</published><updated>2007-07-02T23:13:44.375-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gaia'/><category scheme='http://www.blogger.com/atom/ns#' term='encoding'/><category scheme='http://www.blogger.com/atom/ns#' term='life'/><category scheme='http://www.blogger.com/atom/ns#' term='information'/><category scheme='http://www.blogger.com/atom/ns#' term='media'/><title type='text'>All my Life, is Changing Every Day, In Every Possible Way</title><content type='html'>This is actually a follow-up on a previous post, &lt;a href="/2007/02/information-is-life-in-formation.html"&gt;Information is Life In Formation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I recently &lt;a href="http://science.slashdot.org/article.pl?sid=07/06/30/1927205"&gt;read&lt;/a&gt; on &lt;a href="http://slashdot.org/"&gt;Slashdot&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://upload.wikimedia.org/wikipedia/en/3/3d/Freeman_Dyson.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 200px;" src="http://upload.wikimedia.org/wikipedia/en/3/3d/Freeman_Dyson.jpg" border="0" alt="Freeman Dyson" /&gt;&lt;/a&gt; about an &lt;a href="http://www.nybooks.com/articles/20370"&gt;article&lt;/a&gt; of &lt;a href="http://en.wikipedia.org/wiki/Freeman_dyson"&gt;Freeman Dyson&lt;/a&gt;, a well-known physicist and mathematician, supposedly about "Open Source Biology". His article, entitled &lt;a href="http://www.nybooks.com/articles/20370"&gt;Our Biotech Future&lt;/a&gt;, in turn, references the work of &lt;a href="http://en.wikipedia.org/wiki/Carl_Woese"&gt;Carl Woese&lt;/a&gt;, famous American microbiologist - the discoverer of &lt;a href="http://en.wikipedia.org/wiki/Archaea"&gt;Archaea&lt;/a&gt; among other things.&lt;br /&gt;&lt;br /&gt;Specifically, it references two of Woese's articles, "A New Biology for a New Century"(&lt;a href="http://mmbr.asm.org/cgi/content/abstract/68/2/173"&gt;abstract&lt;/a&gt;|&lt;a href="http://mmbr.asm.org/cgi/content/full/68/2/173"&gt;full text&lt;/a&gt;) and &lt;a href="http://www.nature.com/nature/journal/v445/n7126/full/445369a.html"&gt;Biology's Next Revolution&lt;/a&gt;. Making a nice and interesting story abruptly short, in those articles Woese lends support to the idea that in the beginning, Life wasn't about &lt;a href="http://en.wikipedia.org/wiki/Species"&gt;Species&lt;/a&gt;. Instead, Life was &lt;a href="http://en.wikipedia.org/wiki/Open_source"&gt;Open Source&lt;/a&gt;, in the sense that in the primordial soup, primitive life-forms were exchanging genetic material in a kind of free, &lt;a href="http://en.wikipedia.org/wiki/Horizontal_gene_transfer"&gt;horizontal&lt;/a&gt; manner, like a sort of massively parallel &lt;a href="http://en.wikipedia.org/wiki/Rewriting_system#Abstract_rewriting_systems"&gt;rewriting system&lt;/a&gt; of sorts.&lt;br /&gt;&lt;br /&gt;And all was wonderful in the Garden of Eden, till this organism (likened to Bill Gates) appeared, that didn't allow exchange of genetic material with the others. And so, &lt;a href="http://en.wikipedia.org/wiki/Bacteria"&gt;Bacteria&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Archaea"&gt;Archaea&lt;/a&gt; and Eukarya or &lt;a href="http://en.wikipedia.org/wiki/Eukaryotes"&gt;Eukaryotes&lt;/a&gt; developed in species, only transferring genetic material in a vertical manner - to their descendents, instead of the previously ubiquitous horizontal transfer. The species-based Life prevailed, probably being more resilient to destructive change, and the primordial soup organisms disappeared, but this also meant a significant slow down of evolution.One should note that &lt;a href="http://en.wikipedia.org/wiki/Horizontal_gene_transfer"&gt;HGT&lt;/a&gt; is still common in Bacteria, and even between Bacteria and fungi, for example, and it is thought to be one of the important causes of the development of bacterial drug resistance.&lt;br /&gt;&lt;br /&gt;Nowadays, Dyson argues, the wheel has turned full circle and humans, through the use of advanced breeding and genetic engineering are able to transfer genetic material from some organisms to others, essentially being able to break the interspecies barrier, creating &lt;a href="http://en.wikipedia.org/wiki/Chimera_%28genetics%29"&gt;chimeras&lt;/a&gt;, transgenic organisms, like in the golden age of horizontal genetic material exchange.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://upload.wikimedia.org/wikipedia/en/1/18/The_Young_Family.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px;" src="http://upload.wikimedia.org/wikipedia/en/1/18/The_Young_Family.jpg" border="0" alt="The Young Family" /&gt;&lt;/a&gt;Well, that sounded to me a lot like that previous post, that stated that all Life needed is Media for Information pattern storage and interaction, an initial Seeding of the media, and Time. Oh, and about the Tree of Life, there seems to be none. In the presence of HGT, the Tree of Life has no real root, but an initial Seeding.&lt;br /&gt;&lt;br /&gt;How does this relate to &lt;a href="http://en.wikipedia.org/wiki/Cellular_automaton"&gt;cellular automata&lt;/a&gt; like &lt;a href="http://en.wikipedia.org/wiki/John_Horton_Conway"&gt;Conway&lt;/a&gt;'s &lt;a href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life"&gt;Game of Life&lt;/a&gt;, where stable, resilient-to-change patterns also appear? Would a similar computational device be able to create a "full-blown" (whatever that means) species structure? Food for further thought.&lt;br /&gt;&lt;br /&gt;Anyway, I (just may) have told you so &lt;tt&gt;[tm]&lt;/tt&gt; :-). Actually, the most striking idea seems the fact that, although at the publishing of the former post about Information being Life in Formation I had almost no idea about HGT and the details about the development of primitive Life, and was composing a picture based on the Computational, Information-theoretic approach and intuitions, its main conclusions are largely confirmed by biological "facts". So, even if the Universe isn't, after all, a gigantic cellular automaton as some would say, it still seems that Information processing and Life are so intimately, essentially linked that there is no conceivable way one could exist without the other: the essence of Life lies at least as much in its Software, as in its Hard(Wet)ware (see also another &lt;a href="/2007/01/can-systems-biologist-fix-electrical.html"&gt;post&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;&lt;b&gt;T&lt;/b&gt;he &lt;b&gt;f&lt;/b&gt;ine &lt;b&gt;p&lt;/b&gt;rint: &lt;ul&gt;&lt;li&gt;The title of the post is actually made up of the first two verses of &lt;a   href="http://en.wikipedia.org/wiki/The_Cranberries"&gt;The Cranberries&lt;/a&gt; song &lt;a href="http://www.stlyrics.com/lyrics/myso-calledlife/dreams.htm"&gt;Dreams;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;"The Young Family" is a work by Australian artist &lt;a href="http://www.patriciapiccinini.net/"&gt;Patricia Piccinini.&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/tt&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35708717-5682836544528834562?l=rubycond.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubycond.blogspot.com/feeds/5682836544528834562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35708717&amp;postID=5682836544528834562' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/5682836544528834562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/5682836544528834562'/><link rel='alternate' type='text/html' href='http://rubycond.blogspot.com/2007/07/all-my-life-is-changing-every-day-in.html' title='All my Life, is Changing Every Day, In Every Possible Way'/><author><name>Rubycond</name><uri>http://www.blogger.com/profile/00461194134453001594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35708717.post-5978275976722446189</id><published>2007-06-10T14:11:00.000-07:00</published><updated>2007-07-02T11:42:57.761-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='biojokes'/><title type='text'>Designer genes</title><content type='html'>Slashdot fortune: &lt;em&gt;Do molecular biologists wear designer genes?&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35708717-5978275976722446189?l=rubycond.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubycond.blogspot.com/feeds/5978275976722446189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35708717&amp;postID=5978275976722446189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/5978275976722446189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/5978275976722446189'/><link rel='alternate' type='text/html' href='http://rubycond.blogspot.com/2007/06/designer-genes.html' title='Designer genes'/><author><name>Rubycond</name><uri>http://www.blogger.com/profile/00461194134453001594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35708717.post-7777232252316437788</id><published>2007-05-12T13:21:00.001-07:00</published><updated>2007-05-12T13:21:57.141-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='favorite primes'/><title type='text'>123133721</title><content type='html'>&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35708717-7777232252316437788?l=rubycond.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubycond.blogspot.com/feeds/7777232252316437788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35708717&amp;postID=7777232252316437788' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/7777232252316437788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/7777232252316437788'/><link rel='alternate' type='text/html' href='http://rubycond.blogspot.com/2007/05/123133721.html' title='123133721'/><author><name>Rubycond</name><uri>http://www.blogger.com/profile/00461194134453001594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35708717.post-2684311076439803117</id><published>2007-04-20T22:48:00.000-07:00</published><updated>2007-05-28T13:52:27.017-07:00</updated><title type='text'>The Illusionist</title><content type='html'>&lt;span style="font-weight:bold;"&gt;The Illusionist (No Strings Attached)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;The spirit drinks are finished,&lt;br /&gt;Rusted are the wheels and chains,&lt;br /&gt;No smoky trails in mirror relished,&lt;br /&gt;Dismantled by our weary brains.&lt;br /&gt;&lt;br /&gt;The magic flowers have withered,&lt;br /&gt;The old hat is ripped and torn,&lt;br /&gt;No phantom rabbits lingered,&lt;br /&gt;In former white gloves never worn.&lt;br /&gt;&lt;br /&gt;No more tricks upon us&lt;br /&gt;From your coffers to bestow,&lt;br /&gt;But for the ghostly chorus&lt;br /&gt;Of the mind: "As above, so below".&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;-- O. Cean - 1337 Magickal Spells&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35708717-2684311076439803117?l=rubycond.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubycond.blogspot.com/feeds/2684311076439803117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35708717&amp;postID=2684311076439803117' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/2684311076439803117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/2684311076439803117'/><link rel='alternate' type='text/html' href='http://rubycond.blogspot.com/2007/04/illusionist.html' title='The Illusionist'/><author><name>Rubycond</name><uri>http://www.blogger.com/profile/00461194134453001594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35708717.post-7387711814725351795</id><published>2007-04-14T18:00:00.000-07:00</published><updated>2007-04-21T02:49:29.528-07:00</updated><title type='text'>More numbers</title><content type='html'>Find numbers N and M such that:&lt;ol&gt;&lt;li&gt;N!*M! + N*(N+M)*(M+M)^N = (N+M)!&lt;br /&gt;  &lt;li&gt;N!*M!*(N+M)! = N*(N*M)!&lt;br /&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35708717-7387711814725351795?l=rubycond.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubycond.blogspot.com/feeds/7387711814725351795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35708717&amp;postID=7387711814725351795' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/7387711814725351795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/7387711814725351795'/><link rel='alternate' type='text/html' href='http://rubycond.blogspot.com/2007/04/more-numbers.html' title='More numbers'/><author><name>Rubycond</name><uri>http://www.blogger.com/profile/00461194134453001594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35708717.post-6310211109309980276</id><published>2007-04-13T06:04:00.000-07:00</published><updated>2007-04-21T02:50:21.933-07:00</updated><title type='text'>Trial and error</title><content type='html'>Science is about trial and error: you make an error, then you go to trial.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Metamath problem&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Find numbers N and M so you can construct a valid mathematical formula with:&lt;ul&gt;&lt;li&gt;N factorial signs (!);&lt;br /&gt;  &lt;li&gt;M multiplication signs (*), numbers N, numbers M;&lt;br /&gt;  &lt;li&gt;one equal sign (=);&lt;br /&gt;  &lt;li&gt;in addition, a plus (+).&lt;br /&gt;&lt;/ul&gt;and as many parantheses as you want.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35708717-6310211109309980276?l=rubycond.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubycond.blogspot.com/feeds/6310211109309980276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35708717&amp;postID=6310211109309980276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/6310211109309980276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/6310211109309980276'/><link rel='alternate' type='text/html' href='http://rubycond.blogspot.com/2007/04/trial-and-error.html' title='Trial and error'/><author><name>Rubycond</name><uri>http://www.blogger.com/profile/00461194134453001594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35708717.post-6564063422231328756</id><published>2007-02-19T03:28:00.000-08:00</published><updated>2007-07-02T22:37:55.458-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='life'/><category scheme='http://www.blogger.com/atom/ns#' term='econding'/><category scheme='http://www.blogger.com/atom/ns#' term='information'/><category scheme='http://www.blogger.com/atom/ns#' term='media'/><title type='text'>Information is Life In Formation</title><content type='html'>What is Life?&lt;br /&gt;&lt;br /&gt;I propose that Life is a phenomenon that needs these conditions:&lt;ul&gt;&lt;li&gt;A medium that supports the encoding of information and allows the interaction of the encoded patterns&lt;br /&gt;&lt;li&gt;Seeding of the medium (initial or continuous)&lt;br /&gt;&lt;li&gt;Time to evolve&lt;/ul&gt;That's ALL. Or, as mathematicians would put it, these and only these are the required conditions. And that's the main idea of this post - the fact that any such system has the intrinsic potential to support arbitrary complex (and beautiful) Life-forms.&lt;br /&gt;&lt;br /&gt;A system that fulfills these conditions will, sooner or later, exhibit &lt;it&gt;emergence&lt;/it&gt;, the emergence of Life. &lt;a href="http://en.wikipedia.org/wiki/Autopoiesis"&gt;Autopoietic systems&lt;/a&gt;, structures which are able to fabricate themselves, possibly with variations, will appear. Then Earth-like life is only a more or less huge number of millions of years away.&lt;br /&gt;&lt;br /&gt;Yeah, that's right, YOU are not &lt;it&gt;significantly&lt;/it&gt; more alive, or living than some information patterns, say, some moderatly complicated bit-strings, this is the message.&lt;br /&gt;&lt;br /&gt;What are the implications of this bull^H^H^H^Htheory you ask? Well, there are two main implications:&lt;ul&gt;&lt;li&gt;For any living systems, we can find the encoding &lt;it&gt;medium&lt;/it&gt; and the ways it allows for their interaction.&lt;br /&gt;&lt;li&gt;For any structure, physical or theoretical, that qualifies as a Life-supporting medium by having the above properties, we can think about the nature of Life it is able to support.&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35708717-6564063422231328756?l=rubycond.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubycond.blogspot.com/feeds/6564063422231328756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35708717&amp;postID=6564063422231328756' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/6564063422231328756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/6564063422231328756'/><link rel='alternate' type='text/html' href='http://rubycond.blogspot.com/2007/02/information-is-life-in-formation.html' title='Information is Life In Formation'/><author><name>Rubycond</name><uri>http://www.blogger.com/profile/00461194134453001594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35708717.post-2863514016514167701</id><published>2007-01-26T15:19:00.000-08:00</published><updated>2007-01-27T03:33:02.227-08:00</updated><title type='text'>Can a Systems Biologist Fix an Electrical Engineer?</title><content type='html'>or, &lt;h3&gt;Do Systems Biologists Dream of Electrical Engineers?&lt;/h3&gt;&lt;br /&gt;We're writing a seamless &lt;a href="http://en.wikipedia.org/wiki/Distributed_computing"&gt;distributed computing&lt;/a&gt; library in, surprise-surprise, &lt;a href="http://www.ruby-lang.org/en/"&gt;Ruby&lt;/a&gt;.&lt;br /&gt;It's about distributing objects, using, and finally discarding them as if they were plain local objects. Yes, distributed computation is a harsh mistress... It's about "the network IS the computer", so popular a quote that there is (even? ha!) a &lt;a href="http://slashdot.org/"&gt;Slashdot&lt;/a&gt; joke about it:&lt;br /&gt;&lt;br /&gt;"Okay, the network is the network, and the computer is the computer. Sorry about the confusion."&lt;br&gt;--&lt;i&gt;Sun Microsystems&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Actually, that is not what this post is about. Not at all, really. As the fine folks of &lt;a href="http://en.wikipedia.org/wiki/Monty_python"&gt;Monty Python&lt;/a&gt; would put it, it's about "Something Completely Different". But I had to start with that to get you on the wagon--literally--, well, not on an actual physical wagon, but rather on this train of thought, or is it stream of (serializable) consciousness? There is a connection though, but you'll have to read the whole thing to get to it. Good things come to those who wait (and read and think while doing so). So, if you're still here, why not just give it a try? My promise is that, by the spacetime you're done, you shall be able separate the earth from the fire, the subtle from the gross, suavely, and with great ingenuity and skill. Your skillful work will ascend from earth to heaven and descend to earth again, and will receive the power of the superiors and of the inferiors. So thou will have the glory of the whole world--therefore let all obscurity flee from thee.&lt;br /&gt;Bottom line is: You Might Even Like It&amp;#153;.&lt;br /&gt;&lt;hr&gt;&lt;span style="font-style:italic;"&gt;Spoiler warning&lt;/span&gt;: if you haven't read "Stranger in a strange land" and "Solaris", beware of (plenty of) them below, and maybe choose not to read this pile now. Yes, this is a valid, author-endorsed reason not to read this, so, if you're who I think you are, this is your cue to exit.&lt;br /&gt;&lt;br /&gt;A few days ago I read an article by &lt;a href="http://lucacardelli.name/"&gt;Luca Cardelli&lt;/a&gt; entitled &lt;a href="http://lucacardelli.name/Bibliography.htm#CanASystemsBiologistFixATamagotchi"&gt;Can a Systems Biologist Fix a Tamagotchi?&lt;/a&gt;. Thanks again for sending it to me--you, the guilty part, know who you are :-) The title is a play on that of another article, &lt;a href="http://www.protein.bio.msu.ru/biokhimiya/contents/v69/pdf/bcm_1403.pdf"&gt;Can a Biologist Fix a Radio?&lt;/a&gt; by &lt;a href="http://www.cshl.edu/public/SCIENCE/lazeb.html"&gt;Yuri Lazebnik&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;Lazebnik's article emphasized on the need to develop a formal approach for studying biology, together with an adequate language, an approach that would focus on understanding the system as a whole, as opposed to cataloging myriads of more or less loosely connected pieces, since this way, "the paradox that the more facts we learn the less we understand the process we study" comes into play.&lt;br /&gt;&lt;br /&gt;Cardelli takes this further, and proposes that the challenge of understand biological systems is more akin to the challenge of a systems biologist to fix a Tamagotchi. An electrical engineer could easily fix a radio, but fixing a software bug in an MP3 player would require expertise in the rather different field of software engineering, he argues. Cardelli rings again the bell (wake-up call?) of formal approaches for (systems) biology. The need of a language and the need to find the level on which the essence of a system is manifest are some other things he mentions, while pointing at Computer Science for some hints about how to discover and work with them. At one point, he half-jokingly refers to this language as the "Language of the Creator". The essence of life is in its software, at least as much as in its hardware.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Stranger in a Strange Ecosystem&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you've read Robert Heinlein's &lt;a href="http://en.wikipedia.org/wiki/Stranger_in_a_Strange_Land"&gt;Stranger in a Strange Land&lt;/a&gt;, or just "Stranger" as its fans affectionately call it, you know about the grokking language, the one that Michael Valentine Smith is teaching to the people of Earth so they are able to &lt;a href="http://en.wikipedia.org/wiki/Grok"&gt;grok&lt;/a&gt;--understand deeply and intuitively. Mike, after learning more about humans, decides that the only way to teach them how to grok is to first teach the grokking language to them, which he himself learned from the Martians. It seems that this grokking language has quite a few things in common with the "Language" that Cardelli writes about. Teaching this language is done, for pragmatic reasons :-), in the religious context of the "Church of All Worlds", that is created by Mike for this purpose--sort of like the &lt;a href="http://en.wikipedia.org/wiki/Invisible_Pink_Unicorn"&gt;Church of the Invisible Pink Unicorn&lt;/a&gt; has been created to... well, fool people into thinking more.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Know Thyself&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Both Lazebnik and Cardelli try to analyze the state of the art or, rather, the &lt;i&gt;status quo&lt;/i&gt; in the field of biology, and try to present the limitations of the current approaches, and make predictions about the way the field will evolve. In both papers, there are some striking similarities to Stanislaw Lem's metascience-fiction, as some have called it, or, for our purposes, pseudo-science-fiction novel, &lt;a href="http://en.wikipedia.org/wiki/Solaris_%28novel%29"&gt;Solaris&lt;/a&gt;--also, the name of a computer operating system developed by, yet-again, you've guessed it, Sun Microsystems. If you haven't read it, please, for the love of a possible &lt;a href="http://www.venganza.org"&gt;godlike being&lt;/a&gt;, at least read its above linked Wikipedia entry, &lt;a href="http://www.lem.pl/cyberiadinfo/english/dziela/solaris/solarispl.htm"&gt;this fragment&lt;/a&gt; and also Lem's &lt;a href="http://www.lem.pl/cyberiadinfo/english/kiosk/kiosk.htm#solstation"&gt;essay&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;One similiarity is in the way Lem describes the (evolution of the) field of science that humans develop to understand Solaris, the extremly powerful and seemingly intelligent alien entity that best resembles a planetary ocean, which, by the end of the book, seems like Nature's failed attempt at creating a God. Incidentally, I found an &lt;a href="http://adherents.com/people/pl/Stanislaw_Lem.html"&gt;interesting note about Lem's religious affiliation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The other similarity is in the fact that the godlike ocean can reproduce humans (or rather their recollections of others), it can copy them in great detail, and actually does this in what seems like an attempt to "understand" them. This attempt is doomed to fail, since the ocean seemingly "misunderstands" the essence of humans for their darkest thoughts and fears, and is ultimately unable to find an adequate language for communication. It is lacking, like biology today, the level at which the essence is manifest and the language to explore it. Solaris has plenty of excuses, being a live alien planetary ocean--albeit a godlike one--and, seeing how alien things begin to look in biology, maybe it has some down to Earth excuses too.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;As Above, so Below&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Okay, back to the distributed computing library. We're trying to make it seamless, more precisely, there should be exactly one added line to make a program written for a single computer  work on many computers. Not quite there yet, but getting close.&lt;br /&gt;&lt;br /&gt;"The network is the computer", or, in the spirit of the famous &lt;a href="http://en.wikipedia.org/wiki/Tabula_Smaragdina"&gt;Tabula Smaragdina&lt;/a&gt;, "As on the computer, so onto the network". The Network and the Computer should be One, in Software. Software, which is the Essence of Life, its, if you will, &lt;span style="font-style:italic;"&gt;Spirit&lt;/span&gt;, which is "As above, so below", as in Hardware, so in Software.&lt;br /&gt;On a side-note, there is a lot of &lt;a href="http://en.wikipedia.org/wiki/Magick"&gt;Magick&lt;/a&gt; in Heinlein's "Stranger". See this &lt;a href="http://www.greylodge.org/occultreview/glor_002/stranger.htm"&gt;nice essay&lt;/a&gt;--free thelemic candy included. (You will not be charged extra for reading all those caps).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;The Truth of the Matter&lt;/span&gt;&lt;br /&gt;... lies in the Spirit.&lt;br /&gt;&lt;br /&gt;This is why the non-aptly named "Computer Science" has perhaps the most to say about the essence of &lt;a href="http://en.wikipedia.org/wiki/Life%2C_the_universe%2C_and_everything"&gt;Life, the Universe, and Everything&lt;/a&gt;. It's as much about computers, as biology is about fixing radios. And no, it's not about &lt;a href="http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-3.html"&gt;keeping the clients and the shareholders happy&lt;/a&gt;.&lt;br /&gt;It is about Spirit transforming into Process, and, thereby, creating Reality. It is about Spirit ascending from Concrete to Abstract and descending to concrete again and about the funny mark it leaves behind.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Many Worlds, One Ending&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I wish You a day when all are Free.&lt;br /&gt;As in &lt;span style="font-style:italic;"&gt;Spirit&lt;/span&gt;, so in &lt;span style="font-style:italic;"&gt;Software&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35708717-2863514016514167701?l=rubycond.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubycond.blogspot.com/feeds/2863514016514167701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35708717&amp;postID=2863514016514167701' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/2863514016514167701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/2863514016514167701'/><link rel='alternate' type='text/html' href='http://rubycond.blogspot.com/2007/01/can-systems-biologist-fix-electrical.html' title='Can a Systems Biologist Fix an Electrical Engineer?'/><author><name>Rubycond</name><uri>http://www.blogger.com/profile/00461194134453001594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35708717.post-4801732937123059332</id><published>2006-11-05T04:51:00.000-08:00</published><updated>2007-01-26T18:03:42.498-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='closures'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Lisp'/><category scheme='http://www.blogger.com/atom/ns#' term='memoization'/><title type='text'>Memoization: Lisp vs. Ruby</title><content type='html'>All implementations of memoization below use lexical closures.&lt;br /&gt;&lt;h3&gt;Lisp&lt;/h3&gt;&lt;span style="font-weight:bold;"&gt;Common Lisp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Based on &lt;a href="http://lib.store.yahoo.net/lib/paulgraham/cint.lisp"&gt;Paul Graham&lt;/a&gt;'s code for &lt;a href="http://lib.store.yahoo.net/lib/paulgraham/onlisp.lisp"&gt;&lt;em&gt;memoize&lt;/em&gt;&lt;/a&gt; (search for memoize) from the book &lt;a href="http://paulgraham.com/onlisp.html"&gt;On Lisp&lt;/a&gt;, here is a version that also handles functions that return multiple values:&lt;br /&gt;&lt;pre&gt;(defun memoize (fn)&lt;br /&gt;  (let ((cache (make-hash-table :test #'equal)))&lt;br /&gt;    #'(lambda (&amp;rest args)&lt;br /&gt;        (multiple-value-bind (val win) (gethash args cache)&lt;br /&gt;          (if win&lt;br /&gt;              (values-list val)&lt;br /&gt;              (let ((val (setf (gethash args cache)&lt;br /&gt;                               (multiple-value-list (apply fn args)))))&lt;br /&gt;                (values-list val)))))))&lt;/pre&gt;This works by keeping all the values returned by the function call in a list created using &lt;a href="http://www.lisp.org/HyperSpec/Body/mac_multiple-value-list.html#multiple-value-list"&gt;&lt;em&gt;multiple-value-list&lt;/em&gt;&lt;/a&gt;, inside the &lt;em&gt;cache&lt;/em&gt; hash table. The conversion from the stored list to multiple values is done by &lt;a href="http://www.lisp.org/HyperSpec/Body/fun_values-list.html#values-list"&gt;&lt;em&gt;values-list&lt;/em&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Arc - a new dialect of Lisp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Memoization in &lt;a href="http://paulgraham.com/arc.html"&gt;Arc&lt;/a&gt; by Paul Graham:&lt;br /&gt;&lt;pre&gt;(def memo (f)&lt;br /&gt;  (let cache (table)&lt;br /&gt;    (fn args&lt;br /&gt;      (or (cache args)&lt;br /&gt;          (= (cache args) (apply f args))))))&lt;/pre&gt;As you can see, it is significantly shorter than the Common Lisp one. &lt;br /&gt;Please note, however, that in this case, function calls returning nil are not retrievable from &lt;em&gt;cache&lt;/em&gt;, since &lt;tt&gt;(cache&amp;nbsp;args)&lt;/tt&gt; would appear to fail. There is a workaround, involving the use of the &lt;em&gt;*fail*&lt;/em&gt; variable: Arc search functions return the value of &lt;em&gt;*fail*&lt;/em&gt; upon failure. However, the author assumes that the case of a function call that is computationally intensive only to return nil in the end is so rare that this implementation deliberatly ignores this case and evaluates the function call normally. Thinking about programs that deal with automated theorem proving, program verification or other scientific apps, this assumption may or may not hold a lot of liquid for your purposes. I, for one, would be content with an increase of 1 or 2 in the line count of &lt;em&gt;memoize&lt;/em&gt;'s definition so that I can forget about this quirk in the implementation that restricts the return value of functions and have it cache everything properly, thereby getting a clean abstraction, just like in the Ruby code below. &lt;br /&gt;But, as always, &lt;a href="http://en.wikipedia.org/wiki/YMMV"&gt;YMMV&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Ruby&lt;/h3&gt;And now for something completely similar, in Ruby-speak:&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;&lt;b&gt;&lt;font color="#0000FF"&gt;def&lt;/font&gt;&lt;/b&gt; &lt;b&gt;&lt;font color="#000000"&gt;memoize&lt;/font&gt;&lt;/b&gt;&lt;font color="#990000"&gt;(&lt;/font&gt;fn&lt;font color="#990000"&gt;)&lt;/font&gt;&lt;br /&gt;    cache &lt;font color="#990000"&gt;=&lt;/font&gt; &lt;font color="#990000"&gt;{&lt;/font&gt;&lt;font color="#990000"&gt;}&lt;/font&gt;&lt;br /&gt;    lambda &lt;font color="#990000"&gt;{&lt;/font&gt;&lt;font color="#990000"&gt;|&lt;/font&gt;&lt;font color="#990000"&gt;*&lt;/font&gt;args&lt;font color="#990000"&gt;|&lt;/font&gt;&lt;br /&gt;        &lt;b&gt;&lt;font color="#0000FF"&gt;return&lt;/font&gt;&lt;/b&gt; cache&lt;font color="#990000"&gt;[&lt;/font&gt;args&lt;font color="#990000"&gt;]&lt;/font&gt; &lt;b&gt;&lt;font color="#0000FF"&gt;if&lt;/font&gt;&lt;/b&gt; cache&lt;font color="#990000"&gt;.&lt;/font&gt;has_key&lt;font color="#990000"&gt;?&lt;/font&gt;&lt;font color="#990000"&gt;(&lt;/font&gt;args&lt;font color="#990000"&gt;)&lt;/font&gt;&lt;br /&gt;        cache&lt;font color="#990000"&gt;[&lt;/font&gt;args&lt;font color="#990000"&gt;]&lt;/font&gt; &lt;font color="#990000"&gt;=&lt;/font&gt; fn&lt;font color="#990000"&gt;.&lt;/font&gt;&lt;b&gt;&lt;font color="#000000"&gt;call&lt;/font&gt;&lt;/b&gt;&lt;font color="#990000"&gt;(&lt;/font&gt;&lt;font color="#990000"&gt;*&lt;/font&gt;args&lt;font color="#990000"&gt;)&lt;/font&gt;&lt;br /&gt;    &lt;font color="#990000"&gt;}&lt;/font&gt;&lt;br /&gt;&lt;b&gt;&lt;font color="#0000FF"&gt;end&lt;/font&gt;&lt;/b&gt;&lt;/tt&gt;&lt;/pre&gt;It is worth noting that in Ruby, there is no difference between multiple values and &lt;a href="http://www.rubycentral.com/ref/ref_c_array.html"&gt;Array&lt;/a&gt;s, so no conversion between the two is necessary for storing and retrieving them. This is one reason for which the Ruby version is surprisingly shorter.&lt;br /&gt;Please note that there is an even more elegant (while very similar) implementation of &lt;a href="http://raa.ruby-lang.org/project/memoize/"&gt;&lt;em&gt;memoize&lt;/em&gt;&lt;/a&gt; that can optionally cache on disk too, by Daniel J. Berger.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35708717-4801732937123059332?l=rubycond.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubycond.blogspot.com/feeds/4801732937123059332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35708717&amp;postID=4801732937123059332' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/4801732937123059332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/4801732937123059332'/><link rel='alternate' type='text/html' href='http://rubycond.blogspot.com/2006/11/memoization-lisp-vs-ruby.html' title='Memoization: Lisp vs. Ruby'/><author><name>Rubycond</name><uri>http://www.blogger.com/profile/00461194134453001594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35708717.post-1987471692433589964</id><published>2006-10-16T16:48:00.000-07:00</published><updated>2006-10-16T21:37:09.780-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='U combinator'/><category scheme='http://www.blogger.com/atom/ns#' term='self-application'/><category scheme='http://www.blogger.com/atom/ns#' term='recursion'/><category scheme='http://www.blogger.com/atom/ns#' term='lambda calculus'/><category scheme='http://www.blogger.com/atom/ns#' term='Scheme'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Lisp'/><category scheme='http://www.blogger.com/atom/ns#' term='Y combinator'/><title type='text'>The birth of recursion from self-application in lambda calculus</title><content type='html'>Reading &lt;a href="http://okmij.org/ftp/Computation/fixed-point-combinators.html#Self-application"&gt;Many faces of the fixed-point combinator&lt;/a&gt; and &lt;a href="http://okmij.org/ftp/Computation/overriding-selfapplication.html"&gt;Y overriding self-application&lt;/a&gt; by Oleg Kislyov (oleg-at-pobox.com), I came to understand how to express recursive functions in lambda calculus in an elegant way. Oleg's code was written in Scheme, but it was clear that it was easily translated in pure lambda calculus. I used the &lt;a href="http://ozark.hendrix.edu/~burch/proj/lambda/download.html"&gt;Lambda calculator&lt;/a&gt;  by Carl Burch to do this for the (recursive) &lt;a href="http://en.wikipedia.org/wiki/Factorial"&gt;factorial function&lt;/a&gt;: &lt;pre&gt;(&amp;lambda;f.f f) (&amp;lambda;f.&amp;lambda;n.if (= n 0) 1 (* n (f f (- n 1))))&lt;br /&gt;Example: ((&amp;lambda;f.f f) (&amp;lambda;f.&amp;lambda;n.if (= n 0) 1 (* n (f f (- n 1)))) 5) &lt;/pre&gt; Afterwards, I found on the CLiki &lt;a href="http://www.cliki.net/Factorial"&gt;Factorial page&lt;/a&gt; a Common Lisp translation of the above: &lt;pre&gt;((lambda (f) #'(lambda (n) (funcall f f n)))&lt;br /&gt; #'(lambda (f n) (if (= n 0) 1 (* n (funcall f f (- n 1))))))&lt;/pre&gt; This would probably look much better in Scheme, and I am beginning to understand why Scheme is regarded as a "better Lisp" than Lisp.&lt;br /&gt;&lt;br /&gt;Just when I was contemplating "porting" the lambda expression to Ruby, &lt;a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/20469"&gt;here&lt;/a&gt; it is... well, almost. Actually, the Y combinator is used here, instead of the U combinator used by Oleg in the above articles. So, here is the true Ruby translation (actually a sample call of it):&lt;pre&gt;&lt;tt&gt;p lambda &lt;font color="#990000"&gt;{&lt;/font&gt; &lt;font color="#990000"&gt;|&lt;/font&gt;f&lt;font color="#990000"&gt;|&lt;/font&gt;&lt;br /&gt;    f&lt;font color="#990000"&gt;.&lt;/font&gt;&lt;b&gt;&lt;font color="#000000"&gt;call&lt;/font&gt;&lt;/b&gt;&lt;font color="#990000"&gt;(&lt;/font&gt;f&lt;font color="#990000"&gt;)&lt;/font&gt;&lt;br /&gt;&lt;font color="#990000"&gt;}&lt;/font&gt;&lt;font color="#990000"&gt;.&lt;/font&gt;&lt;b&gt;&lt;font color="#000000"&gt;call&lt;/font&gt;&lt;/b&gt;&lt;font color="#990000"&gt;(&lt;/font&gt;&lt;br /&gt;    lambda &lt;font color="#990000"&gt;{&lt;/font&gt; &lt;font color="#990000"&gt;|&lt;/font&gt;recurse&lt;font color="#990000"&gt;|&lt;/font&gt;&lt;br /&gt;        lambda &lt;font color="#990000"&gt;{&lt;/font&gt; &lt;font color="#990000"&gt;|&lt;/font&gt;n&lt;font color="#990000"&gt;|&lt;/font&gt;&lt;br /&gt;            &lt;b&gt;&lt;font color="#0000FF"&gt;if&lt;/font&gt;&lt;/b&gt; n &lt;font color="#990000"&gt;=&lt;/font&gt;&lt;font color="#990000"&gt;=&lt;/font&gt; &lt;font color="#993399"&gt;0&lt;/font&gt; &lt;b&gt;&lt;font color="#0000FF"&gt;then&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;                &lt;font color="#993399"&gt;1&lt;/font&gt;&lt;br /&gt;            &lt;b&gt;&lt;font color="#0000FF"&gt;else&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;                n &lt;font color="#990000"&gt;*&lt;/font&gt; recurse&lt;font color="#990000"&gt;.&lt;/font&gt;&lt;b&gt;&lt;font color="#000000"&gt;call&lt;/font&gt;&lt;/b&gt;&lt;font color="#990000"&gt;(&lt;/font&gt;recurse&lt;font color="#990000"&gt;)&lt;/font&gt;&lt;font color="#990000"&gt;.&lt;/font&gt;&lt;b&gt;&lt;font color="#000000"&gt;call&lt;/font&gt;&lt;/b&gt;&lt;font color="#990000"&gt;(&lt;/font&gt;n&lt;font color="#990000"&gt;-&lt;/font&gt;&lt;font color="#993399"&gt;1&lt;/font&gt;&lt;font color="#990000"&gt;)&lt;/font&gt;&lt;br /&gt;            &lt;b&gt;&lt;font color="#0000FF"&gt;end&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;        &lt;font color="#990000"&gt;}&lt;/font&gt;&lt;br /&gt;    &lt;font color="#990000"&gt;}&lt;/font&gt;&lt;font color="#990000"&gt;)&lt;/font&gt;&lt;font color="#990000"&gt;.&lt;/font&gt;&lt;b&gt;&lt;font color="#000000"&gt;call&lt;/font&gt;&lt;/b&gt;&lt;font color="#990000"&gt;(&lt;/font&gt;&lt;font color="#993399"&gt;5&lt;/font&gt;&lt;font color="#990000"&gt;)&lt;/font&gt;&lt;br /&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35708717-1987471692433589964?l=rubycond.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubycond.blogspot.com/feeds/1987471692433589964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35708717&amp;postID=1987471692433589964' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/1987471692433589964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/1987471692433589964'/><link rel='alternate' type='text/html' href='http://rubycond.blogspot.com/2006/10/birth-of-recursion-from-self.html' title='The birth of recursion from self-application in lambda calculus'/><author><name>Rubycond</name><uri>http://www.blogger.com/profile/00461194134453001594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35708717.post-6795729629958297744</id><published>2006-10-09T17:13:00.000-07:00</published><updated>2006-10-16T17:20:59.806-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Quine'/><category scheme='http://www.blogger.com/atom/ns#' term='Lisp'/><title type='text'>YALQ - Yet Another Lisp Quine</title><content type='html'>Here is a &lt;a href="http://www.lispworks.com/documentation/HyperSpec/Body/f_format.htm#format"&gt;format&lt;/a&gt;-based Lisp quine:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;(let ((p "(let ((p ") (s "(format t \"~A~S) (s ~S)) ~A)\" p p s s)")) (format t "~A~S) (s ~S)) ~A)" p p s s))&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Please note that the above code should be written on a single line, and there should be a space before the last ~A, before the end of the string.&lt;br /&gt;&lt;br /&gt;While I thought it was pretty original at the time it was written, I now discovered the quine by Dave Seaman (ags@seaman.cc.purdue.tom.edu MINUS cat) on the &lt;a href="http://www.nyx.net/~gthompso/self_lisp.txt"&gt;Lisp section&lt;/a&gt; of the &lt;a href="http://www.nyx.net/~gthompso/quine.htm"&gt;Quine Page&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;(let ((p "(let ((p ~s)) (format t p p))")) (format t p p))&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This one is smarter and shorter, since &lt;em&gt;p&lt;/em&gt; is used as a format-string for printing itself, without needing both a prefix and a suffix, but it is clearly in the same vein.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35708717-6795729629958297744?l=rubycond.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubycond.blogspot.com/feeds/6795729629958297744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35708717&amp;postID=6795729629958297744' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/6795729629958297744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/6795729629958297744'/><link rel='alternate' type='text/html' href='http://rubycond.blogspot.com/2006/10/yalq-yet-another-lisp-quine.html' title='YALQ - Yet Another Lisp &lt;a href=&quot;http://www.nyx.net/~gthompso/quine.htm&quot;&gt;Quine&lt;/a&gt;'/><author><name>Rubycond</name><uri>http://www.blogger.com/profile/00461194134453001594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35708717.post-116034064368658739</id><published>2006-10-08T13:32:00.000-07:00</published><updated>2006-11-07T09:29:17.015-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Lisp'/><category scheme='http://www.blogger.com/atom/ns#' term='mapcar'/><title type='text'>Mapcar in Ruby</title><content type='html'>A Ruby version of Lisp's &lt;a href="http://www.lispworks.com/documentation/HyperSpec/Body/f_mapc_.htm#mapcar"&gt;mapcar&lt;/a&gt; function:&lt;pre&gt;&lt;tt&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;require&lt;/span&gt;&lt;/b&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;'generator'&lt;/span&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="color: rgb(154, 25, 0);"&gt;# One mapcar to rule all Enumerables.&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;def&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;mapcar&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;*&lt;/span&gt;enums&lt;span style="color: rgb(153, 0, 0);"&gt;)&lt;/span&gt;&lt;br /&gt; generators &lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt; enums&lt;span style="color: rgb(153, 0, 0);"&gt;.&lt;/span&gt;collect &lt;span style="color: rgb(153, 0, 0);"&gt;{&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;|&lt;/span&gt;e&lt;span style="color: rgb(153, 0, 0);"&gt;|&lt;/span&gt; Generator&lt;span style="color: rgb(153, 0, 0);"&gt;.&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;new&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;(&lt;/span&gt;e&lt;span style="color: rgb(153, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt; result &lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;]&lt;/span&gt;&lt;br /&gt; &lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;while&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;     &lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;begin&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;         params &lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt; generators&lt;span style="color: rgb(153, 0, 0);"&gt;.&lt;/span&gt;collect &lt;span style="color: rgb(153, 0, 0);"&gt;{&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;|&lt;/span&gt;g&lt;span style="color: rgb(153, 0, 0);"&gt;|&lt;/span&gt; g&lt;span style="color: rgb(153, 0, 0);"&gt;.&lt;/span&gt;current&lt;span style="color: rgb(153, 0, 0);"&gt;;&lt;/span&gt; g&lt;span style="color: rgb(153, 0, 0);"&gt;.&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;next&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;         &lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;rescue&lt;/span&gt;&lt;/b&gt; EOFError&lt;br /&gt;             &lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;&lt;/b&gt; result&lt;br /&gt;     &lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;end&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;     result &lt;span style="color: rgb(153, 0, 0);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;&amp;lt;&lt;/span&gt; &lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;yield&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;*&lt;/span&gt;params&lt;span style="color: rgb(153, 0, 0);"&gt;)&lt;/span&gt;&lt;br /&gt; &lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;end&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;end&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/tt&gt;&lt;/pre&gt;Sample usage:&lt;pre&gt;&lt;tt&gt;qSorters &lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt; arrays&lt;span style="color: rgb(153, 0, 0);"&gt;.&lt;/span&gt;collect &lt;span style="color: rgb(153, 0, 0);"&gt;{&lt;/span&gt;QSort&lt;span style="color: rgb(153, 0, 0);"&gt;.&lt;/span&gt;new&lt;span style="color: rgb(153, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;threads &lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;mapcar&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;(&lt;/span&gt;qSorters&lt;span style="color: rgb(153, 0, 0);"&gt;,&lt;/span&gt; arrays&lt;span style="color: rgb(153, 0, 0);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;{&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;|&lt;/span&gt;q&lt;span style="color: rgb(153, 0, 0);"&gt;,&lt;/span&gt; a&lt;span style="color: rgb(153, 0, 0);"&gt;|&lt;/span&gt; Thread&lt;span style="color: rgb(153, 0, 0);"&gt;.&lt;/span&gt;new &lt;span style="color: rgb(153, 0, 0);"&gt;{&lt;/span&gt;q&lt;span style="color: rgb(153, 0, 0);"&gt;.&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;quicksort&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;(&lt;/span&gt;a&lt;span style="color: rgb(153, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;}&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/tt&gt;&lt;/pre&gt;This creates an &lt;a href="http://www.rubycentral.com/ref/ref_c_array.html"&gt;Array&lt;/a&gt; of &lt;a href="http://www.rubycentral.com/ref/ref_c_thread.html"&gt;Threads&lt;/a&gt; that use the objects in &lt;span style="font-style: italic;"&gt;qSorters&lt;/span&gt; to sort each element of &lt;span style="font-style: italic;"&gt;arrays&lt;/span&gt;.&lt;br /&gt;Please note that the &lt;em&gt;QSort&lt;/em&gt; class is user-defined and omitted here for brevity (and sanity).&lt;br /&gt;The above &lt;em&gt;mapcar&lt;/em&gt; is based on recipe 7.9, pages 256-257 of the &lt;a href="http://www.amazon.com/Cookbook-Cookbooks-OReilly-Lucas-Carlson/dp/0596523696/sr=8-1/qid=1160437099/ref=pd_bbs_1/002-3127989-6043263?ie=UTF8&amp;amp;s=books"&gt;Ruby Cookbook&lt;/a&gt;, specifically the &lt;em&gt;interosculate&lt;/em&gt; function.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35708717-116034064368658739?l=rubycond.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubycond.blogspot.com/feeds/116034064368658739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35708717&amp;postID=116034064368658739' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/116034064368658739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35708717/posts/default/116034064368658739'/><link rel='alternate' type='text/html' href='http://rubycond.blogspot.com/2006/10/mapcar-maplist-in-ruby.html' title='Mapcar in Ruby'/><author><name>Rubycond</name><uri>http://www.blogger.com/profile/00461194134453001594</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
