<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="https://www.w3.org/2005/Atom">
    <title>words</title>
    <subtitle>online</subtitle>
    <link rel="alternate" href="https://words.computerdream.club/" />
    <link rel="self" href="https://words.computerdream.club/feed.xml" type="application/atom+xml" />
    <id>https://words.computerdream.club/</id>
    <updated>2025-02-08T02:33:07Z</updated>

    <author>
        <name>Thomas Omans</name>
        <email>orpheus@computerdream.club</email>
        <uri>https://words.computerdream.club/</uri>
    </author>

    
        <entry>
            <title>on sallust on the gods</title>
            <link rel="alternate" href="https://words.computerdream.club/2018/06/01/on-sallust-on-the-gods/" type="text/html" />
            <id>https://words.computerdream.club/2018/06/01/on-sallust-on-the-gods/</id>
            <updated>2018-06-01T00:00:00Z</updated>

            <summary type="html">I wanted to talk a little bit about the different meanings of fables as they are related by Sallustius in his On the Gods and the World.</summary>
            <content type="html">&lt;p&gt;I wanted to talk a little bit about the different meanings of fables as they are related by Sallustius in his On the Gods and the World.&lt;/p&gt;

&lt;p&gt;In the text Sallust describes the meaning behind some of the maxims inscribed at the temple at delphi, where apollo would speak through his pythia on matters of particular interest to the lives of the men of the day&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/assets/images/geometry.jpg&#34; alt=&#34;Socrates and Pythagorean Geometry&#34;&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Know Thyself and Nothing in Excess&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By this was meant that one should both understand their inner life and operation, &lt;/p&gt;

&lt;p&gt;but also to know their place in the great cosmic chain of being.&lt;/p&gt;

&lt;p&gt;greek legendry is full of these sorts of cautionary tales where through great immoderation people receive great punishment, such as the stories of tantalus or sisyphus&lt;/p&gt;

&lt;p&gt;And it’s exactly this that sallust was elaborating on In the Gods and the World.&lt;/p&gt;

&lt;p&gt;He wanted to talk about the nature of Deity, and in particular about how the Gods could have qualities that were less than admirable.&lt;/p&gt;

&lt;p&gt;The conclusion he arrives at is that the fables are meant to be considered as parables, as multiple orders of intersecting meaning.&lt;/p&gt;

&lt;p&gt;Let me give an example of the sort of fable that is said to relate these distinct classes of meaning.&lt;/p&gt;

&lt;p&gt;In the story of Adonis, the most beautiful of mortals, the mother of the Gods saw him sitting by the river Gallus and fell in love with him, where she placed upon him a starry hat, and mingled with him for all his wants.&lt;/p&gt;

&lt;p&gt;But Adonis being drawn like a magnet by lust of his own fell in love with a Nymph. In order that he should not descend to depths of too deep a depravity the mother of the gods turned his mind and had him castrate his own genitals, whereby the union between the Mother of the Gods and the Adonis was restored.&lt;/p&gt;

&lt;p&gt;So what can we say about this story? Firstly, it is said not to be a tragedy but a beautiful and vivific story. Greek myth has a long history of castration as detachment from generation, or a shift from begotten to unbegotten things. &lt;/p&gt;

&lt;p&gt;We can remember how the Fathers of the Gods were usurped by their sons through castration, Cronos castrating his father Sky with a sickle while still in his mothers womb, during a particularly unpleasant act of copulation. Aphrodite or lust itself was thus formed when his genitals were cast into the sea.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>on mythic harmony</title>
            <link rel="alternate" href="https://words.computerdream.club/2016/10/29/on-mythic-harmony/" type="text/html" />
            <id>https://words.computerdream.club/2016/10/29/on-mythic-harmony/</id>
            <updated>2016-10-29T00:00:00Z</updated>

            <summary type="html">&lt;img src=&#34;/assets/images/monocordio.jpg&#34; alt=&#34;Fludd&amp;#39;s Monochord&#34;&gt;
&lt;span class=&#34;marginnote&#34;&gt;&lt;em&gt;Robert Fludd&amp;rsquo;s Monochord&lt;/em&gt;, figuring the scales of creation as cosmic harmony&lt;/span&gt;</summary>
            <content type="html">&lt;p&gt;&lt;img src=&#34;/assets/images/monocordio.jpg&#34; alt=&#34;Fludd&amp;#39;s Monochord&#34;&gt;
&lt;span class=&#34;marginnote&#34;&gt;&lt;em&gt;Robert Fludd&amp;rsquo;s Monochord&lt;/em&gt;, figuring the scales of creation as cosmic harmony&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;There is a rich history in &lt;em&gt;The Music of the Spheres&lt;/em&gt; and it comes down to us through the seasons of the mind. The stamp left on our soul by our love of music is so immensely profound it can hardly be overestimated.&lt;/p&gt;

&lt;p&gt;In this pair of lectures I want to discuss the various forms that harmony has taken in the life of man and what we can learn by it’s shape and motion. I will argue that music is essential to life and that our love of music is our greatest treasure. I want to distinguish between what I will call mythic harmony and scientific harmony. In the first of these two lectures I want to focus on Mythic harmony how the idea of Universal Harmony has come to down to us and what it meant to those who believed in it.&lt;/p&gt;

&lt;p&gt;The Music of the Spheres presents the image of man’s life being bound by the musical operations of his environment. The life lived becomes the bow to the string drawn and adjacent tones alone compose the chords of truth and beauty. In these lectures we will discuss the search for universal language and our relationship with music both as artists and as celebrants.&lt;/p&gt;

&lt;p&gt;Of the earliest echoes from the memories of man we find the story of &lt;strong&gt;Orpheus and Eurydice&lt;/strong&gt; recounted by the poets Virgil and Ovid&lt;/p&gt;

&lt;p&gt;Orpheus was a renowned musician son of Apollo. Eurydice was his lover and earthly muse. In the myth Eurydice suffers an early death which turns Orpheus to greif. Drunk on his own suffering he becomes the first mortal to travel to the underworld. Orpheus who was granted the musical gifts of his father petitions Hades and Persophene to let his wife return with him to the land of the living:&lt;/p&gt;

&lt;p&gt;As &lt;strong&gt;Virgil&lt;/strong&gt; puts it in his &lt;em&gt;Georgics&lt;/em&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;He even entered the jaws of Taenarus the high gates&lt;/em&gt;&lt;br&gt;
&lt;em&gt;of Dis and the grove dim with dark fear&lt;/em&gt;&lt;br&gt;
&lt;em&gt;and came to the spirits and their dread king and hearts&lt;/em&gt;&lt;br&gt;
&lt;em&gt;that do not know how to soften at human prayer&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&#34;/assets/images/orpheus-eurydice.jpg&#34; alt=&#34;Orpheus and Eurydice in the Underworld&#34;&gt;
&lt;span class=&#34;marginnote&#34;&gt;&lt;em&gt;Orpheus and Eurydice in the Underworld&lt;/em&gt;, unknown painter(s) from the Antwerp School&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;But Orpheus is armed with his lyre and his love and so we see the story continued by &lt;strong&gt;Ovid&lt;/strong&gt; in his &lt;em&gt;Metamorphoses&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;And with his words the music&lt;/em&gt;&lt;br&gt;
&lt;em&gt;made the pale phantoms weep: Ixion&amp;rsquo;s wheel&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Was still Tityus&amp;#39; vulture left the liver&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Tantalus tried no more to reach for the water&lt;/em&gt;&lt;br&gt;
&lt;em&gt;And Belus&amp;#39; daughters rested from their urns&lt;/em&gt;&lt;br&gt;
&lt;em&gt;And Sisyphus climbed on his rock to listen.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;That was the first time ever in all the world&lt;/em&gt;&lt;br&gt;
&lt;em&gt;The furies wept.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here we see music as a motive force and these hearts not moved by prayer are moved by this song of love loaned and borrowed. What are we to make here of the collection of cautionary brothers those who bear the burden of the mark of man granted temporary forgiveness through Orpheus&amp;#39; song? The ending of the myth is no happy tale; we see Orpheus struck by the forgetfulness of man losing his last chance to embrace his lover&amp;rsquo;s skin. He turns back to attend his lover, though forbade by Hades. Orpheus&amp;rsquo;s tragic gaze is often discussed by philosophers throughout the ages.&lt;/p&gt;

&lt;p&gt;So Orpheus is said to have &lt;em&gt;lost love twice&lt;/em&gt; and in the passing of time the Muses take his tongue as a medallion. His head is placed on a silver platter long after his death the Thracian Bard continues to sing the song of love twice lost.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/assets/images/orpheus-head.jpg&#34; alt=&#34;Head of Orpheus&#34;&gt;
&lt;span class=&#34;marginnote&#34;&gt;&lt;em&gt;Thracian Girl Carrying the Head of Orpheus on His Lyre&lt;/em&gt; by Gustave Moreau&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;We can learn much from the morals of this story as applied to our lives, for it bears fruit for thousands of years to come and many of our greatest thinkers have turned it over in their minds. I think many more still will turn it over to come. But what does this show us about the relationship between music and the gods? How was it that Orpheus’ melody turned their hand and granted Eurydice a second life?&lt;/p&gt;

&lt;p&gt;We can look further back in greek mythology though we have to travel forward to the musings of the roman &lt;strong&gt;Emperor Julian&lt;/strong&gt; the apostate, who converted from his Christian faith to the last dying cry of greek paganism.&lt;/p&gt;

&lt;p&gt;Here in his &lt;em&gt;Oration to the Sovereign Sun&lt;/em&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“The divine race of intellectual gods above the heavens are replenished from the Sun with boniform powers to those whose authority the whole choir of the stars submits and whose nod generation which he governs by his providence attentively obeys. For the planets indeed dancing round him as their king harmoniously revolve in a circle with definite intervals about his orb producing certain stable energies and advancing backwards and forwards … to which we may add as manifest to every one that the light of the moon is augmented or diminished according to her distance from the sun.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here we see plainly Julian&amp;rsquo;s view of a cosmic harmony noting the harmonic intervals the planets take in their relative revolutions around the sun. And so the moon is said to be occultly defined by the light of sun.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/assets/images/sovereign-sun.jpg&#34; alt=&#34;Apollo, the Sun&#34;&gt;
&lt;span class=&#34;marginnote&#34;&gt;&lt;em&gt;Apollo and His Chariot&lt;/em&gt;, unknown artist&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;In the Greek legends &lt;em&gt;Apollo&lt;/em&gt;, the God of the Sun, had a twin sister &lt;em&gt;Artemis&lt;/em&gt; who ruled over the Moon. These twin gods were the masculine and feminine incarnations of harmony in motion. Artemis was the Goddess of the hunt, of the Moon, of childbearing, and ritual magic. Apollo was the God of medicine, the Sun, of music, and divination. But both are characterized by two key qualities: &lt;em&gt;Action at a distance and the reckoning of opposites.&lt;/em&gt; It was said that Apollo and Artemis were &lt;em&gt;far-darting&lt;/em&gt;: Apollo roughly translating as &lt;em&gt;‘he who is always shooting’&lt;/em&gt; and Artemis as &lt;em&gt;‘she who acts from afar’.&lt;/em&gt; Both are said to have been the causes of sudden death; Apollo in men and Artemis in women. If you fell over struck dead you’d know who caused it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thomas Taylor&lt;/strong&gt; the great English Neoplatonist in his introduction to the Emperor’s Orations lays bare the occult meaning of Apollo:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;There is a great multitude of medicinal prophetic harmonic and arrow-darting angels daemons and heroes suspended from Apollo who distribute in a partial manner the uniform powers of the God. … The Telestic or mystic art endeavors through sympathy to conjoin these ultimate participants with the gods. … For the medicinal power which takes away the multiform nature of disease imparts uniform health since health is symmetry.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Just as notes in a symphony suspend partially from the totality of the work so a votary to Apollo partially imparts the totality of harmonic symmetry. Here we can see the best of the Pythagorean and Platonic systems in resonance. They enacted harmony through rituals of song and dance; through the act of analogy or sympathy they had second births and created something where before it was not.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/assets/images/artemis-apollo.jpg&#34; alt=&#34;Artemis and Apollo&#34;&gt;
&lt;span class=&#34;marginnote&#34;&gt;&lt;em&gt;Apollo and Diana&lt;/em&gt; by Lucas Cranach&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;To understand this sympathetic link between the emissaries of Apollo we should turn to the Orphic tradition as interpreted by the Pythagorean school.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Orphites&lt;/em&gt; were the ritualistic followers of the Orpheus from our stories. Most likely inspired by the Chaldean Oracles the Orphic tradition introduced a symbolic emanationism on top of the Greek legendry. To these religious few our story of Orpheus and Eurydice was full of occult substance and received many and varied expansions. They believed Orpheus lived several years after his return from the underworld and taught disciples the things he saw. What survives of these teachings are the &lt;em&gt;Hymns of Orpheus&lt;/em&gt; recorded by &lt;strong&gt;Onomacritus&lt;/strong&gt; which taught of a precession of supervening deities suspended from one another in a chain of necessity.&lt;/p&gt;

&lt;p&gt;Pythagoras was said to have received the teachings of the thracian bard and modified many of these teachings to his own work. &lt;strong&gt;Simplicius&lt;/strong&gt; in his &lt;em&gt;Commentaries on Aristotle&lt;/em&gt; writes:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“The Pythagoreans believed a harmonic sound was produced from the motion of the celestial bodies and they scientifically collected this from the analogy of their intervals.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Analogy is fundamental to Pythagorean thought as we can see in the life of the Pythagorean: Aristotle records in his Metaphysics:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Eurytus determined which number belongs to which thing—e.g. this number to man and this to horse—by using pebbles to copy the shape of natural objects like those who arrange numbers in the form of geometrical figures the triangle and the square.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This form of point-wise visualization of figures through their numbers has captured the imagination of mathematicians throughout history from Ford’s tangential circles to Pascal’s geometric triangle but it’s origin lies in Pythagorean thought. A figurate number can be thought of as a collection of dots as a triangle can be made of 1 dot of 3 dots of 6 or 10. There is a simple formula for triangle numbers you start with &lt;code&gt;n=1&lt;/code&gt; and add &lt;code&gt;n=n+1&lt;/code&gt; each step. &lt;code&gt;1+2+3+4…&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/assets/images/triangle-figure.gif&#34; alt=&#34;Triangle Figures&#34;&gt;
&lt;span class=&#34;marginnote&#34;&gt;&lt;em&gt;Progressions of the tetraktys&lt;/em&gt;, each phase is what is known as a &lt;b&gt;&amp;ldquo;triangular number&amp;rdquo;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Eurytus turns this on it’s head and says that things can be analogized on account of their sharing the same number of composite dots! A number like 64 then can be both a square and a cube on account of it having both a square and a cube root. This style of thinking was evidently passed to him by the Pythagorean school for Pythagoras saw patterns of number in the motions of the heavens the same on the motion of a string. Pythagoras was said to be the father of music theory on account of his recognition of the rational intervals described by succession of the first few integers.&lt;/p&gt;

&lt;p&gt;More than sound however the numbers described an alchemical cosmology as Strabo preserves the writings of the Pythagorean &lt;strong&gt;Ocellus Lucanis&lt;/strong&gt; here quoting from his &lt;em&gt;On the Nature of the Universe&lt;/em&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Every nature which has a progression possesses three boundaries and two intervals. The three boundaries therefore are beginning middle and end but the intervals are the progression from beginning to middle and from middle to end. … Thus animals require a conjunction with air for the purpose of respiration but light for the purpose of sight other senses with something else. … The sun and moon the planets and the zodiac have likewise a harmony with the world as being parts of its common arrangement. … Fire which imparts heat is itself hot and honey which is sweet to the taste is itself from itself sweet. … That which is to other things the cause of their harmony is itself from itself co-harmonized.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&#34;/assets/images/square-circle.jpg&#34; alt=&#34;Triangle Figures&#34;&gt;
&lt;span class=&#34;marginnote&#34;&gt;Geometric proof &lt;em&gt;&amp;ldquo;squaring the circle&amp;rdquo;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;How robust was the Pythagorean system that it saw the same in the transmutation of the elements as the scale of the octave as the tasting of honey? That each could be considered in terms of a conjunction between boundaries and interval of things in themselves and the transferrence of relation between them - Quoting the work again:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Fire indeed when it is congregated into one thing generates air but air generates water and water earth. From earth also there is the same circuit of mutation as far as to fire from whence it began to be changed. And fruits and most plants that derive their origin from a root receive the beginning of their generation from seeds. When however they bear fruit and arrive at a maturity they are resolved into seed nature producing a complete circulation from the same to the same.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Aristotle and later Proclus go on to expand this system but first we see it move through &lt;strong&gt;Plato’s&lt;/strong&gt; account of Pythagorean Cosmology in his &lt;em&gt;Timaeus&lt;/em&gt;, on the harmonic creation of the soul:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“He bent them into a circular form connecting them with themselves … he made the one the outer and the other the inner circle. Now the motion of the outer circle he called the motion of the same and the motion of the inner circle the motion of difference”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It is clear that we see the echoes of Pythagorean thought here in Plato’s - the circles of sameness and difference of unity and duality. The ratios on the circle describe intervals the same as are described by the motions of the heavens revolving around their axis according to their quality and kind. Here we see Plato borrow from the Pythagorean tradition to give wings to his flight of the soul. But it was Pythagoras who heard the music of the spheres and recorded it in his tetraktys.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/assets/images/tetractys-music.png&#34; alt=&#34;Tetraktys Music Theory&#34;&gt;
&lt;span class=&#34;marginnote&#34;&gt;&lt;em&gt;Music theory in the tetraktys&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;In the next lecture we will examine the mark of this theory of universal harmony on man’s life first through late antiquity then the renaissance and up to the modern age. We will see how it moves from astronomical theory to musical theory to number theory and astrophysics and socio-political theory explaining a rich and complex structure in terms of harmonic wave analysis. The greek legends and the Pythagorean tradition paint with broad strokes which creates a nutritive space for our mind to pull out harmonic tones.&lt;/p&gt;

&lt;p&gt;The pythagorean style of life offered simply what we struggle so complexly for today the theurgic state of embodied meaning. We want our lives to mean something but we are afraid to define what that meaning might be. Still there is no shortage of ways to cut the octave and we will see how tunings will come in and out of focus like players in an orchestra harmonizing one another with the thing in themselves.&lt;/p&gt;

&lt;p&gt;And thus much on mythic harmony.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>on remembering and forgetting</title>
            <link rel="alternate" href="https://words.computerdream.club/2016/10/23/on-remembering-and-forgetting/" type="text/html" />
            <id>https://words.computerdream.club/2016/10/23/on-remembering-and-forgetting/</id>
            <updated>2016-10-23T00:00:00Z</updated>

            <summary type="html">&lt;img src=&#34;/assets/images/kepler.gif&#34; alt=&#34;Kepler&amp;#39;s Harmony of the World&#34;&gt;
&lt;span class=&#34;marginnote&#34;&gt;
&lt;em&gt;Prelude&lt;/em&gt;, from Paul Hindemith&amp;rsquo;s &lt;em&gt;Die Harmonie der Welt (Harmony of the World)&lt;/em&gt;
&lt;/span&gt;</summary>
            <content type="html">&lt;p&gt;&lt;img src=&#34;/assets/images/kepler.gif&#34; alt=&#34;Kepler&amp;#39;s Harmony of the World&#34;&gt;
&lt;span class=&#34;marginnote&#34;&gt;
&lt;em&gt;Prelude&lt;/em&gt;, from Paul Hindemith&amp;rsquo;s &lt;em&gt;Die Harmonie der Welt (Harmony of the World)&lt;/em&gt;
&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;How can we see what cannot be seen? How can we know what we do not know?&lt;/p&gt;

&lt;p&gt;The Pythagoreans believed we could come into direct knowledge of the unknown through &lt;em&gt;the contemplation of the numbers through their figures and their weddings&lt;/em&gt;. They believed that everything was part of one great equation that the harmonies of number rang out eternal in ourselves and in the world around us.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Plato&lt;/strong&gt; no stranger to Pythagorean philosophy remarks in the &lt;strong&gt;&lt;em&gt;7th book of his Republic&lt;/em&gt;&lt;/strong&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;One may come to understand the nature of numbers … for facility in the energies of the soul itself and its conversion from generation to truth and essence.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In our lives things can be remembered and forgotten they can be lost and found given or taken away. We lose our keys the way we lose our minds constantly coming in and out of view like dancers in the dark.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/assets/images/lethe.jpg&#34; alt=&#34;Dante drinking from the river&#34;&gt;
&lt;span class=&#34;marginnote&#34;&gt;&lt;em&gt;Dante, drinking from the river&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Goethe&lt;/strong&gt;, in his &lt;strong&gt;&lt;em&gt;Faust&lt;/em&gt;&lt;/strong&gt; remembered well that we have a twin nature of spirit and substance:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Two souls alas! are housed within my breast&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Which struggle there for undivided reign:&lt;/em&gt;&lt;br&gt;
&lt;em&gt;One to the world with obstinate desire&lt;/em&gt;&lt;br&gt;
&lt;em&gt;And closely-cleaving organs still adheres:&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Above the mist the other doth aspire&lt;/em&gt;&lt;br&gt;
&lt;em&gt;With sacred vehemence to purer spheres.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We say that &lt;strong&gt;&lt;em&gt;an idea forms like an eidolon&lt;/em&gt;&lt;/strong&gt;, the specter and image of the thing in itself. So why are we so afraid of ghosts, the gusts, spirits wandering in the air? Like the greek &lt;a href=&#34;https://en.wiktionary.org/wiki/pneuma#Etymology&#34;&gt;pneuma&lt;/a&gt; or the fire of heaven. For those we make are our children born from ourselves, condensing like dew drops, like &lt;em&gt;Psyche drawn into Demeter’s somber night&lt;/em&gt;. Just as we are the images of our creators dim reflections of our holy ghost.&lt;/p&gt;

&lt;p&gt;And what of our knowledge and of ourselves? We remember and we forget.&lt;/p&gt;

&lt;p&gt;The poet &lt;strong&gt;Homer&lt;/strong&gt; recalled the way that divine bees spun our souls into flesh and bone drawing us from two rivers: &lt;strong&gt;&lt;em&gt;Lethe and Mnemosyne&lt;/em&gt;&lt;/strong&gt;, with one to the north and one to the south*; one for the dying and one for the deathless.
&lt;span class=&#34;marginnote&#34;&gt;
* &lt;em&gt;For the northern winds are cold and bring winter and dying, but the southern winds are warm and bring summer and life.&lt;/em&gt;
&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;&lt;em&gt;13th book of the Odyssey&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The busy bees within the urns secure&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Honey delicious and like nectar pure.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Perpetual waters through the grotto glide&lt;/em&gt;&lt;br&gt;
&lt;em&gt;A lofty gate unfolds on either side&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We translate mathematics as the art of learning but more properly it should be known as the &lt;strong&gt;art of &lt;em&gt;remembering&lt;/em&gt;&lt;/strong&gt;. For the square is there before we draw it in the sand and will be there long after it is blown to dust. &lt;strong&gt;The doctrine of anamnesis&lt;/strong&gt; so often recited by our most divine Plato is essential to Pythagorean thought. Socrates phrases the problem of meaning directly to Meno asking: &lt;em&gt;What is justice?&lt;/em&gt; This question like our most famous gorgon Medusa paralyzes those who entertain it.&lt;/p&gt;

&lt;p&gt;In his famous paradox Meno inquires how he can find something without being able to identify it. Were it right in front of him he’s afraid he could not see it. In response socrates turns to geometry, mathematics, and learning. He teaches one without formal education how to double the square using only basic means of doubling and halving. We can clearly see that we do not understand such things until we have learned them. We could not identify them if they were right in front of us but somehow we are granted vision through the act of learning.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/assets/images/coexter-meno.jpg&#34; alt=&#34;Coexter Figures extending Socrates&amp;#39; explanation&#34;&gt;&lt;/p&gt;

&lt;p&gt;Socrates&amp;#39; solution to Meno&amp;rsquo;s paradox is no accidental turn of dialogue but is the heart of the Pythagorean doctrine. The numbers are prior to generation and never pass through the cradle nor grave. No number was ever turned to be anything but itself and the numbers like the gods are never seen to die or to be corrupted.&lt;/p&gt;

&lt;p&gt;In the following series we will take an account of &lt;strong&gt;&lt;em&gt;The Fall of Arithmetic into Geometry&lt;/em&gt;&lt;/strong&gt; and will try to understand our own deeply complex relationship with numbers and mathematics.&lt;/p&gt;

&lt;p&gt;We will find that numbers can be used as tools for reasoning and for meditation. They can be used as objects of worship as characters in a story or as sigils and curses. Numbers can be used to trap us in prisons of our own thoughts or to turn our souls toward the things most divine.&lt;/p&gt;

&lt;p&gt;I want to leave you with this fair warning from the poet &lt;strong&gt;Alexander Pope&lt;/strong&gt; and his &lt;strong&gt;&lt;em&gt;Essay on Criticism&lt;/em&gt;&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/assets/images/hall-harmony-of-spheres.jpg&#34; alt=&#34;Harmony of the Spheres&#34;&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;A little learning is a dangerous thing&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Drink deep or taste not the Pierian spring:&lt;/em&gt;&lt;br&gt;
&lt;em&gt;There shallow draughts intoxicate the brain&lt;/em&gt;&lt;br&gt;
&lt;em&gt;And drinking largely sobers us again&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I hope that we can drink sufficiently deep and that these ideas flower like blossoms in our minds.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>chasing your tail</title>
            <link rel="alternate" href="https://words.computerdream.club/2014/05/18/chasing-your-tail/" type="text/html" />
            <id>https://words.computerdream.club/2014/05/18/chasing-your-tail/</id>
            <updated>2014-05-18T00:00:00Z</updated>

            <summary type="html">Who are you? What do you want?</summary>
            <content type="html">&lt;p&gt;Who are you? What do you want?&lt;/p&gt;

&lt;p&gt;I want to be healthier, stronger, funnier, smarter. I want to be respected and powerful and trusted and loved. I want to see my desires in a mirror looking back at me, a double wanting the same from a vision of myself. I want pure expression.&lt;/p&gt;

&lt;p&gt;Someone once told me that the best way to get what you want is to know what you want. The depth and simplicity of this struck me hard but I couldn&amp;rsquo;t answer to it. I tried things like &lt;em&gt;“I want to make the world a better place”&lt;/em&gt; or &lt;em&gt;“I want there to be less wasted effort”&lt;/em&gt;. But everything I tried fell flat against the weight of the thing itself.&lt;/p&gt;

&lt;p&gt;In our lives we can use our desires as a guiding light, helping us stay our course when we find ourselves in strange places. But our ship will never leave the port without a destination. So where are you going?&lt;/p&gt;

&lt;p&gt;The things that guide us in the dark also free us from the burden of answering these questions. We can close our eyes and follow the thread that pulls us. And still, the easiest way to get moving is to have somewhere to go.&lt;/p&gt;

&lt;p&gt;I wanted to be a computer programmer. So I became one. I poured 5 years of my life into trading my free time for experience. I stayed up too late obsessing over the tiniest details of my strange little programs.&lt;/p&gt;

&lt;p&gt;Then one day I realized I had arrived at the place I set out to be. I was writing code that major companies were trusting on their websites, spending my days paid by a megacorp to dive deeper down the rabbit hole of weird tech. And I still wasn&amp;rsquo;t where I wanted to be. When I had lived outside myself I saw programming as a land of milk &amp;amp; honey, a sort of magic for making the imagined real. And I lamented that the thing itself was not the picture in my mind. I had broke through to the other side and I still had pains and fears and was still a weak person afraid of my own shadow.&lt;/p&gt;

&lt;p&gt;And this is how life works.&lt;/p&gt;

&lt;p&gt;Now I see it like language, a game of chaining together fragmented elements in hope of creating some greater meaning.&lt;/p&gt;

&lt;p&gt;I am the same person now as I was before, just as you are the same person as you were before you learned to play the piano, before you heard your favorite song, before you became a singer or dancer. You are already the person you dream of being, separated only by a lack of action &amp;amp; understanding.&lt;/p&gt;

&lt;p&gt;We live our lives from the outside looking in, thinking &lt;em&gt;“Once I get there things will be different. People will finally see me for who I am, not as a pale imitation of myself”&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;You are who you are, you have real passions and fears, real beauty and talent, you are already there on the other side.&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>deploying meatspace</title>
            <link rel="alternate" href="https://words.computerdream.club/2013/03/04/deploying-meatspace/" type="text/html" />
            <id>https://words.computerdream.club/2013/03/04/deploying-meatspace/</id>
            <updated>2013-03-04T00:00:00Z</updated>

            <summary type="html">Have you ever wanted your own &lt;a href=&#34;https://github.com/meatspaces/meatspace-chat&#34;&gt;meatspace&lt;/a&gt;? For your school, work, or your sweater knitting crew? Now you can have one! For 5 dollars a month you can host your own meatspace &lt;a href=&#34;https://chat.meatspac.es&#34;&gt;chat&lt;/a&gt; room on the cloud and invite all your friends and chat chat chat all day and night, without any pesky &amp;lsquo;regular meats&amp;rsquo; getting in your way.</summary>
            <content type="html">&lt;p&gt;Have you ever wanted your own &lt;a href=&#34;https://github.com/meatspaces/meatspace-chat&#34;&gt;meatspace&lt;/a&gt;? For your school, work, or your sweater knitting crew? Now you can have one! For 5 dollars a month you can host your own meatspace &lt;a href=&#34;https://chat.meatspac.es&#34;&gt;chat&lt;/a&gt; room on the cloud and invite all your friends and chat chat chat all day and night, without any pesky &amp;lsquo;regular meats&amp;rsquo; getting in your way.&lt;/p&gt;

&lt;p&gt;If you make an account on &lt;a href=&#34;https://digitalocean.com&#34;&gt;Digital Ocean&lt;/a&gt;, the official host of meatspace, you can use the ansible &lt;a href=&#34;https://github.com/eggsby/meatspace-chat-ansible&#34;&gt;meatspace deployer&lt;/a&gt; to start up a virtual server with meatspace installed. Within minutes your instance will be running and you can invite all the best chatters.&lt;/p&gt;

&lt;p&gt;Before we get started deploying meatspace chat there are a few system requirements we will need. The automation is done with ansible so you&amp;rsquo;ll need that installed. Unfortunately this process this won&amp;rsquo;t work on windows, but should work most everywhere else. We also need to make sure we have the digital ocean python library.&lt;/p&gt;

&lt;p&gt;If you don&amp;rsquo;t have pip, check the &lt;a href=&#34;http://www.pip-installer.org/en/latest/installing.html&#34;&gt;installation page&lt;/a&gt; for help setting it up. This is different on every system but is probably something like &lt;code&gt;brew install pip&lt;/code&gt; or &lt;code&gt;apt-get install python-pip&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Next, we&amp;rsquo;ll need to make sure that we have a copy of the ansible project.&lt;/p&gt;

&lt;p&gt;Edit the contents of &lt;code&gt;.do&lt;/code&gt; to include your digital ocean credentials. Visit their &lt;a href=&#34;https://cloud.digitalocean.com/api_access&#34;&gt;api page&lt;/a&gt; if you don&amp;rsquo;t know these.&lt;/p&gt;

&lt;p&gt;Optionally we can edit the vars file located at &lt;code&gt;ansible/group_vars/all&lt;/code&gt; to configure the server with custom client api keys, domain name information, and any other desired configuration.&lt;/p&gt;

&lt;p&gt;To deploy the new meatspace droplet just run:&lt;/p&gt;

&lt;p&gt;This will create a $5/mo ubuntu server in digital ocean&amp;rsquo;s nyc datacenter and install meatspace chat onto it. The whole process takes about 10 minutes, so you might want to go get some coffee or reflect on your life in the meantime.&lt;/p&gt;

&lt;p&gt;If you ever want to update your meatspace instance to the latest version or configuration you can run:&lt;/p&gt;

&lt;p&gt;That&amp;rsquo;s it! Hopefully this makes meatspace-chat easier to setup for some people. Check out the &lt;a href=&#34;https://github.com/eggsby/meatspace-chat-ansible&#34;&gt;github project&lt;/a&gt; or ping me on &lt;a href=&#34;https://twitter.com/omniegg&#34;&gt;twitter&lt;/a&gt; for comments or support.&lt;/p&gt;

&lt;p&gt;Happy meats,&lt;br&gt;
– Thomas&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>chat on the web</title>
            <link rel="alternate" href="https://words.computerdream.club/2013/03/02/chat-on-the-web/" type="text/html" />
            <id>https://words.computerdream.club/2013/03/02/chat-on-the-web/</id>
            <updated>2013-03-02T00:00:00Z</updated>

            <summary type="html">I wanted to share a chatroom I&amp;rsquo;ve been hanging out on, and some ideas that came floating out of it.</summary>
            <content type="html">&lt;p&gt;I wanted to share a chatroom I&amp;rsquo;ve been hanging out on, and some ideas that came floating out of it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Communication is &lt;em&gt;hard&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Communication is &lt;strong&gt;easy&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Which is true, and why? This simple paradox dominates so much of our social lives, and yet a website for gif chat has put the whole thing in a new light.&lt;/p&gt;

&lt;p&gt;Communication is hard because often we misinterpret the meaning. It is hard because our words rarely line up with the things they are supposed to represent. It is hard because we are afraid of the unintentional impact that our communications can have.&lt;/p&gt;

&lt;p&gt;Communication is easy because we are social creatures and it comes to us involuntarily. Simple things like tension in the neck can communicate discomfort, or a smile or grimace in a particular context. A simple wink or sigh can betray a depth of knowledge.&lt;/p&gt;

&lt;p&gt;We have always been mystified by communication, with great minds dedicating their lives in an attempt to bring back something valuable to the community, something to share with the rest of us. Poets, journalists, artists, musicians, and authors dedicate their lives in order to convey insight. To plant a seed so that it may grow. To go out into the areas of thought not yet before traveled and to bring something useful back to the commonwealth.&lt;/p&gt;

&lt;p&gt;The Greek God Hermes was the archetype of this idea; embodying the translation between the mundane and divine. The Messenger of the Gods was the sigil of unification between the arts &amp;amp; sciences, using knowledge transfer as the medium, translating meaning from one system into another.&lt;/p&gt;

&lt;p&gt;So what does a gif chatroom have to do with communication, poetry, &amp;amp; greek gods? Social revelations are primarily those of synchronicity and will, of looking at the chaos of missed connections and obfuscated meaning and shaping it into something useful, just in time.&lt;/p&gt;

&lt;p&gt;Meatspace has this in spades, itself being a self regulating strange attractor for artists, hackers, geeks, weirdos, subgenius, discordians, musicians, makers, office workers, autodidacts, trolls, machinists, psychologists, professors, wives, parents, brothers, sisters, engineers, &amp;amp; students. And these people communicate with eachother. They chat!&lt;/p&gt;

&lt;p&gt;In meatspac we make handcrafted artisinal gifs. We make gifs you can take home to your family. We do take them home to our family. The community of meatspace is full of people who looked into the technical landscape at the current forms of communication and wanted something more meaningful.&lt;/p&gt;

&lt;p&gt;gifchat may seem counter-intuitive in the world of omni-present video conferencing, but there is something special about a short, looping snapshot of an emote accompanied by a small snippet of text. How can a simple gif and caption so well capture the essence of expression?&lt;/p&gt;

&lt;p&gt;The more complete the emulation of face to face human interaction the more directly we are confronted with The Hard Parts. Did I phrase that right? What will you think of me if I phrase it wrong? Will I have an opportunity to make up for it? Don&amp;rsquo;t worry, just let go.&lt;/p&gt;

&lt;p&gt;With meatspac you can take advantage of the subtle emotional platform that so much of our communication is built upon without any of the pressures of constant upkeep of social appearances thrusted upon us by direct face to face interactions.&lt;/p&gt;

&lt;p&gt;On meatspac hit and run communication is common, popping on while at a restaurant, or when you just wake up, go to bed, or have some time in-between work meetings.&lt;/p&gt;

&lt;p&gt;Meatspace is a place of sharing, a place of learning, for support, and humor. We have gifs to cry on and gifs to cheer us back up again.&lt;/p&gt;

&lt;p&gt;Meat!&lt;/p&gt;

&lt;p&gt;On the Internet!&lt;/p&gt;

&lt;p&gt;Words cannot explain, come over to &lt;a href=&#34;https://chat.meatspac.es&#34;&gt;chat.meatspac.es&lt;/a&gt; and see for yourself!&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>three little birds</title>
            <link rel="alternate" href="https://words.computerdream.club/2013/01/03/Three-little-birds/" type="text/html" />
            <id>https://words.computerdream.club/2013/01/03/Three-little-birds/</id>
            <updated>2013-01-03T00:00:00Z</updated>

            <summary type="html">Simple functions can be very surprising. With functional programming on the rise more and more of my time has been dedicated to understanding functions. In doing so I&amp;rsquo;ve discovered their deep and rich history in practical mathematics, in particular &lt;a href=&#34;http://en.wikipedia.org/wiki/Combinatory_logic&#34;&gt;Combinatory Logic&lt;/a&gt; and &lt;a href=&#34;http://en.wikipedia.org/wiki/Lambda_calculus&#34;&gt;Lambda Calculus&lt;/a&gt;. Understanding the contributions from these fields can help immensely when trying to reason about complex function chains, which are encountered more and more often in modern programing. </summary>
            <content type="html">&lt;p&gt;Simple functions can be very surprising. With functional programming on the rise more and more of my time has been dedicated to understanding functions. In doing so I&amp;rsquo;ve discovered their deep and rich history in practical mathematics, in particular &lt;a href=&#34;http://en.wikipedia.org/wiki/Combinatory_logic&#34;&gt;Combinatory Logic&lt;/a&gt; and &lt;a href=&#34;http://en.wikipedia.org/wiki/Lambda_calculus&#34;&gt;Lambda Calculus&lt;/a&gt;. Understanding the contributions from these fields can help immensely when trying to reason about complex function chains, which are encountered more and more often in modern programing. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Lambda calculus is the use of anonymous function application for calculation&lt;/em&gt; and is defined in terms of simple substitution and conversion rules.
For an excellent introduction to the lambda calculus I recommend Bret Victor&amp;rsquo;s &lt;a href=&#34;http://worrydream.com/AlligatorEggs/&#34;&gt;Alligator Eggs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Combinatory logic is the use of functions to combine functions.&lt;/em&gt; A combinator is a function whose input are functions and whose body is defined only in terms of function application. This is another way of saying that a combinator cannot introduct anything new, it can only combine.
For an introduction to Combinatory Logic you can do no better than Smullyan&amp;rsquo;s &lt;a href=&#34;http://en.wikipedia.org/wiki/To_Mock_a_Mockingbird&#34;&gt;To Mock a Mockingbird&lt;/a&gt; or any of the various &lt;a href=&#34;https://leanpub.com/u/raganwald&#34;&gt;books&lt;/a&gt; or &lt;a href=&#34;http://braythwayt.com/&#34;&gt;posts&lt;/a&gt; by &lt;a href=&#34;https://twitter.com/raganwald&#34;&gt;@raganwald&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;While all of this might sound complex, when viewed in the context of our everyday programming it is rather simple, though the implications are profound. &lt;/p&gt;

&lt;p&gt;In &lt;em&gt;To Mock a Mockingbird&lt;/em&gt;, Smullyan refers to the functions in combinatory logic as birds, and those of us whom wish to understand them as curious birdwatchers. (As we will see, the birds are quite curious themselves). The premise of the metaphor surrounds a birdwatcher who makes bird calls out to some bird in a forest, which responds back with a bird noise of its own. With some imagination, we can use this to represent function application.&lt;/p&gt;

&lt;p&gt;There are a few important but subtle points around this metaphor that must be understood to see why it represents combinatory logic in particular (as opposed to general function application). &lt;/p&gt;

&lt;p&gt;The first is that birds only speak in the language of the birds, so if you call out to them in some foreign tongue they may have unusual responses! If a bird is a combinator and a combinator is a higher order function (a function that operates on functions), then this implies that we should generally only pass functions to our birds (I&amp;rsquo;ll be using the terms interchangeably). 
Another key point lies hidden in the simplicity of the metaphor. If we make a bird noise and it responds with a noise in turn, assuming we made the bird call properly what the other bird hears would be indistinguishable from the bird we are imitating. If the response is a bird noise as well, then it is the same sort of thing as we supplied, a bird! If we can make a given bird noise, we have the &lt;em&gt;essence&lt;/em&gt; of the thing, a first class reference. &lt;em&gt;There is no distinction between a birds name and a birds sound&lt;/em&gt;. To understand what this means we can look at a notion called &lt;a href=&#34;http://en.wikipedia.org/wiki/Referential_transparency_%28computer_science%29&#34;&gt;referential transparency&lt;/a&gt; which says that any time a name is used it can be swapped out with the value of the thing it names and maintain the same meaning. In the forest, if you can respond with the sound a bird makes you have may as well be the bird yourself. In summary, &lt;em&gt;birds are those functions whose parameters are functions, who are defined in terms of function application, and whose resulting application yields a function&lt;/em&gt;!&lt;/p&gt;

&lt;p&gt;I think this metaphor is marvelous for functional programming since many higher level abstractions don&amp;rsquo;t have suitable names, and remember, as all good wizards know: &lt;a href=&#34;http://en.wikipedia.org/wiki/True_name&#34;&gt;to name a thing is to have power over it.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This post introduces a number of functional programming techniques in order to provide some context for combinators. Uncle Bob has said that functional programming is &lt;a href=&#34;http://pragprog.com/magazines/2013-01/functional-programming-basics&#34;&gt;programming without assignments&lt;/a&gt;. Whether or not this is the case it does serve to introduce a curious problem. Some concepts like recursion rely on assignment (what Bob calls the quintessential side-effect). How can we achieve truly functional, side-effect free recursion? Interestingly, the answer is within Smullyan&amp;rsquo;s forest.&lt;/p&gt;

&lt;p&gt;As we enter the lush forest the first bird we see is one which many are too quick to judge. It&amp;rsquo;s called the &lt;strong&gt;idiot bird&lt;/strong&gt; or the &lt;a href=&#34;http://en.wikipedia.org/wiki/Identity_function&#34;&gt;identity bird&lt;/a&gt; and when you make a bird call to it the idiot responds with the very same noise. Amazingly, this bird can make &lt;em&gt;any&lt;/em&gt; possible sound! Can you? In javascript it would look like this:&lt;/p&gt;

&lt;p&gt;This bird seems useless, a function that takes a parameter only to spit it back at us! What an idiot! Some have speculated that the idiot is actually deeply enamoured with other birds and so only mimics them out of appreciation.&lt;/p&gt;

&lt;p&gt;As we continue our stroll, the next bird we encounter is the &lt;strong&gt;mockingbird&lt;/strong&gt;. The mockingbird is a mystical bird which has the interesting property of duplicating its input (it takes one x in, but somehow has two copies of x in its body). While this is commonplace in programming it is not so common in the world of combinators. Because of this ones that do are in a special class called &lt;em&gt;duplicative combinators&lt;/em&gt;. If you call some bird x to the mockingbird it will respond as if the bird x had called out to itself (or what is the same, the function x applied to itself). In javascript:&lt;/p&gt;

&lt;p&gt;What use is this bird?
It&amp;rsquo;s easy to find useless things we can do with it, for instance if you make the noise the idiot bird makes to the mockingbird it will call out the idiot bird back to you. That seems like the behavior of the idiot bird itself, however if you call the mockingbird to the mockingbird it will never stop trying to figure out what it should say about itself! We can demonstrate this by reducing:&lt;/p&gt;

&lt;p&gt;Even with this, it&amp;rsquo;s hard to conceptualize a clear use case for this peculiar bird. The mockingbird lies at the heart of combinatory logic. &lt;em&gt;Sometimes called the &lt;em&gt;U combinator&lt;/em&gt;, the mockingbird is the primary tool for self application&lt;/em&gt;, which can be used to simulate recursion. Without recursion simple languages like Lambda or Combinator Calculus are not expressive enough for universal computation. Lucky they have the mockingbird!&lt;/p&gt;

&lt;p&gt;If it suits our fancy we can even engineer our own mechanical bird to calculate a factorial. It&amp;rsquo;s not quite a real bird (a classical combinator) since it does more than simply combine its input, but it&amp;rsquo;s close enough for our purposes. Since we&amp;rsquo;ve heard the rumour that the mockingbird enables anonymous recursion, we might try to build something that proves this. Many birdwatchers spoke to this magical bird chiefly for this purpose. Our bird doesn&amp;rsquo;t have to follow all the rules of classical combinators but it satisfies the chief property: being a function which takes in a function and returns a function.&lt;/p&gt;

&lt;p&gt;Initially we call the strange factorial out to the mockingbird, or what is the same, strangeFact is applied to itself, which returns the bird from line 2. If we inspect the mechanics of our bird, we can see that &lt;code&gt;fact&lt;/code&gt; bound to &lt;code&gt;strangeFact&lt;/code&gt;, since strangeFact returns the factorial calculator, it only needs to ask should it ever require a copy. (We ask for a copy at line 8 initially, and line 4 if needed subsequently) I encourage you to take the time to understand what is happening above; while it may seem trivial it is the core mechanism of anonymous recursion. Consider the following:&lt;/p&gt;

&lt;p&gt;If the mockingbird can give us a version of our bird that knows about itself, when we define our mechanical bird in terms of the mockingbird we also gain the ability to create functions with references to themselves. &lt;/p&gt;

&lt;p&gt;This works but is very&amp;hellip; strange. In modern javascript, we could write less code with fewer dependencies and wind up with something that is easier to use, simpler to reason about, and more performant to boot!&lt;/p&gt;

&lt;p&gt;Observing this, we can now take great comfort in knowing that we no longer need to use anonymous recursion. While the use of the U combinator style recursion may seem outdated in modern programming parlance its impact on computer science cannot be overstated. Combinator and Lambda Calculus are much simpler notations than javascript which owes its higher level abstractions to the work of those who spoke to birds like these long before us.&lt;/p&gt;

&lt;p&gt;As a birdwatcher who hopes to fashion birds of our own using the mockingbird to simulate recursion is awkward at best. We have to know about the mockingbird inside of our function and manually handle the self application at each step along the way, what&amp;rsquo;s more our bird must also be returned from the mockingbird. What we&amp;rsquo;d like is a way to be flexible enough in our bird creation to not have to worry about this technical detail and be free to focus on only the problem itself. Perhaps there is another bird who can help us achieve what we want.&lt;/p&gt;

&lt;p&gt;The next bird we encounter, the most immediately practical of these strange birds is the &lt;strong&gt;bluebird&lt;/strong&gt;. If you call out some bird x to the bluebird, it&amp;rsquo;ll call back to you with an entirely new bird which knows all about the bird x. This means it gives you back a new function with x in the environment&amp;rsquo;s scope. This new bird has the curious property that if you call out some bird y to it, it will return some even newer bird that knows about the birds x and y. And now we have both x and y in our functions environment. If you give this final bird some bird z, the bluebirds work will be done and it will return what results from calling out bird z to bird y, and calling the resulting bird out to the bird x. This is what is referred to as a closure, because each successive function closes over the value of one parameter.
Having trouble picturing it? &lt;/p&gt;

&lt;p&gt;The above is a special &lt;a href=&#34;http://en.wikipedia.org/wiki/Currying&#34;&gt;curried&lt;/a&gt; way to say:&lt;/p&gt;

&lt;p&gt;The difference is that the first definition allows you to define a bluebird with only an x or only an x and y, rather than only with x y and z. This technique is called &lt;em&gt;partial application&lt;/em&gt;. While the first of these functions all take in a single value, because it is their grouping that we are interested in we can say that bluebird simply takes three inputs (xyz). &lt;/p&gt;

&lt;p&gt;The bluebird is also known in many circles as &lt;strong&gt;compose&lt;/strong&gt; and can be used to thread some value through arbitrary function sequences. Traditionally in combinatory logic the threaded value is a function itself but as we will see it doesn&amp;rsquo;t have to be.
&lt;em&gt;The core of the bluebirds functionality is that it defers the application of x in favor of first applying y.&lt;/em&gt;
Here is an example of using the bluebird to construct increasingly complex functions.&lt;/p&gt;

&lt;p&gt;Here we have times being a closure that returns a fn with the value of n closed over. With &lt;code&gt;times6&lt;/code&gt; being a bluebird, we can reduce the above invocation by following the rule of &lt;code&gt;Bxyz = (x·y)z = x(yz)&lt;/code&gt; where &lt;strong&gt;x&lt;/strong&gt; is &lt;code&gt;invert&lt;/code&gt;, &lt;strong&gt;y&lt;/strong&gt; is &lt;code&gt;times6&lt;/code&gt; and &lt;strong&gt;z&lt;/strong&gt; is &lt;code&gt;-6&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The bluebird allows for some remarkably beautiful chaining, and we&amp;rsquo;ve only begun to scratch the surface with this example. &lt;/p&gt;

&lt;p&gt;Continuing along, the next pair of birds we meet are the strangest yet. They seem to have much more in common with the mockingbird than the bluebird though in actuality they are simply a hybrid of the two. These birds are both dear friends of the mockingbird and in fact are defined in terms of it!
The first of the pair is called the &lt;strong&gt;lark&lt;/strong&gt;. When you call out some birds x and y to the lark, it will respond by calling the sound of y out to the mockingbird, then taking the response and calling it out to the bird x, or what is the same, applying y to the mockingbird then applying that resulting bird to x.&lt;/p&gt;

&lt;p&gt;Given the lark we can show that the lark given identity is the same as the mockingbird, &lt;code&gt;LI = M&lt;/code&gt; and the lark given the lark is something like two strange mockingbirds: &lt;code&gt;LLxy = Mx(My)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The lark is a way to compose some function with self application.&lt;/em&gt;
Given this and our knowledge of bluebirds, we could also define the lark as:&lt;/p&gt;

&lt;p&gt;Next is the &lt;strong&gt;meadowlark&lt;/strong&gt;. When you call out some x and y to the meadowlark, it will respond by calling out y to the mockingbird of x&lt;/p&gt;

&lt;p&gt;Note: This bird was unnecessary in combinator calculus because it can also be written as Mxy. 
So how can we use the meadowlark?&lt;/p&gt;

&lt;p&gt;Given the meadowlark we can show that &lt;code&gt;MₑI = I&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;Interestingly &lt;em&gt;the meadowlark behaves much like the mockingbird&lt;/em&gt; duplicating for all time. In fact, &lt;em&gt;this bird differs from mockingbird only in that it ensures that there is a y.&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;While interesting, both larks seem to be devoid of any practical use. It&amp;rsquo;s as if they took the good parts about the bluebird (generalized function composition), and tangled them up with the notion of the mockingbird. What we will see however, is that these birds are the primary methods of composing self application. (x(yy) or xxy). Why would we want to compose self application? If self application can be used to simulate recursion, then we can use higher order functions to &lt;em&gt;compose our functions with the notion of recursion&lt;/em&gt;! Perhaps the there is a bird who can do this for us somewhere deeper in the combinator forest.&lt;/p&gt;

&lt;p&gt;There are special birds in the combinator forest called &lt;strong&gt;Sage birds&lt;/strong&gt;. Sage birds are particularly useful &lt;em&gt;for finding the fixed points of other birds&lt;/em&gt;, where a fixed point is the element when called out to some bird will results in the element itself. That is, &lt;code&gt;f(x) = x&lt;/code&gt;. Everything is a fixed point of identity, but finding the fixed points of other birds is much harder to reason about. So why is it useful to have a bird to help you find these invariant points? Well, having a fixed point means you have found the limit of the function, also known as the convergence. In recursive functions, the convergence is of particular importance since it is often the only way to terminate evaluation (those functions who never terminate are said to have diverged).  Can you see why locating a convergence can be useful if we want to represent recursion abstractly? Consider how &lt;code&gt;strangeFact&lt;/code&gt; uses the mockingbird to advance computation by a step. Can you see how we can use the lark and meadowlark to abstract these steps?&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Haskell_Curry&#34;&gt;Haskell Curry&lt;/a&gt; saw this clearly and created the most popular of all sage birds, dubbed the &lt;a href=&#34;http://en.wikipedia.org/wiki/Fixed-point_combinator#Y_combinator&#34;&gt;Y combinator&lt;/a&gt;. Remember that phrase curried from earlier? That particular style of partial application, where one element is applied at a time, as well as the &lt;a href=&#34;http://www.haskell.org/haskellwiki/Haskell&#34;&gt;Haskell&lt;/a&gt; programming language both get their namesake from the very same! 
In the lambda calculus it would look like this: &lt;/p&gt;

&lt;p&gt;If you look carefully you might notice that there are some familiar friends here, in particular the mockingbird &lt;code&gt;(x)(x)&lt;/code&gt; and the lark &lt;code&gt;x(yy)&lt;/code&gt; in the inner form resulting in &lt;code&gt;(x(yy))(x(yy))&lt;/code&gt;. Can you find any other birds here? &lt;/p&gt;

&lt;p&gt;First, here&amp;rsquo;s what it would look if we and translated the lambda terms literally:&lt;/p&gt;

&lt;p&gt;This is a bit dizzying, but we can simplify it by recognizing that we are invoking a function with itself. This is the same thing as passing the function to the mockingbird.&lt;/p&gt;

&lt;p&gt;And by realizing that the inner function is applying the mockingbird of x to some f, or what is the same, that the inner function is the lark of f.&lt;/p&gt;

&lt;p&gt;And by realizing the above is simply a means of composing f (threading it through lark and then mockingbird):&lt;/p&gt;

&lt;p&gt;This is fantastic! We&amp;rsquo;ve shown that &lt;em&gt;the famous Y combinator can be represented as the combination of three little birds&lt;/em&gt;!
The only problem is that the above code doesn&amp;rsquo;t actually work.&lt;/p&gt;

&lt;p&gt;While we can show that it is mathematically sound, with &lt;code&gt;Θ&lt;/code&gt; as the sage bird:&lt;/p&gt;

&lt;p&gt;The last two reductions can be flipped and viewed as &lt;code&gt;x(Lx(Lx)) = Lx(Lx)&lt;/code&gt;, or &lt;code&gt;x(y) = y&lt;/code&gt; where &lt;code&gt;y = Lx(Lx)&lt;/code&gt; which shows that we have found the fixed point! The problem is that in modern programming environments, we can expand &lt;code&gt;Lx(Lx)&lt;/code&gt; infinitely. Languages like javascript do.&lt;/p&gt;

&lt;p&gt;This successful reduction strategy above is referred to as &amp;lsquo;normal order&amp;rsquo; (call by name), which means we substitute the parameters before evaluating them, where the one expanding forever is called &amp;lsquo;applicative order&amp;rsquo; (call by value) which instead reduces its parameters into values before expanding a functions body. In call by name systems we can simply call this thing by the name &lt;code&gt;Lx(Lx)&lt;/code&gt;, but in call by value languages (like javascript and most popular languages) we get lost when asking for the value, similar to a mockingbird attempting to mock itself. Maybe we can find a different bird that works in call by value systems.&lt;/p&gt;

&lt;p&gt;Seeing the shortcomings of the Y combinator, we can see that if we can somehow defer evaluation of the lark we can avoid blowing up the stack, and thus make a sage bird that works with applicative order. So rather than invoking the lark at &lt;code&gt;sage(x)&lt;/code&gt; we can defer this until we have some z to call it with. This means the z of bluebird should be the actual argument to the function &lt;em&gt;returned&lt;/em&gt; by the this new combinator, not the function provided to it. This is a subtle note, but an important one. It means we will have to return a bird which returns partially applied bluebird rather than returning a partially applied bluebird ourselves.&lt;/p&gt;

&lt;p&gt;The above combinator is known as the &lt;strong&gt;Z Combinator&lt;/strong&gt;, though &lt;em&gt;sometimes it is called the Y combinator since it reduces to Y&lt;/em&gt;. (Remember the meadowlark ensures the presence of some y). While the Z combinator is a bit more cumbersome and harder to reason about, it properly combines the pieces to work with a call by value system by using the meadowlark to manually defer evaluation. I encourage you to write down the reductions yourself in order to see what&amp;rsquo;s going on, it&amp;rsquo;s quite interesting!&lt;/p&gt;

&lt;p&gt;Having seen this new bird, let&amp;rsquo;s revisit our strange factorial.&lt;/p&gt;

&lt;p&gt;If we know we are working with a fixed point combinator we can forget the mockingbird from our previous version and focus our attention on the inner function alone (the actual factorial function), all thanks to higher order abstractions. Amazingly, our version of the factorial takes in the idea of what it means to recur! Let&amp;rsquo;s see it in action:&lt;/p&gt;

&lt;p&gt;And without assignment:&lt;/p&gt;

&lt;p&gt;The Z combinator or &amp;ldquo;the mockingbird of the bluebird of f and the meadowlark&amp;rdquo; can calculate all the way down to the fixed point of f by &lt;em&gt;trampolining a functions invocation with its definition.&lt;/em&gt;. Unlike our U combinator, the Y and Z combinators also takes care of self application so we don&amp;rsquo;t have to worry about using the mockingbird to rebind our name inside our function. The above birds are achingly clever, and yet built of out relatively simple parts! &lt;/p&gt;

&lt;p&gt;What a fantastic example of the power of combinators. Given such a massive problem as &amp;ldquo;how can we support recursion without assignment?&amp;rdquo; we&amp;rsquo;ve seen how combinators can be used not only to simplify the problem itself, but also serve to provide us with a tool for understanding larger concepts by breaking them down into simple ideas. 
I hope I&amp;rsquo;ve helped elucidate some small corner of the wonderful world of combinators for you, as others have done for me. I&amp;rsquo;ve heard it said that &lt;em&gt;if classes are the nouns of programming and functions are the verbs then combinators are the adverbs.&lt;/em&gt;
We&amp;rsquo;ve demonstrated how we can use these combinators to factor out common patterns from our functions or as building blocks in and of themselves. Even something as opaque as the infamous Y combinator can be reduced in terms of it&amp;rsquo;s simpler components.&lt;/p&gt;

&lt;p&gt;It may surprise you to learn that there are an infinite number of sage birds to be found by combining simple combinators, can you find any others?&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>porting java to clojure</title>
            <link rel="alternate" href="https://words.computerdream.club/2012/08/10/Porting-java-to-clojure/" type="text/html" />
            <id>https://words.computerdream.club/2012/08/10/Porting-java-to-clojure/</id>
            <updated>2012-08-10T00:00:00Z</updated>

            <summary type="html">Hi everyone!</summary>
            <content type="html">&lt;p&gt;Hi everyone!&lt;/p&gt;

&lt;p&gt;I wanted to share some interesting things I found while porting a hashing function from java over to clojure.  I needed to translate some unique identifiers from one format over to a different, universal, and shared format for some quick reports I was trying to pull; luckily this had already been done and was available as a simple standalone class.  I could have (and arguably should have) just used the class file itself and not written a lick of code, but I like understanding how things worked and I figured porting it into native clojure would be a good chance to both understand it as well as learn a bit about clojure in the process!&lt;/p&gt;

&lt;p&gt;So heres the original java class:&lt;/p&gt;

&lt;p&gt;It&amp;rsquo;s pretty simple, first it creates some number boundaries, one the upper bounds of an unsigned 64 int represented as hex and secondly the upper limit of the universal identifiers.  It also specifies a prime number in order to get a broader distribution of keys per character. I know this isn&amp;rsquo;t sha1, but it&amp;rsquo;s what we had currently in use, and so it was what I was going to replicate.  My interest was porting it, but first I had to grok it.&lt;/p&gt;

&lt;p&gt;The main work happens in the &amp;lsquo;hash&amp;rsquo; method, which returns a long given a string.  It generates a hash seed as an initial value and then proceeds to multiply this value by the prime declared earlier; it then finds the modulus between that new hash value and the u64-max-int (ensuring it is within bounds), followed by a bitwise exclusive or between the accumulated value and the value of the current character; repeating this process for each character in the given string.  Finally it takes this newly built checksum and ensures that it&amp;rsquo;s within the bounds of the max universal ids, returning as a long. Whew!&lt;/p&gt;

&lt;p&gt;This may or may not be the best way to create a hash within the limits of the universal id boundaries, but it seems to have worked so far. The syntax and notation above should hopefully be familiar to anyone who has used a c-style language.&lt;/p&gt;

&lt;p&gt;So let&amp;rsquo;s take a look at the clojure (and lispy) equivalent.&lt;/p&gt;

&lt;p&gt;This probably looks very strange at first, but I think it&amp;rsquo;s a uniquely elegant way to represent transformations over data (in our particular case, the transformation is the one that turns a string id into a universal integer id).  If you are new to clojure &lt;code&gt;(def x 1)&lt;/code&gt; is the same as &lt;code&gt;x = 1&lt;/code&gt; and &lt;code&gt;(defn my-fn [args] (use args))&lt;/code&gt; can be read as &lt;code&gt;function my-fn (args) {use(args);&lt;/code&gt;  The first four lines equate to the static final fields in the java class, with the exception of the seed being extracted out of the hashing method (since it is unchanging).  &lt;/p&gt;

&lt;p&gt;The other caveat is the &lt;code&gt;-&amp;gt;&lt;/code&gt; operator.  This function is actually a macro, which says &lt;em&gt;take the value of the first parameter provided to me, and slip it in as the first parameter to the following statement, then take the result of that statement and slide it in as the first parameter to the following statement&amp;hellip;&lt;/em&gt; etc.&lt;/p&gt;

&lt;p&gt;Above I represent where the prior value would be inserted as two commas (which the clojure reader interperates as whitespace).  An example for this would be a transformation where &lt;code&gt;&amp;quot;hello   &amp;quot;.toUpperCase().strip();&lt;/code&gt; is translated as &lt;code&gt;(-&amp;gt; &amp;quot;hello   &amp;quot; (.toUpperCase) (.strip))&lt;/code&gt;.  This is called the &lt;code&gt;thrush operator&lt;/code&gt; or the &lt;code&gt;thread-first macro&lt;/code&gt; and it is unique to lisp.&lt;/p&gt;

&lt;p&gt;Following along, on line 7 I pull out what was previously an inline parameter in our java class (a simple call to &lt;code&gt;BigInteger.valueOf(charArray[i])&lt;/code&gt;), generalizing it into a function which can generate a hashcode for any clojure object. &lt;/p&gt;

&lt;p&gt;I think the next section was a particular revelation for me, wherein I realized that &lt;strong&gt;every for-each body is intended for one of three things&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;to derive some single value from a series &amp;ndash; &lt;code&gt;reduce&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;to produce an entirely new collection of values &amp;ndash; &lt;code&gt;map&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;to perform a series of sequential side effects. &amp;ndash; &lt;code&gt;doseq&lt;/code&gt;, &lt;code&gt;forEach&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It&amp;rsquo;s only recently that I&amp;rsquo;m realizing I don&amp;rsquo;t need that last one to achieve the former. Reading over the body of the for-each loop, it was obvious that a new value was gradually being built up by iterating over the character array. I know that the reduce function is intended for just this purpose, so I sought out to see how I might write a reducing function that implemented the same functionality as the for-each body.&lt;/p&gt;

&lt;p&gt;It was surpisingly simple once I saw the pattern, and the thrushing operator made the transformation so incredibly readable!
&lt;em&gt;Take the provided checksum value, multiply it by our prime, find the modulus of the u64 max, and perform the xor against the hash of the hashable.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Wow! This is exactly how we would describe this in english! The instance method invocation style offered by clojure allows for some really astonishing composition and generalization. I also believe that &lt;strong&gt;naming things forces you to think about their proper abstraction&lt;/strong&gt;.  Finally, we have our function to actually convert some collection (like a collection of characters, but really &lt;em&gt;any collection&lt;/em&gt;) into a checksum.  We get the checksum value by using our reducing function, providing it our seed as an init value and finally we ensure this number is within the universal id boundaries via mod and return it as a long.&lt;/p&gt;

&lt;p&gt;I&amp;rsquo;m continually impressed by not only how enjoyable clojure is to work with, but how powerful and general the abstractions of functional programming are. So, do you prefer one of the above styles to the other? Why? I think it&amp;rsquo;s pretty obvious which camp I am in. :D&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>pattern matching &amp; clojure</title>
            <link rel="alternate" href="https://words.computerdream.club/2012/08/03/Simple-pattern-matching/" type="text/html" />
            <id>https://words.computerdream.club/2012/08/03/Simple-pattern-matching/</id>
            <updated>2012-08-03T00:00:00Z</updated>

            <summary type="html">Lately, I&amp;rsquo;ve been fascinated by &lt;a href=&#34;http://clojure.org&#34;&gt;clojure&lt;/a&gt;, a dynamically typed lisp hosted on the JVM. Clojure is known for its immutable data types and list processing capabilities, but as it turns out it&amp;rsquo;s really good at representing abstract ideas, too.  A while back I came upon this &lt;a href=&#34;https://gist.github.com/2594296&#34;&gt;gist&lt;/a&gt; by &lt;a href=&#34;http://dosync.posterous.com&#34;&gt;david nolen&lt;/a&gt; (who happens to have authored quite a number of awesome gists), and was reminded of it today while talking about different ways to structure some validation methods.</summary>
            <content type="html">&lt;p&gt;Lately, I&amp;rsquo;ve been fascinated by &lt;a href=&#34;http://clojure.org&#34;&gt;clojure&lt;/a&gt;, a dynamically typed lisp hosted on the JVM. Clojure is known for its immutable data types and list processing capabilities, but as it turns out it&amp;rsquo;s really good at representing abstract ideas, too.  A while back I came upon this &lt;a href=&#34;https://gist.github.com/2594296&#34;&gt;gist&lt;/a&gt; by &lt;a href=&#34;http://dosync.posterous.com&#34;&gt;david nolen&lt;/a&gt; (who happens to have authored quite a number of awesome gists), and was reminded of it today while talking about different ways to structure some validation methods.&lt;/p&gt;

&lt;p&gt;The gist shows user/pass validation using pattern matching in two languages, clojure and javascript. But more than that, it shows how sometimes all you need are simple case expressions. To explain it however, I think we may need a small primer in clojure.&lt;/p&gt;

&lt;p&gt;If you don&amp;rsquo;t know clojure, or lisp, the syntax is pretty simple.  Everything is a expression (called s-expression or s-exp), expressions are defined by parentheses, and the first thing in a expression is a function where the rest are the parameters to be supplied to that function.  &lt;/p&gt;

&lt;p&gt;So instead of saying &lt;code&gt;printf(&amp;quot;Hello, %s!&amp;quot;, &amp;quot;world&amp;quot;)&lt;/code&gt;
you would say &lt;code&gt;(printf &amp;quot;Hello, %s!&amp;quot; &amp;quot;world&amp;quot;)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Since everything in clojure is just a function with parameters if you want to describe something you must realize it, or evaluate the code.  A expression like &lt;code&gt;(+ 1 (+ 3 4))&lt;/code&gt; follows relatively simply; &lt;em&gt;The function + is called with 1 and some form. That form is the value of the + function called with 3 and 4.&lt;/em&gt; When + finally returns the value of 7, the outer function can continue and realize its value of 8.&lt;/p&gt;

&lt;p&gt;Consider the following:&lt;/p&gt;

&lt;p&gt;How could we even explain this simple bit of code with our previous set of syntax rules? It&amp;rsquo;s impossible! This is because the previous problem of summing 1, 3, and 4 could be described as a pure function (which is a special way to say that the function is referentially transparent, or that given the same inputs it will always return the same outputs), while our javascript example involves simple mutable state. But do we need this state? When is it time to come and clean up the vars x and y? Are we done using them yet? Will we ever be? &lt;/p&gt;

&lt;p&gt;We could represent the previous snippet in clojure like this:&lt;/p&gt;

&lt;p&gt;This may look odd if you&amp;rsquo;ve never used a lisp before, but let&amp;rsquo;s try to apply our previous set of syntax rules to this single expression.
The first part of the expression is the function &lt;code&gt;let&lt;/code&gt;, invoked with 3 parameters; the value of some vector, and two &lt;code&gt;s-exp&lt;/code&gt;s (one is the println fn, and another is the let fn). These forms are all at the same level, so we can continue by taking the values from them sequentially.  There&amp;rsquo;s a problem however, if we try to take the value of &lt;strong&gt;any&lt;/strong&gt; of them, we will realize that we don&amp;rsquo;t yet have the value of x or y! (try it yourself).  Clearly this &lt;em&gt;&amp;lsquo;everything is a function&amp;rsquo;&lt;/em&gt; stuff is a lie, if the syntax were only that simple, we wouldn&amp;rsquo;t be able to represent even the simplest of problems!&lt;/p&gt;

&lt;p&gt;But we&amp;rsquo;ve yet to address the problem of the side effects; specifically, why does our javascript code have them while the same code in clojure does not? The reason for this is that the act of assignment itself is necessarily a side effect. Its entire purpose is to provide a particular value which other functions can reference at some other point in time. However, unchecked assignment is not always ideal as anyone familiar with concurrent assignment and referencing can tell you. And so, in order to resolve this issue once and for all, God invented the &lt;code&gt;macro&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;macro&lt;/code&gt; is a special kind of &lt;code&gt;fn&lt;/code&gt; that doesn&amp;rsquo;t immediately evaluate the parameters it receives.  Instead it&amp;rsquo;s defined in terms of a special function recipe in which it reorganizes or modifies the expressions provided to it, transforming and evaluating the values it requires while substituting the values of others.&lt;/p&gt;

&lt;p&gt;So then, &lt;code&gt;let&lt;/code&gt; is a macro which doesn&amp;rsquo;t immediately evaluate its forms.  Instead it takes as its first parameters a binding vector, containing an even amount of elements to be considered as keys and values.  It then walks all subsequent forms, evaluating them and substituting the value of the required key any time it is asked for. So we could describe the previous snippet as follows:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Invoke the let macro with the binding vector where &lt;code&gt;x&lt;/code&gt; is 1 and &lt;code&gt;y&lt;/code&gt; is 2. With values in hand, continue walking the forms and evaluating, supplying the value of any given symbol should it be bound to some value.&lt;/em&gt; &amp;ndash;  The let macro has no problems when the lets are nested and shadows the old values for x and y while incrementing and decrementing them to get the new values to be bound only for the inner expressions!&lt;/p&gt;

&lt;p&gt;Onwards to the code!&lt;/p&gt;

&lt;p&gt;I&amp;rsquo;m sure the first thing you realize is that there is an awful lot of weird characters in this, as if someone were holding their shift key while sweeping their fingers around the keyboard; but don&amp;rsquo;t worry, the important thing is that each of those characters has a syntactic meaning!&lt;/p&gt;

&lt;p&gt;The first line just invokes the &lt;code&gt;defn&lt;/code&gt; macro, which names a function that takes some parameter list defined in the binding vector and subsequently, the form to bind the values of the parameters to.  In our case the function is named &lt;code&gt;validate-credentials&lt;/code&gt;, and it takes two arguments: &lt;code&gt;username&lt;/code&gt; and &lt;code&gt;password&lt;/code&gt;.  It then uses let to get the shorthand for four symbols, &lt;code&gt;uc&lt;/code&gt;, defined as the count of the characters in username, &lt;code&gt;pc&lt;/code&gt; defined as the count of the characters in the password, a &lt;code&gt;less-than-3?&lt;/code&gt; fn to determine whether a given number is less than 3, and the respective fn for &lt;code&gt;less-than-4?&lt;/code&gt;. It then invokes the pattern matching macro supplying pairs of patterns to match and expressions to evaluate upon successful match.  What it says on line 6 is to match against the values for the four symbols username, uc, password, and pc, in that specific order.  Those _ are actually variables names, where the variables could be used in the following expession. Using an underscore as a variable name is a common idiom for saying &amp;lsquo;throw away this value&amp;rsquo;.&lt;/p&gt;

&lt;p&gt;The first expression says: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the username is nil or the empty string, and the rest of the values are anything, give a no username given error.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The second expression says:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the password is nil or the empty string, and the rest of the values are anything, give a no password given error.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The third expression says:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I don&amp;rsquo;t care about the values for anything, but when the value of the username count is is less than 3, give a bad usercount error.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fourth expression says:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the passcount is less than 4, return the respective error.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fifth expression says:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I care only that the username is in alphanumeric.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once your eyes uncross from trying to read all those funny characters, the solution is really quite elegant. Things are always just defined in terms of simple pairs, a binding vector and the code to evaluate with those symbols bound, from the let form to the defn form to the matching form.  Once you know how to read the pattern matcher, you don&amp;rsquo;t even need to think about how to implement your control flow, you simply describe the shape of your interesting cases and dispatch off of them. The &lt;a href=&#34;https://github.com/clojure/core.match&#34;&gt;core.match&lt;/a&gt; library shown above enables vastly richer pattern matching than simple case or conditional expressions, holding onto variables in a similar way to let, allowing for a refreshingly clear and succinct representation of complex scenarios.  &lt;/p&gt;

&lt;p&gt;But enough about musing about how great clojure is, let&amp;rsquo;s look at the javascript version!&lt;/p&gt;

&lt;p&gt;Note: If you are less than familiar with javascript (and specifically &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Conditional_Operator&#34;&gt;ternary operators&lt;/a&gt;), you should check out mozilla&amp;rsquo;s awesome &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Values,_variables,_and_literals&#34;&gt;tutorial&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;The first thing a few of my js hacker friends said when they saw this snippet was how readable and elegant it was for a validator in javascript, and I don&amp;rsquo;t disagree; but even still I want to take a closer look at it. It starts by defining an object named user, who has one attribute, a method named &lt;code&gt;validateCredentials&lt;/code&gt;.  This method also takes two parameters: username and password. Besides the extra concept of the &lt;code&gt;Object&lt;/code&gt;, by line 2 we are still remarkably similar to the earlier clojure implementation.  Line 3 specifies that the following expression is the return value of the function (clojure didn&amp;rsquo;t need to state this because the last form inside of a defn is implicitly the return value).&lt;/p&gt;

&lt;p&gt;Finally, it begins its pattern matching rules by leveraging nested ternary expressions, or nested &lt;code&gt;if ? then : else&lt;/code&gt; expressions.  But wait, what&amp;rsquo;s going on in our first pattern? &lt;/p&gt;

&lt;p&gt;If we try to convert that first pattern matching form to english it becomes something like:
&lt;em&gt;If the boolean opposite of the username plus the empty string or if the username is the empty string then give the no username given error&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Wait, the opposite of the username plus the empty string? What does this even mean?! It turns out that in javascript, simple nil checks aren&amp;rsquo;t exactly simple, with the nil being possibly undefined or possibly some other falsey value (which may cause some unexpected behavior), and so in order to get at a boolean value, we coerce it into a string type by adding it to the empty string, then coerce it further into its boolean opposite using the &lt;code&gt;!&lt;/code&gt; operator. Since an empty string will evaluate as false the boolean opposite of this evaluation is true, causing the if expression to succeed, and giving our failure message! &amp;ndash; &lt;em&gt;Whew!&lt;/em&gt; Now in order to understand line 4 we must understand &lt;code&gt;Ternaries&lt;/code&gt;, &lt;code&gt;Type coercion&lt;/code&gt;, and &lt;code&gt;Objects&lt;/code&gt;, as well as the short circuit logic of the &lt;code&gt;||&lt;/code&gt; operator.  Before we only needed to understand functions, macros and the shape of some data!&lt;/p&gt;

&lt;p&gt;Once we know some rules about javascript the rest follow easily and clearly, save for the usage of the regular expression (which was also used in the clojure example). My point is that once you understand the idiosyncrasies of the language you are using, you forget what it is like to not have to deal with them.  You say &lt;em&gt;ah yes, this is simple because I know how to do it, it is clear because I can read it&lt;/em&gt;, and things like the above js pattern matching appear beautiful and elegant to you, regardless of their incidental complexity. And it is elegant javascript; it imports a simple idea into a language with complicated syntax. That is a good thing.&lt;/p&gt;

&lt;p&gt;But wouldn&amp;rsquo;t you rather just use a language where the simple syntax made it trivial to represent your ideas, whether simple or complex?  For more, I highly recommend watching author of clojure, Rich Hickey&amp;rsquo;s amazing talk on this sort of simplicity, &lt;a href=&#34;http://www.infoq.com/presentations/Simple-Made-Easy&#34;&gt;Simple Made Easy&lt;/a&gt;.  Oh, also, if you made it this far, drop me a line and tell me what you thought! &lt;a href=&#34;http://twitter.com/omniegg/&#34;&gt;twitter&lt;/a&gt; or &lt;a href=&#34;http://gplus.to/egghead/&#34;&gt;g+&lt;/a&gt;&lt;/p&gt;
</content>
        </entry>
    
        <entry>
            <title>running with mynt</title>
            <link rel="alternate" href="https://words.computerdream.club/2012/01/26/Running-with-mynt/" type="text/html" />
            <id>https://words.computerdream.club/2012/01/26/Running-with-mynt/</id>
            <updated>2012-01-26T00:00:00Z</updated>

            <summary type="html">I&amp;rsquo;ve been in the market for a solid blogging platform for some time. I&amp;rsquo;ve built fully featured blog engines with &lt;a href=&#34;http://djangoproject.com&#34;&gt;django&lt;/a&gt;, played with drop-in solutions like &lt;a href=&#34;http://wordpress.com&#34;&gt;wordpress&lt;/a&gt; and &lt;a href=&#34;http://drupal.com&#34;&gt;drupal&lt;/a&gt;, as well as trying hosted solutions like &lt;a href=&#34;http://tumblr.com&#34;&gt;tumblr&lt;/a&gt;. It always ended the same; I found myself spending more time worrying about the platform than actually writing. I would have to spend a non-trivial amount of time and effort becoming familiar with the domain specific idiosyncrasies of each product, what was required to theme the project, extend functionality, or more often than not, what was required to purge unnecessary features. All the platforms I mentioned are rich, mature and suitable blogging platforms.  They also aren&amp;rsquo;t what I have been looking for. </summary>
            <content type="html">&lt;p&gt;I&amp;rsquo;ve been in the market for a solid blogging platform for some time. I&amp;rsquo;ve built fully featured blog engines with &lt;a href=&#34;http://djangoproject.com&#34;&gt;django&lt;/a&gt;, played with drop-in solutions like &lt;a href=&#34;http://wordpress.com&#34;&gt;wordpress&lt;/a&gt; and &lt;a href=&#34;http://drupal.com&#34;&gt;drupal&lt;/a&gt;, as well as trying hosted solutions like &lt;a href=&#34;http://tumblr.com&#34;&gt;tumblr&lt;/a&gt;. It always ended the same; I found myself spending more time worrying about the platform than actually writing. I would have to spend a non-trivial amount of time and effort becoming familiar with the domain specific idiosyncrasies of each product, what was required to theme the project, extend functionality, or more often than not, what was required to purge unnecessary features. All the platforms I mentioned are rich, mature and suitable blogging platforms.  They also aren&amp;rsquo;t what I have been looking for. &lt;/p&gt;

&lt;p&gt;Yesterday I read about a new static site generator on the &lt;a href=&#34;http://planet.python.org&#34;&gt;Planet Python&lt;/a&gt; feed, called &lt;a href=&#34;http://mynt.mirroredwhite.com&#34;&gt;mynt&lt;/a&gt; written by &lt;a href=&#34;http://mirroredwhite.com&#34;&gt;Andrew Fricke&lt;/a&gt;. It boasted a rich feature-set and simplicity. It was written in python and used markdown and jinja2 for layout and content. I was familiar with the tools so I decided to give it a go.  &lt;/p&gt;

&lt;p&gt;Installation was a breeze, I created a new isolated python environment with 
&lt;code&gt;mkvirtualenv samelog -p /usr/bin/python2.7&lt;/code&gt; (mynt needs python 2.7 since it uses some core libraries like argparse not found in earlier versions of 2.x &amp;ndash; oh, and you&amp;rsquo;re using Doug Hellmann&amp;rsquo;s &lt;a href=&#34;http://www.doughellmann.com/projects/virtualenvwrapper/&#34;&gt;virtualenvwrapper&lt;/a&gt; already, aren&amp;rsquo;t you?). I then installed with a simple &lt;code&gt;pip install mynt&lt;/code&gt;, made sure that &lt;code&gt;mynt --version&lt;/code&gt; returned a sane response to check the install and I was ready for the races.&lt;/p&gt;

&lt;p&gt;Unfortunately mynt doesn&amp;rsquo;t come with any scripts to generate a dummy project, but I found the source to Andrew&amp;rsquo;s personal site helpful as a starting point. Luckily, you can find this up on &lt;a href=&#34;https://github.com/Anomareh/MirroredWhite&#34;&gt;github&lt;/a&gt;.  In either case, you should be set by simply running this command in your project directory:&lt;/p&gt;

&lt;p&gt;This will create all the necessary files for your project, of course you&amp;rsquo;ll need to fill in the content yourself.&lt;/p&gt;

&lt;p&gt;Mynt uses &lt;a href=&#34;http://yaml.org/&#34;&gt;yaml&lt;/a&gt; for configuration in both templates and project config.  An exhaustive list of config options can be found at mynts documentation. However, I just needed one:&lt;/p&gt;

&lt;p&gt;This tells mynt that it&amp;rsquo;s mounted at /log/ rather than / and to handle assets/urls accordingly, simple enough!&lt;/p&gt;

&lt;p&gt;Fist things first, we&amp;rsquo;ll need a layout.  Open up &lt;code&gt;_templates/base.html&lt;/code&gt; in your favorite text editor and give it something like this:&lt;/p&gt;

&lt;p&gt;Hopefully this is simple enough for you, if you&amp;rsquo;ve used twig in php, django, or jinja templates before.  We&amp;rsquo;re just setting up two blocks to be replaced by other templates, accessible via &lt;code&gt;block title&lt;/code&gt; and &lt;code&gt;block content&lt;/code&gt;.  The &lt;code&gt;get_asset()&lt;/code&gt; bit is specific to mynt, it returns the uri path relative to your mynt project and the &lt;code&gt;_assets/&lt;/code&gt; folder we created earlier.&lt;/p&gt;

&lt;p&gt;Next, let&amp;rsquo;s create our template for posts themselves.  Posts can have any amount of variables thrown into them by yaml frontmatter.  In our example however, we&amp;rsquo;ll reference only the &lt;code&gt;posts&lt;/code&gt; variable provided by mynt.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;_templates/post.html&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will set the title of our base template to &amp;lsquo;My Blog - My Post Title&amp;rsquo; and fill the content section up with the data of the post itself.  &lt;/p&gt;

&lt;p&gt;Finally, we just need a simple way to view a list of the posts.  We&amp;rsquo;ll do this by editing &lt;code&gt;index.html&lt;/code&gt;.  As a quick caveat, any html or xml file not located in _assets, _templates, or _posts, and not beginning with a . or _ will be treated as a standard jinja2 template, with folder structure preserved and access to the global variables &lt;code&gt;site&lt;/code&gt;, &lt;code&gt;posts&lt;/code&gt;, &lt;code&gt;archives&lt;/code&gt;, and &lt;code&gt;tags&lt;/code&gt;. (Yes, that means that your project/rss/rss.xml file can be a jinja2 template and available at /rss/rss.xml). Visit the mynt documentation for more information. We&amp;rsquo;ll leverage this right now when creating our post listing.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;index.html&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Nothing new here, save the use of a for loop to iterate over the posts object, and the &lt;code&gt;get_url()&lt;/code&gt; builtin to generate the url string for a given post.  But that&amp;rsquo;s all we need.  With these 3 small templates, we are ready to start creating our content.&lt;/p&gt;

&lt;p&gt;Content in mynt is written in markdown by default.  Every piece of content must be located in the posts folder, begin with a YYYY-MM-DD date string, and the contents of the file must contain yaml frontmatter referencing the layout and the title of the post.&lt;/p&gt;

&lt;p&gt;The post might not be all that shiny, but it&amp;rsquo;s the layout that matters. The three dashes delimit the yaml config for the post which in turn become variables accessible to your templates. (remember how we used post.title earlier? this is where it comes from!).  Everything below gets parsed as markdown, with access to the special markdown fences for code blocks. (example of that &lt;a href=&#34;https://gist.github.com/1687005&#34;&gt;here&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;That&amp;rsquo;s it! Run &lt;code&gt;mynt _deploy&lt;/code&gt; from your project root and your static blog will be generated! Easy, huh?&lt;/p&gt;

&lt;p&gt;However, we can do better.  When working with a static site generator, there are often a lot of tasks you need to repeat; generating the content, moving it to its proper deploy environment, or cleaning up the generated files. Luckily, &lt;a href=&#34;http://docs.fabfile.org/&#34;&gt;fabric&lt;/a&gt; makes repeated tasks like these simple.&lt;/p&gt;

&lt;p&gt;Let&amp;rsquo;s look at the fabfile all at once, and then we&amp;rsquo;ll drill down into the specifics of what each part does.&lt;/p&gt;

&lt;p&gt;Fabric itself is a bit of an ssh toolkit for python, letting you run arbitrary operations across numerous machines.  However, since we&amp;rsquo;re just working locally, we&amp;rsquo;ll only import &amp;lsquo;local&amp;rsquo;.  We&amp;rsquo;ll import a fabric project to set things up, and declare a few variables to make the script easier to change down the line.  Each function defined in a fabfile is available via the command &lt;code&gt;fab function&lt;/code&gt;, so we could run &lt;code&gt;fab clean&lt;/code&gt; to remove the _deploy directory, &lt;code&gt;fab generate&lt;/code&gt; to generate the static blog, or build functions out of the combinations of these.  The one I find myself running the most is &lt;code&gt;fab redeploy&lt;/code&gt; to clean up the current deploy folder, regenerate the content, and push it over the wire to the folder that&amp;rsquo;s exposed to the web.  (In my case I&amp;rsquo;m using scp, yours could very well be a cp).  Finally after deploying we clean up the files we generated.  Less typing, more time for other things!&lt;/p&gt;

&lt;p&gt;All things considered, I&amp;rsquo;m enthralled by the simplicity and flexibility mynt offers.  I was able to get it up and running in a day with minimal effort, and am bubbling with ideas about how to take advantage of the simple key/value store provided by the yaml frontmatter; accessible via the jinja2 templates.  I had tried alternatives like &lt;a href=&#34;http://ringce.com/hyde&#34;&gt;hyde&lt;/a&gt; before but always wound up getting lost in the complexity, jumping down one of the rabbit holes in its feature-set and realizing hours later that I&amp;rsquo;ve yet to produce anything productive.  mynt&amp;rsquo;s power on the other hand lies in its simplicity.  It&amp;rsquo;s just python under the hood, but what you can do with jinja2/yaml/markdown alone is immense.  The focus is exposed simplicity, not hiding waiting to be found.  (That said I&amp;rsquo;ve yet to peek too deeply under the hood of mynt&amp;hellip; but I&amp;rsquo;ll leave that for another day!).&lt;/p&gt;

&lt;p&gt;In any case, I hope you try &lt;a href=&#34;http://mynt.mirroredwhite.com/docs/&#34;&gt;mynt&lt;/a&gt; out for yourself and let me know what you think!&lt;/p&gt;
</content>
        </entry>
    
</feed>
