Sy Brand Profile picture
c++ developer advocate @microsoft ~ poet ~ filmmaker ~ tired person ~ they/them
Jul 29, 2022 100 tweets 30 min read
This seems fun 1 like = 1 favourite film f... Haven't really watched anything from this year yet, so gonna start in 2021 with Alone Sleeps The Water, Frozen She Awakes. It packs such incredible textures and feeling into just 5 minutes Ice on the camera lens, sno...
Jun 21, 2022 12 tweets 3 min read
People say "passing small types by value is faster than by reference", but how is the code generated different?

Consider this code void by_value(int); void by... Here's the assembly generated by MSVC targeting x64 using the default rules for calling functions (calling conventions), compiling with optimisations on (/O2)

When you pass an object by reference, it needs to be stored in memory so that the address of it can be taken and passed sub     rsp, 40  lea     rc...
Jun 20, 2022 6 tweets 2 min read
Continuing my read of this.

The second chapter is on criteria of judging the "value" of art, which is my joint least favourite part of art philosophy (the other being essentialist definitions of what art is, which is what the first chapter was on) This chapter goes through most of the classical criteria: beauty, the sublime, skill, ethics, emotional power, innovation.

The specifically Marxist contribution which the author looks at is the degree to which an artwork "gives powerful and insightful social relations"
Jun 20, 2022 5 tweets 1 min read
Try to not put your hopes and time and energy into relationships where the other person isn't reciprocating. Try to identify relationships that actually have the potential to grow. I spent a lot of my life putting too much into relationships that were doomed, when I should have focused on building up those I already had, or finding new ones elsewhere.

This applies to any kind of personal relationship
Jun 20, 2022 4 tweets 1 min read
Wrote a poem today for the first time in a month or so, felt good Would recommend
Jun 16, 2022 7 tweets 2 min read
I'm begging C++ teaching resources to not teach pointers right near the start of the course. Functions, references, classes first. Jumping straight into pointers is unnecessary and often demoralising. There are simpler solutions to many of the use cases for pointers.
Jun 15, 2022 29 tweets 5 min read
Reading this to distract my brain: a Marxist examination of art philosophy The Dialectics of Art by Jo... From what I gather it is a series of essays applying Marx' labour theory to art production and contextualising contemporary art within capitalism
Jun 14, 2022 4 tweets 2 min read
How do virtual functions find the correct version to call at runtime? I explain, as always, with my cats 🐈🐈 The flag I passed to MSVC to get that information was /d1reportAllClassLayout. There's also /d1reportSingleClassLayout<class>.

Clang has -cc1 -fdump-vtable-layouts and -cc1 -fdump-record-layouts

GCC has -fdump-lang-class=<file>
Apr 13, 2022 11 tweets 2 min read
Can't sleep, here's some haphazard thoughts about when I learned Lisp and how it changed the way I saw programming I taught myself Common Lisp in my second year of university after touching maybe 7 or 8 other languages. I was mostly drawn to it cause I liked Emacs, but was told that if I submitted coursework in Emacs Lisp my professors would hate me.
Mar 21, 2022 32 tweets 10 min read
I'm writing a talk on what's new in C++23, so while I'm doing that, here's a thread of new features: size_t literal suffix

Fed up of signedness/width mismatches in some cases? This could help. Use the uz suffix for std::size_t, z on its own for the signed version. std::vector<int> v{0, 1, 2, 3}; for (auto i = 0uz, s = v.siz
Mar 19, 2022 4 tweets 1 min read
This morning:
- go to feed friend's cats
- get there, I've forgotten keys
- go home
- go back with keys, feed cats
- get home, oops, I had to go to pharmacy
- go to pharmacy, crap, I've left masks at friend's house
- go to friend's house
- go back to pharmacy, it's shut
- screm Now I've lost my camera charger, can someone reboot today?