<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>gjtorikian.online</title>
  <subtitle>I inhale and exhale.</subtitle>
  <id>https://gjtorikian.online/</id>
  <link rel="alternate" type="text/html" href="https://gjtorikian.online/" />
  <link rel="self" type="application/atom+xml" href="https://gjtorikian.online/feed.xml" />
  <updated>2026-07-23T00:00:00.000Z</updated>
  <author><name>Garen Torikian</name></author>
  <entry>
    <title>Proving a human wrote something</title>
    <id>https://gjtorikian.online/posts/proving-a-human-wrote-something/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/proving-a-human-wrote-something/" />
    <published>2026-07-23T00:00:00.000Z</published>
    <updated>2026-07-23T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="tech" />
    <summary type="text">When drafting a new blog post after some years, it’s mandatory to begin it with some form of mea culpa . I actually made a New Year’s resolution to start writing more blog posts; after the dissolution of my company last year, my head was stuffed with all sorts of technical knowledge I needed to shar...</summary>
    <content type="html"><![CDATA[<p>When drafting a new blog post after some years, it’s mandatory to begin it with some form of <em>mea culpa</em>. I actually made a New Year’s resolution to start writing more blog posts; after the dissolution of <a href="https://web.archive.org/web/20250326145422/https://yetto.app/" rel="noopener">my company</a> last year, my head was stuffed with all sorts of technical knowledge I needed to share (and which, I felt, the world <em>needed</em> to hear). I even put together a spreadsheet of possible ideas, which, as I’m writing this down now, I should probably revisit. Some combination of “I got lazy” or “I got busy” or “I didn’t think anyone would care” prevented me from writing, though. (That’s not to say I haven’t been writing anywhere else: I just got “<a href="https://gothamguillotine.com/2026/07/15/how-to-keep-well-in-wartime/" rel="noopener">How to Keep Well in Wartime</a>” published, and I’m still running <a href="https://inch.press/" rel="noopener"><em>Inch Press</em></a>!)</p>
<p>I still also make endless side projects and maintain innumerable open source repos. To that end, I recently <a href="https://mitchellh.com/writing/everyone-should-know-simd" rel="noopener">read something by Mitchell Hashimoto</a> which began with this increasingly common disclaimer:</p>
<blockquote>
<p>this was completely hand-written with no AI assistance</p>
</blockquote>
<p>I’m not an AI-hater. I use it all day, every day, at my day job (and even <a href="https://workos.com/blog/handwritten-sdks-are-dead" rel="noopener">wrote about on the company blog</a>—more proof I still write!). I create shippable production code with it and experiments that never leave my terminal. I use it in my open source work to write commits, provide feedback, and generally automate tasks that are too convoluted to come up with in a bash or Ruby script. I don’t think any engineer can, or should, ignore AI. It’s a technology, and like all technologies, it’s here to stay (until something better comes along). It’s beneficial to the craft to understand how to work with it rather than spend time fighting against it.</p>
<p>Part of the reason I enjoy programming is because I like solving technical puzzles. And, part of the reason I like AI is because I can say “do X using Y because of Z,” while walking away to go brew a third cup of coffee or pet my cat or do anything other than sit at my desk, tip-tapping the solution out. When I was a teenager, I, like Lain, never wanted to leave the Internet. Now that I’m closer to the end of my life than its beginning, I want to experience as much as I can of the real world, as often as I can.</p>
<p>With age comes wisdom and worry. Whenever I use AI, I’m actually very <a href="https://www.apa.org/monitor/2026/07-08/ai-job-skills-thinking" rel="noopener">concerned about the smoothing of my brain</a>. The inherent irony of my usage outlined above is that the only reason I <em>know</em> about X using Y because of Z is because I accumulated twenty-something years of infernal knowledge for how to communicate with this damn beast made of rocks. I’m fine with letting go of the physical embodiment of programming, but the mental process is still something I look forward to sparring with.</p>
<p>I can say something similar about writing. When I engage with an AI to produce code, there is, to some extent, a deterministic goal I am hoping to achieve: the button should do this, the site should look like that. But when I engage with an AI to produce written words, the outcome is often calibrated to produce a response I didn’t decide on. That is to say: the AI knows all the tricks of “good content”—how to create a staccato sentence or how to produce dichotomastic statements to get the reader to feel a certain way. How the AI gets at that goal is often not how <em>I</em> would get at the goal; and because getting at a goal is one of the very points of writing, I often choose to write my own thoughts using my own hands.</p>
<p>At last, we’re coming to the point, which is a question I (and others) have been wondering, which Hashimoto’s note alludes to: how do you prove a human wrote something? Forget about the why or the value in it, just: how?</p>
<p>My answer to that is a project I called <a href="https://semoi.net/" rel="noopener">Semoi</a>.<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup> The idea is somewhat simple: what distinguishes humans typing from an LLM producing is time and effort. A human is slower, and a human’s digital fingerprints are quite literally that: the keystrokes it took to produce the text. Semoi is a plugin (currently only available for Obsidian) which tracks the length of time it took for a document to be written up. It also tracks the number of keystrokes it took to produce that document. When you’re done writing the piece, you send all that information to the Semoi server, which cryptographically signs and mints the information, proving that it hasn’t been tampered with.</p>
<p><img src="https://gjtorikian.online/assets/images/2026-07/semoi-plugin.png" alt="Screenshot of the Semoi plugin minting a proof" loading="lazy" decoding="async"></p>
<p>You can then get a little image to paste in your blog somewhere proving that yes, indeed, you wrote the piece.</p>
<p><img src="https://gjtorikian.online/assets/images/2026-07/semoi-cert.png" alt="Screenshot of the Semoi certificate" loading="lazy" decoding="async"></p>
<p>And of course you can <a href="https://semoi.net/verify/bbff30b3b0f9e72c53517a55" rel="noopener">share the link around</a> if you so desire.</p>
<p>My theory goes like this: say a thousand word blog post is published. If an LLM wrote that piece of text, the time it took for it to do so would be on the order of seconds, not minutes. That’s one heuristic Semoi captures. Another is the series of keyup/keydown events that a human types. An LLM generated piece would simply be one copy-paste event—from the terminal to the editor—so one would expect that thousand-word piece to have thousands of individual characters (and events for each of those).</p>
<p>Is it foolproof? No. Is it extremely scientific? Also no. Is it a good idea? Well, I think so. You can see a presentation I gave of this system at my favorite event, <a href="https://www.youtube.com/watch?v=PVHoTq2iKhI" rel="noopener">WordHack</a>.</p>
<p>One could work around Semoi by, for example, typing out a bunch of gibberish, leaving their editor open, and then pasting in an LLM generated texting and minting the proof. To which I would respond: why? That’s really pathetic.</p>
<p>No information about your text is ever sent to the server, and there’s no way to identify the author based on the minted certificate. All the server receives is a JSON blob of timestamps and keystroke events.</p>
<p>If Semoi never takes off, that’s completely fine! My GitHub repositories are gardens full of both flourishing and withered flowers. But it’s my sincere hope that in writing this post, it nudges someone else to think of an even better idea than this one. That’s another point of writing, after all.</p>
<hr class="footnotes-sep">
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>From Lucia Joyce’s famous declaration: “C’est moi qui est l’artiste” <a href="#fnref1" class="footnote-backref">↩︎</a></p>
</li>
</ol>
</section>
]]></content>
  </entry>
  <entry>
    <title>Exorcism in Politics or the Conspiracy of Imbeciles</title>
    <id>https://gjtorikian.online/posts/exorcism-in-politics-or-the-conspiracy-of-imbeciles/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/exorcism-in-politics-or-the-conspiracy-of-imbeciles/" />
    <published>2020-07-08T00:00:00.000Z</published>
    <updated>2020-07-08T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="politics" />
    <summary type="text">I often think of this essay by Baudrillard, and always have a hard time finding it. It’s from Screened Out , first published by Verso in 2002, translated by Chris Turner. The book itself was first published as Ecran total , by Editions Galilee, in 2000.</summary>
    <content type="html"><![CDATA[<p>I often think of this essay by Baudrillard, and always have a hard time finding it. It’s from <em>Screened Out</em>, first published by Verso in 2002, translated by Chris Turner. The book itself was first published as <em>Ecran total</em>, by Editions Galilee, in 2000.</p>
<hr>
<p>Two situations, each equally critical and irresolvable: the worthlessness of contemporary art; political impotence in the face of Le Pen. There is a trade-off between the two and a resolution by transfusion: powerlessness to mount any political opposition to Le Pen is displaced on to the terrain of culture and the cultural Holy Alliance. So, when it comes to questioning contemporary art, this can be the product only of reactionary and irrational - if not, indeed, fascistic - thinking.</p>
<p>How can one counter this respectful conspiracy of imbeciles? Sadly, nothing can correct this mechanism of intellectual perversion, since it is inspired by bad conscience and the impotence of our ‘democratic’ elites to resolve both the impasse of art and the political impasse of the struggle against the Front National. The easiest solution is to merge the two problems in the same moralizing vituperation. The real question then becomes: can one not ‘open up’ the issue in some way, suggest something unusual, irreverent, unconventional or paradoxical without automatically being seen as coming from the extreme Right (which is, it must be said, a homage paid to the extreme Right)? Why has everything moral, conventional and conformist - things which were traditionally on the Right — now gone over to the Left?</p>
<p>A painful revision. Whereas the Right embodied moral values and the Left, by contrast, a certain contradictory historical and political resolve, the Left today, stripped of all political energy, has become a pure court of morality — the embodiment of universal values, the champion of the reign of Virtue and upholder of the antiquated values of the Good and the True — a court before which everyone is answerable but itself. The political illusion of the Left, deep-frozen for twenty years spent in opposition, has turned out, on the Left’s gaining power, to be pregnant not with the meaning of history, but with a morality of history. With a morality of Truth, Right and good conscience — the degree zero of politics and even, we may safely say, the lowest point of the genealogy of morals. This moralization of values in which the historical truth of a particular event, the aesthetic quality of a work of art or the scientific pertinence of a particular hypothesis can be judged only in moral terms, is the historical defeat of the Left (and of thought). Even reality, the reality principle, is an article of faith. Question the reality of a war and you’ll be condemned for betraying the moral law.</p>
<p>With the Left as lacking in political vitality as the Right, where has politics moved to? The answer is simple: on to the ground of the extreme Right. As Bruno Latour put it very well in Le Monde, the only person talking politics in France today is Le Pen. All the others are talking morality or civics; they sound like schoolteachers or instructors, managers or programmers. Le Pen, committed to evil and immorality, snaffles all the political stakes, scoops up all that has been cast aside or positively repressed by the politics of Good and Enlightenment. The more the moral coalition hardens against him - a mark of political impotence - the more political capital he makes out of immorality, out of being the only one on the side of evil. When, in the past, the Right went over to defending moral values and the established order, the Left did not hesitate to defy those same moral values in the name of political ones. It is itself today the victim of such a slide, of such a dereliction: with the Left overtaken by moralism, the repressed political energy necessarily crystallizes else- where - in the enemy camp. And so the Left, by embodying the reign ofVirtue, which is also the reign of the greatest hypocrisy, can only fuel Vice.</p>
<p>If Le Pen didn’t exist, he’d have to be invented. It is he who delivers us from a whole evil side of ourselves, from the quintessence of all that is worst in us. For this we should rightly anathematize him. But if he disappeared, woe betide us, exposed to all our racist, sexist and nationalist viruses (we all have them) or, quite simply, to the murderous negativity of social being. In this respect he is the mirror of the political class, who use him to exorcize their own evils, just as we use them to exorcize all the corruption inherent in the operation of society. The same corrupting function, the same cathartic function. The desire to root all this out, the desire to purify society and moralize public life, to liquidate all that represents evil, shows a total misconception of the mechanisms of evil, and thus of the very form of the political.</p>
<p>The anti-Le Pen forces, employing tactics of unilateral condemnation and showing no appreciation of this reversibility of evil, have entirely abandoned its use to Le Pen himself. As a result he is, by his very exclusion, in an impregnable position. The political class, by stigmatizing him in the name of Virtue, puts him in the most comfortable of situations, where all he has to do is sweep up the symbolic charge of ambivalence, of rejection of evil and hypocrisy which his righteous adversaries obligingly produce for him — almost as if they were in his pay. He draws his energy from his enemies themselves, who rush to turn his own mistakes to his advantage. They have not understood that good is never the product of rooting out evil, which always exacts a glorious revenge, but of subtly treating evil with evil.</p>
<p>Le Pen is, then, the embodiment of stupidity and worthlessness, admittedly, but of the stupidity and worthlessness of the others, of those who, in denouncing him, denounce their own impotence and stupidity, simultaneously revealing the absurdity of fighting him head on without any understanding of this diabolical game of musical chairs - thus, in a terrifying lack of lucidity, feeding up their own phantoms, their own negative doubles.</p>
<p>What governs this perverse effect by which the Left is stuck in denunciation, while Le Pen retains an exclusive hold on enunciation — with the one profiting fully from his crime and the other harvesting all the negative effects of recrimination, the one delighting in evil and the other becoming entangled in victimhood? The answer is a simple truth: by confining Le Pen to a ghetto, the democratic Left has walled itself up; it points to itself as the discriminatory power and exiles itself in its obsession. It automatically cedes the other party’s claim of a denial of justice. And Le Pen does not shy from appealing to Republican legality for his own advantage. Above all, however, he cloaks himself in the illegal, imaginary, but very profound prestige of the persecuted — so well, indeed, that he can enjoy the benefits both of legality and illegality. From this ostracism he derives a freedom of language and a boldness of judgement which the Left denies itself.</p>
<p>An example of the magical thinking which currently does service for political thought: Le Pen is criticized for rejecting and excluding immigrants, but this is as nothing compared with the process of social exclusion which is going forward at all levels of society (exclusion itself, together with the ‘social fracture’, found itself excluded by the decree dissolving the National Assembly). And this complex, inextricable process of collective responsibility is one we are all accessories to, and victims of. It is, therefore, typically magical thinking to seek to ward off this virus which is spreading everywhere as an effect of our social and technical ‘progress’; to exorcize this curse of exclusion and our impotence in the face of it by vesting it in one execrable man, institution or group, whoever or whatever they may be; to treat it as a canker that could simply be surgically removed, when the secondary infections have already spread to all parts. The Front National is merely following the paths beaten by these secondaries — paths beaten with all the more virulence for the fact that we believe we have eliminated the tumour, and so, as a result, the germs spread into the whole organism. Not to mention that this magical projection where the Front National is concerned does to it precisely what it does to immigrants. We must beware of this ruse of contamination in which, by sheer transparence of evil, the positive changes into a negative virus, and the demand for liberty into ‘democratic despotism’. As ever, we see here that reversibility, that subtle coiling and winding, of evil which catches rational intelligence off its guard (when the whole of modern pathology teaches us so much about this at the level of the physical body, we pay no heed to it where the social body is concerned).</p>
<p>To remain with politics, we must avoid ideology and see things in terms of social physics. Our democratic society is the stasis and Le Pen the metastasis. Society as a whole is dying of inertia and immunodeficiency. Le Pen is the visible transcription of this viral state, its spectacular projection. Things here are as they are in dreams: he is the burlesque, hallucinatory figuration of this latent state, of this silent inertia made up in equal measure of enforced integration and systematic exclusion. Since, in this society, the hope of reducing social inequality has (almost) definitively dis- appeared, we should not be surprised to see the resentment shifted on to race inequality. The bankruptcy of the social project is responsible for the successful re- emergence of race (and of all the other forms of fatal strategies). In this sense, Le Pen is the only ‘unofficial’ analyser of this society. The fact that the analysis is on the extreme Right is merely a sad consequence of the fact that there is no such analyst on the Left or the far Left. And certainly none is to be found among the judges or the intellectuals. Only immigrants, at the opposite extreme, might also be in a position to analyse what is going on, but a certain form of ‘right thinking’ has largely taken them over. Le Pen is the only one radically to minimize the Right—Left distinction — admittedly, because it is of little importance to him, but the uncompromising critique of that distinction made since the 1960s and in 1968 has unfortunately disappeared from political life. He benefits, then, from a defacto situation the political class refuses to face up to (indeed, they do all they can to mask it with elections), but one day the extreme consequences of that situation will have to be drawn. If, one day, political imagination, political will and resolve have some opportunity to bounce back, they will do so only on the basis oft he radical abolition of this fossilized distinction which has, over the decades, revealed itself to be an empty sham, and which only holds up now by corrupt collusion. It is a distinction which has vanished in reality, but which, by some incurable revisionism, is constantly being revived, thereby making Le Pen the begetter of the only new political scene. It is as though everyone were involved in scuppering what remains of democracy, doubtless to give the retrospective illusion that it once existed. Many things today have no other existence than this staging of their disappearance. Proving that they existed by a premature act of mourning, Le Pen here being the agent of that work of mourning and the man carrying out the ‘contract’.</p>
<p>Is there some chance of drawing the consequences of this extreme (but original) situation other than through the hallucinatory medium ofLe Pen — that is to say, other than by a magical conjuration which saps all energies? How are we to avoid succumbing to this viral excrescence of our own demons, other than by going back, beyond political moralism and democratic revisionism, to that unofficial analysis which Le Pen and the Front National have in a sense snatched from us?</p>
<p><em>7 May 1997</em></p>
]]></content>
  </entry>
  <entry>
    <title>Borges&apos; Mother and Saroyan</title>
    <id>https://gjtorikian.online/posts/borges-mother-and-saroyan/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/borges-mother-and-saroyan/" />
    <published>2019-10-22T00:00:00.000Z</published>
    <updated>2019-10-22T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="saroyan" />
    <category term="borges" />
    <summary type="text">In the 1978 edition of “The Aleph and Other Stories,” written by Jorge Luis Borges, edited and translated by Norman Thomas di Giovanni, there’s a throwaway line in the final section titled “An Autobiographical Essay”  :</summary>
    <content type="html"><![CDATA[<p>In the 1978 edition of “The Aleph and Other Stories,” written by Jorge Luis Borges, edited and translated by Norman Thomas di Giovanni, there’s a throwaway line in the final section titled “An Autobiographical Essay”<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup>:</p>
<blockquote>
<p>My mother has always had a hospitable mind. From the time she learned English, through my father, she has done most of her reading in that language. After my father’s death, finding that she was unable to keep her mind on the printed page, she tried her hand at translating William Saroyan’s <em>The Human Comedy</em> in order to compel herself to concentrate. The translation found its way into print, and she was honored for this by a society of Buenos Aires Armenians.</p>
</blockquote>
<p>This book was given to me by a friend as a birthday gift, and since her inscription is dated, I know exactly that for over twelve years this thought has haunted me from time to time: Borges’ mother translated Saroyan. I’ve read several biographies on the writer and poured over his archives at Stanford, and no one has ever mentioned the possible effect his prose had on Borges. Is it not a delight to think that the Argentine could’ve been influenced by the Armenian?</p>
<p>From time to time, I’ve done some research on the relationship Borges and his mother, Leonor Acevedo Suárez, had with Saroyan, although truthfully it hasn’t been in earnest. Lately, I’ve been thinking about the relationship more and more, and began to search for information. There don’t seem to be any resources in English for the triangle between Saroyan and Suárez and Borges. How Suárez even came across the desire to translate this novel is a mystery to me. I can’t find an Argentinean publication date for <em>La comedia humana</em>; the oldest one I can find online is from 1965, published by Plaza &amp; Janés, which is based out of Barcelona. Borges’ father died in 1938 and <em>The Human Comedy</em> came out in 1943, so this edition seems rather late, if it does happen to be Suárez’s translation.</p>
<p>Instead, I <em>did</em> manage to find more information from Borges himself on the translation undertaken by his mother. <em>Borges en diálogo</em>, published in 1985, is a set of radio interviews between Borges and the writer Osvaldo Ferrari. It’s pretty much just Ferrari tossing a topic up into the air like a tennis ball and allowing Borges to strike against it for a few minutes. Incredibly, the English translation for this conversation only came out in 2015, 30 years later; if I had been just a little more motivated, perhaps I could have offered the first translation of the additional information on Borges’ mother and Saroyan. Unable to find any copies of the English text online, though, here’s at least my rendition of the transcript, deposited into the eddies of the Internet for someone else to come across and make use of:</p>
<blockquote>
<p>Now, my mother understood very little English; when my father died in 1938, she wasn’t even able to read. She would read a page and then forget it, as if she had been reading a blank page. Then, she set upon herself a task that forced her to pay attention, and that was to translate. She translated a book by William Saroyan called <em>The Human Comedy</em> (<em>La comedia humana</em>). She showed it to my brother-in-law, Guillermo de Torre, and he published it. On another occasion, the Armenians put together a small party for my mother at the Argentinian Society of Writers, on calle México—that old run-down house close to the National Library. Well, I remember I went with her, and it was a great surprise to see her stand up and give a little speech, for about ten minutes. I believe that it was the first time in her life that she spoke, let’s say, in public. Fine, it wasn’t a large audience, just a group of men whose last names ended in “ian,” without a doubt all residents of Retiro, the neighborhood I live in, an essentially Armenian neighborhood. In any case, there are more Armenians here than any other peoples. And very close by, there’s an Arabic neighborhood. But unfortunately, these neighborhoods aren’t preserved, or they don’t have their own proper architecture. One has to pay attention to the names, and here there are certainly many Toppolians, Mamulians, Saroians.</p>
</blockquote>
<p><img src="https://gjtorikian.online/assets/images/2019-10/En_di%C3%A1logo_1.png" alt="En diálogo, 1" loading="lazy" decoding="async"><br>
<img src="https://gjtorikian.online/assets/images/2019-10/En_di%C3%A1logo_2.png" alt="En diálogo, 2" loading="lazy" decoding="async"></p>
<hr class="footnotes-sep">
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>This essay was originally published by <a href="https://www.newyorker.com/magazine/1970/09/19/autobiographical-notes-argentine-writer" rel="noopener"><em>The New Yorker</em>, September 19, 1970 pg. 40</a> <a href="#fnref1" class="footnote-backref">↩︎</a></p>
</li>
</ol>
</section>
]]></content>
  </entry>
  <entry>
    <title>Go doesn&apos;t care about you</title>
    <id>https://gjtorikian.online/posts/go-doesnt-care-about-you/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/go-doesnt-care-about-you/" />
    <published>2019-01-25T00:00:00.000Z</published>
    <updated>2019-01-25T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="tech" />
    <summary type="text">There’s a theory called linguistic relativity which postulates that the language you speak modifies your comprehension of the world. That a word does not exist in a language does not mean that the concept itself doesn’t exist; only that it is harder to express, and therefore, a source of potential b...</summary>
    <content type="html"><![CDATA[<p>There’s a theory called <a href="https://en.wikipedia.org/wiki/Linguistic_relativity" rel="noopener">linguistic relativity</a> which postulates that the language you speak modifies your comprehension of the world. That a word does not exist in a language does not mean that the concept itself doesn’t exist; only that it is harder to express, and therefore, a source of potential bias when attempting to describe something.<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup></p>
<p>I don’t think this hypothesis is taken into consideration often enough when describing programming. There is not a strictly 1:1 correlation between human and programming languages by any means. But when we say “This language is a good choice for the problem,” what does “good” actually mean? Well, usually we mean that a computational idea that needs to be expressed—asynchronous work, memory safety, function composition—can be stated easily. It’s not to say that one language <em>can’t</em> do any of those things, but it does imply that some languages make it harder to do than others.</p>
<p>Go is a language which is able to succinctly express high-performance concepts. This post is not going to delve into some of the negative aspects of Go which have been discussed many times before by early adopters, such as its error handling or its absolutely atrocious lack of appropriate tooling for dependency/package management. I’m also not even going to outright say Go is bad, because it’s not <em>bad</em> (and because I don’t want to scare future employers 😉).</p>
<p>It’s just that it’s only contribution to the world is to be able to quickly write performant code.</p>
<div class="heading-wrapper">
<h2 id="do-what-i-tell-you-to-do">“Do what I tell you to do”</h2>
<a class="heading-anchor" href="#do-what-i-tell-you-to-do" aria-label="Link to &quot;“Do what I tell you to do”&quot;">#</a></div>
<p>I’ll begin by picking on one aspect of Go which attacks you right as you’re trying to learn the language: you can’t write a program which includes unused imports. For example, suppose I have the following code:</p>
<pre class="language-go"><code class="language-go"><span class="token keyword">package</span> main

<span class="token keyword">import</span> <span class="token string">"fmt"</span>
<span class="token keyword">import</span> <span class="token string">"math"</span>

<span class="token keyword">func</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  fmt<span class="token punctuation">.</span><span class="token function">Println</span><span class="token punctuation">(</span><span class="token string">"hello world"</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>
</code></pre>
<p>When building this, the compiler will complain with: <code>./unused.go:4:8: imported and not used: &quot;math&quot;</code>. There’s no usage of <code>math</code> anywhere in the running code, so it’s not necessary to <code>import</code> the <code>math</code> package. This is a neat way to ensure that your code is not pulling in dependencies it doesn’t need, and it makes sense. You don’t have to worry about this error ever coming up if you configure your editor to run <code>gofmt</code> (a tool designed to rewrite your code to a standardized formatting) every time you save a file.</p>
<p>Here’s the issue, though. When writing code, sometimes it’s necessary to just try ideas out. If one direction doesn’t work, you revert your changes and try rebuilding from scratch. As a programmer, playing is just as important as perfecting. That the compiler interrupts your thought process here is not only annoying, but also, unnecessary. In any other language, this might show up as a warning, but Go insists that your iterative progress halt, and that you either comment the unused import, or figure out a way to make use of it.</p>
<p>But, as I said–if you run <code>gofmt</code> automatically, this is no longer a problem. However…that is not always the case. Consider the following code:</p>
<pre class="language-go"><code class="language-go"><span class="token keyword">package</span> main

<span class="token keyword">import</span> <span class="token string">"fmt"</span>

<span class="token keyword">func</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  <span class="token keyword">var</span> word <span class="token builtin">string</span>
  fmt<span class="token punctuation">.</span><span class="token function">Println</span><span class="token punctuation">(</span><span class="token string">"hello world"</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>
</code></pre>
<p>At one point, I thought I would need a string variable called <code>word</code>, but I ended up changing my mind. Again, the compiler will argue with you: <code>word declared and not used</code>. Only this time, <code>gofmt</code> does <em>not</em> clean this unused variable. Why is the tool wise enough to know that an import is not being used and helps clear it away, while being too dumb to remove a variable it’s noticed that I’m not using?</p>
<p>What’s the behavior of a program which defines a constant that isn’t used anywhere?</p>
<pre class="language-go"><code class="language-go"><span class="token keyword">package</span> main

<span class="token keyword">import</span> <span class="token string">"fmt"</span>

<span class="token keyword">const</span> <span class="token punctuation">(</span>
  phrase <span class="token operator">=</span> <span class="token string">"universe"</span>
<span class="token punctuation">)</span>

<span class="token keyword">func</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  fmt<span class="token punctuation">.</span><span class="token function">Println</span><span class="token punctuation">(</span><span class="token string">"hello world"</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>
</code></pre>
<p>I introduced a <code>const</code> named <code>phrase</code>, but I never use it. But you know what? The compiler doesn’t complain, and <code>gofmt</code> doesn’t remove it. The program runs just fine.</p>
<p>This level of inconsistency is the root of my frustrations with Go.</p>
<div class="heading-wrapper">
<h2 id="im-not-going-to-help-you">“I’m not going to help you”</h2>
<a class="heading-anchor" href="#im-not-going-to-help-you" aria-label="Link to &quot;“I’m not going to help you”&quot;">#</a></div>
<p>Here’s another one: Go touts itself as capable of producing memory efficient software. Its language authors come from a C background, and they are all too familiar with the dangers of memory allocation, pointer referencing, and cleanup. And yet, I found it incredibly easy to produce segfaults, without even messing with pointer logic.</p>
<p>Consider this program:</p>
<pre class="language-go"><code class="language-go"><span class="token keyword">package</span> main

<span class="token keyword">import</span> <span class="token string">"fmt"</span>

<span class="token keyword">func</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  myset <span class="token operator">:=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token builtin">int</span><span class="token punctuation">{</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">}</span>

  s <span class="token operator">:=</span> myset<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">:</span><span class="token number">10</span><span class="token punctuation">]</span>
  fmt<span class="token punctuation">.</span><span class="token function">Println</span><span class="token punctuation">(</span>s<span class="token punctuation">)</span>
<span class="token punctuation">}</span>
</code></pre>
<p>As soon as you try to run it, it crashes spectacularly:</p>
<pre class="language-plaintext"><code class="language-plaintext">panic: runtime error: slice bounds out of range

goroutine 1 [running]:
main.main()
  /Users/gjtorikian/projects/arr.go:10 +0x6d
exit status 2
</code></pre>
<p><code>myset</code> only has five elements, and I attempted to access a fictional 10th. Of course this won’t work, but I was still able to compile the program, run it, and hurt myself. Let’s take a look at a similar example in Rust, another language about as old as Go that also brags about its memory efficiency:</p>
<pre class="language-rust"><code class="language-rust"><span class="token keyword">fn</span> <span class="token function-definition function">main</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  <span class="token keyword">let</span> myset<span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token keyword">i32</span><span class="token punctuation">;</span> <span class="token number">5</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">]</span><span class="token punctuation">;</span>

  <span class="token macro property">println!</span><span class="token punctuation">(</span><span class="token string">"{}"</span><span class="token punctuation">,</span> myset<span class="token punctuation">[</span><span class="token number">10</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<p>When you attempt to build this program, the compiler responds with:</p>
<pre class="language-plaintext"><code class="language-plaintext">error: index out of bounds: the len is 5 but the index is 10
 --> arr.rs:5:20
  |
5 |     println!("{}", myset[10]);
  |                    ^^^^^^^^^
  |
  = note: #[deny(const_err)] on by default

error: aborting due to previous error
</code></pre>
<p>This time, the compiler is intelligent enough to notice that you’re attempting to do something undefined. Better still, it specifically points out where in the code the error is, and it gives you specific information (<code>len is 5 but the index is 10</code>). Now, injecting this kind of intelligence into Go’s compiler is difficult, but Rust shows <em>it is not impossible</em>. Furthermore, when Rust detects a variable isn’t being used, it doesn’t get angry at you (unless you ask it to), and it suggests a workaround:</p>
<pre class="language-plaintext"><code class="language-plaintext">warning: unused variable: `unused_var`
 --> arr.rs:4:9
  |
4 |     let unused_var: i32;
  |         ^^^^^^^^^^ help: consider using `_unused_var` instead
  |
  = note: #[warn(unused_variables)] on by default
</code></pre>
<p>Many people believe that Rust is a hard language to learn, and it <em>is</em>. The <a href="https://gjtorikian.online/posts/wrapping-rust-in-ruby-to-parse-graphql/#rustc-is-helpful-and-unforgiving"><code>rustc</code> compiler is unforgiving</a> in its demands for memory safety. It asks the programmer to think hard about how their program runs, and being able to riff on an idea isn’t easy. But you know what? The compiler is always right. It’s not only right, it’s helpful. It tries to point you to online documentation explaining what problem it’s found, and what you can do to fix it.</p>
<p>A compiler understanding memory management is one thing. A compiler coming back at you and saying obtusely <code>word declared and not used</code> is an entirely different, much easier problem to solve. A language designer must simply <em>care</em> to see it as a problem. The examples above are trivial, but in a real-world scenario, it’s very easy to get a Go program to crash, with absolutely no insight other than a line number to a file which, crucially, comes <em>after</em> a bunch of hex garbage:</p>
<pre class="language-plaintext"><code class="language-plaintext">panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x14aba17]

goroutine 1 [running]:
github.com/gjtorikian/metrocarddump/metrocarddump.parse.func1(0x1634f80, 0xc0000463c0, 0x1630b20, 0xc0000e02c0, 0x0, 0x0)
  /Users/gjtorikian/go/src/github.com/gjtorikian/metrocarddump/metrocarddump/app.go:165 +0x777
github.com/chromedp/chromedp.ActionFunc.Do(0xc0028c6230, 0x1634f80, 0xc0000463c0, 0x1630b20, 0xc0000e02c0, 0x0, 0x0)
  /Users/gjtorikian/go/src/github.com/chromedp/chromedp/actions.go:22 +0x4e
github.com/chromedp/chromedp.Tasks.Do(0xc0028a6b40, 0x6, 0x6, 0x1634f80, 0xc0000463c0, 0x1630b20, 0xc0000e02c0, 0xc0001a1400, 0xc0028923c0)
  /Users/gjtorikian/go/src/github.com/chromedp/chromedp/actions.go:35 +0x90
github.com/chromedp/chromedp.(*CDP).Run(0xc000116120, 0x1634f80, 0xc0000463c0, 0x1631d40, 0xc0028923e0, 0xc000030100, 0xc002506040)
  /Users/gjtorikian/go/src/github.com/chromedp/chromedp/chromedp.go:340 +0x9e
github.com/gjtorikian/metrocarddump/metrocarddump.navigate.func1(0x1634f80, 0xc0000463c0, 0x1630b20, 0xc0000e02c0, 0x0, 0x0)
  /Users/gjtorikian/go/src/github.com/gjtorikian/metrocarddump/metrocarddump/app.go:111 +0x194
github.com/chromedp/chromedp.ActionFunc.Do(0xc000134440, 0x1634f80, 0xc0000463c0, 0x1630b20, 0xc0000e02c0, 0x0, 0x0)
  /Users/gjtorikian/go/src/github.com/chromedp/chromedp/actions.go:22 +0x4e
github.com/chromedp/chromedp.Tasks.Do(0xc000134480, 0x4, 0x4, 0x1634f80, 0xc0000463c0, 0x1630b20, 0xc0000e02c0, 0xc00006cc00, 0x0)
  /Users/gjtorikian/go/src/github.com/chromedp/chromedp/actions.go:35 +0x90
github.com/chromedp/chromedp.(*CDP).Run(0xc000116120, 0x1634f80, 0xc0000463c0, 0x1631d40, 0xc0025060a0, 0xc000134480, 0x4)
  /Users/gjtorikian/go/src/github.com/chromedp/chromedp/chromedp.go:340 +0x9e
github.com/gjtorikian/metrocarddump/metrocarddump.glob..func1(0xc0001029a0)
  /Users/gjtorikian/go/src/github.com/gjtorikian/metrocarddump/metrocarddump/app.go:66 +0x2e1
github.com/gjtorikian/metrocarddump/metrocarddump.NewApp.func1(0xc0001029a0)
  /Users/gjtorikian/go/src/github.com/gjtorikian/metrocarddump/metrocarddump/app.go:41 +0x32
github.com/codegangsta/cli.HandleAction(0x14f8020, 0x15d4188, 0xc0001029a0, 0xc000123920, 0x0)
  /Users/gjtorikian/go/src/github.com/codegangsta/cli/app.go:503 +0x7c
github.com/codegangsta/cli.(*App).Run(0xc00012a000, 0xc0000301b0, 0x1, 0x1, 0x0, 0x0)
  /Users/gjtorikian/go/src/github.com/codegangsta/cli/app.go:268 +0x5b7
main.main()
  /Users/gjtorikian/go/src/github.com/gjtorikian/metrocarddump/metrocarddump.go:13 +0x4f
exit
</code></pre>
<p>Every programming language is an attempt to express a concept; the compiler (or linter) is a handbook that double checks your sentiments. When you’re learning a new language, a good teacher corrects your tenses, and guides you towards self-sufficiency. A compiler’s role is to question you, not in order to belittle you, but in order to verify what it is you are truly after.</p>
<p>The Go compiler is a horrible teacher: it tells you that you’re wrong, and then walks away. It’s <em>your</em> fault you made a mistake: figure it out.</p>
<p>I wouldn’t go so far as to say that it’s a level of incompetence, or even laziness, that Go treats its users this way. It’s clearly intentional. I think the problems with the language need to be taken into context as to who designed it, and how.</p>
<p>We forgive JavaScript for its flaws because <a href="https://en.wikipedia.org/wiki/JavaScript#Beginnings_at_Netscape" rel="noopener">it was designed in 10 days to combat a monopoly</a>. There’s more than one way to do things in Perl because <a href="https://en.wikipedia.org/wiki/Perl#Design" rel="noopener">it was designed by a linguist</a>. Ruby was <a href="https://en.wikipedia.org/wiki/Ruby_(programming_language)#Philosophy" rel="noopener">designed to make programmers happy</a>.</p>
<p>When it comes to language design, what’s Go’s excuse?</p>
<div class="heading-wrapper">
<h2 id="i-know-better-than-you">“I know better than you”</h2>
<a class="heading-anchor" href="#i-know-better-than-you" aria-label="Link to &quot;“I know better than you”&quot;">#</a></div>
<p><a href="https://twitter.com/gjtorikian/status/1086688585351335937" rel="noopener">I promised a hot take</a>, and here it is: a language so overbearing that it won’t let you make what <em>it</em> considers a mistake (while allowing you to make other severe errors) without offering any help could only be developed by a company with such arrogant superiority as to readily employ someone like <a href="https://en.wikipedia.org/wiki/Google%27s_Ideological_Echo_Chamber" rel="noopener">James Damore</a>. Or, if that’s too bombastic: Go was designed by programmers who don’t care what you think who work at a company that also doesn’t care about you.<sup class="footnote-ref"><a href="#fn2" id="fnref2">[2]</a></sup> They believe they are in the absolute right, and any crticism to their worldview is wrong. They didn’t write a language to solve your problems, they wrote it to solve theirs. They don’t care about your problems.</p>
<p>I understand why people are writing Go. Its success is intertwined with the overvaluation of a programmer. As every company became a software company, an emphasis on shipping code quickly overtook thoughtful design. That the language has annoyances is secondary to what its value is to a business. Time is money, businesses want to make more money, and therefore a tool that can get a programmer to produce “better” code faster is always going to win over one that is less prone to error, but takes more time to reason about.</p>
<p>When we say Go is “better” than another language, we mean marginally safer. We mean that Go can supersede untyped languages as a quicker way to produce software. With Go, you can produce performant, cross-platform binaries, with little effort, in a fairly straightforward way. In exchange, you have to surrender to its demands.</p>
<p>From the beginning of your very first Go project, you will encounter the <code>GOPATH</code>, which is a very specific directory where all third-party Go code must reside. This restriction was introduced to make things simpler. The consensus on the Internet is “<a href="https://www.reddit.com/r/golang/comments/40ps8k/really_wrestling_with_gopath/" rel="noopener">don’t fight <code>GOPATH</code></a>.” Taken independently, it is a good idea; but the more you work with Go, the more you realize that the only way to be successful with <em>any</em> of its concepts is to just work with whatever it tells you. The idea of there being Only One Way to build something sickens me. Use this one browser. Use this one search engine. Use this one programming language. All your problems will disappear if you just submit.</p>
<p>It takes two to make a language: one to speak it, and one to hear it. The German language is well-known for <a href="https://en.wikipedia.org/wiki/Compound_(linguistics)" rel="noopener">its ability to concatenate words</a> into a single, enormous phrase. Expressing a feeling is hard, and different languages have different words that reflect what their communities and societies value. It seems to me that Go is interested in talking at you, not with you. It’s a one-way language. Either you agree with it, or you don’t. And if you don’t—well, maybe you’re not the kind of person who believes that its authors are just humans, rather than infallible gods. I’m not sure they do either. If they did, they’d be much more receptive to the community’s feedback, if they cared to hear it. More than any other programming language, it’s popular to bash on Go because you know you won’t get anywhere with your critique. While searching for particularly egregious dismissals from the language authors, I found <a href="http://www.evanmiller.org/four-days-of-go.html" rel="noopener">this post</a> by Evan Miller, who already described the problem succinctly several years ago:</p>
<blockquote>
<p>[Go] feels like it is designed by an obsessive personality — obsessed with build times in particular, but also having an obsession with detail, someone who rarely makes mistakes when writing code, who generally will not run code until it appears to be complete and correct…Reading Go’s mailing list and documentation, I get a similar sense of refusal-to-engage — the authors are communicative, to be sure, but in a didactic way. They seem tired of hearing people’s ideas, as if they’ve already thought of everything, and the relative success of Go at Google and elsewhere has only led them to turn the volume knob down.</p>
</blockquote>
<div class="heading-wrapper">
<h2 id="because-i-said-so">“Because I said so”</h2>
<a class="heading-anchor" href="#because-i-said-so" aria-label="Link to &quot;“Because I said so”&quot;">#</a></div>
<p>Let’s return to the language itself. We know that Go is able to produce performant programs that are simple to write. But how legible are they, really?</p>
<p>Suppose we need to convert an integer to a string. What’s that look like in Go?</p>
<pre class="language-go"><code class="language-go"><span class="token keyword">package</span> main

<span class="token keyword">import</span> <span class="token punctuation">(</span>
  <span class="token string">"strconv"</span>
  <span class="token string">"fmt"</span>
<span class="token punctuation">)</span>

<span class="token keyword">func</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  t <span class="token operator">:=</span> strconv<span class="token punctuation">.</span><span class="token function">Itoa</span><span class="token punctuation">(</span><span class="token number">123</span><span class="token punctuation">)</span>
  fmt<span class="token punctuation">.</span><span class="token function">Println</span><span class="token punctuation">(</span>t<span class="token punctuation">)</span>
<span class="token punctuation">}</span>
</code></pre>
<p><code>Itoa</code> is such a bizarre name for a method! Where does this come from? Naturally, <a href="https://stackoverflow.com/a/10105983/213345" rel="noopener">this is a reference</a> to a method from C. And because “the creators of Go are all deeply embedded in that heritage and feel entirely comfortable with these names,” we should be okay with it, too.</p>
<p>How then does one convert a float? <code>ftoa</code>, maybe? No, <em>that</em> method is actually called <a href="https://golang.org/pkg/strconv/#ParseFloat" rel="noopener"><code>ParseFloat</code></a>. A-ha! So the language designers <em>are</em> aware of properly named functions. So why do they insist on retaining some older C references as well? Because they want to. There’s no consistency. Instead, you get someone’s half-baked memories of a way they used to program combined with newer ways of working with data types.</p>
<p>No language is without its problems, of course. When you want to create a new directory in Ruby, you call <code>Dir.mkdir</code>, which is analogous to the <code>mkdir</code> Unix command. When you want to execute the equally important <a href="https://superuser.com/a/165159/42699" rel="noopener"><code>mkdir -p</code></a>, you instead call <code>FileUtils.mkdir_p</code>. The inconsistency between the classes used is confusing and worth criticism.</p>
<p>Go’s problem is that it takes its inconsistencies to an esoteric level. Have you ever tried to format a time value into a string in a language? All of the ones I have worked with rely on a format defined by <a href="http://man7.org/linux/man-pages/man3/strftime.3.html" rel="noopener"><code>strftime</code></a>, another holdover from C. For example, to configure a time value to a full day name, a full month, a full day and a full year, you write this:</p>
<pre class="language-ruby"><code class="language-ruby"><span class="token builtin">Time</span><span class="token punctuation">.</span>now<span class="token punctuation">.</span>strftime<span class="token punctuation">(</span><span class="token string-literal"><span class="token string">"%A %B %d, %Y"</span></span><span class="token punctuation">)</span>
<span class="token operator">=></span> <span class="token string-literal"><span class="token string">"Friday January 25, 2019"</span></span>
</code></pre>
<p>Ooooh, remembering those percent-encoded references is so annoying! But many language have simply carried this syntax over, without change.</p>
<p>You might believe that Go would carry over this C-formatting. After all, its authors are C pros, right? Although such an assumption would be sane, it is also wrong. In Go, the exact same time formatting can be expressed like this:</p>
<pre class="language-go"><code class="language-go"><span class="token keyword">package</span> main

<span class="token keyword">import</span> <span class="token punctuation">(</span>
  <span class="token string">"fmt"</span>
  <span class="token string">"time"</span>
<span class="token punctuation">)</span>

<span class="token keyword">func</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  fmt<span class="token punctuation">.</span><span class="token function">Println</span><span class="token punctuation">(</span>time<span class="token punctuation">.</span><span class="token function">Now</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Format</span><span class="token punctuation">(</span><span class="token string">"Monday January 02, 2006"</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>
</code></pre>
<p><a href="https://github.com/golang/go/issues/444" rel="noopener">The language authors decided</a> that <code>strftime</code> is a bad interface—which is true. But rather than come up with a more elegant system, they decided that time ought to be formatted using a literal date phrase, rather than other placeholders. If you want the full name of a month, use <code>January</code>; if you want a shorter version, use <code>Jan</code>. Is this really an improvement on <code>%B</code> and <code>%b</code>?</p>
<p>Nowhere is the disdain of Go’s language authors for its users more perfectly encapsulated than this. Remember: “It’s not buggy and your supposition is wrong.”</p>
<div class="heading-wrapper">
<h2 id="language-is-imperfect-and-thats-okay">Language is imperfect, and that’s okay</h2>
<a class="heading-anchor" href="#language-is-imperfect-and-thats-okay" aria-label="Link to &quot;Language is imperfect, and that’s okay&quot;">#</a></div>
<p>I recognize that I’m in a shrinking population of programmers who question the tools and processes around them, a group of people who don’t believe a company whose business is selling all the trackable aspects of your life would also be capable of building an emotive language. Language is about communication, and Google, one of the most networked companies in the world, has historically understood very little about how people actually interact.</p>
<p>Python is another popular language at Google, and Python’s design principle is “<a href="https://wiki.python.org/moin/TOOWTDI" rel="noopener">There’s only one way to do it</a>.” Needless to say, I’m not much of a fan of Python, either. When a language is reduced to “correct” and “incorrect,” rather than gradients of clarity, the speaker is restricted from freedom of expression. Phrases indisputably devolve into “right” or “wrong,” which is a horrible reduction of a creative endeavor.</p>
<p>I was thinking about an example of this kind of “our way or no way” thought process, and recalled <a href="http://orwell.ru/library/novels/1984/english/en_app" rel="noopener">the principles of Newspeak</a>:</p>
<blockquote>
<p>Newspeak was designed not to extend but to diminish the range of thought, and this purpose was indirectly assisted by cutting the choice of words down to a minimum…The intention was to make speech, and especially speech on any subject not ideologically neutral, as nearly as possible independent of consciousness. For the purposes of everyday life it was no doubt necessary, or sometimes necessary, to reflect before speaking, but a Party member called upon to make a political or ethical judgement should be able to spray forth the correct opinions as automatically as a machine gun spraying forth bullets.</p>
</blockquote>
<p>By eliminating choices, a speaker of Newspeak could unambiguously shoot out sentences. Implementing concepts such as a standardized code style and a single path for dependencies are, by themselves, really good ideas. But taken in the larger context of Go’s design decisions, the implications are chilling. We might begin to understand why Go didn’t come with package management: because it doesn’t want different ways of doing things. The language is not conducive to a community of suggestions and improvements; you ought to be able to get by with what the standard package provides. Compare this mindset with, say, <a href="https://nodejs.org/en/knowledge/getting-started/what-is-node-core-verus-userland/" rel="noopener">Node’s free-for-all attitude towards Userland</a>. Code can use callbacks or promises, be asynchronous or not, and written in Typescript or Coffeescript. On a macroscopic level, it is confusing, but each individual programmer is free to choose the means of expression that suites them.</p>
<p>With Go, there is no sense of collaboration between yourself and the language. The joy in expressing a thought that satisfies the listener/compiler and also delights the speaker/programmer is not there. Go is <a href="https://en.wikipedia.org/wiki/Controlled_natural_language" rel="noopener">a controlled language</a>, the programming equivalent of Newspeak, and your role as a programmer is to use it without any capability to make personal adjustments.</p>
<p>Some might argue that flexibility in programming languages results in complex, unmanageable systems that don’t look like they were written with a single cohesive thought, <a href="https://golang.org/doc/faq#creating_a_new_language" rel="noopener">a problem Go wants to eliminate</a>. Programming languages are meant to accomplish tasks. They are tools, not means of communication. By reducing ambiguity, you can eliminate bugs and become more efficient.</p>
<p>It’s precisely that kind of “efficiency-first” attitude that disinterests me. The speed at which a task can be completed should never be the final metric for one’s skill, either as a programmer or a poet. Go is not infallible; the idea that you can be both fast and correct is an absolute myth. As with every trade-off, you can be one, or the other.</p>
<p>The capacity for diversity is what makes a language great, and what makes a programmer great is their ability to comprehend the rules of their language: which to abide, which to bend, and which to break. Programming is, after all, not just an endeavor between man and machine, but also between humans themselves. If we agree that creative expression is vital to human and programming languages alike, then we need to also accept that perfecting a language of previous errors—a perfection carried out by a small subset of people, rather than a broader community—is antithetical to that development, if not outright dangerous.</p>
<hr class="footnotes-sep">
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>“<a href="https://www.nytimes.com/2010/08/29/magazine/29language-t.html" rel="noopener">Does Your Language Shape How You Think?</a>” is a good summary of all of this. This won’t be a post on linguistics, sadly. <a href="#fnref1" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn2" class="footnote-item"><p>If you won’t believe me, then at least believe <a href="https://medium.com/@steve.yegge/why-i-left-google-to-join-grab-86dfffc0be84" rel="noopener">Steve Yegge</a>. <a href="#fnref2" class="footnote-backref">↩︎</a></p>
</li>
</ol>
</section>
]]></content>
  </entry>
  <entry>
    <title>The way you say sou</title>
    <id>https://gjtorikian.online/posts/the-way-you-say-sou/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/the-way-you-say-sou/" />
    <published>2019-01-17T00:00:00.000Z</published>
    <updated>2019-01-17T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="tweetstorm" />
    <category term="translation" />
    <summary type="text">From a tweetstorm !</summary>
    <content type="html"><![CDATA[<p><em><a href="https://twitter.com/gjtorikian/status/1085983208053923845" rel="noopener">From a tweetstorm</a>!</em></p>
<hr>
<p>Sometimes, I watch the same <a href="https://www.netflix.com" rel="noopener">Netflix</a> scenes over and over. I love languages, and when I hear an interesting phrase, I become immensely curious as to how it’s translated.</p>
<p>Come along with me as we examine the same scene in five different ways!</p>
<hr>
<p>Last night, I became incredibly obsessed with a twenty-second clip from a Netflix romcom anime Hi Score Girl, from S1E12. No plot lines are spoiled.</p>
<p>Here it is in the original Japanese.</p>
<p>Japanese knowledge isn’t required; given the colors, ominous music, and close-up shots…</p>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/He6HUXcBeng" frameborder="0" allowfullscreen></iframe>
</div>
<hr>
<p>…you can tell something sad is unfolding. Hidaka, the girl, says something. Haruo, the boy nervously replies. She says something, he replies again.</p>
<p>An entire world of meaning is in that final close-up of her mouth as she whispers: “a, sou”</p>
<p><img src="https://gjtorikian.online/assets/images/2019-01/ah_sou.gif" alt="GIF of Hidaka whispering" loading="lazy" decoding="async"></p>
<hr>
<p>(All following translations are my own, and rough ✌🏽 (I should also note that I have nothing but the utmost respect for VAs and subbers. All of the following tweets are just my thoughts ✌🏽))</p>
<hr>
<p>A translation could be:</p>
<p>sugu chikaku dakara ii noni<br>
I’ll be nearby soon, so it’s fine.</p>
<p>iyaiya<br>
Nah, it’s cool.</p>
<p>konnya wa hanabitaikai nan da yone<br>
Tonight is the fireworks festival, isn’t it?</p>
<p>un, maa, ore wa zenzen kyoumi ga nai<br>
Yeah, uh, I have absolutely no interest in that.</p>
<hr>
<p>Then:「あ そう」</p>
<p>“A, sou”</p>
<p>Yeah, of course.</p>
<hr>
<p>“Sou” could be used as a way of saying “that’s right/correct.”</p>
<p>More accurately–and here’s where it gets wacky!–is that you could also say “sou” when you’re being polite and already know the answer.</p>
<hr>
<p>If someone told you, “It’s going to rain today!” and you can see the clouds are gray and the smell of wet wind is in the air you still reply with “It does look that way,” acknowledging what they said.</p>
<p>“Sou” captures a feeling: one person agreeing with another’s stated fact.</p>
<hr>
<p>For more context, you can also use it as a respectful questioning – “Is that right?” or “You don’t say?” You’re not challenging their fact, you’re respecting their knowledge.</p>
<p>It’s purely humbling and not at all sarcastic, the exact opposite of what this face implies.</p>
<p><img src="https://gjtorikian.online/assets/images/2019-01/ya_dont_say.jpg" alt="A grotesque picture of Nicolas Cage" loading="lazy" decoding="async"></p>
<hr>
<p>When Haruo says “I’m not interested” and Hidaka simply replies “sou,” I interpret it to mean “Oh, yeah. That’s right. Of course you wouldn’t be interested in those things, what else should I have expected.”</p>
<hr>
<p>In English, you might reply to something with “Yeah, right” and it can be said either as a positive statement (“Ohhhh yeah”) or a sarcastic rebuttal.</p>
<p>I choose to believe that Hidaka is being a little stinker here (which she’s completely right to do so, Haruo is a selfish idiot)</p>
<hr>
<p>Cue my usual act when encountering something like the word “sou”: I pause Netflix, swap the languages, rewind the scene, and play it again.</p>
<hr>
<p>Here’s that same scene in English.</p>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/NeEfHaaJD3E" frameborder="0" allowfullscreen></iframe>
</div>
<hr>
<p>(One major difference here is that, due to time constraints, the English audio and text do not match, which gives us two different translations to follow for the price of one.</p>
<p>(Y E S!))</p>
<hr>
<p>In the first exchange, Hidaka’s spoken and written lines are fine. They capture the original meaning: she lives close by and doesn’t need to be walked home.</p>
<hr>
<p>Haruo, though… his voice loses that nervous “iyaiya” from the Japanese. He almost sounds resigned. Not bored, but reluctant. His written text is also somewhat brief: “It’s fine.”</p>
<p>Maybe this could’ve had a “whatever” attached on to show how unbothered he is by this “duty”?</p>
<hr>
<p>The fireworks conversation, in voice and text, is flawless. Haruo’s voice accurately captures his near disgust at the activity. He completely treats Hidaka as an ignorable presence.</p>
<hr>
<p>Let’s look at text translation of “sou” first: “Ah, I see.” This is a harshly literal translation. A better one that captures the original (and Haruo’s surprise at her uncharacteristic “rudeness”) could be “Of course not.”</p>
<hr>
<p>Her voice nails her feelings, though. The word “Yeah” can convey a much deeper feeling from how it’s sounded it out than if you just read the word.</p>
<p>You can hear her heart break as she realizes this guy isn’t going to take her out on a date.</p>
<hr>
<p>The next language to interpret is in Spanish. Same fun bonus here–two translations for one. Hooray!</p>
<p>Unlike the English, the differences between the sound and the text are very frustrating here. But I can understand why each choice was made.</p>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/Waia6sJ3xjA" frameborder="0" allowfullscreen></iframe>
</div>
<hr>
<p>Hidaka: Ya voy más que vivimos muy cerca.</p>
<p>“I’m going, though we live close to each other.”</p>
<hr>
<p>This misses the Japanese and English confidence that she carries in herself. Yes, they live close by, and she doesn’t want or need Haruo. In Japanese she literally says “it’s all good.”</p>
<p>Here in Spanish, she’s simply stating a fact and narrating what they are doing.</p>
<hr>
<p>But her TEXT translates as follows: “You don’t need to accompany me. I live close.”</p>
<p>Perfect! It captures the Japanese more precisely. Hidaka says she lives close by, &amp; doesn’t include Haruo’s relation to her at all. She cuts him out. The difference between vivimos &amp; vivo. No we.</p>
<hr>
<p>Haruo: Sí, tienes razón</p>
<p>Ehhh… this is such a weird reply. It translates maybe as “Yeah, you’ve got a point.” Which is a pretty rude thing to tell someone when they’re just making small talk about the distance between their homes.</p>
<hr>
<p>But again, the text absolutely nails it with “está bien”, which is a much more casual way of brushing off the walk. He’s saying “it’s all good” here versus “yeah you are right.”</p>
<p>Consider if it had been something like “no hay problema,” an even larger  mistake.</p>
<hr>
<p>There’s a big difference between “it’s fine” and “it’s not a problem.” Only the first choice is best for “iyaiya.” Calling something “not a problem” implies that the speaker assumes the listener thinks there was a problem, which is more bad etiquette.</p>
<hr>
<p>Hidaka: Mira, ya empezó festival</p>
<p>A unique observation in the Spanish: “The festival’s already started.” They reduced some of her coyness, which is a shame. She’s quite precise now.</p>
<p>I will say her excited “mira/look!” did get me to notice the subtle rumble of distant fireworks.</p>
<hr>
<p>Hidaka is speaking so stiffly here, again, just stating a fact. Instead of playing dumb (“the festival’s going to start, isn’t it?”) she knows the precise timeline of it. It’s as if she’s moments away from asking if he wants to go. Too bold a move for her character.</p>
<hr>
<p>Hidaka’s subtitles, though, are straight up from the original Japanese, even cleverly swapping “ね/ne” for ¿no?</p>
<p>That’s great. She knows the festival is tonight, but she wants to coax some excitement out of Haruo for it.</p>
<hr>
<p>Haruo: Sí, aunque no me gusta mucho esas cosas</p>
<p>This is REALLY great: “Yeah, though I don’t really like those things much.” Haruo used “興味/kyoumi/interest” &amp; refers specifically to Hidaka’s mention of the festival.</p>
<p>“estas cosas/those things” captures that dismissive attitude.</p>
<hr>
<p>His Spanish text falters for the first time: “no me interesa/ it doesn’t interest me.” It’s okay, but it could be better.</p>
<p>All languages miss the finality of “全然/zenzen/whatsoever.” No interest, <em>at all</em>. “nunca me gustó” might more clearly express the absolutely zero passion.</p>
<hr>
<p>Hidaka: Sí, entiendo.</p>
<p>Just as in English, it’s Hidaka’s voice that captures better what her words do not: “Yes, I understand.” She has a pissed tone in this language. But I think the word entiendo itself is another erroneous example of her stiffness.</p>
<hr>
<p>I think “claro” could be substituted here, which has a closer connotation to English’s sweet-and-sour “Of course.”</p>
<p>“It’s going to rain today.” “Of course!” Claro: it’s an obvious fact because the clouds are gray. Entiendo’s usage makes it come off as a harsher “Yeah, I know.”</p>
<hr>
<p>Her “ya veo” subtitle is a much better choice. Literally “I see,” it could be taken to also be “Now I get it. <em>Now</em> I understand.”</p>
<p>Hidaka realizing now en español that she’s not getting that fireworks date.</p>
<hr>
<p>Of the four translations, I think the good and less good formatting of how the “sou” sentiment is at least expressed consistently, given how the characters lines are all shaped immediately prior.</p>
<hr>
<p>Hidaka is either reserved, speaking nonchalantly, then seething with anger.</p>
<p>Or she’s being polite, acting coy, then depressed she can’t get Haruo’s attention.</p>
<p>In twenty seconds, we follow her thoughts and feelings along a slow, sad arc. All expressed with one melancholic “sou”</p>
]]></content>
  </entry>
  <entry>
    <title>A Eulogy for The Chris Gethard Show</title>
    <id>https://gjtorikian.online/posts/a-eulogy-for-the-chris-gethard-show/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/a-eulogy-for-the-chris-gethard-show/" />
    <published>2018-08-07T00:00:00.000Z</published>
    <updated>2018-08-07T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="television" />
    <category term="don&apos;t ever forget life" />
    <category term="new york city" />
    <summary type="text">Jon Yu was the one who got me tuned into The Chris Gethard Show with a humble tweet:</summary>
    <content type="html"><![CDATA[<p>Jon Yu was the one who got me tuned into The Chris Gethard Show with a humble tweet:<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup></p>
<center>
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Watch Jon Hamm Wrestle X-Pac <a href="https://t.co/AymluvsozB">https://t.co/AymluvsozB</a></p>&mdash; Adam Riff™ (@adamriffs) <a href="https://twitter.com/adamriffs/status/751235154551664640?ref_src=twsrc%5Etfw">July 8, 2016</a></blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</center>
<p>When I was younger, I was <em>very</em> into wrestling.<sup class="footnote-ref"><a href="#fn2" id="fnref2">[2]</a></sup> It was a consequence of being young in the early 90s and living in the suburbs. All of us wanted violence and adventure. My friends subscribed to the wrestling magazines, and there was <a href="https://gjtorikian.online/assets/images/2018-08/wrestlefest.jpg">an arcade cabinet</a> of the old Wrestlefest game at my Boys and Girls Club. At home, I wasn’t allowed to watch the matches, but I caught them whenever I could. Twenty years after the fandom, I could have cared less about Jon Hamm. The article only hinted at the real story. What the hell was <a href="https://www.youtube.com/watch?v=obwnbKlbysM" rel="noopener">the old 1-2-3-Kid</a> up to? How was “<a href="https://www.cagesideseats.com/2011/9/16/2425936/on-this-date-in-wcw-history-sean-waltman-debuts-as-syxx-and-joins-the" rel="noopener">the traitor</a>” atoning? What became of him after living as a <a href="https://en.wikipedia.org/wiki/D-Generation_X#DX_Army_(1998%E2%80%931999)" rel="noopener">d-generate</a>?</p>
<p>I’d never heard of Chris Gethard or his show. This was my first episode and I wasn’t even entirely sure what it was I was watching. The episode centers around one goofy character kidnapping Chris’ friend (another goofy character), and the only way to get his friend back was to settle the score. Fans who had been following the series for years knew all too well what The Human Fish and Vacation Jason were. I just signed up to see some former wrestlers fight a celebrity in a sumo body suite.</p>
<p>Two parts still stand out. The first is <a href="https://www.youtube.com/watch?v=W8awydCqNxQ&amp;feature=youtu.be&amp;t=22m57s" rel="noopener">Chris executing this incredible DDT</a>. Critical viewers will find some reason to point out how unimpressive this move was, with assistance from the villain and camera cuts.</p>
<p>If that’s how you feel, The Chris Gethard Show isn’t for you.</p>
<p>The other part, though, was <a href="https://youtu.be/W8awydCqNxQ?t=34m15s" rel="noopener">the ending</a>, where, after losing the match, Chris Gethard agrees to be wiped from existence. Keep in mind, again, I had never seen this show. I was utterly confused. The good guys always win in wrestling. The hero defeats the villain and the drama continues on into another cycle. Maybe this whole match wasn’t scripted. Or, more likely: it was, and something went wrong. Gethard accidentally got pinned. The show had been taped live; maybe they were trying to cover up the unexpected situation by having Gethard run the clock by talking about his feelings and getting meta about the show, literally finishing the scene by apologizing to everyone he had let down. He hadn’t meant for any of this to happen.</p>
<p>There’s a distinct moment in the speech where Chris breaks “character.” If you caught it immediately, congratulations, you’re a GethHead.<sup class="footnote-ref"><a href="#fn3" id="fnref3">[3]</a></sup> I know now that Chris Gethard, the host of The Chris Gethard show, is the everyman–he’s part-George Bailey, part-Donald Duck, and can’t ever seem to catch a break. But <em>no matter what</em> he comes back every week to try again.<sup class="footnote-ref"><a href="#fn4" id="fnref4">[4]</a></sup> He may <a href="https://www.youtube.com/watch?v=WfHfeg9s7-8&amp;feature=youtu.be&amp;t=12m14s" rel="noopener">embarrass himself in front of one of his heroes</a>, get <a href="https://youtu.be/FH_X9J3-T3Y?t=32m4s" rel="noopener">nipple-clamped by a dominatrix</a>, or <a href="https://www.youtube.com/watch?v=zP14qSyCZRA&amp;feature=youtu.be&amp;t=40m55s" rel="noopener">pranked by his own callers</a>. But the least you can say, the <em>least</em>, is that he put on a show for nearly a decade.</p>
<p>But Chris Gethard, the human, can’t jump cut when he feels bad. And when he needs to come back on the air, sometimes, he doesn’t. The ending isn’t just a series finale, it’s a refusal to die.<sup class="footnote-ref"><a href="#fn5" id="fnref5">[5]</a></sup> Really, there’s no way to underplay it.</p>
<p>Although I didn’t <em>completely</em> understand what Chris was upset about, I wanted to believe it was authentic. I started watching the show <em>backwards</em>. The wrestling episode begins with a rivalry between characters; I wanted to know what the hell that was all about. From there I more or less jumped around the entire Fusion run, just twenty episodes. A Gethard Show aficionado might tell you that these are, certifiably, the worst episodes in the whole run. Not only would I disagree with that now, I wouldn’t have believed you then anyway. I was in <a href="https://gjtorikian.online/posts/how-sad-was-i/">a bad place</a> and I had a lot of time on my hands. I started smoking a lot of <a href="https://apothecarium.com/" rel="noopener">weed</a>. I was eating <a href="https://www.yelp.com/biz/metro-caffe-san-francisco?osq=metrocaffe" rel="noopener">cheesesteaks</a> and <a href="https://www.yelp.com/biz/el-castillito-san-francisco-2?osq=Castillito" rel="noopener">burritos</a> in my pajamas. I watched The Chris Gethard show to feel better. I wanted to hear from <a href="https://www.youtube.com/watch?v=v29Jf7JPAF8&amp;list=RDv29Jf7JPAF8" rel="noopener">people quitting their jobs</a>. I wanted to witness <a href="https://www.youtube.com/watch?v=HJfBoHqU5Fk&amp;list=PLfWTNhVnrYRF8uWpGsd02al8iYqsVKdbe&amp;index=7" rel="noopener">family disputes</a>. And yeah, I don’t care if it was just for thirty minutes, I will always want to watch <a href="https://www.youtube.com/watch?v=ngQs0eOeeL4&amp;list=RDv29Jf7JPAF8&amp;index=15" rel="noopener">a bunch of puppies</a>, whenever, however.</p>
<p>One day I finished my binge. And as I was trying to get more content, <em>trying</em> to find out what was coming up next, I discovered that in fact there were <a href="https://www.youtube.com/watch?v=GHAPS5yR3ik&amp;list=PLBDD9FE6F3007B95C&amp;t=2m10s" rel="noopener">years of content</a> already around from when the show was on Manhattan public access.</p>
<p>What else could I do? I became so grateful for this weirdo to show up and take the punches over and over again. It wasn’t about the pain. It was about expecting the smile at the end.</p>
<p>I found a way to send him <a href="https://gjtorikian.online/assets/images/2018-08/reddit.png">a message</a>:</p>
<blockquote>
<p>I’ll keep this brief because you probably don’t like unsolicited messages. Sorry that you’re getting one.</p>
<p>I caught wind of your show because I was once super into wrestling, and someone on Twitter shared the season finale of your second season. I thought the whole episode was great, but what really made me sit up was hearing you talk about what the show meant to you and what you had hoped you’d accomplished. It was an honest display of emotion that I hadn’t expected, and that I honestly had a hard time believing was genuine or not. I spent the last two weeks watching your show online—I haven’t gotten to the public access years yet!—and I’ve come to discover that, yeah. You’re the real fucking deal.</p>
<p>You’re funny, your friends are funny, the whole dial-in-improv show somehow works and is funny, but the themes of most of the shows revolve around really essential human experiences—the mundane and the significant. One week you’ve got kids on the air asking prom dates out and another you’re amping people up to quit their jobs. You’re talking to your heroes about what they meant to you and you’re talking to your friends about mental health.</p>
<p>I guess I just want you to know that I really appreciate all of that. Personally and worldwide, 2016 has just been an absolute shit of a year. It was a real treasure coming across your show and laughing and learning and listening. Thank you for it and everyone else who made it possible.</p>
</blockquote>
<p>He didn’t have to respond, but he did. He hoped the rest of my year was nice.</p>
<p>Shortly after that, I watched around one hundred fifty-five hours of public access television in seven weeks. Then my year started getting better.</p>
<p>It turns out that my experience was not unique. Hundreds of GethHeads had, at one point or another, also gone through some difficult period, as children or adults. It was a show for hurt people (which is to say: everyone). And the show transmitted a message that said that it was okay to mess up, it was okay to get upset, it was okay to be confused, so long as you kept trying harder the next time.<sup class="footnote-ref"><a href="#fn6" id="fnref6">[6]</a></sup> The show wanted you to know that there were people out there who believed this, and what’s more, they filmed it, they demonstrated it, they lived it.</p>
<p>Now, fortunes are made by people livecasting through Facebook, Snapchat, Twitch, YouTube. The host is an explorer, navigating the terrains of their mundane existence. Anyone other than the person being filmed is an accident, a prop that serves a minor function. Personas are constructed, given generic names, used, then discarded once they get boring. The Chris Gethard Show revolved around its active audience participation. Its hosts needed its viewers just as much, if not more often, than the viewers needed the hosts. Everyone watching felt a deeply human need to connect with each other. If there was a great caller one week, we rejoiced whenever they reappeared. If there was a rude one, we jeered and banded together to bring the show back on track.</p>
<p>There is a broad representation of <a href="https://www.theawl.com/2017/12/sadcom-cartoon-alcoholics/" rel="noopener">characters that are toxic, but sad</a>. There aren’t many of people that are sad, but brave. There are <a href="https://www.theverge.com/2018/2/20/17032706/netflix-push-derren-brown-milgram-murder" rel="noopener">shows providing inhumane entertainment</a>. There aren’t many whose taboo is simply being honest.</p>
<p>In a way, The Chris Gethard Show never belonged on cable in this century. Cable worked in the early 80s as a platform for reckless courage. Cable worked when <a href="https://www.newyorker.com/culture/cultural-comment/a-garry-shandling-photograph-that-closes-the-book-on-a-late-night-era" rel="noopener">Garry Shandling turned down Carson and Letterman</a>. The Chris Gethard Show was already taking risks, by speaking, with no effort, about their feelings, <a href="https://www.youtube.com/watch?v=wOffsaxKu-E" rel="noopener">happy</a> or <a href="https://www.youtube.com/watch?v=ZoXdYSPkmMU" rel="noopener">otherwise</a>. They told you when they <a href="https://www.youtube.com/watch?v=nLQZVXBt4gs" rel="noopener">didn’t have any ideas</a>, they <a href="https://www.youtube.com/watch?v=bXlH2GbKliI&amp;list=PLBDD9FE6F3007B95C&amp;index=107" rel="noopener">insisted their fanbase provide better quality calls</a>, they <a href="https://www.youtube.com/watch?v=uqbjbKL1RLU&amp;list=PLBDD9FE6F3007B95C&amp;index=57" rel="noopener">begged for celebrity validation</a>. More often, they would err towards being a positive force, by <a href="https://youtu.be/C-kZwXsGlIs" rel="noopener">trying to prevent a deportation</a>, by <a href="https://www.youtube.com/watch?v=nCkHElBriwk" rel="noopener">hosting Thanksgiving for anyone without a place to go</a>, by <a href="https://www.youtube.com/watch?v=Bv6kyjw5OcI&amp;feature=youtu.be&amp;t=44m" rel="noopener">presenting a wedding proposal</a>.<sup class="footnote-ref"><a href="#fn7" id="fnref7">[7]</a></sup></p>
<p>What more could cable offer? Glory, I guess. Money, definitely. But the show had already become every form it could be.</p>
<p>Knowing that they must have had a limited time, The Chris Gethard Show’s final seasons on TruTv were some of the best. Years of honing comedy combined with a seemingly unlimited budget enabled them to explore new irrational possibilities. I was fortunate enough to attend several tapings in New York for their last two seasons. You would expect the audience to be asked to keep the noise down. You would expect whoever threw a hot dog at a guest’s faced to be ejected from the taping. You would expect that an entire show would be ruined the moment someone else yells out the answer to a simple hint.<sup class="footnote-ref"><a href="#fn8" id="fnref8">[8]</a></sup> The show is quantum: live, it’s exactly the same as it is while being transmitted. The Chris Gethard Show would do whatever they wanted so long as the audience promised to enjoy it. It’s a simple contract that we will all continue to keep.</p>
<p>The show’s unlearned success could not grow and <a href="https://twitter.com/ChrisGethard/status/1026531763865182208" rel="noopener">it ended</a>. There was nowhere left for it to go. There was nothing left for it to do.</p>
<p>Without a doubt, there will be excavators that will look back at The Chris Gethard Show and realize what a perfect encapsulation of the era it was. We will abide the dada comedy. The visceral urge to record will thrive. But we will lose the purity of truth that gives these actions any deeper meaning. In the foreseeable future we will have a stampede of <a href="https://youtu.be/C-4cSs_RGc4?t=1m41s" rel="noopener">jackasses</a> streaming themselves as they plot new ways to hurt themselves “for the lulz.”</p>
<p>Sometimes the good guys don’t win. They lose well, and they try again.</p>
<hr>
<p>All my love to everyone who ever starred in, guest-starred in, randomly joined, improvised for, acted in, wrote for, directed, edited, lighted, recorded, interned at, photographed, played music for, screened for, shared with, designed for, wrote about, called into, tweeted about, paid money for, and cleaned up after The Chris Gethard Show.</p>
<hr class="footnotes-sep">
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>Heck, don’t even bother reading this and just go <a href="https://twitter.com/adamriffs" rel="noopener">follow</a> everything he does. <a href="#fnref1" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn2" class="footnote-item"><p>Real, fake, it doesn’t matter: “<a href="https://www.youtube.com/watch?v=__GxJ4kLcPg&amp;feature=youtu.be&amp;t=5m28s" rel="noopener">For fans of my generation…[it] was the first time we thought of morality on that level.</a>” <a href="#fnref2" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn3" class="footnote-item"><p>Even the fandom is influenced by wrestling. <a href="#fnref3" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn4" class="footnote-item"><p>Try what, exactly? To make you laugh? To make you feel. <a href="#fnref4" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn5" class="footnote-item"><p>Contrast this ending with the <a href="https://www.youtube.com/watch?v=fa9NoPPcaB0&amp;feature=youtu.be&amp;t=48m" rel="noopener">utter jubilation</a> Gethard feels when announcing his first move to cable TV. I couldn’t appreciate the true depths of Gethard’s Fusion TV finale because I hadn’t followed the course of Gethard’s arc, as a host or himself. <a href="#fnref5" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn6" class="footnote-item"><p>“Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.” <a href="#fnref6" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn7" class="footnote-item"><p>Later, they would up the ante by <a href="https://www.youtube.com/watch?v=5tK9B7ugq0M" rel="noopener">performing valid  marriages</a>. <a href="#fnref7" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn8" class="footnote-item"><p>Thank you for not throwing me out. <a href="#fnref8" class="footnote-backref">↩︎</a></p>
</li>
</ol>
</section>
]]></content>
  </entry>
  <entry>
    <title>Wireless SNES</title>
    <id>https://gjtorikian.online/posts/wireless-snes/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/wireless-snes/" />
    <published>2018-04-26T00:00:00.000Z</published>
    <updated>2018-04-26T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="tech" />
    <summary type="text">On May 25, 2016, around 8am PST, tired and bored, I bought a Super Nintendo console from eBay, with the explicit intent of coming up with some kind of art project for it. When it arrived, I opened the case up, got an idea for something to build, then made absolutely no progress.</summary>
    <content type="html"><![CDATA[<p>On May 25, 2016, around 8am PST, tired and bored, I bought a Super Nintendo console from eBay, with the explicit intent of coming up with some kind of art project for it. When it arrived, I opened the case up, got an idea for something to build, then made absolutely no progress.</p>
<p>In April 2017 I moved across the country with the SNES in tow. Around mid-July, I started tinkering with the SNES again, but I didn’t seriously get back into the project until October. At the beginning of this year, I decided that I would either finish the damn project by May or throw the whole console away.</p>
<p>This is the story of completing the project.</p>
<div class="heading-wrapper">
<h2 id="the-idea">The Idea</h2>
<a class="heading-anchor" href="#the-idea" aria-label="Link to &quot;The Idea&quot;">#</a></div>
<p>The exhibition of console-hacking-disguised-as-art-pieces isn’t new. Probably the most well-known artist in the medium is Cory Arcangel, who exhibited <a href="http://collection.whitney.org/object/20588" rel="noopener">Super Mario Clouds</a> at the Whitney in 2002. More recently, I’ve found Nathan Villicaña-Shaw to be designing really wild stuff, like his <a href="http://bitdeph.com/symbiotic-snes/" rel="noopener">Symbiotic SNES</a> project, where you can play four different copies of an SNES game simultaneously with a single controller.</p>
<p>In late 2015, Shared Studios’ Portal Project <a href="https://hoodline.com/2015/09/a-portal-to-other-countries-opens-today" rel="noopener">arrived in San Francisco</a>. It’s a neat idea: you step inside a shipping container, into complete darkness and silence. The only other artifact that’s present is a giant projector screen across from you. Soon, you’re connected with another person who also stepped into a shipping container in some other part of the world. You get fifteen minutes to introduce yourselves and talk about your cities, your interests, your lives. And then you’re kicked out.</p>
<p>I have two older sisters, and, growing up, we used to play on my cousin’s NES at my nene’s house (which I believe we may have even inherited eventually–the NES, not the house). But by the time the SNES came around, my sisters had grown out of video games. In order to play anything multiplayer, I had to be taken to a friend’s house, which, while not unpleasant, was only possible if my mother’s permission and schedule allowed it. Between the four of us, she was the only one who knew how to drive.</p>
<p>My SNES idea was simple: I wanted two Super Nintendos, one acting as Player One and another acting as Player Two to communicate wirelessly with each other. Ideally, one would be set up where I lived and one would be set up in Mexico City or London or Los Angeles, somewhere far enough away to make the experience amazing. My main constraint was that the project had to run on <em>original</em> hardware. No emulators, no tricks. Whatever I built would need to pick up controller inputs and send them somewhere else.</p>
<p>After many months of failed attempts, I finally got the damn thing working, though I did have to scale back the idea to use <em>radio</em> signals instead of wifi, which means that the two consoles are communicating through each other at a maximum distance of about 150 feet. There were two reasons to drop down to radio signals. First, I couldn’t find a wifi enabled device that was small enough or reliable enough to fit inside an SNES console. More importantly, I had no idea what I was doing, and keeping it simpler seemed smarter. To establish a wifi connection, there are a lot of other factors to keep in mind, like setting up a server to handle the communication and ensuring that lag between the devices isn’t problematic. With radio signals, the only major problem would be physical interference, which can be worked around by just putting the two consoles in an open area.</p>
<div class="heading-wrapper">
<h2 id="the-setup">The Setup</h2>
<a class="heading-anchor" href="#the-setup" aria-label="Link to &quot;The Setup&quot;">#</a></div>
<p>The schematics and protocols for how an SNES works have been known for decades. <a href="https://gamefaqs.gamespot.com/snes/916396-super-nintendo/faqs/5395" rel="noopener">Here’s a write-up from 1996</a> about the way the SNES processes button pushes from a controller. Although there are seven pins available on an SNES connection, only five pins are used: 5V power, clock, latch, data, and ground. The other two wires do nothing, and probably existed for potential new devices to expand on later on. As well, all of these wires, except data, flow INTO the controller, whereas the data signal is sent back OUT to the SNES console.</p>
<p>Suppose you want to order tacos from your favorite restaurant. They’ve got 12 different kinds of fillings: chorizo, carne asada, pollo, huitlacoche, carnitas, and so on. But you don’t know which fillings are available until you call to place your order. When you call the restaurant, they stop everything that they were doing, and just go down the list of fillings in order to tell you what’s available:</p>
<p>—Hello.<br /><br>
—Hello. We have chorizo, pollo, huitlacoche. That’s it.</p>
<p>In a grossly simplistic format, the console/controller relationship works the same way. You are the console, and the controller is the restaurant. Every ~16.67ms (0.01667s), the SNES console sends out a signal to latch (or store) the state of the buttons. A chip inside the controller keeps track of which buttons are pressed and which aren’t. Then, the controller sends back each button state to the console in 12μs (0.000012s) cycles. The polling sequence of each button is the same: first it’s the B button, then Y, then Select, and so on. This happens 16 times, even though there are only 12 buttons on a regular SNES controller. Again, these additional cycles may have been meant for some kind of controller with additional buttons.</p>
<p>The point of this nerdery isn’t to be pedantic; it’s to point out that the 16-time read cycle happens <em>really fast</em>. In order to implement my idea, I needed a microcontroller intercept the button data when it came from a controller, store it, and then allow the state to pass through to the console. After storing all 16 button states, the microcontroller would need to send all of these to the other console and “replay” them. In other words, someone would need to tap the phone line of the taco conversation, pretend to be a customer, ask for the available taco fillings, and then pass the available fillings back to the customer so they can do whatever they want with the information.</p>
<p>In theory, it’s possible, but in reality the timing was hard to get right. Searching the Net, I found <a href="https://www.youtube.com/watch?v=08xeSZQVzQE" rel="noopener">this video</a> which, at least, validated that one could intercept SNES controller data and have it pass back into the console unhindered. I also found <a href="https://hackaday.com/2015/02/20/snes-controller-modified-to-be-completely-wireless/" rel="noopener">projects that created wireless controllers</a>, which gave me some hope, but as far as I knew, no one was sending controller data wirelessly to a different console.</p>
<div class="heading-wrapper">
<h2 id="the-analysis-aka-the-many-months">The Analysis (a.k.a. The Many Months)</h2>
<a class="heading-anchor" href="#the-analysis-aka-the-many-months" aria-label="Link to &quot;The Analysis (a.k.a. The Many Months)&quot;">#</a></div>
<p>I don’t know much about hardware hacking. I built a few PCs when I was younger, but that’s like following a recipe. If you stick to the parts list, you’re not likely to screw anything up. My one and only hardware hack was fixing a VCR by replacing its rubber band so that cassette tapes could properly insert and eject.</p>
<p>When I still thought I could do this project over wifi, I bought <a href="https://www.raspberrypi.org/products/raspberry-pi-3-model-b/" rel="noopener">a Raspberry Pi 3</a>, which comes with an embedded wifi chip. Then I did something very dumb: I opened up the SNES I had and simply soldered five wires to the back of the controller port. I thought that if I loaded the Pi with <a href="https://retropie.org.uk/" rel="noopener">RetroPie</a>, an emulator that provides support for real controllers, I wouldn’t need to write much original code. <a href="https://retropie.org.uk/forum/topic/13171/timing-problems-with-snes-controller-hooked-into-rpi-3" rel="noopener">Through a forum post</a>, I also found that this idea had merit: at least one other person <a href="https://imgur.com/a/KUV1Y" rel="noopener">had soldered wires directly</a> onto the SNES.</p>
<p>I never got this setup working. The Raspberry Pi <em>could</em> intercept the buttons, but it would never send them back into the console, meaning that the game was not playable. I spent months in this sort of limbo of checking and rechecking code and posts and ideas, but I never got it to work. I gave up.</p>
<p>When picked the project back up again, I took a different approach. The SNES is a very valuable piece of hardware because its supply is limited; it’s not a good idea to just solder ports and potentially damage it. I didn’t want to manipulate and destroy any part of the unit until I was certain that I could get something to work. I bought <a href="https://www.amazon.com/gp/product/B005WMIR4C/ref=od_aui_detailpages00?ie=UTF8&amp;psc=1" rel="noopener">two SNES controller extension cables</a>. I cut one of them open down the middle and stripped off the black tubing. Then, I <a href="http://www.instructables.com/id/Dupont-Crimp-Tool-Tutorial/" rel="noopener">crimped</a> each of the ten wires (five from each half), which was not fun at all. I didn’t think it was possible for something to be <em>more</em> stressful than soldering, but here I was, spending three hours trying to get a bit of metal to wrap around a few thin strands of copper.</p>
<p>By working with extension cables, I could plug one end into the console and the other end with the exposed wires into the breadboard. With the other spliced half, I plugged its exposed wires into the breadboard, and the other end into a working controller. Hopefully this pictures makes the setup clear:</p>
<p><img src="https://gjtorikian.online/assets/images/2018-04/extension-cables.JPG" alt="Extension cable spliced and plugged into breadboard" loading="lazy" decoding="async"></p>
<p>In the picture:</p>
<ul>
<li>Green is 5v power</li>
<li>Black is ground</li>
<li>Red is data</li>
<li>White is latch</li>
<li>Yellow is clock</li>
</ul>
<p>Why do this? Breadboards wiring runs <a href="https://cdn.tutsplus.com/mac/uploads/2013/10/horizontal-rows.png" rel="noopener">horizontally</a>, meaning that a wire plugged into one end of a row is connected to a wire plugged into all the other columns of the row. By splitting the extension cord apart, I could ensure that the controller was still communicating with the console, while at the same time, I could plug separate wires anywhere between them along the row to intercept the signal back into the microcontroller.</p>
<p>Still certain I could do this project with wifi, I bought <a href="https://store.arduino.cc/usa/arduino-mkr1000" rel="noopener">an Arduino MKR1000</a>, which was smaller than the Pi, and ought to have fit better in the SNES console case. But this didn’t work at all, either. <a href="https://github.com/loiclacombe/teensy_adapter" rel="noopener">Most</a> <a href="https://github.com/burks10/Arduino-SNES-Controller" rel="noopener">of</a> <a href="https://github.com/jtrinklein/SConE" rel="noopener">the</a> <a href="https://github.com/steichten/SNESspy" rel="noopener">other</a> SNES controller sketches I found were not using an MKR1000. I discovered that the MKR1000 runs on a newer ARM chip, and older sketches for other boards and chips would not work for it. Ugh.</p>
<div class="heading-wrapper">
<h2 id="the-implementation">The Implementation</h2>
<a class="heading-anchor" href="#the-implementation" aria-label="Link to &quot;The Implementation&quot;">#</a></div>
<p>A problem with a project like this is that I couldn’t quite tell if the software I wrote was the problem, whether the hardware that I manipulated wasn’t working, or whether the idea just had zero functionality at all.</p>
<p>After failing with the MKR1000, I decided to just start all over from the basics. Forget trying to get this to work over any range: I just wanted to see if I could get buttons to intercept reliably.</p>
<p>I found <a href="http://nickjmeyer.github.io/arduinos/2015/11/16/Reading-SNES.html" rel="noopener">a project which appeared to provide support for intercepting buttons</a>. I bought <a href="https://store.arduino.cc/usa/arduino-uno-rev3" rel="noopener">an Arduino Uno</a> in order to reimplement the project on a known working chip. I kept the breadboard setup, and plugged wires from the Arduino between the wiring for the controller and the console. This, for the first time, <em>worked</em>. I could intercept the SNES controller buttons, and the console played the game at the same time. I was ecstatic.</p>
<p>Except…a lot of the input was being dropped. I would press a button and <em>sometimes</em> the Arduino would register it. I thought that maybe the connections were bad (the crimp job from the spliced extension cord was <em>really</em> bad), but eventually decided that it might’ve just been the software.</p>
<p>The code made use of the standard setup for reading signals on an Arduino. Recall that as far as the relationship between the console and the controller is concerned, the clock and latch wires ought to flow INTO the controller, and the data signal from the controller flows OUT to the SNES.</p>
<p>My setup originally looked something like this:</p>
<pre class="language-plaintext"><code class="language-plaintext">pinMode(SNES_LATCH, INPUT);
pinMode(SNES_CLOCK, INPUT);
pinMode(CONTROLLER_DATA, INPUT);

...

# we've called the restaurant, check button states on clock cycle
WAIT_FALLING_EDGE(SNES_LATCH);

for (position = 0; position &lt; 16; position++) {

  # within the allotted time, tell me which filling is available
  WAIT_FALLING_EDGE(SNES_CLOCK);

  button[position] = digitalRead(CONTROLLER_DATA);
}
</code></pre>
<p>I learned that <code>digitalRead</code> is not time critical. All of the 16 button reads need to happen within 12μs (0.000012s) each. Could this “conversation” between the microcontroller and the controller be too slow?</p>
<p>I came across the concept of <a href="https://www.arduino.cc/en/Reference/PortManipulation" rel="noopener">direct port manipulation</a>, which, in a nutshell, sacrifices legibility of code for speed. Once I changed the code to read the signals via direct port manipulation, the Arduino could consistently read the data. It took me an incredible amount of time to understand implementing this concept in software. <a href="http://speedrun.evilash25.com/2017/02/controller-input-display-and-arduino.html" rel="noopener">This blog post</a> actually helped me find a project that relied on port manipulation to read SNES controller data, and was exactly what I needed to continue.</p>
<p>Now that I could read signals from a controller, I had to test the next step: could I <em>manipulate</em> controller data going into the console? That is, if I pressed down on the Player Two controller, could I force the Player One character to go down at the same time? The button cycle pattern is always the same. On the fifth cycle, I wanted to send a signal to Port One to force the character to always go down, as if someone were just holding the Down button on the Player One controller. Proving that I could send data to Port One meant that I could deliver any button data I wanted, regardless of where it was coming from (a real controller, a signal generated by software, or from a controller fifty feet away).</p>
<p>I spliced another extension cord open. I plugged one end of it into Port One of the SNES, and I <em>only</em> plugged the data wire into my breadboard. The latch and clock signals came from Port Two. What I wanted to see is whether the timing for controllers one and two occurred at the same time, or at separate intervals. To prove that, I would continue to intercept the latch and clock signals from the console’s Port Two; I would use the Player Two controller to send data; but I would wire the breadboard up so that the data went to the console’s Port One. Whatever button Player Two pressed should also be sent to Port One.</p>
<p>This, to my immense joy, worked. Although I couldn’t find any information on it, it <em>seems</em> that the button latches and clock reads happen simultaneously for Ports One and Two.</p>
<p>The final part of this experiment was to have the two Super Nintendos communicate with each other. Scraping the wifi idea, I bought <a href="https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/" rel="noopener">two NRF24L01 modules</a>. These chips operate on a radio frequency, sort of like the technology behind cordless phones. I wired these up to each Arduino, and wrote a little program to just send a “Hello World” message between the two Arduinos. But I couldn’t reliably send a message from one Arduino to another. Messages were being dropped.</p>
<p>I quickly discovered that while the NRF24L01 operates on 3.3V, and the Arduino can provide 3.3V power, there’s an issue with the regulation. In order to work around this, <a href="https://www.youtube.com/watch?v=wlhuO82IZjQ&amp;feature=youtu.be&amp;t=2m45s" rel="noopener">most guides suggest soldering a capacitor</a> between the positive and negative pins of the NRF24L01. After I did this, the “Hello World” message transmission worked beautifully.</p>
<p>I unplugged everything off the breadboards. It was time to graduate this project from an experiment to a real configuration. I clipped off one end of each of my jumper wires, and soldered the exposed copper directly to the back of each controller port:</p>
<p><img src="https://gjtorikian.online/assets/images/2018-04/port-solder.JPG" alt="Wires soldered to the back of an SNES controller port" loading="lazy" decoding="async"></p>
<p>On one Super Nintendo, I soldered a wire going from the back of all five pins and plugged them into the Arduino. I then soldered a sixth wire onto the <em>other</em> controller’s data pin. That is, one Super Nintendo had the clock, latch, and data ports for Port One flowing into the Arduino, and it was also wired to send data out to Port Two’s data pin. The other Super Nintendo had the reverse setup, so that one Arduino acted as intercepting Controller One’s signals and sending Controller Two’s signals out. Using the NRF24L01, I had the Arduinos pass each other the button states for their respective controller to the other unit</p>
<p>And finally, <a href="https://twitter.com/gjtorikian/status/987352013024395265" rel="noopener">everything was working</a>. I could press buttons on Controller One and have it register as an input on the other console.</p>
<div class="heading-wrapper">
<h2 id="the-next-steps">The Next Steps</h2>
<a class="heading-anchor" href="#the-next-steps" aria-label="Link to &quot;The Next Steps&quot;">#</a></div>
<p>All the code for this project can be found <a href="https://github.com/gjtorikian/wireless-snes" rel="noopener">on GitHub</a>.</p>
<p>I’d like to take a healthy break this summer before resuming work on my original idea of making two Super Nintendos communicate over wifi. Synchronizing two independent games would be immensely difficult. That is, if one cartridge has a random enemy appear, the other cartridge would need to duplicate that event, so that both players are playing the same game.</p>
<p>But this would not be impossible. There was once <a href="https://en.wikipedia.org/wiki/XBAND" rel="noopener">a hardware attachment called the XBAND</a>, which fit between the console and the cartridge, and it allowed for Internet gameplay over a modem–pretty advanced stuff for 1995. The most interesting piece of technology here would be how they managed to keep the two games in sync. Unfortunately, the SNES XBAND code has never been made public, so it’s not clear how this was originally done.</p>
<p>In all honesty there might need to be some “artistic license” in providing a functional experience. I can absolutely envision one system being the primary console, and providing all the game and video data to a secondary, “dumber” system, which would be nothing more than an Arduino housed inside of a console, happily receiving and sending real controller inputs, with zero actual cartridge code being executed. I’m still against emulation, but as long as there’s some real hardware being used, what does it matter if it’s only partially an illusion?</p>
]]></content>
  </entry>
  <entry>
    <title>How sad was I?</title>
    <id>https://gjtorikian.online/posts/how-sad-was-i/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/how-sad-was-i/" />
    <published>2018-02-13T00:00:00.000Z</published>
    <updated>2018-02-13T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="tech" />
    <summary type="text">By all accounts, 2016 was an absolute mess of a year. The deaths of David Bowie and Carrie Fisher bookended a long stream of miserable events, not the least of which being that the US elected a fascist and my seven-year relationship was ending. In comparison, 2017 fared marginally better: I made a c...</summary>
    <content type="html"><![CDATA[<p>By all accounts, 2016 was an absolute mess of a year. The deaths of David Bowie and Carrie Fisher bookended a long stream of miserable events, not the least of which being that the US elected a fascist and my seven-year relationship was ending. In comparison, 2017 fared marginally better: I made a cross-country move that I’d always wanted to make, which opened up new possibilities for balance in my life. (There was still the fascist, though.)</p>
<p>I’ve wanted to try out text sentiment analysis ever since I saw <a href="https://www.youtube.com/watch?v=56ftygaP68I" rel="noopener">this talk</a> on analyzing Bowie’s personas throughout his career. <a href="https://ziggy.mybluemix.net/" rel="noopener">The website demonstrating the analysis</a> is simple: given all the song lyrics of an album, <a href="https://www.ibm.com/watson/services/personality-insights/" rel="noopener">IBM’s Watson</a> would be able to tell you, based on adjectives and whatnot, whether the text comes off as happy, sad, angry, calm, and so on. According to the Personality Insights documentation:</p>
<blockquote>
<p>Many contemporary personality psychologists believe that there are <a href="https://en.wikipedia.org/wiki/Big_Five_personality_traits" rel="noopener">five basic dimensions of personality</a>: extraversion, agreeableness, openness, conscientiousness and neuroticism.</p>
</blockquote>
<p>Despite a tendency towards introversion, I’ve routinely expressed myself under the relative anonymity of the Internet. When I was a teen, I used my LiveJournal as a place to vent; these days, I turn to Twitter to overshare damn near everything. <a href="https://xkcd.com/137/" rel="noopener">I rarely censor myself</a>, though occasionally I’m self-aware enough to delete tweets if I believe that they’re too upsetting.</p>
<p><a href="https://twitter.com/gjtorikian/status/936729602914955264" rel="noopener">Towards the end of last year</a>, I wanted to know “objectively” whether 2017 was a better year or not. Using Watson, I decided to analyze my tweeting patterns between the two years and see how my persona had changed. If you’re interested in running your own experiment, all the code is available <a href="https://www.github.com/gjtorikian/how-sad-was-i" rel="noopener">on GitHub</a>.</p>
<div class="heading-wrapper">
<h2 id="extraversion">Extraversion</h2>
<a class="heading-anchor" href="#extraversion" aria-label="Link to &quot;Extraversion&quot;">#</a></div>
<blockquote>
<p>Energy, positive emotions, surgency, assertiveness, sociability and the tendency to seek stimulation in the company of others, and talkativeness. High extraversion is often perceived as attention-seeking, and domineering. Low extraversion causes a reserved, reflective personality, which can be perceived as aloof or self-absorbed.</p>
</blockquote>
<p><img src="https://gjtorikian.online/assets/images/2018-02/Extraversion.png" alt="Extraversion graph" loading="lazy" decoding="async"></p>
<p>In almost no way, shape, or form would I call myself “attention-seeking,” though I’ve got to admit that anyone who publishes anything on the Internet—tweets, selfies, art, software—must hope, on some level, to ensnare validation from someone in the universe.</p>
<p>I consider the lows of 2017 here to be something closer to a standard. The May 2017 bump might be a result of me moving. I’m not sure what that October 2017 bump might be; the only significant event I see is <a href="https://twitter.com/gjtorikian/status/924697949564735495" rel="noopener">winning a writing contest</a>. The higher ranking of 2016 was probably the result of my attempts to pretend to the world how well-adjusted and wonderful life was. The high of April is extremely interesting: those would be from tweets that accompanied my first trip through Texas, which saw <a href="https://twitter.com/gjtorikian/status/726172777561133057" rel="noopener">visits to breweries</a> and the consumption of <a href="https://twitter.com/gjtorikian/status/726572096311189504" rel="noopener">twelve tacos</a> at a festival.</p>
<div class="heading-wrapper">
<h2 id="agreeableness">Agreeableness</h2>
<a class="heading-anchor" href="#agreeableness" aria-label="Link to &quot;Agreeableness&quot;">#</a></div>
<blockquote>
<p>A tendency to be compassionate and cooperative rather than suspicious and antagonistic towards others. It is also a measure of one’s trusting and helpful nature, and whether a person is generally well-tempered or not. High agreeableness is often seen as naive or submissive. Low agreeableness personalities are often competitive or challenging people, which can be seen as argumentative or untrustworthy.</p>
</blockquote>
<p><img src="https://gjtorikian.online/assets/images/2018-02/Agreeableness.png" alt="Agreeableness graph" loading="lazy" decoding="async"></p>
<p>I’m not totally sure what to make of this one. I wouldn’t consider myself so misanthropic as to be consistently below a 50% mark here, but data doesn’t lie.</p>
<p>I think it’s interesting that 2016 had a repetitive variation, with December finishing at right about the same level as January.</p>
<p>March 2017 I had made the decision to move, which might explain the plummet in my “naivety.” I can’t really explain the low dip in June 2017, other than the fact that I was traveling for much of May 2017. Maybe by the time I got back home I realized that I needed to be more “competitive” with myself.</p>
<div class="heading-wrapper">
<h2 id="openness">Openness</h2>
<a class="heading-anchor" href="#openness" aria-label="Link to &quot;Openness&quot;">#</a></div>
<blockquote>
<p>Appreciation for art, emotion, adventure, unusual ideas, curiosity, and variety of experience. It reflects the degree of intellectual curiosity, creativity and a preference for novelty and variety a person has. It is also described as the extent to which a person is imaginative or independent, and depicts a personal preference for a variety of activities over a strict routine.</p>
</blockquote>
<p><img src="https://gjtorikian.online/assets/images/2018-02/Openness.png" alt="Openness graph" loading="lazy" decoding="async"></p>
<p>I’m pretty stoked that between the two years, my sentiments around this type remained at a fairly consistent high ranking.</p>
<p>It seems like my attitude towards new experiences went on an upswing after May 2017, when I moved. The massive dip in September 2016 might’ve been work-related: GitHub launched <a href="https://twitter.com/gjtorikian/status/776122841385152512" rel="noopener">a GraphQL API</a> at the beginning of the month. In trying to interpret this, I could absolutely see how months of crunch time work leading up to the public announcement would cause me to completely shut off from “a variety of activities” in favor of just tuning out for a few weeks.</p>
<div class="heading-wrapper">
<h2 id="conscientiousness">Conscientiousness</h2>
<a class="heading-anchor" href="#conscientiousness" aria-label="Link to &quot;Conscientiousness&quot;">#</a></div>
<blockquote>
<p>A tendency to be organized and dependable, show self-discipline, act dutifully, aim for achievement, and prefer planned rather than spontaneous behavior. High conscientiousness are often perceived as stubborn and obsessive. Low conscientiousness are flexible and spontaneous, but can be perceived as sloppy and unreliable.</p>
</blockquote>
<p><img src="https://gjtorikian.online/assets/images/2018-02/Conscientiousness.png" alt="Conscientiousness graph" loading="lazy" decoding="async"></p>
<p>These are pretty low numbers, but I can’t disagree that I’m “flexible” and “sloppy” in general.</p>
<p>Given that higher numbers means a tendency towards planning, I am surprised none of the months during my move reflected this, because that required an enormous amount of coordination. I guess I wasn’t really tweeting about this mundane details. The uptick in November 2016 is almost certainly due to politicizing after the election, with tweets about <a href="https://twitter.com/gjtorikian/status/803496486285676544" rel="noopener">being ready to fight</a>, <a href="https://twitter.com/gjtorikian/status/800091001259900929" rel="noopener">trolling Trump</a>, and <a href="https://twitter.com/gjtorikian/status/798608213528612864" rel="noopener">rules for surviving autocracies</a>.</p>
<div class="heading-wrapper">
<h2 id="neuroticism">Neuroticism</h2>
<a class="heading-anchor" href="#neuroticism" aria-label="Link to &quot;Neuroticism&quot;">#</a></div>
<blockquote>
<p>The tendency to experience unpleasant emotions easily, such as anger, anxiety, depression, and vulnerability. Neuroticism also refers to the degree of emotional stability and impulse control and is sometimes referred to by its low pole, “emotional stability”. A high need for stability manifests as a stable and calm personality, but can be seen as uninspiring and unconcerned. A low need for stability causes a reactive and excitable personality, often very dynamic individuals, but they can be perceived as unstable or insecure.</p>
</blockquote>
<p><img src="https://gjtorikian.online/assets/images/2018-02/Neuroticism.png" alt="Neuroticism graph" loading="lazy" decoding="async"></p>
<p>It’s not that I <em>want</em> to be neurotic, but I would definitely say I’m neurotic. The numbers here aren’t too surprising.</p>
<p>Given that the lows are described as “unstable or insecure,” it’s interesting how closely this aligns with Conscientiousness’ fluctuations above mapping to “sloppy and unreliable.” In other words, the patterns here seem to match up, with each emote rising and falling at around the same time.</p>
<p>I’m not quite sure what July 2017 could’ve been, other than another road trip to Texas. It certainly seems like it was the calmest portion of the year.</p>
]]></content>
  </entry>
  <entry>
    <title>A Nearly Complete List of Armenian Representation in Contemporary Film and Television</title>
    <id>https://gjtorikian.online/posts/a-nearly-complete-list-of-armenian-representation-in-contemporary-film-and-television/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/a-nearly-complete-list-of-armenian-representation-in-contemporary-film-and-television/" />
    <published>2017-12-21T00:00:00.000Z</published>
    <updated>2017-12-21T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <summary type="text">A few years ago, I noticed a trend in the ethnicities of characters that needed to be weird, vile, or both.</summary>
    <content type="html"><![CDATA[<p>A few years ago, I noticed a trend in the ethnicities of characters that needed to be weird, vile, or both.</p>
<div class="heading-wrapper">
<h2 id="the-shepherd-from-everything-you-always-wanted-know-about-sex-1972">The Shepherd from “Everything You Always Wanted Know About Sex” (1972)</h2>
<a class="heading-anchor" href="#the-shepherd-from-everything-you-always-wanted-know-about-sex-1972" aria-label="Link to &quot;The Shepherd from “Everything You Always Wanted Know About Sex” (1972)&quot;">#</a></div>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/tzr5Cubph9Y?start=111" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
</div>
<div class="heading-wrapper">
<h2 id="armen-tamzarian-from-the-simpsons-1997">Armen Tamzarian from “The Simpsons” (1997)</h2>
<a class="heading-anchor" href="#armen-tamzarian-from-the-simpsons-1997" aria-label="Link to &quot;Armen Tamzarian from “The Simpsons” (1997)&quot;">#</a></div>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/uI63C--Vi_k" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
</div>
<div class="heading-wrapper">
<h2 id="lieutenant-vin-makazian-from-the-sopranos-1999">Lieutenant Vin Makazian from “The Sopranos” (1999)</h2>
<a class="heading-anchor" href="#lieutenant-vin-makazian-from-the-sopranos-1999" aria-label="Link to &quot;Lieutenant Vin Makazian from “The Sopranos” (1999)&quot;">#</a></div>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/WsLOeYoG2S8" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
</div>
<div class="heading-wrapper">
<h2 id="the-armenian-mob-from-the-shield-2002-2008">The Armenian Mob from “The Shield” (~2002 - 2008)</h2>
<a class="heading-anchor" href="#the-armenian-mob-from-the-shield-2002-2008" aria-label="Link to &quot;The Armenian Mob from “The Shield” (~2002 - 2008)&quot;">#</a></div>
<div class="videoWrapper">
<iframe src="https://player.vimeo.com/video/248370787" width="640" height="480" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
<div class="heading-wrapper">
<h2 id="aram-keshisyan-from-weeds-2006-2007">Aram Keshisyan from “Weeds” (~2006 - 2007)</h2>
<a class="heading-anchor" href="#aram-keshisyan-from-weeds-2006-2007" aria-label="Link to &quot;Aram Keshisyan from “Weeds” (~2006 - 2007)&quot;">#</a></div>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/OBgUDMlmTy4?start=87" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
</div>
<div class="heading-wrapper">
<h2 id="armenian-landlords-from-sopranos-2006">Armenian Landlords from “Sopranos” (2006)</h2>
<a class="heading-anchor" href="#armenian-landlords-from-sopranos-2006" aria-label="Link to &quot;Armenian Landlords from “Sopranos” (2006)&quot;">#</a></div>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/watch?v=iJ1AJx3ZmZI"
frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
</div>
<div class="heading-wrapper">
<h2 id="armenian-power-from-house-of-cards-2015">Armenian Power from “House of Cards” (2015)</h2>
<a class="heading-anchor" href="#armenian-power-from-house-of-cards-2015" aria-label="Link to &quot;Armenian Power from “House of Cards” (2015)&quot;">#</a></div>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/fqD11fUx4aw?start=22" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
</div>
<div class="heading-wrapper">
<h2 id="ugly-armenian-from-chernobyl-2019">Ugly Armenian from “Chernobyl” (2019)</h2>
<a class="heading-anchor" href="#ugly-armenian-from-chernobyl-2019" aria-label="Link to &quot;Ugly Armenian from “Chernobyl” (2019)&quot;">#</a></div>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/YwnOzXwaXxM"
frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
</div>
]]></content>
  </entry>
  <entry>
    <title>Wrapping Rust in Ruby to Parse GraphQL</title>
    <id>https://gjtorikian.online/posts/wrapping-rust-in-ruby-to-parse-graphql/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/wrapping-rust-in-ruby-to-parse-graphql/" />
    <published>2017-08-15T00:00:00.000Z</published>
    <updated>2017-08-15T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="tech" />
    <summary type="text">I have been looking for an excuse to learn Rust for some time now. Although I had read several tutorials and ran through the Exercism.io problems , I am incapable of learning anything new unless I actually get a chance to build something with it. But I didn’t have any good ideas!</summary>
    <content type="html"><![CDATA[<p>I have been looking for an excuse to learn Rust for some time now. Although I had read several tutorials and ran through <a href="http://exercism.io/languages/rust/about" rel="noopener">the Exercism.io problems</a>, I am incapable of learning anything new unless I actually get a chance to build something with it. But I didn’t have any good ideas!</p>
<p><a href="https://githubengineering.com/the-github-graphql-api/" rel="noopener">At GitHub</a>, we’ve been using <a href="http://graphql.org/" rel="noopener">GraphQL</a> in production for some time now. A few months ago there was some chatter to define a GraphQL schema using <a href="https://github.com/rmosolgo/graphql-ruby/issues/727" rel="noopener">the IDL format</a>. While the idea is super interesting, I realized I had finally found a project worth getting excited about: I could write a GraphQL IDL parser in Rust! Rust has <a href="https://blog.rust-lang.org/2015/04/24/Rust-Once-Run-Everywhere.html" rel="noopener">an incredibly awesome FFI system</a>, and, since I had experience wrapping C libraries in Ruby, I decided I’d also trying wrapping a dylib generated by Rust into Ruby as a double whammy.</p>
<div class="heading-wrapper">
<h2 id="why">Why?</h2>
<a class="heading-anchor" href="#why" aria-label="Link to &quot;Why?&quot;">#</a></div>
<p>Aside from “learn something new,” there are two reasons I embarked on this project:</p>
<ul>
<li>I absolutely <em>love</em> text processing problems–whether it ranges from writing a quick regular expression to crafting a grammar in Bison/Flex. I’ve written several context-free grammars in C, and I wanted to see how those same techniques could work in Rust. I’ve also had trouble setting up and distributing the tooling for these parsers, like crafting a <a href="https://cmake.org/" rel="noopener">CMake</a> file that worked on different platforms or struggling to guess all the necessary <code>apt-get</code> packages Travis CI needs whitelisted. A pure Rust implementation that could generate platform-independent packages was very appealing.</li>
<li>Most of the GraphQL tooling, I’m sorry to say, appears to be in JavaScript. While that’s cool<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup>, I really believe that when it comes to creating a tool ecosystem, base implementations ought to be in a language that can be consumed by other projects. In other words, the world doesn’t need different GraphQL IDL parsers in Node, and Ruby, and Python, and Java, and Scala. The heavy-lifting should be done in something like C or Rust, and then those higher level languages ought to make use of that one foundational library. This ensures consistency and correctness, no matter what your backend is written in.</li>
</ul>
<div class="heading-wrapper">
<h2 id="getting-started">Getting started</h2>
<a class="heading-anchor" href="#getting-started" aria-label="Link to &quot;Getting started&quot;">#</a></div>
<p>Before I even started thinking about an FFI, the first thing I needed to do was write the actual Rust library. Although <a href="https://github.com/facebook/graphql/pull/90" rel="noopener">the GraphQL IDL spec</a> is not formal yet, it already has a <a href="https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form" rel="noopener">BNF-ish</a> format describing the grammar. It appeared to be context-free, so I went poking around <a href="https://www.crates.io/" rel="noopener">crates.io</a> looking for a crate to use. <a href="https://github.com/lalrpop/lalrpop" rel="noopener">lalrpop</a> seemed like a good package! What I liked about it (aside from <a href="https://github.com/lalrpop/lalrpop/blob/0c9f9025f7295f492e89871f04d2d729a764e62f/doc/src/tutorial/index.md" rel="noopener">the excellent documentation</a>) was that I could write down the IDL grammar almost precisely as the spec had it listed. Some of the other parser libraries required Rust code to define the grammar, which seemed very language specific.</p>
<p>The IDL spec defines several things, but I chose to focus just on the types for now. GraphQL has<br>
six distinct types:</p>
<ul>
<li>Scalars</li>
<li>Objects</li>
<li>Enums</li>
<li>Interfaces</li>
<li>Unions</li>
<li>Input objects</li>
</ul>
<p>Of these, scalars are by far the easiest things to reason about. A definition in the LALR crate format looks like this:</p>
<pre class="language-plaintext"><code class="language-plaintext">ScalarTypeDefinition: TypeDefinition = {
    &lt;d:Description?> "scalar" &lt;n:Name> => {
        TypeDefinition::ScalarType(GraphQLScalar::new(d, n))
    }
};
</code></pre>
<p>An optional description (<code>Description?</code>), the keyword <code>scalar</code>, and a name. That’s it! Each type definition I concentrated on taught me something about working in Rust. For example, working on this simple piece taught me how to work with <a href="https://medium.com/adventures-in-rust/deal-with-it-option-type-in-rust-4246e1dd9e47" rel="noopener"><code>Option</code></a>s, which was a new concept for me.</p>
<p>Once I had scalars defined (the easiest choice), I figured I should move on to the hardest one next–objects. An object definition looks like this:</p>
<pre class="language-plaintext"><code class="language-plaintext">ObjectTypeDefinition: TypeDefinition = {
    &lt;d:Description?> "type" &lt;n:Name> &lt;i:(ImplementsInterfaces?)> &lt;r:(Directives?)> "{" &lt;f:(Fields?)> "}" => {
        TypeDefinition::ObjectType(GraphQLObject::new(d, n, i, r, f))
    },
};
</code></pre>
<p>The first three pieces are nearly identical: optional description, keyword <code>type</code>, a name. Then things get wacky: there’s an optional comma-separated list of names defining interfaces, and optional list of directives, and an optional list of fields, which have their <em>own</em> complex grammars:</p>
<pre class="language-plaintext"><code class="language-plaintext">Fields: Vec&lt;GraphQLField> = {
    &lt;f:FieldDefinition+> => {
      f
    }
};

FieldDefinition: GraphQLField = {
  &lt;d:Description?> &lt;n:FieldName> &lt;a:(ArgumentsDefinition?)> ":" &lt;t:FieldType> &lt;r:(Directives?)> => {
      GraphQLField::new(d, n, t, a, r)
  }
};
</code></pre>
<p>A field can be one or more field definitions (<code>FieldDefinition+</code>), and a field definition has its own set of items to parse.</p>
<p>I broke the problem piece-by-piece, continuing to focus on learning new language features. For example, I worked on comma-separated interfaces first, because I didn’t know how to work with vectors (“growable arrays”). Then, I moved onto the fields of an object, and finally circled back to add the directives.</p>
<p>The good news is that the other four GraphQL types are vast simplifications on the same themes. For example, an enum definition is just a pipe-separated list of names; since I knew how to handle a comma-separated list, a pipe-separated list wasn’t much different. Interfaces and input objects also have lists of fields and directives, so I could simply reuse the object grammars there and be done with it.</p>
<div class="heading-wrapper">
<h2 id="dont-repeat-yourself">Don’t repeat yourself</h2>
<a class="heading-anchor" href="#dont-repeat-yourself" aria-label="Link to &quot;Don’t repeat yourself&quot;">#</a></div>
<p>The parts of the Rust language that I really enjoyed working with are implementations and macros.</p>
<p>Before getting to implementations, I have to talk about <code>struct</code>s and <code>enum</code>s first. A <code>struct</code> in Rust can be a C-resembling structure that defines a set of fields and types. For example, for a scalar and an object, they might look like:</p>
<pre class="language-rust"><code class="language-rust"><span class="token keyword">pub</span> <span class="token keyword">struct</span> <span class="token type-definition class-name">GraphQLScalar</span> <span class="token punctuation">{</span>
    description<span class="token punctuation">:</span> <span class="token class-name">Option</span><span class="token operator">&lt;</span><span class="token class-name">String</span><span class="token operator">></span><span class="token punctuation">,</span>
    name<span class="token punctuation">:</span> <span class="token class-name">String</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>

<span class="token keyword">pub</span> <span class="token keyword">struct</span> <span class="token type-definition class-name">GraphQLObject</span> <span class="token punctuation">{</span>
    description<span class="token punctuation">:</span> <span class="token class-name">Option</span><span class="token operator">&lt;</span><span class="token class-name">String</span><span class="token operator">></span><span class="token punctuation">,</span>
    name<span class="token punctuation">:</span> <span class="token class-name">String</span><span class="token punctuation">,</span>
    implements<span class="token punctuation">:</span> <span class="token class-name">Option</span><span class="token operator">&lt;</span><span class="token class-name">Vec</span><span class="token operator">&lt;</span><span class="token class-name">String</span><span class="token operator">>></span><span class="token punctuation">,</span>
    directives<span class="token punctuation">:</span> <span class="token class-name">Option</span><span class="token operator">&lt;</span><span class="token class-name">Vec</span><span class="token operator">&lt;</span><span class="token class-name">GraphQLDirective</span><span class="token operator">>></span><span class="token punctuation">,</span>
    fields<span class="token punctuation">:</span> <span class="token class-name">Option</span><span class="token operator">&lt;</span><span class="token class-name">Vec</span><span class="token operator">&lt;</span><span class="token class-name">GraphQLField</span><span class="token operator">>></span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>
</code></pre>
<p>Rust has <em>typed</em> enums, which is something I’d never heard of before. It’s a bit like a <code>union</code> in C, though, as opposed to something that serves as integer flags. A Rust <code>enum</code> is a thing that can represent one of several variants:</p>
<pre class="language-rust"><code class="language-rust"><span class="token keyword">pub</span> <span class="token keyword">enum</span> <span class="token type-definition class-name">TypeDefinition</span> <span class="token punctuation">{</span>
    <span class="token class-name">ScalarType</span><span class="token punctuation">(</span><span class="token class-name">GraphQLScalar</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
    <span class="token class-name">ObjectType</span><span class="token punctuation">(</span><span class="token class-name">GraphQLObject</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
    <span class="token class-name">EnumType</span><span class="token punctuation">(</span><span class="token class-name">GraphQLEnum</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
    <span class="token class-name">InterfaceType</span><span class="token punctuation">(</span><span class="token class-name">GraphQLInterface</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
    <span class="token class-name">UnionType</span><span class="token punctuation">(</span><span class="token class-name">GraphQLUnion</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
    <span class="token class-name">InputObjectType</span><span class="token punctuation">(</span><span class="token class-name">GraphQLInputObject</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>
</code></pre>
<p>When defining the values of a <code>TypeDefinition</code>, we say that a <code>ScalarType</code> is just the <code>struct GraphQLScalar</code> from before, an <code>ObjectType</code> is the <code>struct GraphQLObject</code>, and so on.</p>
<p>Here’s where it gets exciting. Within <a href="https://doc.rust-lang.org/stable/rust-by-example/fn/methods.html" rel="noopener">an implementation</a> on <code>TypeDefinition</code>, you can define a method which is used by all of the types. This acts as a sort of method definition on a superclass, which is inherited by the subclasses (except replace the word <code>class</code> with <code>struct</code> 😉). Every item in the <code>TypeDefinition</code> <code>enum</code> can use the method, after <code>match</code>ing on the caller’s type. For example:</p>
<pre class="language-rust"><code class="language-rust"><span class="token keyword">impl</span> <span class="token class-name">TypeDefinition</span> <span class="token punctuation">{</span>
    <span class="token keyword">pub</span> <span class="token keyword">fn</span> <span class="token function-definition function">typename</span><span class="token punctuation">(</span><span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">)</span> <span class="token punctuation">-></span> <span class="token operator">&amp;</span><span class="token keyword">str</span> <span class="token punctuation">{</span>
        <span class="token keyword">match</span> <span class="token operator">*</span><span class="token keyword">self</span> <span class="token punctuation">{</span>
            <span class="token class-name">TypeDefinition</span><span class="token punctuation">::</span><span class="token class-name">ScalarType</span> <span class="token punctuation">{</span> <span class="token punctuation">}</span> <span class="token operator">=></span> <span class="token string">"scalar"</span><span class="token punctuation">,</span>
            <span class="token class-name">TypeDefinition</span><span class="token punctuation">::</span><span class="token class-name">ObjectType</span> <span class="token punctuation">{</span> <span class="token punctuation">}</span> <span class="token operator">=></span> <span class="token string">"object"</span><span class="token punctuation">,</span>
            <span class="token class-name">TypeDefinition</span><span class="token punctuation">::</span><span class="token class-name">EnumType</span> <span class="token punctuation">{</span> <span class="token punctuation">}</span> <span class="token operator">=></span> <span class="token string">"enum"</span><span class="token punctuation">,</span>
            <span class="token class-name">TypeDefinition</span><span class="token punctuation">::</span><span class="token class-name">InterfaceType</span> <span class="token punctuation">{</span> <span class="token punctuation">}</span> <span class="token operator">=></span> <span class="token string">"interface"</span><span class="token punctuation">,</span>
            <span class="token class-name">TypeDefinition</span><span class="token punctuation">::</span><span class="token class-name">UnionType</span> <span class="token punctuation">{</span> <span class="token punctuation">}</span> <span class="token operator">=></span> <span class="token string">"union"</span><span class="token punctuation">,</span>
            <span class="token class-name">TypeDefinition</span><span class="token punctuation">::</span><span class="token class-name">InputObjectType</span> <span class="token punctuation">{</span> <span class="token punctuation">}</span> <span class="token operator">=></span> <span class="token string">"input_object"</span><span class="token punctuation">,</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<p>For every type in that enum, I’ve defined a method, <code>typename</code>. When <code>typename</code> is called, the <code>match</code> selector will return a <code>&amp;str</code> depending on the type of the caller. <code>match</code> is pretty much just a <code>case</code> statement, except the compiler will also complain if every condition isn’t met. For example, if I omitted <code>InputObjectType</code> from above, the Rust compiler would fail with:</p>
<pre class="language-plaintext"><code class="language-plaintext">--> src/type_definition.rs:217:15
 |
217 |         match *self {
 |               ^^^^^ pattern `InputObjectType(_)` not covered

error: aborting due to previous error(s)
</code></pre>
<p>For types that had certain properties, I defined methods that matched on just those values:</p>
<pre class="language-rust"><code class="language-rust"><span class="token keyword">impl</span> <span class="token class-name">TypeDefinition</span> <span class="token punctuation">{</span>
    <span class="token keyword">pub</span> <span class="token keyword">fn</span> <span class="token function-definition function">fields</span><span class="token punctuation">(</span><span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">)</span> <span class="token punctuation">-></span> <span class="token class-name">Option</span><span class="token operator">&lt;</span><span class="token class-name">Vec</span><span class="token operator">&lt;</span><span class="token class-name">GraphQLField</span><span class="token operator">>></span> <span class="token punctuation">{</span>
        <span class="token keyword">match</span> <span class="token operator">*</span><span class="token keyword">self</span> <span class="token punctuation">{</span>
            <span class="token class-name">TypeDefinition</span><span class="token punctuation">::</span><span class="token class-name">ObjectType</span><span class="token punctuation">(</span><span class="token class-name">GraphQLObject</span> <span class="token punctuation">{</span> <span class="token keyword">ref</span> fields <span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token operator">|</span>
            <span class="token class-name">TypeDefinition</span><span class="token punctuation">::</span><span class="token class-name">InterfaceType</span><span class="token punctuation">(</span><span class="token class-name">GraphQLInterface</span> <span class="token punctuation">{</span> <span class="token keyword">ref</span> fields <span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token operator">|</span>
            <span class="token class-name">TypeDefinition</span><span class="token punctuation">::</span><span class="token class-name">InputObjectType</span><span class="token punctuation">(</span><span class="token class-name">GraphQLInputObject</span> <span class="token punctuation">{</span> <span class="token keyword">ref</span> fields <span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>
                fields<span class="token punctuation">.</span><span class="token function">to_owned</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
            <span class="token punctuation">}</span>
            _ <span class="token operator">=></span> <span class="token macro property">panic!</span><span class="token punctuation">(</span><span class="token string">"That method does not exist for this type."</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<p>For situations that got a bit more complicated, I used macros. <a href="https://danielkeep.github.io/practical-intro-to-macros.html" rel="noopener">Rust macros</a> are used to provide metaprogramming to the language. They are obnoxious to read and write, but once you use them, their value is very clear. For example, in the same <code>impl TypeDefinition</code>, I wrote a macro to define common methods across the types:</p>
<pre class="language-rust"><code class="language-rust"><span class="token keyword">impl</span> <span class="token class-name">TypeDefinition</span> <span class="token punctuation">{</span>
  <span class="token macro property">impl_graphql_objects_common_methods!</span> <span class="token punctuation">{</span>
      <span class="token class-name">ScalarType</span><span class="token punctuation">:</span><span class="token class-name">GraphQLScalar</span><span class="token punctuation">,</span>
      <span class="token class-name">ObjectType</span><span class="token punctuation">:</span><span class="token class-name">GraphQLObject</span><span class="token punctuation">,</span>
      <span class="token class-name">EnumType</span><span class="token punctuation">:</span><span class="token class-name">GraphQLEnum</span><span class="token punctuation">,</span>
      <span class="token class-name">InterfaceType</span><span class="token punctuation">:</span><span class="token class-name">GraphQLInterface</span><span class="token punctuation">,</span>
      <span class="token class-name">UnionType</span><span class="token punctuation">:</span><span class="token class-name">GraphQLUnion</span><span class="token punctuation">,</span>
      <span class="token class-name">InputObjectType</span><span class="token punctuation">:</span><span class="token class-name">GraphQLInputObject</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<p>The <code>!</code> denotes a macro; this one is defined as:</p>
<pre class="language-rust"><code class="language-rust"><span class="token macro property">macro_rules!</span> impl_graphql_objects_common_methods <span class="token punctuation">{</span>
    <span class="token punctuation">(</span>
        $<span class="token punctuation">(</span>
            <span class="token variable">$x</span><span class="token punctuation">:</span><span class="token fragment-specifier punctuation">ident</span><span class="token punctuation">:</span><span class="token variable">$y</span><span class="token punctuation">:</span><span class="token fragment-specifier punctuation">ident</span>
        <span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token operator">*</span>
    <span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>
        <span class="token keyword">pub</span> <span class="token keyword">fn</span> <span class="token function-definition function">name</span><span class="token punctuation">(</span><span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">)</span> <span class="token punctuation">-></span> <span class="token operator">&amp;</span><span class="token keyword">str</span> <span class="token punctuation">{</span>
            <span class="token keyword">match</span> <span class="token operator">*</span><span class="token keyword">self</span> <span class="token punctuation">{</span>
                $<span class="token punctuation">(</span>
                    <span class="token class-name">TypeDefinition</span><span class="token punctuation">::</span><span class="token variable">$x</span><span class="token punctuation">(</span><span class="token variable">$y</span><span class="token punctuation">{</span> <span class="token keyword">ref</span> name <span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token operator">&amp;</span>name
                <span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token operator">*</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<p>Yeah, it look confusing. Let’s break it down. Since every GraphQL type has a name, I wanted to add a method <code>name</code> on all of the types in the enum. I first defined what my pattern of inputs would look like:</p>
<pre class="language-plaintext"><code class="language-plaintext">$(
    $x:ident:$y:ident
),*
</code></pre>
<p>It’s two identifiers (<code>ident</code>) that I have labelled <code>$x</code> and <code>$y</code> (<code>$x:ident</code> and <code>$y:ident</code>), that are separated by a colon, and that are part of a comma-separated sequence (<code>,*</code>). I can then reuse <code>$x</code> and <code>$y</code> throughout the macro definition. The original list I provided (<code>ScalarType:GraphQLScalar</code>, etc.) just inserts <code>ScalarType</code> as <code>$x</code> and <code>GraphQLScalar</code> as <code>$y</code> and expands the sequence:</p>
<pre class="language-rust"><code class="language-rust"><span class="token keyword">match</span> <span class="token operator">*</span><span class="token keyword">self</span> <span class="token punctuation">{</span>
    <span class="token class-name">TypeDefinition</span><span class="token punctuation">::</span><span class="token class-name">ScalarType</span><span class="token punctuation">(</span><span class="token class-name">GraphQLScalar</span> <span class="token punctuation">{</span> <span class="token keyword">ref</span> name <span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token operator">&amp;</span>name<span class="token punctuation">,</span>
    <span class="token class-name">TypeDefinition</span><span class="token punctuation">::</span><span class="token class-name">ObjectType</span><span class="token punctuation">(</span><span class="token class-name">GraphQLObject</span> <span class="token punctuation">{</span> <span class="token keyword">ref</span> name <span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token operator">&amp;</span>name<span class="token punctuation">,</span>
    <span class="token comment">// ...</span>
<span class="token punctuation">}</span>
</code></pre>
<p>Like most everything else in Rust, once the concepts and syntaxes click, even the most obtuse parts start to make sense. With macros, the parser was completed much more quickly.<sup class="footnote-ref"><a href="#fn2" id="fnref2">[2]</a></sup></p>
<div class="heading-wrapper">
<h2 id="rustc-is-helpful-and-unforgiving"><code>rustc</code> is helpful and unforgiving</h2>
<a class="heading-anchor" href="#rustc-is-helpful-and-unforgiving" aria-label="Link to &quot;rustc is helpful and unforgiving&quot;">#</a></div>
<p>Much has been said about how tremendously unforgiving the Rust compiler is, and a lot of that is true. Rust is not just a language you can pick up in a few days and be super productive in it. The compiler Knows Everything, and will absolutely call you out on anything it finds dubious. If you think Go complaining about unused package imports are annoying, you haven’t seen anything yet.</p>
<p>Earlier, I talked about how great it is that the compiler will throw an error if all the <code>match</code> paths aren’t met. Unfortunately, it’s not so fun when it’s angry about moving out of a borrowed context:</p>
<pre class="language-plaintext"><code class="language-plaintext">error: cannot move out of borrowed content
foo.rs:45       else if SignedInt::abs(dir as i32 - self.direction as i32) == 2 { return 1; }
                                                        ^~~~
foo.rs:47:21: 47:24 error: use of moved value: `dir`
foo.rs:47           self.direction = dir;
                                         ^~~
foo.rs:45:26: 45:29 note: `dir` moved here because it has type `foo::Direction`, which is non-copyable
foo.rs:45       else if SignedInt::abs(dir as i32 - self.direction as i32) == 2 { return 1; }
</code></pre>
<p>Programming in Rust “guarantees memory safety” because the compiler does all the analysis, and will refuse to run anything that it deems unsafe. The compiler does a great job at telling you where you screwed up. More often, it’ll try to correct you when you’ve misunderstood variable references and how they’re consumed. In the beginning, it feels like you need a solid understanding of capital-C Computer capital-S Science to understand what certain problems are.</p>
<p>It took me several solid months of repeatedly leaving and returning to this project before I finally began to understand what the compiler was agitated about, to the point where I would write code and catch my errors before compiling it. In a production environment, this is, of course, much better than being allowed to write crummy code. But whereas you have decades of material on writing safe C, there isn’t a lot of content (yet) available on such things as converting strings (<code>&amp;str</code> vs <code>String</code> vs <code>Cow</code>?), or how to safely pass around references.</p>
<p>Having said that, of course, once your program <em>does</em> compile, it’s almost certainly guaranteed to work exactly how you expect it to, barring any logical errors.</p>
<div class="heading-wrapper">
<h2 id="working-with-the-ffi">Working with the FFI</h2>
<a class="heading-anchor" href="#working-with-the-ffi" aria-label="Link to &quot;Working with the FFI&quot;">#</a></div>
<p>It took me a month-and-a-half to get just the pure Rust library parser working. And it took just about another five days to write the FFI to C, plus the bindings to Ruby. How did that happen so quickly?</p>
<p>I’ll start by saying that I first looked at two projects, <a href="https://github.com/tildeio/helix" rel="noopener">helix</a> and <a href="https://github.com/d-unseductable/ruru" rel="noopener">ruru</a>, which are designed to allow Rust code to interoperate with Ruby much more easily. While they looked nice, they required changes to the core Rust library, and that was something I was not willing to do. For example, Helix uses macros to transform Rust code into something that can be called by Ruby:</p>
<pre class="language-rust"><code class="language-rust"><span class="token macro property">ruby!</span> <span class="token punctuation">{</span>
    class <span class="token class-name">Console</span> <span class="token punctuation">{</span>
        def <span class="token function">log</span><span class="token punctuation">(</span>string<span class="token punctuation">:</span> <span class="token class-name">String</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token macro property">println!</span><span class="token punctuation">(</span><span class="token string">"LOG: {}"</span><span class="token punctuation">,</span> string<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<p>I didn’t want my Rust library to <em>only</em> support Ruby, and I didn’t want it littered with Ruby-only macros, either. Since my goal was to create a foundational library that could be used in a variety of higher level languages, I figured I would probably have to write my own C glue code. I am a bit humblebrag about this, because as far as I know, no one has written plain C to map between a Rust-generated dylib and Ruby yet–or at least, I couldn’t find any practical examples online.</p>
<p>I went about this incorrectly at first. I had created my Ruby gem, and had imported the Rust parser as a submodule. I began writing the C extension code the way I was used to, but partway through I stopped and realized I had to start over. If you’ve never written a Ruby extension, it’s mostly vanilla C with some additional methods imported from <code>ruby.h</code>. For example:</p>
<pre class="language-c"><code class="language-c"><span class="token keyword">struct</span> <span class="token class-name">mystruct</span> <span class="token punctuation">{</span>
  <span class="token keyword">int</span> a<span class="token punctuation">;</span>
  <span class="token keyword">int</span> b<span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>

<span class="token keyword">static</span> VALUE <span class="token function">example_open</span><span class="token punctuation">(</span>VALUE m<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
  <span class="token keyword">struct</span> <span class="token class-name">mystruct</span> <span class="token operator">*</span>conn<span class="token punctuation">;</span>
  <span class="token comment">/**** allocate a struct ****/</span>
  conn <span class="token operator">=</span> <span class="token function">ALLOC</span><span class="token punctuation">(</span><span class="token keyword">struct</span> <span class="token class-name">mystruct</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
  conn<span class="token operator">-></span>a <span class="token operator">=</span> <span class="token number">25</span><span class="token punctuation">;</span>
  conn<span class="token operator">-></span>b <span class="token operator">=</span> <span class="token number">99</span><span class="token punctuation">;</span>

  <span class="token comment">/**** return a Ruby object that maps to the struct ****/</span>
  <span class="token keyword">return</span> <span class="token function">Data_Wrap_Struct</span><span class="token punctuation">(</span>c_conn<span class="token punctuation">,</span> <span class="token constant">NULL</span><span class="token punctuation">,</span> mystruct_free<span class="token punctuation">,</span> conn<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<p>I had begun to write “Ruby C” code instead of understanding first how the plain C mapping should work, so I stopped this idea and began to work on just C bindings first. I was fortunate enough to come across <a href="https://github.com/rust-lang/regex/tree/master/regex-capi" rel="noopener">regex-capi</a>, which are C bindings to Rust’s regular expression library. It provided a lot of guidance for how to set up an FFI library in Rust, including embedding a new <em>Cargo.toml</em> into a separate directory as well as writing a simple <em>example.c</em> to test the basics.</p>
<p>This wasn’t the hardest part of the project, but it was definitely the trickiest. Once again, I started with scalars, so I wrote a basic header file for what that looks like:</p>
<pre class="language-c"><code class="language-c"><span class="token keyword">typedef</span> <span class="token keyword">struct</span> <span class="token class-name">GraphQLScalar</span> <span class="token punctuation">{</span>
  <span class="token keyword">const</span> <span class="token keyword">char</span><span class="token operator">*</span> name<span class="token punctuation">;</span>
  <span class="token keyword">const</span> <span class="token keyword">char</span><span class="token operator">*</span> description<span class="token punctuation">;</span>
<span class="token punctuation">}</span> GraphQLScalar<span class="token punctuation">;</span>

<span class="token keyword">typedef</span> <span class="token keyword">struct</span> <span class="token class-name">GraphQLTypes</span> <span class="token punctuation">{</span>
  <span class="token keyword">const</span> <span class="token keyword">char</span><span class="token operator">*</span> typename<span class="token punctuation">;</span>
  <span class="token keyword">union</span>
  <span class="token punctuation">{</span>
    GraphQLScalar scalar<span class="token punctuation">;</span>
  <span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span> GraphQLTypes<span class="token punctuation">;</span>

<span class="token comment">/* This is the actual method exposed by Rust FFI */</span>
<span class="token class-name">uint8_t</span> <span class="token function">gqlidl_parse_schema</span><span class="token punctuation">(</span><span class="token keyword">char</span><span class="token operator">*</span> schema<span class="token punctuation">,</span> GraphQLTypes<span class="token operator">*</span><span class="token operator">*</span> types<span class="token punctuation">,</span> <span class="token class-name">size_t</span><span class="token operator">*</span> types_len<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>To write an FFI binding in Rust, you write Rust code, but you return C types. For example:</p>
<pre class="language-rust"><code class="language-rust"><span class="token attribute attr-name">#[repr(C)]</span>
<span class="token keyword">pub</span> <span class="token keyword">struct</span> <span class="token type-definition class-name">Scalar</span> <span class="token punctuation">{</span>
    typename<span class="token punctuation">:</span> <span class="token operator">*</span><span class="token keyword">const</span> c_char<span class="token punctuation">,</span>
    name<span class="token punctuation">:</span> <span class="token operator">*</span><span class="token keyword">const</span> c_char<span class="token punctuation">,</span>
    description<span class="token punctuation">:</span> <span class="token operator">*</span><span class="token keyword">const</span> c_char<span class="token punctuation">,</span>
<span class="token punctuation">}</span>
</code></pre>
<p>The work to do the parsing is all in Rust; all the FFI has to do is take that output from Rust and put it in a data format that C can receive. <code>repr(C)</code> is <a href="https://doc.rust-lang.org/nomicon/other-reprs.html" rel="noopener">crazy important</a>, and tells the compiler to position the fields in the same memory layout as a C compiler.<br>
Some of the more fun patterns are when you deal with arrays of custom objects. Here’s a truncated look at the header file for an object:</p>
<pre class="language-c"><code class="language-c"><span class="token keyword">typedef</span> <span class="token keyword">struct</span> <span class="token class-name">GraphQLField</span> <span class="token punctuation">{</span>
  <span class="token keyword">const</span> <span class="token keyword">char</span><span class="token operator">*</span> description<span class="token punctuation">;</span>
  <span class="token keyword">const</span> <span class="token keyword">char</span><span class="token operator">*</span> name<span class="token punctuation">;</span>
<span class="token punctuation">}</span> GraphQLField<span class="token punctuation">;</span>

<span class="token keyword">typedef</span> <span class="token keyword">struct</span> <span class="token class-name">array_of_fields</span> <span class="token punctuation">{</span>
  <span class="token class-name">size_t</span> length<span class="token punctuation">;</span>
  <span class="token keyword">const</span> GraphQLField<span class="token operator">*</span> data<span class="token punctuation">;</span>
<span class="token punctuation">}</span> array_of_fields<span class="token punctuation">;</span>

<span class="token keyword">typedef</span> <span class="token keyword">struct</span> <span class="token class-name">GraphQLObject</span> <span class="token punctuation">{</span>
  <span class="token keyword">const</span> <span class="token keyword">char</span><span class="token operator">*</span> description<span class="token punctuation">;</span>
  <span class="token keyword">const</span> <span class="token keyword">char</span><span class="token operator">*</span> name<span class="token punctuation">;</span>
  <span class="token keyword">struct</span> <span class="token class-name">array_of_fields</span> fields<span class="token punctuation">;</span>
<span class="token punctuation">}</span> GraphQLObject<span class="token punctuation">;</span>
</code></pre>
<p>In Rust, that looks like:</p>
<pre class="language-rust"><code class="language-rust"><span class="token attribute attr-name">#[derive(Copy)]</span>
<span class="token attribute attr-name">#[repr(C)]</span>
<span class="token keyword">pub</span> <span class="token keyword">struct</span> <span class="token type-definition class-name">Object</span> <span class="token punctuation">{</span>
    typename<span class="token punctuation">:</span> <span class="token operator">*</span><span class="token keyword">const</span> c_char<span class="token punctuation">,</span>
    description<span class="token punctuation">:</span> <span class="token operator">*</span><span class="token keyword">const</span> c_char<span class="token punctuation">,</span>
    name<span class="token punctuation">:</span> <span class="token operator">*</span><span class="token keyword">const</span> c_char<span class="token punctuation">,</span>
    fields<span class="token punctuation">:</span> <span class="token class-name">ArrayOfFields</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>

<span class="token attribute attr-name">#[derive(Copy, Clone)]</span>
<span class="token attribute attr-name">#[repr(C)]</span>
<span class="token keyword">struct</span> <span class="token type-definition class-name">Field</span> <span class="token punctuation">{</span>
    description<span class="token punctuation">:</span> <span class="token operator">*</span><span class="token keyword">const</span> c_char<span class="token punctuation">,</span>
    name<span class="token punctuation">:</span> <span class="token operator">*</span><span class="token keyword">const</span> c_char<span class="token punctuation">,</span>
<span class="token punctuation">}</span>

<span class="token attribute attr-name">#[derive(Copy, Clone)]</span>
<span class="token attribute attr-name">#[repr(C)]</span>
<span class="token keyword">struct</span> <span class="token type-definition class-name">ArrayOfFields</span> <span class="token punctuation">{</span>
    length<span class="token punctuation">:</span> size_t<span class="token punctuation">,</span>
    values<span class="token punctuation">:</span> <span class="token operator">*</span><span class="token keyword">const</span> <span class="token operator">*</span><span class="token keyword">const</span> c_void<span class="token punctuation">,</span>
<span class="token punctuation">}</span>
</code></pre>
<p>For brevity, I’ve cut some pieces out, but the idea is that in C, you create a struct that contains a <code>size_t</code> indicating the number of items in the array, and a pointer to the actual data type (in this case, <code>GraphQLField</code>). The Rust code behaves similarly: <code>values</code> is stored as a <code>Vec&lt;Field&gt;</code>. <code>#[repr(C)]</code> again ensures that the data crossing the FFI wire is kept in the same memory layout.</p>
<p>A word of caution, if you’re writing your own FFI bindings: <a href="https://doc.rust-lang.org/std/mem/fn.forget.html" class="no-underline"><code>std::mem:forget</code></a> is your bitter, bitter friend. Since Rust is <em>so good</em> at tracking memory–when objects are used, and when they go out of scope–you have to remember to “forget” arrays and such if they are being sent over the wire back to C. From my understanding, that’s because Rust will free the memory used up by that <em>Rust</em> object, not knowing that it still needs to be made available to the C library. If that’s the case, you’ll still need to track and free the memory at some point in the lifecycle of your program.</p>
<p>Like I said: Computer Science.</p>
<p>I would say that writing the FFI Rust code is a bit of a slog, since you’ve essentially rewritten the same structure three different times:</p>
<ul>
<li>A bunch of <code>struct</code>s in the pure Rust lib</li>
<li>A bunch of <code>struct</code>s in the Rust FFI lib, returning C data types</li>
<li>A bunch of <code>struct</code>s in the C header</li>
</ul>
<p>But, since I knew how I wanted the C structures to look like, it wasn’t <em>too</em> bad to create that second set of Rust FFI lib <code>struct</code>s.</p>
<p>After populating the C header file, I wrote a very small program as a proof-of-concept. This was intended to be a sanity check before writing full-fledged tests in C:</p>
<pre class="language-c"><code class="language-c"><span class="token keyword">int</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  GraphQLTypes<span class="token operator">*</span> types <span class="token operator">=</span> <span class="token constant">NULL</span><span class="token punctuation">;</span>
  <span class="token class-name">size_t</span> types_len <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
  <span class="token class-name">uint8_t</span> err<span class="token punctuation">;</span>

  err <span class="token operator">=</span> <span class="token function">gqlidl_parse_schema</span><span class="token punctuation">(</span><span class="token string">"# Yeah yeah\nscalar DateTime"</span><span class="token punctuation">,</span> <span class="token operator">&amp;</span>types<span class="token punctuation">,</span> <span class="token operator">&amp;</span>types_len<span class="token punctuation">)</span><span class="token punctuation">;</span>

  <span class="token keyword">if</span> <span class="token punctuation">(</span>err <span class="token operator">></span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token function">printf</span><span class="token punctuation">(</span><span class="token string">"Error: Return code %d"</span><span class="token punctuation">,</span> err<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token function">exit</span><span class="token punctuation">(</span>err<span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>

  <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token class-name">size_t</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> types_len<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token function">printf</span><span class="token punctuation">(</span><span class="token string">"typename: %s\n"</span><span class="token punctuation">,</span> types<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>typename<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token function">printf</span><span class="token punctuation">(</span><span class="token string">"desc: %s\n"</span><span class="token punctuation">,</span> types<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>scalar<span class="token punctuation">.</span>description<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token function">printf</span><span class="token punctuation">(</span><span class="token string">"name: %s\n"</span><span class="token punctuation">,</span> types<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>scalar<span class="token punctuation">.</span>name<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token function">strncmp</span><span class="token punctuation">(</span>types<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>typename<span class="token punctuation">,</span> <span class="token string">"scalar"</span><span class="token punctuation">,</span> <span class="token number">6</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token function">printf</span><span class="token punctuation">(</span><span class="token string">"a scalar!"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>

  <span class="token keyword">return</span> err<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<div class="heading-wrapper">
<h2 id="wrap-it-in-ruby">Wrap it in Ruby</h2>
<a class="heading-anchor" href="#wrap-it-in-ruby" aria-label="Link to &quot;Wrap it in Ruby&quot;">#</a></div>
<p>The Ruby part of this project is actually a bit dull! Once I had the C bindings to the Rust-generated dylib, all I had to do was make sure I could compile an extension that made use of that library.</p>
<p>I always use <a href="https://github.com/rake-compiler/rake-compiler" rel="noopener">rake-compiler</a> for Ruby extensions (as opposed to <a href="https://github.com/ffi/ffi" rel="noopener">ffi</a>), mostly because I don’t want the <code>ffi</code> DSL to abstract away what the code I’m writing is actually doing.</p>
<p>The <em>extconf.rb</em> is surprisingly simple. Here’s the good stuff:</p>
<pre class="language-ruby"><code class="language-ruby"><span class="token comment"># FFI_DIR points to the submodule's target directory</span>
<span class="token command-literal"><span class="token command string">`cargo build </span><span class="token interpolation"><span class="token delimiter punctuation">#{</span><span class="token content">target</span><span class="token delimiter punctuation">}</span></span><span class="token command string"> --manifest-path </span><span class="token interpolation"><span class="token delimiter punctuation">#{</span><span class="token content"><span class="token builtin">File</span><span class="token punctuation">.</span>join<span class="token punctuation">(</span><span class="token constant">FFI_DIR</span><span class="token punctuation">,</span> <span class="token string-literal"><span class="token string">'Cargo.toml'</span></span><span class="token punctuation">)</span></span><span class="token delimiter punctuation">}</span></span><span class="token command string">`</span></span>

<span class="token variable">$LIBS</span> <span class="token operator">&lt;&lt;</span> <span class="token string-literal"><span class="token string">' -lgraphqlidlparser'</span></span>

<span class="token constant">HEADER_DIRS</span> <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token constant">INCLUDEDIR</span><span class="token punctuation">,</span> <span class="token constant">HEADER_DIR</span><span class="token punctuation">]</span>
<span class="token constant">LIB_DIRS</span> <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token constant">LIBDIR</span><span class="token punctuation">,</span> <span class="token constant">RELEASE_DIR</span><span class="token punctuation">]</span>

dir_config<span class="token punctuation">(</span><span class="token string-literal"><span class="token string">'graphql-idl-parser'</span></span><span class="token punctuation">,</span> <span class="token constant">HEADER_DIRS</span><span class="token punctuation">,</span> <span class="token constant">LIB_DIRS</span><span class="token punctuation">)</span>

<span class="token variable">$CFLAGS</span> <span class="token operator">&lt;&lt;</span> <span class="token string-literal"><span class="token string">" </span><span class="token interpolation"><span class="token delimiter punctuation">#{</span><span class="token content">flag</span><span class="token delimiter punctuation">}</span></span><span class="token string"> -std=c11 -Wall -pedantic -Werror -Wfatal-errors -Wstrict-aliasing"</span></span>

create_makefile<span class="token punctuation">(</span><span class="token string-literal"><span class="token string">'graphql-idl-parser/graphqlidlparser'</span></span><span class="token punctuation">)</span>
</code></pre>
<p>The C extension code is not much different than the example posted above, it just uses some of the <code>&quot;ruby.h&quot;</code> methods mentioned earlier. Here’s a snippet:</p>
<pre class="language-c"><code class="language-c"><span class="token keyword">static</span> VALUE <span class="token function">GRAPHQLIDLPARSERPROCESS_process</span><span class="token punctuation">(</span>VALUE self<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
  VALUE rb_schema <span class="token operator">=</span> <span class="token function">rb_iv_get</span><span class="token punctuation">(</span>self<span class="token punctuation">,</span> <span class="token string">"@schema"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
  VALUE rb_result <span class="token operator">=</span> <span class="token function">rb_obj_alloc</span><span class="token punctuation">(</span>rb_cResult<span class="token punctuation">)</span><span class="token punctuation">;</span>
  VALUE rb_types<span class="token punctuation">;</span>
  VALUE rb_hash<span class="token punctuation">;</span>
  GraphQLTypes<span class="token operator">*</span> types <span class="token operator">=</span> <span class="token constant">NULL</span><span class="token punctuation">;</span>
  <span class="token class-name">size_t</span> types_len <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
  <span class="token class-name">uint8_t</span> err<span class="token punctuation">;</span>
  <span class="token keyword">const</span> <span class="token keyword">char</span> <span class="token operator">*</span>schema <span class="token operator">=</span> <span class="token function">StringValueCStr</span><span class="token punctuation">(</span>rb_schema<span class="token punctuation">)</span><span class="token punctuation">;</span>

  err <span class="token operator">=</span> <span class="token function">gqlidl_parse_schema</span><span class="token punctuation">(</span>schema<span class="token punctuation">,</span> <span class="token operator">&amp;</span>types<span class="token punctuation">,</span> <span class="token operator">&amp;</span>types_len<span class="token punctuation">)</span><span class="token punctuation">;</span>

  <span class="token keyword">if</span> <span class="token punctuation">(</span>err <span class="token operator">></span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token function">printf</span><span class="token punctuation">(</span><span class="token string">"Error: Return code %d"</span><span class="token punctuation">,</span> err<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token function">exit</span><span class="token punctuation">(</span>err<span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>

  rb_types <span class="token operator">=</span> <span class="token function">rb_ary_new</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

  <span class="token comment">/**** attr_reader :types ****/</span>
  <span class="token function">rb_define_attr</span><span class="token punctuation">(</span>rb_cResult<span class="token punctuation">,</span> <span class="token string">"types"</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

  <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token class-name">size_t</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> types_len<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    rb_hash <span class="token operator">=</span> <span class="token function">rb_hash_new</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

    <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token function">strcmp</span><span class="token punctuation">(</span>types<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>typename<span class="token punctuation">,</span> <span class="token string">"scalar"</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token function">rb_hash_aset</span><span class="token punctuation">(</span>rb_hash<span class="token punctuation">,</span> <span class="token function">CSTR2SYM</span><span class="token punctuation">(</span><span class="token string">"typename"</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">convert_string</span><span class="token punctuation">(</span>types<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>typename<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
      <span class="token function">rb_hash_aset</span><span class="token punctuation">(</span>rb_hash<span class="token punctuation">,</span> <span class="token function">CSTR2SYM</span><span class="token punctuation">(</span><span class="token string">"name"</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">convert_string</span><span class="token punctuation">(</span>types<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>scalar_type<span class="token punctuation">.</span>name<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
      <span class="token function">rb_hash_aset</span><span class="token punctuation">(</span>rb_hash<span class="token punctuation">,</span> <span class="token function">CSTR2SYM</span><span class="token punctuation">(</span><span class="token string">"description"</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">convert_string</span><span class="token punctuation">(</span>types<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>scalar_type<span class="token punctuation">.</span>description<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token function">rb_ary_push</span><span class="token punctuation">(</span>rb_types<span class="token punctuation">,</span> rb_hash<span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>

  <span class="token function">rb_iv_set</span><span class="token punctuation">(</span>rb_result<span class="token punctuation">,</span> <span class="token string">"@types"</span><span class="token punctuation">,</span> rb_types<span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token keyword">return</span> rb_result<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<div class="heading-wrapper">
<h2 id="benchmarks">“Benchmarks”</h2>
<a class="heading-anchor" href="#benchmarks" aria-label="Link to &quot;“Benchmarks”&quot;">#</a></div>
<p>This isn’t really a fair comparison, but once the project was done, I decided to compare <a href="https://github.com/rmosolgo/graphql-ruby" rel="noopener">graphql-ruby</a>’s IDL loading with my Rust-backed gem.</p>
<p>You can fetch the IDL with:</p>
<pre class="language-plaintext"><code class="language-plaintext">curl -u gjtorikian:${GITHUB_TOKEN} -H "Accept: application/vnd.github.idl+json" https://api.github.com/graphql
</code></pre>
<p>It’s about 180KB and 7,000 lines long.</p>
<pre class="language-plaintext"><code class="language-plaintext">Warming up --------------------------------------
           pure ruby     1.000  i/100ms
           this gem      7.000  i/100ms
Calculating -------------------------------------
           pure ruby      6.527  (± 0.0%) i/s -     33.000  in   5.082540s
           this gem      73.511  (± 5.4%) i/s -    371.000  in   5.064868s

Comparison:
           this gem :       73.5 i/s
           pure ruby:        6.5 i/s - 11.26x  slower
</code></pre>
<p>I consider the project a success!</p>
<div class="heading-wrapper">
<h2 id="links">Links</h2>
<a class="heading-anchor" href="#links" aria-label="Link to &quot;Links&quot;">#</a></div>
<ul>
<li><a href="https://github.com/gjtorikian/graphql-idl-parser" rel="noopener">graphql-idl-parser</a> – the Rust library</li>
<li><a href="https://github.com/gjtorikian/graphql-idl-parser-ruby" rel="noopener">graphql-idl-parser-ruby</a> – the Ruby library</li>
</ul>
<div class="heading-wrapper">
<h2 id="acknowledgements">Acknowledgements</h2>
<a class="heading-anchor" href="#acknowledgements" aria-label="Link to &quot;Acknowledgements&quot;">#</a></div>
<p>Both <a href="https://users.rust-lang.org/" rel="noopener">https://users.rust-lang.org/</a> and the IRC channel are filled with tremendously helpful people. The <a href="http://jakegoulding.com/rust-ffi-omnibus/" rel="noopener">Rust FFI Omnibus guide</a> is also terrific. <a href="https://www.reddit.com/r/rust/comments/6mxg7q/looking_for_examples_of_complicated_ffi_bindings/" rel="noopener">This Reddit thread</a> and the projects in the comments were crucial to making things finally click for me.</p>
<hr class="footnotes-sep">
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>Just kidding, I hate it. <a href="#fnref1" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn2" class="footnote-item"><p>See this “<a href="https://github.com/gjtorikian/graphql-idl-parser/commit/a9656e50cb769868a47e218f0abf8903299c6f4a" rel="noopener">Macros are pretty cool</a>” commit for an example of how much code I could deduplicate. <a href="#fnref2" class="footnote-backref">↩︎</a></p>
</li>
</ol>
</section>
]]></content>
  </entry>
  <entry>
    <title>Cartoons, and Kids These Days</title>
    <id>https://gjtorikian.online/posts/cartoons-and-kids-these-days/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/cartoons-and-kids-these-days/" />
    <published>2017-03-05T00:00:00.000Z</published>
    <updated>2017-03-05T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <summary type="text">I still regularly watch cartoons. Kids these days are so fortunate to have the cartoons that they do.</summary>
    <content type="html"><![CDATA[<p>I still regularly watch cartoons. Kids these days are so fortunate to have the cartoons that they do.</p>
<p>The cartoons that aired when I was growing up were different. The cartoons of the 1980s served mostly as opportunities for companies like Mattel and Hasbro to advance the grand ideals of capitalism. Every day, young viewers were inundated with the principle to buy a full gamut of tie-in merchandise. It was a vicious process: you watched the cartoons which sold the products that you begged your parents to buy in order to prove your love for the cartoon. Marketing on that scale wasn’t unique to 80s, but it certainly was mastered during those years.  Through weekly half-hour installments, advertisers could promote a multitude of toys, lunch boxes, bed sheets, t-shirts, cereals, pajamas, coloring books, and more. But the cartoons (and the products) were entirely redundant, gender biased, lazily written, and otherwise, not really that great.</p>
<p>Peeking back even just a few decades, you wonder how cartoons ever devolved to such a crude state. From the 1930s through the 1970s, various studios were pushing animation entertainment forward, maturing in style and audience. Disney’s feature-length films for children are still objectively gorgeous and technical masterpieces. Warner Bros. focused on composing comedies aimed at slightly older audiences. Hanna-Barbera produced primetime sitcoms for adults. Yes, within those years there were loads of crap, too, but for every <em>Jabberjaw</em> there was a <em>Rocky and Bullwinkle</em> to balance it out.</p>
<p>Shortly after television executives officiated the marriage of cartoons and action figures, the 1990s made things a little weird. Cartoons were predominantly an entertainment format for children. And within those limitations, animators grew restless and wanted to start telling their kinds of stories. A whole genre of adult-oriented cartoons began to emerge, beginning with CalArts outsiders and The Sick and Twisted Festival of Animation. It’s not a coincidence that a show like <em>The Simpsons</em>, breaking all the rules of decency, worked as an effective bridge between the two decades. Aimed at an adult audience, it only gained infamy after spawning its own merchandising empire.<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup></p>
<p>With the growth of cable television in the mid-90s, networks were able to start taking risks in airing subversive animation. There was MTV’s entire <em>Liquid Television</em> line-up with <em>Beavis and Butthead</em> and <em>Æon Flux</em> or Comedy Central with <em>Dr. Katz</em> and <em>South Park</em>. By the end, even Cartoon Network, a channel designed to rerun nearly all the previous generation’s children’s programming, came out with its own late-night <em>Adult Swim</em> block, anchored by <em>Space Ghost</em> and <em>Aqua Teen Hunger Force</em>.</p>
<p>Animation is a very expensive medium to produce, and daring to do something different is always a financial liability in any industry. At first, cable television gambled with new cartoons almost exclusively for content catered to adults. When it comes to radical children’s programming, one is hard-pressed to find many early examples.<sup class="footnote-ref"><a href="#fn2" id="fnref2">[2]</a></sup></p>
<p>But this decade? This decade is intent on examining the effects of its actions in ways unlike years prior. Mainstream media has only just begun reflecting on the global impact of a relentlessly destructive society, whether it concerns the food we eat or the wars we wage or the people that make up our communities. Narratives about people from different backgrounds with different bodies living with different experiences began surfacing in television and movies, and are now being represented in cartoons.</p>
<p>Popular cartoons these days don’t just sell a lot of toys; they provide a kind of self-awareness that hasn’t typically been the focus of children’s programming. It feels like the natural culmination of a slow movement over the years to capture a much wider audience. Rather than focusing solely at children or adults, animators understand that a successful show needs to be “smart” and span generations. Plenty has been written about how <em>Adventure Time</em> is a “<a href="https://www.theguardian.com/tv-and-radio/2012/sep/07/adventure-time-weirdest-show-ever" rel="noopener">kids’ show that’s OK for adults to like</a>”, or how a cartoon with “adult humor” like <em>Bob’s Burgers</em> can still be <a href="http://flavorwire.com/548871/the-weirdness-and-warmth-of-bobs-burgers-thanksgiving-episodes" rel="noopener">family-oriented by not resorting to obscenity</a>.</p>
<p>More than ever, cartoons take cues from the world around them, rather than serving as distractions.</p>
<p>Take a look at this clip from <em>Star Wars: Rebels</em>. I realize this might sounds hypocritical: “Just a Star Wars fanboy leaning on a Star Wars cartoon to make a point, even though it’s obviously a glaring example of franchise-driven cartooning!” Regardless of what it appears to be on the surface, <em>Rebels</em> actually takes a close look at the effects of war. It definitely contains the very bland trope of “good versus evil” running throughout, but there’s also recurring representations of the consequences of one’s actions. The main character’s parents are killed for being outspoken opponents to the Empire; soldiers regularly defect or, in this case, muse upon the effects constant conflict has on the living:</p>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/ZROh_sZ-qNE?start=22" frameborder="0" allowfullscreen></iframe>
</div>
<p>You would <em>never</em> find an episode of <em>G.I. Joe</em> where a character tries to explain what post-traumatic stress disorder looks like. We live in a world of perpetual war and endless celebrations for military force over diplomacy. But rather than follow the same well-trodden path towards praising the violent, the show encourages you to take a more sympathetic attitude to those who participate.<sup class="footnote-ref"><a href="#fn3" id="fnref3">[3]</a></sup></p>
<p>Or, consider a show like <em>Steven Universe</em> which is more overt in stating its progressive agenda. An average episode is about ten minutes long; each still manage to quickly demonstrate ideas about love and self-respect. Here’s a one minute clip as an example:</p>
<div class="videoWrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/LxmIasBLHgg" frameborder="0" allowfullscreen></iframe>
</div>
<p>In that clip, representing a tenth of the whole episode, there was:</p>
<ul>
<li>A discussion about the death of Steven’s mother</li>
<li>An admission that the family name was discarded</li>
<li>A hostile conversation involving bigotry</li>
</ul>
<p>When did <em>Barbie</em> ever lash out against someone’s xenophobia?</p>
<p>Cartoons teaching inclusivity and compassion are becoming the norm. It’ll be interesting to see what the next few years will mean for cartoons. It’s likely possible that, just as cable television in the 90s paved the way for new types of cartoons, the streaming services of today will also be motivated to produce new intelligent content catered to children, just as they have already done with adults.</p>
<p>Cartoons may be the proof that there is hope for the future.</p>
<hr class="footnotes-sep">
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>Without question, until that point, no other cartoon had as large an effect on popular culture. What other cartoon could <a href="https://www.youtube.com/watch?v=1-T5eSUm-js" rel="noopener">boast about its disputes with the White House</a>? <a href="#fnref1" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn2" class="footnote-item"><p>At the least, there ought to be <a href="http://www.asanet.org/sites/default/files/savvy/footnotes/feb10/dora_0210.html" rel="noopener">more serious examinations</a> on the impact a show like <em>Dora the Explorer</em> had for daring to showcase non-white protagonists. <a href="#fnref2" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn3" class="footnote-item"><p>A much earlier cartoon that operated much the same was <em>Mobile Suit Gundam</em>. Airing in 1979, it was a mecha-war anime that routinely reminded viewers about <a href="https://youtu.be/NaevVGGw1A0" rel="noopener">the terrible cost of war</a>. The closest thing that the States produced around the same time and with the same message was <em>M<em>A</em>S*H</em>. <a href="#fnref3" class="footnote-backref">↩︎</a></p>
</li>
</ol>
</section>
]]></content>
  </entry>
  <entry>
    <title>Signing petitions</title>
    <id>https://gjtorikian.online/posts/signing-petitions/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/signing-petitions/" />
    <published>2016-12-18T00:00:00.000Z</published>
    <updated>2016-12-18T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="joyce" />
    <category term="tech" />
    <summary type="text">There’s a petition being passed around amongst people working in the tech industry, http://neveragain.tech/ , which aims to ensure that any signer vows to resist designing systems that would “facilitate ethnic or religious targeting”. Such a collection of information would allow nefarious powers to...</summary>
    <content type="html"><![CDATA[<p>There’s a petition being passed around amongst people working in the tech industry, <a href="http://neveragain.tech/" rel="noopener">http://neveragain.tech/</a>, which aims to ensure that any signer vows to resist designing systems that would “facilitate ethnic or religious targeting”. Such a collection of information would allow nefarious powers to process, collect, analyze, and possibly predict the movement and actions of millions of Muslisms living in America.</p>
<p>I almost signed it, initially swayed by their text “recogniz[ing] that mass deportations precipitated the very atrocity the word genocide was created to describe: the murder of 1.5 million Armenians in Turkey.” Throughout the week I’ve been hesitating, though, and I think I finally remembered why.</p>
<p>There’s a brief scene in the last chapter of <em>Portrait of the Artist as a Young Man</em> that’s relevant here. Stephen Dedalus is asked to sign a petition on universal peace, and is chastised by his schoolmates for refusing to do so:</p>
<blockquote>
<p>–Minor poets, I suppose, are above such trivial questions as the question of universal peace.</p>
<p>…</p>
<p>Stephen, in the act of being led away, caught sight of MacCann’s flushed blunt-featured face.</p>
<p>–My signature is of no account, he said politely. You are right to go your way. Leave me to go mine.</p>
<p>–Dedalus, said MacCann crisply, I believe you’re a good fellow but you have yet to learn the dignity of altruism and the responsibility of the human individual.</p>
<p>A voice said:</p>
<p>–Intellectual crankery is better out of this movement than in it.</p>
<p>Stephen, recognizing the harsh tone of MacAlister’s voice did not turn in the direction of the voice.</p>
<p>…</p>
<p>Stephen bent down towards Davin who, intent on the game, had paid no heed to the talk of the others.</p>
<p>–And how is my little tame goose? he asked. Did he sign, too?</p>
<p>Davin nodded and said:</p>
<p>–And you, Stevie?</p>
<p>Stephen shook his head.</p>
<p>–You’re a terrible man, Stevie, said Davin, taking the short pipe from his mouth, always alone.</p>
<p>–Now that you have signed the petition for universal peace, said Stephen, I suppose you will burn that little copybook I saw in your room.</p>
<p>As Davin did not answer, Stephen began to quote:</p>
<p>–Long pace, fianna! Right incline, fianna! Fianna, by numbers, salute, one, two!</p>
<p>–That’s a different question, said Davin. I’m an Irish nationalist, first and foremost. But that’s you all out. You’re a born sneerer, Stevie.</p>
<p>–When you make the next rebellion with hurleysticks, said Stephen, and want the indispensable informer, tell me. I can find you a few in this college.</p>
<p>–I can’t understand you, said Davin. One time I hear you talk against English literature. Now you talk against the Irish informers. What with your name and your ideas–Are you Irish at all?</p>
<p>–Come with me now to the office of arms and I will show you the tree of my family, said Stephen.</p>
</blockquote>
<p>The scene is brief but poignant. One of the reasons Stephen refuses to sign is in opposition to the hypocrisy of his classmates. Based on the books they read, <a href="https://books.google.com/books?id=GCJV652XWCoC&amp;pg=PA274&amp;dq=Long+pace+fianna+gaelic&amp;hl=en&amp;sa=X&amp;ved=0ahUKEwj15NCdvP3QAhXGx1QKHQlVAGwQ6AEIHDAA#v=onepage&amp;q&amp;f=false" rel="noopener">they’re Irish nationalists</a>. Fenians vowed to “<a href="https://en.wikipedia.org/w/index.php?title=Irish_Republican_Brotherhood&amp;oldid=751006830#cite_ref-8" rel="noopener">fight to overthrow British rule in Ireland</a>”. How can they also stand for universal peace? <em>“That’s a different question.”</em> (Tangentially, that Stephen has to “prove” his Irishness is also telling: you’re either with the crowd, or you’re against them.)</p>
<p>The Never Again petition introduces similar discrepancies. I do not condone collecting and using information on any person, whether it be on the basis of their religion, gender, age, sexuality, or more. I have no doubt that the individuals signing the petition would not willingly contribute to such horrendous technology. A system designed to collect and exploit people’s personal information is destined for catastrophic abuse. Innocent lives are at stake.</p>
<p>But the crux of the problem is this: the petition is specifically aimed towards people that write software. And modern-day software companies profit <em>almost exclusively</em> from collecting, processing, manipulating, and reselling people’s personal information. If you, your colleague, or your company is mining data, you can very well enable a fascist who intends to amass information on a person’s religious beliefs in order to exile them. There’s a significant difference, to be sure, but working on the former paves the way for the latter.</p>
<p>For example, some of the signatories are from Palantir, <a href="http://venturebeat.com/2016/10/05/why-palantir-is-silicon-valleys-most-questionable-unicorn/" rel="noopener">a data-mining company working with the CIA</a> to fight “bad guys”. (Let us not even mention the irony that one of its founders, Peter Thiel, <a href="http://www.nytimes.com/2016/10/16/technology/peter-thiel-donald-j-trump.html" rel="noopener">funded Trump’s campaign</a>).</p>
<p>There are a plenty of folks from Twitter, Google, and Facebook, companies that mine your activities to get you to click on meticulously crafted advertisements. Their services are fueled by converting your behaviors into commodities to sell to companies to get you to buy things you believe you want or need.</p>
<p>Some people signing work at Uber, whose <a href="http://www.theverge.com/2016/11/30/13763714/uber-location-data-tracking-app-privacy-ios-android" rel="noopener">recent app update tracks users’ movements</a>, even when it’s not in use.</p>
<p>Should the sins of the company/country be laid upon the employees/citizens? Maybe not.</p>
<p>But it starts small. It always starts small. The left largely ignored <a href="https://www.aclu.org/blog/speak-freely/president-obama-will-soon-turn-over-keys-surveillance-state-president-elect-trump" rel="noopener">executive orders passed by the Obama administration to expand the NSA’s surveillance capabilities</a>. But we are horrified to learn that Trump will inherit them. The tech industry all too often intertwines data collection with sustainability: “<a href="https://www.fastcompany.com/3008436/takeaway/why-data-god-jeffrey-hammerbacher-left-facebook-found-cloudera" rel="noopener">The best minds of my generation are thinking about how to make people click ads</a>”. How will these systems be used now that they’ve already been constructed?</p>
<p>In general, most petitions are ineffective. A online petition does not replace action in the real world. And my objection is not necessarily towards the petition existing. I’m against the notion of individuals openly opposing coerced data collection while their jobs require them to design similar schemes.</p>
<p>Tech is politics. Food is politics. Fashion is politics. Everything is politics. And politics is non-stop. It never ends. You don’t get a break. You don’t get to pick and choose which things to pay attention to and which to ignore. You’re either always fighting or you’re content with what’s going on. While you, personally, may never be asked to build something horrendous, that doesn’t mean you won’t be contributing to some other horror unwittingly.</p>
<p>I don’t fault individual signers. All I ask is this: that people also pledge to resist <em>any</em> misconducts present at work, whether it directly affects someone you know, someone you work with, or a user of your product that you’ve never seen. Whether you’re an engineer or a part of marketing, support, sales, legal, whatever—make sure you’re against unethical data collection in any capacity. Make sure that the decisions you make towards a better performance review don’t end up ruining someone else’s life. If you code something to track a stranger based on their location, you’re making it easier for someone else to misuse. If you write UI text that obfuscates the misuses of privacy, you’re keeping people ignorant of the facts. If you’re working on harvesting what people star, what people buy, what people watch, what people listen to, what people download–please seriously consider investigating if those qualitative metrics, that usability information, those graphs proving what people are doing are not being used for profit, abuse, or worse.</p>
]]></content>
  </entry>
  <entry>
    <title>Who&apos;s to blame?</title>
    <id>https://gjtorikian.online/posts/whos-to-blame/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/whos-to-blame/" />
    <published>2016-11-10T00:00:00.000Z</published>
    <updated>2016-11-10T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="politics" />
    <summary type="text">For as long as I’ve been able to vote, I’ve lived in the blue parts of California. Regardless of who I ended up casting a ballot for, my counties, cities, and state have almost always swing to the Democratic Party. There have been a few exceptions to that–we did elect Schwarzenegger after all.</summary>
    <content type="html"><![CDATA[<p>For as long as I’ve been able to vote, I’ve lived in the blue parts of California. Regardless of who I ended up casting a ballot for, my counties, cities, and state have almost always swing to the Democratic Party. There have been a few exceptions to that–we did elect <a href="https://en.wikipedia.org/wiki/Arnold_Schwarzenegger#Governor_of_California" rel="noopener">Schwarzenegger</a> after all.</p>
<p>Given the prevailing Democratic tendencies, it’s very easy to feel like your personal vote doesn’t actually make a difference in the grand scheme of things. Regardless, I’ve almost always voted Green Party. I vote Green not because I think it’s punk and cool and a middle finger to the establishment, but because the policies they advocate for are most inline with what I believe in. I try to do this on all levels of government, from local to federal. In San Francisco, your choices for local officials are often two Democrats, best described as left and slightly lefter. (With the relatively recent exception of folks like <a href="https://en.wikipedia.org/wiki/Matt_Gonzalez" rel="noopener">Matt Gonzalez</a>.) In those cases, I’ll always lean into the more progressive of the candidates.</p>
<p>In other words, I always vote. I don’t abstain from voting if there isn’t a Green Party candidate. Abstaining is the worst decision a voter can make, because they’re throwing away an opportunity to make a statement.</p>
<p>Somehow, voting third party in local elections is commendable. It’s seen as “the right thing to do”, because the only way to break out of a two-party system is to start from the bottom-up. Attempting to change the system from the top-down is regarded as futile. That’s why, every four years, when there’s a candidate running for president, you’re told to just pick from two folks and disregard anyone else who might be competing. If you do happen to vote third party, you’re seen as a naïve imbecile, incapable of understanding how politics and government should work, and told that you’d be better of just moving to Iceland instead of living in reality in the United States of America.</p>
<p>This year’s election was no exception. The slightly lefter person lost to the catastrophically righter person, and <a href="http://motto.time.com/4564294/rachel-maddow-third-party-candidates-election-2016/" rel="noopener">the blame starts shifting to folks that voted third party</a>. And, I’m ready to admit that given what I described earlier, voting third party in California isn’t that big of a difference. It swung Democrat, as expected. It’s places like Florida or Pennsylvania or Utah or Tennessee or Michigan that shouldn’t have third-party voters. If all those voters had just voted for Clinton, we wouldn’t be embarking into our dystopian nightmare.</p>
<p>I reject that premise, wholly and utterly. And I’m sick and tired of third-party voters being blamed for losses.</p>
<p><em>Every single time</em> third parties are discussed nationally, <a href="https://en.wikipedia.org/wiki/United_States_presidential_election,_2000#Ralph_Nader_spoiler_effect" rel="noopener">the 2000 Gore-Bush-Nader election</a> is referenced. Intelligent liberals like <a href="https://digitalcitizen.info/2010/03/26/michael-moores-unjustified-anger-at-ralph-nader/" rel="noopener">Michael Moore</a> hold on to this notion that Nader “spoiled” Gore’s victory. But Gore didn’t lose Florida because of Nader’s voters. Gore lost because he ran a terrible platform. He ran a platform that many other citizens in many other states didn’t agree with.</p>
<p>Here’s the thing: we live in a democracy that supports a multi-party system. The other parties may not be likely to hold office, but they are allowed to exist nonetheless. A vote for a third party is an exercise of your national right. Anyone who coerces or shames someone about their voting choice is against the very idea of democracy.</p>
<p>No debate.</p>
<p>End of discussion.</p>
<p>Blaming voters of third parties is a convenient scapegoat that’s easy to justify because it’s easy to understand. But it’s a distraction from the truth that’s too horrifying to comprehend: that more people chose to vote for a misogynistic warmongering narcissistic bigot because they liked him.</p>
<p>More than anything else, this election did inform me that actually, yes, there is such a thing as the lesser of two evils. But I exercised the right to choose to vote amongst multiple parties, and will continue to exercise my right to vote on a candidate that I think best represents the future I want to build.</p>
<p>Who’s to blame? If we can’t blame the third party voters for not casting to Clinton, who can we blame?</p>
<p>Blame the millions of people who watched <a href="https://www.theguardian.com/commentisfree/2016/nov/10/trump-the-apprentice-president-elect-reality-tv" rel="noopener">Trump’s show</a>, stayed at Trump’s properties, and <a href="https://en.wikipedia.org/wiki/Donald_Trump_presidential_campaign,_2000" rel="noopener">gave him any kind of platform</a> at all. People enjoyed his brash quirkiness, fed his ego, and wanted to vacuum suck more of his vapidity. But an idiot that’s gaining notoriety thinks people are laughing <em>with</em> him, not at him. He thinks they’re agreeing with him.</p>
<p>Blame the DNC. They had an actual, outside-the-system progressive candidate, and they did <a href="http://observer.com/2016/07/california-calls-fraud-demands-dnc-investigation/" rel="noopener">everything they could to snuff him into the ground</a>.</p>
<p>Blame the utterly, horribly misguided people that believe that a billionaire psychopath is going to care about anything other than making more profits for himself. Or maybe pity them instead.</p>
<p>Blame late-night talk shows for <a href="http://blogs.wsj.com/speakeasy/2016/09/16/donald-trump-lets-jimmy-fallon-rub-his-hair/" rel="noopener">pandering to this buffoon</a>.</p>
<p>Blame the fact that we still haven’t fixed <a href="http://www.huffingtonpost.com/entry/democrats-popular-vote-presidential_us_582246c4e4b0aac62487dde9" rel="noopener">our ridiculous Electoral College</a>, even though everyone agrees it’s an astoundingly inaccurate representation.</p>
<p>Blame the politicians who abandoned their moral anchors and sought to latch onto that miserable rocket, people like <a href="https://www.washingtonpost.com/news/the-fix/wp/2016/02/26/chris-christie-just-endorsed-trump-a-few-weeks-ago-he-said-trump-had-no-experience-and-would-hand-the-race-to-democrats" rel="noopener">Chris Christie</a> or <a href="http://www.usatoday.com/story/news/politics/onpolitics/2016/10/06/once-defiant-ted-cruz-caught-phone-banking-trump/91699638/" rel="noopener">Ted Cruz</a>.</p>
<p>Blame people who spewed garbage daily, like <a href="http://www.rushlimbaugh.com/daily/2016/07/21/vote_trump_pence_to_stop_hillary" rel="noopener">Rush Limbaugh</a>. While driving through Texas, I heard him convince people that they should abandon their conscience and vote for a man who’s acted as nothing but a vile venomous demon, simply because he represented a certain party. Blame <a href="https://www.washingtonpost.com/politics/2016/live-updates/general-election/real-time-updates-on-the-2016-election-voting-and-race-results/ann-coulters-grandparent-argument-would-exclude-trump-from-voting/" rel="noopener">Ann Coulter</a> for suggesting that only certain types of people ought to be able to vote.</p>
<p>Blame foreign actors <a href="https://www.theguardian.com/us-news/2016/nov/09/putin-applauds-trump-win-and-hails-new-era-of-positive-ties-with-us?CMP=share_btn_tw" rel="noopener">like Putin</a> who deliberately interfered with another sovereign state through means we can’t even imagine, simply for his own benefit. (Though, this may be a bit of political karma: how many elections has the U.S.A. meddled in?)</p>
<p>Blame the <a href="https://www.thenation.com/article/the-gops-attack-on-voting-rights-was-the-most-under-covered-story-of-2016/" rel="noopener">gutting of the Voting Rights Act</a>, which disenfranchised millions of people from casting a ballot.</p>
<p>Speaking of the disenfranchised, blame the <a href="https://mobile.twitter.com/SSS_joshnelson/status/796374940903768064" rel="noopener">46% of eligible voters that did not vote</a>. Don’t blame them too much, though. Since federal elections aren’t national holidays, as in many other civilized democracies, those who are the least likely to be able to take time off work to vote are the most susceptible to being screwed over by policies guided by the one percent.</p>
<p>Blame his lawyers who built a wall that fortifies him against any rebuke. Blame the sycophants who clamor over each other to get to the top of his friend list. Blame the businesspeople who made lucrative deals with this devil for decades (only to regret them as all their valuations tanked). Blame the people more concerned with their 401ks than their fellow neighbor. Blame the people who want to make sure their family is safe at the expense of someone else’s. Blame the misogynists for turning down an extraordinarily qualified candidate in favor of a man. Fuck, blame Twitter for not suspending accounts dedicating to harassing other people.</p>
<p>But don’t blame the people who voted for the pro-clean energy, pro-LGBTQ, pro-universal health care and -education, pro-choice, pro-environment, anti-gun, anti-big bank, anti-TPP, anti-Guantanamo, anti-discrimination, anti-surveillance, anti-militarization, anti-war candidate.</p>
]]></content>
  </entry>
  <entry>
    <title>The first move</title>
    <id>https://gjtorikian.online/posts/the-first-move/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/the-first-move/" />
    <published>2016-09-19T00:00:00.000Z</published>
    <updated>2016-09-19T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="san-francisco" />
    <category term="saroyan" />
    <summary type="text">About a week ago, I moved to San Francisco ten years ago. I didn’t intend to make a big deal out of it—it’s a random day in a random year that happens to coincide with the moment when I got an opportunity to move—but the concept of 2006 San Francisco is so bizarre to outsiders that I felt the urge t...</summary>
    <content type="html"><![CDATA[<p>About a week ago, I moved to San Francisco ten years ago. I didn’t intend to make a big deal out of it—it’s a random day in a random year that happens to coincide with the moment when I got an opportunity to move—but the concept of 2006 San Francisco is so bizarre to outsiders that I felt the urge to put down some words.</p>
<p>Saroyan has this great quote about his time in San Francisco: “I am a young man in an old city.” For the first few years I lived in San Francisco, this same refrain ran through my head. It was beautiful. On any given day you could walk through a neighborhood and absorb its layers of history. What I mean is, the past here is <em>comprehensible</em>. San Francisco has a good one hundred fifty or sixty years as a port of California. Most of that life is recorded and plaqued all across the city. And it helps that it isn’t very large. You really can just walk through half the city in a few hours and learn a lot. You’re not sitting in a car and driving between different points. You’re not bogged down by four hundred years of events.</p>
<p>I almost didn’t get here myself. When I left college I was certain I would move to Portland. I thought that Portland and San Francisco were the only two cities with a nice blend of art and technology. It was never about money. It was about trying incredibly new things. I was interviewing with OHSU when a job in San Rafael wanted me first, so within a week, I packed everything into my compact car and drove up in a day. I knew I only wanted to be in San Francisco and refused to move anywhere remotely close to work. There was a coworker nearby who took me via carpool, and, when he quit, I rode a bus for ninety minutes to get to the office. No one could understand why I was paying $900 a month for the privilege of living with four other people, but I didn’t care. A few months later I was paying $650 for the privilege of living with six other people. And I thought I was living exactly where I needed to be. Everything I loved was right in front of me. City Lights and Star Wars. About two months later, I sold the car and haven’t wanted to own one since.</p>
<p>In the ten years I’ve lived here, I’ve had six different addresses; four of those have been in the same two block radius. That’s nearly a third of my life living in a neighborhood I’ve chosen and loved.</p>
<p>But even in the early years, no one thought about <em>staying</em> here. Even at 23 or 24 we called it Neverland, a place for people who didn’t want to grow old. San Francisco was always a place where hordes of strugglers came, discovered themselves, and then left. And the ones who did stay became warped.</p>
<p>Though, the weird thing is, after all these years, I’m the only one who stayed.</p>
<p>It’s a funny thing if you talk to people who lived through the first dotcom crash. They’ll all say the same thing: that San Francisco wasn’t like this one. It’s true that some of the chaos has dissipated—where did all the Cacophony Society events go? I think what changes, though, is that you start to care more about the place you’re living. That sounds so dull. But you create your own history, and it’s personal, and when you walk down those neighborhoods you walk down, you add your own layer on top of the others that originally brought you here. What bothers you isn’t the countless apps and services, the inhumanity, the flashy new money folks. It’s that people don’t care about where they’re living. They see it as a vehicle to get rich and leave. It’s more profitable to siphon the land instead of invest in it.</p>
<p>My second year living here, I was fed up. I wanted to move and live in New York. Saroyan had done this, too. (He moved back four months later.)</p>
<p>I don’t regret not moving. I might not have met María if I hadn’t stayed. I might not have found an incredibly privileged job if I hadn’t stayed. I might not have been at my mother’s final moments if I hadn’t stayed.</p>
<p>It does bother me that people couldn’t stick past the two or three years they were here before writing it off. The City’s in another weird transition right now. The only way to keep anything the way you want it to be is to fight to preserve all the reasons it attracted you.</p>
<p>I’m not much of a fighter, though.</p>
]]></content>
  </entry>
  <entry>
    <title>London: 12 Years On</title>
    <id>https://gjtorikian.online/posts/london-12-years-on/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/london-12-years-on/" />
    <published>2016-03-04T00:00:00.000Z</published>
    <updated>2016-03-04T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="london" />
    <summary type="text">I can tell you with excruciatingly embarrassing details how I became interested in Japan as a teenager. But after I was a Japanophile, I was an Anglophile. And I don’t remember how I became interested in England at all. Maybe I was trying to impress someone. Maybe it was the least foreign foreign co...</summary>
    <content type="html"><![CDATA[<p>I can tell you with excruciatingly embarrassing details how I became interested in Japan as a teenager. But after I was a Japanophile, I was an Anglophile. And I don’t remember how I became interested in England at all. Maybe I was trying to impress someone. Maybe it was the least foreign foreign country I could move to. Maybe all the Shakespeare and Milton and Gaiman and Lawrence and Hopkins and Woolf finally got to my head. Either way, at one point, I really needed to get over there and see what was going on.</p>
<p>July 2004 was my first trip out to London. I think I had planned to be there two or three weeks, which was probably the longest time I’d been out of the country on my own. I remember that the only reason I could have gone was because I had a terrific boss who let me completely forge all my time sheets. I knew she knew I was lying, but we never talked about it. There wouldn’t have been any way I could take a full course-load at school and still, somehow, put in 20 or 30 hours a week at my desk job. I wrote out completely irregular hours every two weeks: one day, I’d come in for four hours, the next, seven, the day after, six. For the few months prior to the trip my hours became more unrealistic, more erratic. My boss just signed each sheet with a smile and I still got paid.</p>
<p>There are a lot of personal moments I remember about that trip. The <a href="https://en.wikipedia.org/wiki/Bill_Brandt#Exhibitions" rel="noopener">Bill Brandt exhibit at the V&amp;A</a>. Buying a bottle of absinthe while underage. Watching a bunch of Ealing comedies. But there are also memories of events that were larger than myself. The optimism surrounding Rooney at age 18. Portugal beating Greece in the Eurocup finals. The city making itself over for the 2012 Olympics.</p>
<p>After that trip, I was absolutely certain that I would move to London. It was so cool, so <em>European</em>. I don’t remember how that dream dissolved. I do remember London was quickly superseded by a bevy of other cities around the world, all of which were even more exotic. Instead of <em>English</em>, the most wonderful curse in the world seemed to be to move to a place where I could only pronounce about five words poorly. (After Japan and England came France; this would have coincided with the years I was obsessed with Paris in the '20s.)</p>
<p>Like any city, London’s changed in the last decade-plus years. Where the Tube was once a modern marvel of public transportation, I saw now every spec and grime of filth and dirt, the floors sticky, the seats sopping wet. Bustles of irritated people shuffling up and down flights of stairs to stress at their next destination. Everything was loads more expensive than I ever remembered it being. There was construction, everywhere, throngs, everywhere.</p>
<p>Of course, I’d changed, too.</p>
<p>A decade-plus ago I had every single block, every street corner, every step I needed to take written down on pieces of paper that I shuffled through <em>constantly</em>. This time around I was much more willing to pick a direction and get lost. The modern day tourist doesn’t need to carry a map anymore: you can just pull out your phone and check directions in-between tweets.</p>
<p>A decade-plus ago I remember being terrified of opening my mouth for fear of someone observing my accentless talk. Rather than ask questions, I was a voluntary mute, observing how people behaved so that I could imitate them. This time around I could care less who shuddered at my laughs and heard me as an outsider. I didn’t need to fit in.</p>
<p>A decade-plus ago I was learning to drink in pubs. It was the first time I’d handled money at a bar and I thought that someone certainly would ask for an ID and refuse service. By now I’ve become an expert at bar etiquette. Stroke the beard. Squint the eyes. Make yourself seen and unobtrusive.</p>
<p>There was less tourism on this trip, less visits to graveyards, less urges to pack every moment with a new sight, less visits to shreds of land where someone stood three hundred years ago. I was more comfortable just being in one spot, inhaling all the differences between then and now. “Me. And me now.”</p>
<p>What hasn’t changed?</p>
<p>I had Danyel to guide me around this time around, too. Twelve years ago, I wrote:</p>
<blockquote>
<p>Thankfully Danyel and i formed a gang to combat London’s vast museums and seedy pubs.</p>
</blockquote>
<p>I had my cousin Ani to rely on as a source of comfort. Twelve years ago, I wrote:</p>
<blockquote>
<p>I recall at the café we were now at that my cousins and i began discussing what it meant to be an individual.</p>
</blockquote>
<p>Meeting again with both, not a single thing had changed. I’m forever grateful to have had two differently wonderful encounters in the same place. Time and space is a very weird thing.</p>
<p>A decade-plus later I feel more or less the exact same way I did then: on the verge of crossing the terrifyingly thrilling chasm of the unknown. I was and am on the cusp of entering the world and I wanted and want to embrace as much of it as I possibly could and can. Then and now there was and is ahead of me an immense possibility for both opportunity and disappointment.</p>
<p>A decade-plus later I’ve been to enough places to know now that this time around London wasn’t as revolutionary a city as I once believed. But I did enjoy reigniting that thrill of discovery. What I found wasn’t anything to behold; this time was spent looking within.</p>
<p>A decade-plus later I’m less willing to take risks and encounter the bad with the good. I’m not sure if that attitude is a function of age or one’s character or if it’s a proper or improper way to go about living. The older we get, the less we’re inclined to take risks. We’re less willing to be surprised, but also maybe less able to be.</p>
<p>But twelve years ago I would have never wanted to become the sort of person who was <em>comfortable</em> and situated in one place. It seemed like the best way to get into a rut was to just accept things the way they were, even though I didn’t yet have any notion of what any of that meant. What I thought I knew I didn’t. What I only sensed I now know intimately. What could have been wasn’t. But I couldn’t have known that then.</p>
]]></content>
  </entry>
  <entry>
    <title>Back to writing</title>
    <id>https://gjtorikian.online/posts/back-to-writing/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/back-to-writing/" />
    <published>2016-01-05T00:00:00.000Z</published>
    <updated>2016-01-05T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <summary type="text">As part of an entire suite of 2016 changes, I’ve decided to give public blogging another try.</summary>
    <content type="html"><![CDATA[<p>As part of an entire suite of 2016 changes, I’ve decided to give public blogging another try.</p>
<p>In 2015, I consciously tried to do things that I hadn’t done before. The manifestation of that resolution was in <a href="https://github.com/gjtorikian/presentations" rel="noopener">giving public talks a whopping four times</a>. Now that <em>that’s</em> been tried, I think I can say with some certainty that I never want to do it again. 😉</p>
<p>But for many years, blogging just didn’t interest me. I used to joke that pretty much every social network that’s now commonplace—I’ve already done it. Medium? I was blogging about September 11th on LiveJournal. Slack? I used to run an FServe on IRC. Facebook, Friendster. Instagram, Flickr. Twitter… well, the analogy’s stretched to its limit. In any event, I didn’t see the point of trying something I’d already done. It is pretty amusing, though, that many Internet things that people take advantage of <em>now</em> are really just polished versions of things that came before it.</p>
<p>But what’s changed? Why start blogging again? Honestly, I think I had a lot of happy moments blogging into the ether. There was a lot of satisfaction in writing something and tossing it into the void. Maybe I’m trying to recapture that mystery. Another part of me worries about those endless nights where all I did <em>was</em> write, and drink. Is it possible to recreate happiness through writing? We’ll see. And I guess a lot of the “oh I don’t care I’ll just put it online” mentality was an interesting challenge, I guess, for myself to try something that was once dangerous. Shit, maybe it still <em>is</em> dangerous. I met a ton of people off of the Internet through blogging in my late teens, a few of whom I’m still friends with. I don’t know if I’d ever go through that again.</p>
<p>These days, a lot of written communication is heavily edited after an incredible amount of introspection, hesitation, and self-correction. Fuck that. There is something entirely visceral about writing, and, I hope, reading words that straddle the line between stream-of-consciousness and outright-emotion. Or maybe it’s all just a matter of pretension, to justify to ourselves and others that there was a moment in space and time where our experiences mattered.</p>
<p>In addition to becoming more polished, the Internet of 2016 (as opposed to the Internet of 2001) is a lot more locked down. I knew I didn’t want to start writing on some proprietary format, and it depresses me that that’s quickly become the default option for people who want to put 💩 online. It wouldn’t be so much of a problem if there wasn’t also this completely contrary message in the world for people to become more computer proficient. I owe a lot of what I know to just getting on a computer and making things up as I go along. It’s deeply disturbing to continue to come across posts from people that are reasonably well-written and stashed onto Medium (or what-have-you). I had hoped that the vast majority of people would come to agree that we should be actively distrusting and questioning the intents of any service. Not in a tinfoil-hat-wearing “Don’t trust nobody gotta look over your shoulder constantly” sort of way, but at least in a rationale “What does this entity gain by me putting myself on there?” And once you come to an understanding of what <em>their</em> gain is, you’ll be able to better assess whether or not you’re comfortable making that exchange.</p>
<p>For some, being data mined is irrelevant, and that’s not for anyone to judge. What’s being mined these days when your words are placed into the care of someone else? Your photos? Your projects?</p>
<p>For the curious, I grabbed all of my old LiveJournal posts and sifted through the ones that I thought were still interesting. I used <a href="https://github.com/ceejbot/ljmigrate" rel="noopener">ljmigrate</a>, which is a Python utility to interact with LJ’s API; it worked like a charm! Starting around 2009, I think, I also ran <a href="https://en.wikipedia.org/wiki/Habari" rel="noopener">a Habari blog</a> on <a href="http://miadzin.org" rel="noopener">miadzin.org</a>; some of those posts have also been brought over.</p>
<p>Assuming I’ve done enough posts to push them below the fold, I <em>might</em> just go ahead and bring over my entire blogging history from 2001. Some of these words were just <em>painfully</em> trite, though I guess that if anyone took a look at their writing output from ages 17 to 20, they’d be none to pleased, unless you’re like a goddamn Rimbaud or something. I feel like there’s a good amount of liberation in being able to just publically admit what a fool you once were (or still are). The counterargument, of course, is that you just wish you could’ve jumped straight from year 16 to 28 and avoided a decade of confusion.</p>
<p>Maybe, after a half dozen well-intentioned attempts, I’ll end up shutting this down for good, and  euthanize the desire to write. I hope it doesn’t come to that, but it certainly might. Third time’s a charm, though.</p>
]]></content>
  </entry>
  <entry>
    <title>New Book</title>
    <id>https://gjtorikian.online/posts/new-book/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/new-book/" />
    <published>2010-11-11T00:00:00.000Z</published>
    <updated>2010-11-11T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="unrecallable-alleys" />
    <summary type="text">Two years after I first heard about it during my Bolaño craze, I have finally started Javier Marías’ “Dark Back of Time.”</summary>
    <content type="html"><![CDATA[<p>Two years after I first heard about it during my Bolaño craze, I have finally started Javier Marías’ “Dark Back of Time.”</p>
<p>I already know judging from the first few pages that I will enjoy it immensely. It has been a long time since I have been moved by an introduction. The writing reminds me of a little bit of Pessoa.</p>
<p>“Or it may happen that the ending survives me, as almost everything that arises from us or accompanies us or that we bring about survives us; our intentions last longer than we do. We set too many things in motion and then leave them, and their inertia, weak as it is, outlives us: the words that replace us and that someone occasionally remembers or passes on, not always confessing to their provenance; the letters smoothed flat, the bent photographs, the notes written on yellow paper, left for a woman who will sleep alone in the aftermath of wakeful caresses because we leave in the middle of the night like a scoundrel who is just passing through; the objects and furniture that served us and that we allowed into our homes—a red chair, a pen, an image of India, a toy soldier made of lead, a comb—the books we write but also those we buy and read only once or that remain closed on the shelf to the last and then carry on somewhere else with their life of waiting, hoping for other eyes more avid or more placid than ours; the clothes that will go on hanging among mothballs because someone may insist on keeping them, for sentimental reasons—though I don’t know if there are mothballs anymore—the fabrics fading and languishing in their airlessness, each day more oblivious to the forms that gave them meaning, the scent of those forms; the songs that will go on being sung when we do not sing or hum or listen to them; the streets that shelter us as if they were endless hallways and chambers that pay no attention to their ephemeral and inconstant residents; the footsteps that cannot be replicated, that leave no trace on asphalt or are quickly erased on dirt, those footsteps don’t stay behind but depart with us or even before us in their harmlessness or their venom; the medicines, our hurried scrawl, the cherished photos we display, which no longer look back at us, the pillow, our jacket hanging from the back of a chair, a pith helmet brought back from Tunisia in the 1930s aboard the ship Ciudad de Cádiz, it belongs to my father and still has its chin strap, and the Hindu lieutenant made of painted wood that I’ve just brought home with some hesitation, that figurine will also outlast me, or may. And the narratives we invent, which will be appropriated by others who, in speaking of our past existence, gone and never known, will render us fictitious. Even our gestures will continue to be made by someone who inherited them or saw them and was unknowingly mimetic or repeated them on purpose to invoke us and create a strange, momentary and vicarious illusion of our life; and perhaps there will remain, isolated in another person, certain of our traits which we will have transmitted involuntarily, as affectation or unconscious curse, because features can bring luck or misfortune, the eyes verging on Oriental and the mouth as if sketched on with a pencil—“beaky lip, beaky lip”—the chin almost cleft, the broad hands, a cigarette in the left one; I’ll leave no feature to anyone. We lose everything because everything remains except us. And therefore any form of posterity may be an affront, and perhaps any memory, as well.”</p>
]]></content>
  </entry>
  <entry>
    <title>Scratch</title>
    <id>https://gjtorikian.online/posts/scratch/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/scratch/" />
    <published>2009-09-10T00:00:00.000Z</published>
    <updated>2009-09-10T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="unrecallable-alleys" />
    <summary type="text">It’s not a city of lost souls. It’s not a place where the hopeless end up. From its origins San Francisco has always been a city for the certain few who know that life can be lived in better ways. The early settlers panned for gold, hoping to establish their security through labor and luck; for them...</summary>
    <content type="html"><![CDATA[<p>It’s not a city of lost souls. It’s not a place where the hopeless end up. From its origins San Francisco has always been a city for the certain few who know that life can be lived in better ways. The early settlers panned for gold, hoping to establish their security through labor and luck; for them, the history of the east retained its oppression. Women fought for and obtained equal rights there; so too did minority races. And in recent years the gay population has endeavored to show that it, too, belongs to the species of <em>homo sapiens</em>, backwards though it may be, fine and dandy overall. This is all to say nothing of the current technocrats who are not satisfied until every acre of land has wires buried beneath it, and every space of air is transmitting frequencies, all for the sake of a better “standard for living.”</p>
<p>And embedded in these pockets of social and economic changes stand out the individuals, nameless as they are. No one moves here without understanding that they lack something. No one living here is not in a frenzied pursuit for a missing piece of themselves. No matter if they’re trying to recreate youth, or hosting sustainable gourmet feasts, or creating costumed bar crawls. Everyone is searching. Whether they find what they seek is irrelevant. The important thing is that they’re looking. The heart knows what it lacks.</p>
<p>The first question San Franciscans ask is “Where are you from?” Since the city is migratory, everyone knows their residence is as temporary as their neighbors. For the sake of conversation, it helps to discuss with fond recollection “the old life,” to quickly follow up with your endevours in San Francisco. The contrast between the two is important, to the speaker as well as the listener. It sets a sort of challenge to everyone involved, to dare to follow the dreams they separately made. That’s as close a label as it can get, probably. A city of dreamers. The world spins in its elliptical orbit while the citizens of San Francisco drift along in their own manners, impervious to land outside its borders.</p>
<p>Hordes of men and women move here out of their own original seed, and while some remain ecstatic over the possibility of bonding with like-minded humans, others turn bitter. It is very difficult to be original here, a city that has seen everything, a city that will permit anything. Within it you will find your niche, and soon after you may discover cliques that even you are not privileged to join. Those who do not accept this basic fact of life–that there are always people better than you–turn vicious.</p>
<p>Happiest are those who appreciate the enthusiasms of others, but find themselves unsuitable for higher callings. After many years of struggles, false starts, external and internal obstacles, depression, and doubt, they transform themselves into the person they wanted to see. Most usually leave, not out of spite, but gratitude. They say goodbye to their city with teary eyes. They have taken what the could, and most important, they have given it everything they had. And yet, they owe San Francisco their lives.</p>
]]></content>
  </entry>
  <entry>
    <title>I say this not to deny my debts to him</title>
    <id>https://gjtorikian.online/posts/i-say-this-not-to-deny-my-debts-to-him/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/i-say-this-not-to-deny-my-debts-to-him/" />
    <published>2009-08-15T00:00:00.000Z</published>
    <updated>2009-08-15T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="unrecallable-alleys" />
    <summary type="text">“I say this not to deny my debts to him, which are many, but to lead you back, and to lead myself back, to a principle that I think is fundamental for all those who have taken part in this conference, certainly for me, and certainly for Borges: this most important point is that books talk to each ot...</summary>
    <content type="html"><![CDATA[<p>“I say this not to deny my debts to him, which are many, but to lead you back, and to lead myself back, to a principle that I think is fundamental for all those who have taken part in this conference, certainly for me, and certainly for Borges: this most important point is that books talk to each other.”</p>
]]></content>
  </entry>
  <entry>
    <title>Morelliana</title>
    <id>https://gjtorikian.online/posts/morelliana/</id>
    <link rel="alternate" type="text/html" href="https://gjtorikian.online/posts/morelliana/" />
    <published>2009-03-27T00:00:00.000Z</published>
    <updated>2009-03-27T00:00:00.000Z</updated>
    <author><name>Garen Torikian</name></author>
    <category term="unrecallable-alleys" />
    <summary type="text">&quot;I think about forgotten gestures, the multiple signals and words of grandparents, lost little by little, not inherited, fallen one after the other off the tree of time. Tonight I found a candle on a table, and as a game I lit it and walked along the corridor with it. The breeze stirred up by my mot...</summary>
    <content type="html"><![CDATA[<p>&quot;I think about forgotten gestures, the multiple signals and words of grandparents, lost little by little, not inherited, fallen one after the other off the tree of time. Tonight I found a candle on a table, and as a game I lit it and walked along the corridor with it. The breeze stirred up by my motion was about to put it out, then I saw my right hand come up all by itself, cup itself, protect the flame with a living lampshade that kept the breeze away. While the flame climbed up again alert, I thought that the gesture had belonged to all of us (I thought us and I thought well, or I felt well) for thousands of years, during the Age of Fire, until they changed it on us to electric lights. I imagined other gestures, the one that women make when they lift the hem of their skirts, the one that men make looking for the hilt of their swords. Like words lost in childhood, heard for the last time by old people who are heading towards death. In my home no one talks about the “camphor closet” any more, no one talks about “the triv”—the trivet—any more. Like music of the moment, 1920s waltzes, polkas that warmed grandparents’ hearts.</p>
<p>“I think about those objects, those boxes, those utensils that sometimes would turn up in storerooms, kitchens, or hidden spots, and whose use no one can explain any more. The vanity of believing that we understand the works of time: it buries its dead and keeps the keys. Only in dreams, in poetry, in play—lighting a candle, walking with it along the corridor—do we sometimes arrive at what we were before we were this thing that, who knows, we are.”</p>
]]></content>
  </entry>
</feed>
