State-Free Programs and On-Disk State

I’m having some thoughts this morning:

If we view programs as pure execution (or, as in SICP, a way to wrangle processes and make them do what we want), and if we follow Functional Programming “rules”, still there must be some way to keep and store state of a system—state in a system is inescapable, from a Systems Modelling point of view.

It occurs to me, that if one takes the idea of separating components of a program to its logical conclusion, one should be able to separate state-related computation from state itself. State-related computation should end up as a separate module of a certain given program, and state should end up in a datastore of some sort, whether volatile or not.

So in practical terms, if we subtract state from a program, we could offload it into a separate store on-disk or on-RAM, and with such fast I/O these days, it becomes trivial to use something like, for example, LevelDB, or Redis, or RocksDB for this. In even more pragmatical terms, make your program state-free, and any time you might need to save it or read it, just fire off a write/query to some fast, simple k/v datastore.

This is probably obscenely obvious and not a new idea by any means, but something just clicked and went off in my head, and I had to write it down to cement my intuition.

The Completely True, Non–fiction Account of my Trip to Guanajuato

We Hit the Road

A few weeks ago, I came back from a very transformational trip. It wasn’t even that kind of trip. I mean, there were certainly some drugs involved, but what I’m talking about is, I took a trip to Guanajuato all the way from Mexico City, to attend the Guanajuato International Film Festival, a.k.a. the GIFF.

The festival started in San Miguel de Allende, and then continued in Guanajuato. The original plan was to make the trip with a very close friend, Diego—otherwise known as Guy, to those of you who read that other post—, to catch the festival right at the beginning in San Miguel, and stay there and just try to survive in any way we could, and follow the festival when it moved from San Miguel to Guanajuato, and then come home. Unfortunately a summer class I signed up for got in the way (how I happened to forget about that is something I haven’t worked out yet), so in the end, I and five other friends could only make it for the last three days of the festival, but my friend Diego did leave for San Miguel as we originally intended.

When we hit the road there were only five of us divided into two cars, with me driving one of them and my friend Bruno the other one. It was a six hour drive, only stopping once to pick up another friend along the way in Querétaro, and of course the occasional piss call. When we finally got to Guanajuato my butt was numb, and my heart was racing from the adrenaline of trying to keep up with my maniac–driver friend Bruno, who, for some reason, enjoys excreting an endless stream of pure fear into his pants through his asshole. Of course you could call this fear–substance “fecal matter”, but I’ll leave that choice up to you.

Guanajuato is the most magical town I’ve ever been to, and this is not an exaggeration. It’s an incredible multi–level city with old tunnels you can drive through running underneath it, that pretty much can get you anywhere, provided you don’t get lost in the vast maze that they are. Add to this, that this is an ancient city from a time Spaniard influence was still strong in Mexican architecture and art (founded in 1823 to be exact, and almost perfectly preserved ever since), and what you get is a colorful fantasy setting with just the right touch of Steampunk and SciFi.

Just so you get an idea of what sort of deranged people attend the festival, the only set of films we could catch when we got there—which was at around 1:00 am—, was a series of horror movies being projected in a fucking graveyard, with all the things a graveyard implies: tombstones, mausoleums and urns; dead bodies under your feet and decrepit flowers on the graves of long–forgotten relatives who surely wouldn’t mind a bunch of quaint young people sitting there for their own amusement and entertainment…

Alas, we didn’t get to watch those horror movies. Instead, we ended up following a group of drunk people who were supposedly going to lead us through the narrow stone–paved streets of Guanajuato, and into some sort of wild party. We were all down for it, of course, but somehow each group—theirs and ours—went their own way after a while, and I soon found myself sitting at some shady taquería that served some of the worst tacos I’ve ever had. Later that night, those tacos would manifest themselves as horrible visions of tortured places and horrible monsters crawling through my intestines. I swear, those tacos were shitty.

Naturally, the only thing left to do after such a violent late dinner, was to go back to the hotel and sleep, but there was the issue that I had no idea where Diego was or where he was going to sleep that night (the plan was that we were gonna meet him when we got to the city, so he could stay with the rest of the group in a cheap hotel we found online). I called him a few times but apparently his cellphone died, so there was nothing else I could do. “Listen, stop worrying, ok? He’s probably fine, the damn hippie. He probably found somewhere to stay and he’ll be all right in the morning. Just go to sleep, dammit.”

So I did, and that was that.

We Hit it Hard

The next morning, right after breakfast we headed to the Teatro Juárez and I called Diego again, to see if he was still alive and everything. Turns out the fucker was watching a Polish movie, and would meet with us outside the Teatro.

When he got there, the first thing he did, was take out a little tin box that contained a bunch of roots of some kind and a pair of joints.

“Chew on this,” and he held up his palm to me, and on it was one of those tiny roots.

“What is it?”

“Just chew on it. It’s fucking amazing.”

“Uh… alright.” My mouth went immediately and completely numb, and the taste was so strong it made my eyes water.

“Jesus Christ, what is this?”

He explained to me that the plant those roots came from is called chilcuahue. In the past, Aztecs used that plant in various ways because of its medicinal properties. The roots, in particular, are used to treat mouth sores.

“Holy crap, you guys have to try this.”

Only three people in the group decided to chew the chilcuahue roots at first. The others were hesitant, but ultimately, a few hours later, decided to give it a go.

Now, let’s not forget this is a film festival, so there are films to watch. And that’s pretty much the only thing we did for the next seven hours or so. And I can tell you: those were the best seven continuous hours of film I’ve ever watched.

Of course the rest of the group got tired after the first couple of sets of short films (the whole festival consisted of either small batches of short films with something in common, or single long films), so only Diego and I stayed for the third set, while the others took a walk around the city and got something to eat. Staying was worth it… the last batch were a series of Polish–only short films, and all of them were amazing.

And it was also at this point, before being swallowed into the theatre, before walking into the third screening, while standing in line, that I noticed for the first time a girl with short green hair and dark rimmed glasses. And I thought she was exceptional. Diego simultaneously noticed a British girl—“How do you know she’s British?”

“She was talking with her friends in english, in a British accent.”


“Talk to her.”

“What? Why?”

“Well… she’s pretty. You’re smart. She must be interesting if she’s here. I can’t see where this could go wrong. Promise me you’ll talk to her, or I’ll smack you.”

Gee all right… I promise. If we see her again outside, I’ll talk to her.”

But I never got to talk to her; we didn’t see her again after that.

It was dark when we emerged from the theatre. We had to find the others. We were gonna hit the bars that night. No. They were gonna hit a bar… I don’t drink significant amounts of alcohol.


pick up

“Where are you?”

“Uh… don’t move. We found this great bar. Be with you in a few.”


Bruno led us through the streets of Guanajuato to a street packed with people, laughter drowning the sound of music coming from every direction, neon signs here and there, and the characteristic vibe of drunk people everywhere.

“This is it. I’ve heard great things about this place.”

Fifty people or so were waiting outside.

“Nah. This looks too crowded. The music’s terrible… let’s find some other place.”

Twenty steps back, there was this relatively quiet bar with exceptional artwork hanging on the wall near the door. It was a painting of about two meters by one that contained all of history’s greatest characters… Napoleon, Hitler, Atila the Hun, Cleopatra, Marx, Mike Tyson… Jesus wasn’t there. Jesus was not in the painting.

We sat down and ordered a few beers prepared in various colourful ways. Mine had chile and mango. We drank. We waited. We talked a bit.

I remembered what Diego had in his little tin can. I started to get anxious. I gave Diego knowing looks. I gave Diego little head bobs. I eyed the exit. I said, “Hey Diego… how about we go for a walk and have some tea?”

“Right, right. Hey listen, guys: we’re gonna go for a quick walk and get some fresh air. Be right back. Don’t move.”

The street was still crowded. Music still came from every direction. Laughter still drowned the other sounds. It was a beautiful scene, really. We stumbled into one of Diego’s friends; I can’t remember how he said he met her… I think he stayed with her at a students residence of some sort. She was with a friend. “Hi,” I said, smiling, “I’m Arturo.”

“Hi,” she said, smiling, “I’m…”—I didn’t catch her name.

“So what are you guys up to?”

“Oh some friends are over there, at that bar. We came out for a quick hit… and a walk.”

She said she was all for a quick hit. I asked if she knew where we could have it. She said, “Come with me”. We said, “Ok”. She led us right around the corner, into a narrow alley, which was no ordinary alley, by the side of a bar. I had never seen such a strange alley before: it wasn’t an ordinary street in that instead of being flat, it was a set of steps that started with a gentle slope and ended in a violent steep angle, and was met by another perpendicular street at the other end. And all the way at the top, you could see a couple sitting, holding hands, kissing.

We lit our smoke–making machine. We put the smoke into our bodies.

“Well, listen.” I say, “Hey, hey: I’ve had two hits. I can’t have any more than that… I’m high already.”


“I said I’m high already.”

“Oh. I can’t finish this by myself either.”

So we give it to someone else, I say. There’s a couple of guys around the corner, I say.

So we emerge from the narrow alley, with smoke rising from Diego’s hand, past his face, and into the night sky.

One of us approached them (I can’t remember whom), and said, “Hey, uh, we won’t be using the rest of this, so it’s yours now. You can ha—”

“Whoa, for real?”

“Yeah, yeah, for re—“

“Gee, man, thanks! You are so awesome. So awesome.”

They asked us if we were there for the festival. We said we were. They asked us which movies we liked so far. We said all of them.

A small debate about a particularly outrageous film started. We all got excited and couldn’t stop talking about the social implications of this or the political message of that or the artistic value of so–and–so. What a huge racket that was. When whomever we were talking to stopped paying attention, because he got distracted by something someone else said to him, we would just turn to face another participant of our noise party to keep expanding on our opinion about the banality of this–work–and–such–and–this. All of this without pausing for a second to catch our breaths.

Three other people joined the group. They were girls. I turned to see them, wondering who they might be, and my hart sank. She was there… the girl with the wonderful green hair and thick–rimmed glasses was there, standing right beside me with a huge smile and a face that screamed, “I wonder what these idiots are talking about.”

They knew these girls. We said hi. I said hi, taking particular and special care to each and every letter that made up the words that came out of my mouth, as if by doing this I would impress her, or be more in sync or whatever you call it, with her. I immediately forgot the other girls’ names, but I struggled to keep hers long enough to remember what it was until I was sober again. “My name is Daniela,” she said, smiling. “I am Arturo,” I said, smiling. We kissed each other on the cheek, which is a very un–American thing to do, but a very Mexican thing to do.

“So let’s go dance! There’s a fabulous place, not very far from here.”

I had never gone dancing like that, with a group of strangers. I only dance at parties. I never go to dancing–places or whatever.

“Did they just say we should go dancing?”

“Uh… yeah… I think?”

We said, sure! Let’s go dancing.

Then I got lost.


“No, yeah—I t h I n”

“—closed… a H na d J”



“So are we going dancing?” I was genuinely confused.

“No, the dancing–place is closed already. But we’re gonna go play some billiards. Wanna come?”

“Sure! So let’s go, then.”

So we started following them, but we stopped midway, and then it was just Diego and me again, talking about nothing. Crap. “Did we just lose them?”


Shit. Well… let’s go back to the bar… no point in trying to find them now.”

Disappointed, we walked back to the bar, where the others were still drinking and having a great time. Talking about nothing.

We payed the bill and walked back to where we had left the car, earlier that morning. As we’re walking I’m talking to Diego, I’m saying: You know how you’re sometimes excited and scared at the same time, because you’re facing a new experience? You know how you catalogue people based on the encounters you’ve had with their type before? You know how you can collect these little events in your people–catalogue, and you know how you can catalogue every relationship you’ve had before according to the types of people you’ve dated? You know how you get all nervous when you’re talking to girl, and no matter how attractive she is, no matter how much she gives you butterflies, you still can’t focus and take the leap, because she is a completely new type of experience of human contact that doesn’t fit in your previous experiences? You know?

Well, that’s what happened to me, I say. In a way, it was a good thing we didn’t go with them, I say. I was so excited, but so anxious… I’m not sure I could have handled looking into her eyes, and hypothetically speaking, in a hypothetical scenario, holding hands with her, or even having a hypothetical kiss after a hypothetical night of having hypothetical conversations with her, I say.

“Yeah, yeah… well, I gotta go… I have to walk to the students residence. And it’s a long walk, and I’m tired.”

So we all went to sleep.

The Road Hit us Back

The cold light of the morning sun hits my eyes and I know it’ll be the last time I wake up in Guanajuato. And as we walk towards a buffet restaurant to have breakfast, I can feel the collective hangover the whole city is suffering. Everybody is quiet, and everybody moves slowly.

The atmosphere was completely different this time: You could see children playing, families chatting and having coffee, old men and women walking holding hands… everything was calm and quiet.

After breakfast I called Diego once more. We agreed to meet in front of the city’s cathedral. He would be there with his stuff packed and ready to start the journey home.

First thing he said when he saw me: “I ran into Daniela today. I got you her phone number.”

“What? So she just gave it to you like that? Did you tell her it was for me?”

“Nah, not exactly. She said, ‘Hey, you guys didn’t go dancing with us last night. Where were you?’”

So Diego told me he apologised to her, and explained to her we were really high. She said, “Well, it was super fun meeting you guys. It would be nice to keep in touch; I like your friend.” And she gave Diego her number. Days later he texted her and she never texted back.

The first portion of the drive home was peaceful, with us chatting all the way, talking about everything.

We stopped in Querétaro to drop off our friend who lives there, and her mother invited us in. Her family was having some sort of party or reunion, and her fancy friends were sitting around a table in the yard. We must’ve looked terrible because they wouldn’t stop throwing judgmental looks at us.

After we finished our cake and coffee, we were back on the road, and after a few hours, we were back in Mexico City.

I dropped off everyone at their respective homes, except for Diego, who stayed at my place that night and the following three days as well.

I don’t know what made it feel so important and deep and life–changing, but we had a conversation in my car, parked outside my house at one am, and this is the part of the trip that actually changed me; this was the true learning; not before, not the movies, not the green–haired girl, but this—this 60–minute long conversation I had with Diego in the darkness of my car outside my house. We talked about how he had met a guy in San Miguel de Allende. He had a very deep and meaningful conversation with him, he said. He said he wanted to share with me what the guy told him, because he considers us to be more or less the same, with similar contexts and backgrounds, and similar struggles. He said the guy told him, “Stop victimising yourself. Stop putting yourself in a position where you are the victim of the world. You may feel alone in this society, where nobody ever understands you and nobody ever truly supports you, but the fact of the matter is, this loneliness is just you being betrayed by what everybody has ever taught you: You have to fit in, but you don’t. Let me tell you: You don’t have to fit in. Forget what everyone’s ever told you. You have a voice and you have something to say to the world, and you deserve to be heard. Don’t stop and ask anybody for permission, and just do shit. Nobody will understand. That thing where everybody is trying to be different? That’s bullshit. I know this because I was like you, and we are the true outsiders. We don’t try to be different just for the sake of it. We just are, and people are afraid of this, and they get mad at you because you are at all times judging the reality you live in according to radically different ideas that feel unsafe to them, and they panic. You are you, and not anybody else. You are the result of shaping your ideas and refining your beliefs throughout the years, and not anybody else’s, and no one will understand. They will feel uncomfortable around you, because you’ve managed to transcend and go beyond what everyone expects from anybody, and they won’t be able to read you and label you according to what they know. But the trick is to not give a fuck and understand that you just have to keep pushing on your ideas. Never stop working. Never stop being you.”

I was almost in tears when I heard this. He said the guy said this to him within five minutes of meeting him, and he felt nobody had ever known him so well. I felt exactly the same way. I’ve never met this guy, and he’s never talked to me directly, but I felt like he knew me like nobody else. It was like being relieved from a huge burden I had been carrying my whole life, and for this I will always be thankful to him. All my failed relationships, and all my failed endeavours… they were failures because I was victimising myself. I have a voice and I have something to say to the world, and I deserve to be heard.

“You are invaluable,” Diego said to me. “You are unique and you must understand that you can’t keep sabotaging yourself. You must stop trying to force your ideas into the mold that’s been cast unto you by everybody. You have a voice and you have something to say to the world, and you deserve to be heard.”

I have a voice and I have something to say to the world, and I don’t care whether I am heard or not, I will just keep on pushing.

Some Days

At some point after every birthday I feel like I’m at the “outro” of my life. I can’t see beyond my own nose and I can’t picture myself waking up the next day. And I constantly feel like I am on the verge of death. And even now I can’t see myself ageing and growing old and settling down and having kids or not settling down and not having kids in some distant city in some distant country, maybe with a bicycle or maybe not, and perhaps a dog fits into the picture.

And every now and then I feel anxious about everything and grow uncomfortable and start walking and can’t stop until I lose track of my thoughts and look for the reason that prompted me to start in the first place, and come to the realisation that there is no reason, at which point I will stop on my tracks, turn back and go home. Then I’ll sit on the couch and forget about the whole thing and consume television programmes or maybe Internet videos.

Also every now and then I feel out of place and unhappy and just really fucking uncomfortable with everything and everyone in my life. “Where have all the good, interesting people gone?” And I will turn around and look for someone to console me and talk to me, but I’ll find there is no one—not even my friends. And I will begin asking myself where I would like to be if it is not here but it will be pointless because the answer invariably is “nowhere”. I don’t want to be anywhere. I don’t want to be. I don’t wanna die; I just don’t want to be.

Some days I feel like it is not me who is living my life but rather some impostor who’s acting out for the entertainment and amusement of some harsh spectator who expects everything to be really fucking interesting. And that spectator will be me. But I am also the actor. But I am also the spectator. And I observe my life with a great deal of attention and care and demand more of the actor whenever I feel he isn’t performing well. “No, no, no! When you talk to her there has to be more drama! What are you doing, you idiot? You have to act cool for this scene!”

But some other days it will hit me that I am actually me and that it is I who is living my life. And that I own this I character and that I should internalise his feelings and emotions and thoughts and intentions. And it will hit me in the most absurd way possible, like for example when I am walking down the stairs of my building and I walk into one of my neighbours and he stops and says “Good morning! Lovely day, isn’t it?” and I will reply with what starts as a fake smile, “Yes indeed!” but then realise that the smile on my face has suddenly become mine and that it is I who is producing it and that I own the smile and that I own this face and that I own these feelings. Did I really intend to answer so cheerfully? Am I really this full of joy? Well, who the fuck knows, but I certainly own that feeling now! And also now I, unfortunately, have to play along with it.

Well, fuck.