Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A letter to my daughter, Augusta, in ruby (jpfuentes2.tumblr.com)
186 points by pacbard on Jan 8, 2013 | hide | past | favorite | 59 comments


I once wrote a letter to my son in C++.

We don't talk anymore.


Me and a former boss a while back:

Me: "When I was taking C++ back in high school-"

Boss: "Dear god, what kind of high school did you go to?"

Me: "A Catholic one"

Boss: "Ah, that explains it"

Yes, it actually was a bit of a hard-line place. Wouldn't trade it for the world though, even the C++ class (since that's where I discovered Python).


and you got divorce papers from your wife written in Objective-C ? (Or maybe Go?)


Ick, comparing Objective-C to Go?


No, it was a (poor) pun on the language names...


I God I hope that was meant to be a joke, if not I'm going straight to hell...


> if not I'm going straight to hell...

...said the future J2EE developer...


So he returned 0?


Reminds me of this obfuscated C classic: http://www.ioccc.org/1990/westley.c

If you want to compile it, replace each "1s" with "is" in the code and compile for example like this:

gcc -Dis=1 westley.c -o westley

(or just put is=1; in the beginning with the same substitutions).

Normal compilers don't like 1s notation for short. Then run the result with some integer parameter ;)


Here's a bit shorter version of this amazing letter:

puts 'Augusta, we <3 you!'


Here's a shorter version of love.rb:

    class Augusta; end

    def a_letter(*args, &blk)
      puts 'Augusta, we <3 you!'
    end


Not quite, you'll run into various class/modules/methods not found.


Try it.


Except you're missing the trap and loop : )


Hah! I went for over-achievement, I suppose.


Love expressed is always amazing, no matter the number of lines!


Especially when it doubles as a learning exercise for your Daughter one day :)


That's cute, but most of the "magic" is hidden behind the require line. That's somewhat breaking the rules I think (compare that to Perl poetry such as the Black Perl).


Nice! Reminds me of judofyr's "On Camping vs Sinatra"

http://timelessrepo.com/on-camping-vs-sinatra


I was about to say that it reminds me of the Haiku's I've been collecting:

http://timelessrepo.com/haiku

Or Tribute (that I wrote):

http://timelessrepo.com/tribute


Yeah but the maintenance overhead on such complexity... Just wait till the teenage years!

Nah, given the design decisions inspiring this codebase, I don't have any reason to believe your daughter will have any challenge extending and reusing its functionality once she's grown up. ;-)


I'm tempted to fork this, change name to my daughter's name and frame it or make a Tee. Not sure if the author would think of it as disrespectful.


That's why it's MIT. Please feel free!


Hey, it's Open Source, right? LICENSE seems to confirm this.


That guy who said Javascript is the new Perl has been proven wrong.


This has nothing to due with obfuscation but the malleability of ruby itself, read the required file he made a DSL.


??


A little more flippant but I wrote this version of Goldilocks in JavaScript a little while back: https://gist.github.com/3755270


Nice. It inspired me to spend some free time I had today doing same thing in perl 5 & 6 - https://gist.github.com/4542918


Blah, this is not a good way to get back into Ruby. I get that most of it is just fluff, but can anyone break it down a little? Really stretching the syntax.


Are there specific pieces you don't understand? Or would you want a walkthrough?


Just kind of a walk-through. I think part of it is that I can't fully force myself to read it as code when it's written poetically like that, so even syntax conventions I fully get are causing my eyes to glaze over.


I really love how the second to last line rhymes in such a way that, when read with the semicolon out loud, produces a neat sound to it.

"Until infinity ends do; Forever end."


Code as poetry. Are there any other examples of this?


I must confess I have not seen many. I drew inspiration from Marc-André Cournoyer and his post "how to apply to a job" http://macournoyer.com/blog/2010/02/23/how-to-apply-to-a-job.... However, I've entertained the idea of writing code as prose for quite some time.


See the Perl Poetry page on Perlmonks for regular contributions:

http://www.perlmonks.org/?node=Perl%20Poetry


Black perl - originally by Larry Wall & updated for Perl 5 by Ovid (http://www.perlmonks.org/?node_id=17000)

        BEFOREHAND: close door, each window & exit; wait until time.
	     open spellbook, study, select it, confess, tell, deny;
	write it, print the hex while each watches,
	     reverse "its length", write again;
	     kill spiders, pop them, chop, split, kill them.
	          unlink arms, shift, wait & listen (listening, wait),
	sort the flock (then, warn "the goats". kill "the sheep");
	     kill them, dump qualms, shift moralities,
	     values aside, each one;
	          die sheep, die, reverse system
	          you accept (reject, respect);
	next step,
	     kill next sacrifice, each sacrifice,
	     wait, redo ritual until "all the spirits are pleased";
	     do it ("as they say").
	do it(*everyone***must***participate***in***forbidden**s*e*x*).
	return last victim; package body;
	     exit crypt (time, times & "half a time") & close it,
	     select (quickly) & warn next victim;
	AFTERWORDS: tell nobody.
	     wait, wait until time;
	     wait until next year, next decade;
	          sleep, sleep, die yourself and
	          rest at last


Some extra references:

- Black Perl updated for Perl 5 - http://www.perlmonks.org/?node_id=237465

- Black Perl Revisited - http://www.perlmonks.org/?node_id=578707

- http://en.wikipedia.org/wiki/Black_Perl


Black perl is a real art, without hidden setup&definitions.

Perlay?


Very touching :)


This is great! Proof that code is art.


That's what I going for. I tagged it as "Code as Art." I initially dubbed it a poem but decided it read more like a letter, instead. Personally, I think it qualifies as code prose.


Don't take me wrong, but I do not think that this poem (or, as @jpfuentes states correctly, prose) can be categorized as "art". I think of it as a lovely crafted letter, written on a very unusual support. Nothing too much different from a cross-stitched handkerchief.

Anyway, it's seriously touching.


The thing is, these things are supposed to be personal. But someone can fork it.


16 months before finding time for programming again. Sounds about right.


Hahaha. Kids will do that to you.


I had to upgrade to ruby 1.9 in order to run it. Very beautiful, btw.


Wow it never ceases to amaze me the things that headline in HN. As much as I understand the love for one's child(ren), I am a bit disappointed to go on a site called 'Hacker News' to see this type of irrelevant posting.


You may consider reading up on the Hacker way:

A hacker is a person that loves to program, or someone who enjoys playful cleverness, or a combination of the two.[3] The act of engaging in activities (such as programming or other media[4]) in a spirit of playfulness and exploration is termed hacking. However the defining characteristic of a hacker is not the activities performed themselves (e.g. programming), but the manner in which it is done: Hacking entails some form of excellence, for example exploring the limits of what is possible[5], thereby doing something exciting and meaningful.

http://en.wikipedia.org/wiki/Hacker_(programmer_subculture)


The concept of code as poetry - or the hidden elegance capable behind it is something that obviously piques ones interest - if it were just for the aww factor it wouldn't get as many up votes. Code is an art, and it's nice to see it sometimes used for something other than the norm.


This is the most emotional script ever I have ever seen :)


LoL (Lines of Love) is inversely proportional to LoC


Seems like the daughter will become a programmer.


at least know how to read ruby source code


Love it! <3


Beautiful


amazing!


[dead]


Don't be a dick.


nice




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: