yaymukund’s weblog ^_^

This is a list of places in Rust where implementing a trait or using a struct affects the syntax of your code. I think of these features as "magical" because using them can change the behavior of very basic Rust code (let, for-in, &, etc.).

What follows is a small list of (hopefully) illustrative examples, and a short epilogue pointing you to more articles if this topic interests you.

Continue reading…

Here's how you wire up an AWS lambda into an HTTP API using Terraform and AWS's API Gateway v2 resources.

Continue reading…

I decided to catalogue examples of engineers— primarily software developers— being asked to change a name to avoid being racist, sexist, transphobic, ableist, or otherwise bigoted. About half of these examples come from responses to my AskMetaFilter question.

Continue reading…

In Jon Gjengset's Demystifying Unsafe Code talk at Rust NYC, he gives a very interesting example of unsafe code. Here's the link— please go and watch it— but I've transcribed it here along with my paraphrased explanation.

Continue reading…

A Few Things Like These (Ippatiyum Cila Vicayankal)

Among birds, I like crows very much.
It's true; it is a thieving creature
tactfully snatching away the eats from the hands of children.
In deed, it is a foolish creature
visiting and perching on the compound wall of the house
and caws at the oddest hours.
Even then
isn't it my friend
who looks at me and calls out to me
in my village where I crawled as a baby and grew up
and also in this city planted from elsewhere?

— Cinnakkapali (Translated by Nirmal Selvamony)

There were three or four crows standing on a branch in the trees outside our balcony, so this poem feels very timely.

Source: Oikopoetrics and Tamil Poetry by Nirmal Selvanomy

Later, I Learned to Speak Without a Tongue

But first I wrote backwards.
First I learned to breathe without my throat.

Once, my teeth chattered alphabets and people sat in rows
to hear me speak.

Later I wrote on paper and the paper cut itself to emptiness.
Later I sat alone in the pew.

Once I chanted into the empty nests of finches.
Once a cathedral grew in the meadow,

crowns of flowers on the skulls of deer.
Before that I had children.

After that, everything I loved became a hole.
I lay down and shouted names into the dirt.

After that, eyes grew upon my heart and all those eyes
grew hearts and all those hearts eyes and hearts and eyes

were trapped inside me in the dark. Later the children will
come back and we'll swim moonlit in the river.

Later, an emptiness will swallow me and whole.
After that I will turn to grass.

— Lisa Allen Ortiz

I love this poem. The surreal imagery ("my teeth chattered alphabets", "skulls of deer") contrasts with her plain, almost boring, sentence structure (First this. Then that. Once this). She also speaks with absolute certainty, describing only what did or will happen. The resulting poem sounds like a recipe or a witness statement, but what is she recounting?

Sleeping Alone

to the neighbor's dog
and bark.
He must
be very big,
his mouth as big
as my head,
his head
as big
as a Macy's Day float,
his corridor throat
commanding me
to hear:
I am one
in the lonely bowl
of night
and there
is so

— Amy Miller, 2018

I want to hug a dog.

How to spy on your Rust code

In the following code, how can you test that Player is making the correct API calls?

struct Player<'a> {
  api: &'a Api,

impl<'a> Player<'a> {
  pub fn new(api: &'a Api) -> Player<'a> {
    Player { api }

  pub fn play(&self, song: &str) {

  pub fn stop(&self) {
Continue reading…

Wireless printers on swaywm

Here's how you add a wireless printer to Sway. You'll need the following tools:

  1. CUPS, the "standards-based, open source printing system"
  2. Avahi for wireless support
  3. nss-mdns, so we can refer to the printer as <hostname>.local (e.g. myprinter.local)
Continue reading…

By translating these poems, we aim to memorialize Xu, share some of his excellent literary work, and spread awareness that the harsh conditions, struggles and aspirations of Chinese migrant workers (including but not limited to Foxconn) have not diminished since the more widely-publicized spate of 18 attempted Foxconn suicides in 2010, resulting in 14 deaths. Insiders report that thereafter, although the frequency of suicides decreased (mainly due to Foxconn's installation of nets making it more difficult for workers to jump from their dormitories, along with the development of workers' collective resistance), such suicides have continued to the present. Including Xu Lizhi, at least 8 cases have been reported in the media since 2010, but insiders say that many other cases go unreported. We hope that in the future, workers in Foxconn and elsewhere manage to find ways around such companies' military-style discipline and surveillance, come together, and forge collective paths out of this capitalist world of death, into a world worth living in. Don't give up!

Source: libcom.org/blog/xulizhi-foxconn-suicide-poetry

Continue reading…