forked from recursiveuniverse/recursiveuniverse.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
132 lines (94 loc) · 8.48 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Café au Life by raganwald</title>
<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/pygment_trac.css">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-31177360-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div class="wrapper">
<header>
<h1>Café au Life</h1>
<p>HashLife. On Node.</p>
<p class="view"><a href="https://github.com/recursiveuniverse/recursiveuniverse.github.com">View the Project on GitHub <small>recursiveuniverse/recursiveuniverse.github.com</small></a></p>
<ul>
<li><a href="https://github.com/recursiveuniverse/recursiveuniverse.github.com/zipball/master">Download <strong>ZIP File</strong></a></li>
<li><a href="https://github.com/recursiveuniverse/recursiveuniverse.github.com/tarball/master">Download <strong>TAR Ball</strong></a></li>
<li><a href="https://github.com/recursiveuniverse/recursiveuniverse.github.com">Fork On <strong>GitHub</strong></a></li>
</ul>
</header>
<section>
<h3>Café au Life</h3>
<p>Café au Life is an implementation of John Conway's <a href="http://en.wikipedia.org/wiki/Conway's_Game_of_Life">Game of Life</a> cellular automata written in <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a>. Café au Life runs on <a href="http://nodejs.org">Node.js</a>, it is not designed to run as an interactive program in a browser window.</p>
<p>The <a href="http://recursiveuniver.se/docs/cafeaulife.html">annotated source code</a> is the best way to explore the algorithm.</p>
<h3>Why should I care?</h3>
<p>Café au Life implements Bill Gosper's <a href="http://en.wikipedia.org/wiki/Hashlife">HashLife</a> algorithm. HashLife exploits regularity, so for certain life patterns, it runs at super-linear speed. It's <a href="http://raganwald.posterous.com/a-beautiful-algorithm">a beautiful algorithm</a>!</p>
<p>If you set up a Glider Gun when the Earth was first formed 4.5 billion years ago, and ran one generation per second, in the 143.4 <em>quadrillion</em> seconds that have elapsed since then, the pattern would grow to 23,900,000,000,000,036 live cells.</p>
<p>Café au Life takes just under two seconds to boot up, and another second to calculate the state of the pattern after 143.4 quadrillion generations. If you haven't seen how the algorithm works, you owe it to yourself to read the <a href="http://recursiveuniver.se/docs/cafeaulife.html">annotated source code</a>.</p>
<h3>How can I try it?</h3>
<p>The easiest way to try Café au Life is to install CoffeeScript and node.js, clone the repository, then use the REPL from the command line:</p>
<pre><code>$ coffee
coffee> Life = require('./lib/cafeaulife').set_universe_rules()
coffee> gun = require('./lib/menagerie').gospers_glider_gun
coffee> gun.future_at_time(143400000000000000).population
23900000000000036
coffee>
</code></pre>
<p>Have fun!</p>
<h3>Is it any good?</h3>
<p><a href="http://news.ycombinator.com/item?id=3067434">Yes</a>.</p>
<h3>What should I read next?</h3>
<p>The <a href="http://recursiveuniver.se/docs/cafeaulife.html">annotated source code</a>.</p>
<h3>What else can I read about the code?</h3>
<p><a href="https://github.com/raganwald/homoiconic/blob/master/2011/11/COMEFROM.md#readme">Williams, Master of the "Come From"</a> is a short work of fiction that introduces the idea of aggressively separating concerns into separate modules. Café au Life was written in part to explore the "Williams Style" and see how it would play out when writing a non-trivial program.</p>
<p><a href="https://github.com/raganwald/homoiconic/blob/master/2012/03/garbage_collection_in_coffeescript.md#readme">Implementing Garbage Collection in CS/JS with Aspect-Oriented Programming</a> is an experience report describing the refactoring and programming necessary to add garbage collection to Café au Life.</p>
<h3>Why does Conway's Game of Life matter?</h3>
<p>One of the most important questions we ask ourselves is whether a non-trivial machine can be constructed that reproduces itself. If the answer is "no," then we can reason that for any machine, there must be a factory or creator outside of the machine. That goes for humans and all life. If the answer is "yes," then we can reason that it is not <em>necessary</em> for there to be a factory or creator for every machine, including ourselves.</p>
<p>Cellular automata patterns are a kind of machine, with properties close enough to physical machines that it is very easy to reason by correspondence: If such-and-such is possible for a cellular automaton, it must be possible for a physical machine, therefore research into the capabilities of cellular automata is an important part of research into the capabilities of machines, including our bodies and our brains.</p>
<p>Life theorists have proven all sorts of things about what ought to be possible with Life patterns. Life experimenters have taken it to the next level and have built Universal Turing Machines, self-replicating machines, and all sorts of things that demonstrate the universality of Conway's Game of Life. Implementations that can handle very large and/or very long-running Life patterns are an important tool for experimentation.</p>
<p>If you'd like to read more, the most approachable book on the subject is William Poundstone's brilliant <a href="http://www.amazon.com/gp/product/0809252023/ref=as_li_ss_il?ie=UTF8&tag=raganwald001-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0809252023">The Recursive Universe</a>. Beg, borrow, or steal a copy, new or used. Get it in hardcover while you still can.</p>
<h3>Who's responsible for this?</h3>
<p><a href="http://braythwayt.com">Reg "Raganwald" Braithwaite</a> has authored libraries for Javascript and Ruby programming
such as <a href="https://github.com/raganwald/Katy">Katy</a>, <a href="http://github.com/raganwald/JQuery-Combinators">JQuery Combinators</a>,
<a href="https://github.com/raganwald/YouAreDaChef">YouAreDaChef</a>, <a href="http://github.com/raganwald/andand">andand</a>,
and more you can find on <a href="https://github.com/raganwald">Github</a>.</p>
<p>He has written three collections of essays:</p>
<ul>
<li>
<a href="http://leanpub.com/combinators">Kestrels, Quirky Birds, and Hopeless Egocentricity</a>: <em>Raganwald's collected adventures in Combinatory Logic and Ruby Meta-Programming</em>
</li>
<li>
<a href="http://leanpub.com/shippingsoftware">What I've Learned From Failure</a>: <em>A quarter-century of experience shipping software, distilled into fixnum bittersweet essays</em>
</li>
<li><a href="http://leanpub.com/dowhatyoulove">How to Do What You Love & Earn What You’re Worth as a Programmer</a></li>
</ul><p>His hands-on coding blog <a href="https://github.com/raganwald/homoiconic">Homoiconic</a> frequently lights up the Hackerverse, and he also writes about <a href="http://raganwald.posterous.com/">project management and other subjects</a>.</p>
<h3>Copyright and License</h3>
<p>(c) 2012 <b><a href="http://braythwayt.com">Reg Braithwaite</a></b> (<a href="http://twitter.com/raganwald">@raganwald</a>)</p>
<p>Café au Life is freely distributable under the terms of the <a href="http://en.wikipedia.org/wiki/MIT_License">MIT license</a>.</p>
<h3>Big thanks:</h3>
<p>The annotated source code was generated directly from the <a href="http://recursiveuniver.se/docs/cafeaulife.html">original source</a> using <a href="http://jashkenas.github.com/docco/">Docco</a>.</p>
</section>
<footer>
<p>This project is maintained by <a href="https://github.com/raganwald">raganwald</a></p>
<p><small>Hosted on GitHub Pages — Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
</footer>
</div>
<script src="javascripts/scale.fix.js"></script>
</body>
</html>