More from Confessions of a Code Addict
Measuring, analyzing, and optimizing loops using Linux perf, Top-Down Microarchitectural Analysis, and the CPU’s micro-op cache
Why Your O(log n) Algorithm Might Lose to O(n)
A step-by-step walkthrough of the toy kill program using raw Linux syscalls.
Welcome to my ongoing series on x86-64 assembly programming, designed for programmers who want to peel back the abstraction and understand how code really runs at the machine level.
A deep dive into Python’s name resolution, bytecode, and how CPython 3.11 quietly made a popular optimization irrelevant.
More in programming
“Earth to Dave.” Brian rapped his knuckles lightly against Dave’s head. He snapped back into it. “This nice lady wants to know what kind of bagel you want” It was so like Brian to call the woman at the counter a nice lady. At some point, he’d watched American Pie and thought Stifler was how people should be. Or maybe he was just always like that and the movie made him think it was acceptable. He called himself a gentleman, but not in the creepy Elliot Rodger way, or in anything resembling the real meaning of the word. I think he just thought it was funny how that word got a rise out of people. Dave replied, “uhhh a cinnamon raisin…with uhh…butter…yea butter.” Even the nice lady knew Dave was high, Brian and I ordered normal bagel sandwiches and here was Dave ordering dessert. Brian paid for the bagels with his mom’s credit card and told us we could Venmo him later. His mom’s credit card and we Venmo him. That’s the type of guy he was. “He didn’t leave last night. Passed out right where he was sitting,” Brian spoke about Dave like he wasn’t there. This would happen sometimes. Like we would smoke and get high, but for Dave it was a different thing. He would smoke till he was catatonic. He was also the first one in our friend group to start smoking. Dave’s older brother killed himself when we were freshmen, and that’s around when it started. A coping strategy. It wasn’t just the loss of his brother, his mom was never the same afterward. I don’t think I saw her out of the house after that; Dave said she barely left her room. The overall downer atmosphere was too much for his sister and she moved to California as soon as she could. He was all that was left. Dave got quiet after that. Maybe it was the weed, maybe it was the pain, but he started riding his bike to school every day and doing really well in classes. His brother was some kind of wunderkind; maybe he thought if he was like that his mother would stop moping. He graduated valedictorian and she never did. Maybe that wasn’t enough? “I thought we were gonna have a party last night,” I mentioned offhandedly. Brian’s parties weren’t the Met Gala, but it was usually more than just the three of us. I was hoping Ari was going to be there. “Hoping Ari was gonna be there?” Oh God even when I say something so innocuous Brian knows what I’m thinking. “Nah, we found the Volcano and didn’t really want to text anyone else after that.” “Understandable” “I don’t know if Dave slept. When I came downstairs he had the bag inflated on top of the machine.” He ribbed Dave with his elbow while he said this. “I slept,” mumbled Dave. “It’s called wake and bake.” Dave and Brian both liked 2000s movies, stoner comedies, movies about high school and prom, getting laid. Something about it being a simpler time. They were closer than I was with either of them. Dave would go to dark places and Brian couldn’t be brought there. So it worked. Even though Brian was kind of an asshole, he was a good guy to have around. His dad was a trucker and he wasn’t around much. This is one of the things we bonded over. They called our name and we sat down at a table with the bagels. In the morning the visit from the cops didn’t really seem like much of a big deal, so I thought I’d tell the guys about it. Upon doing so, Brian immediately pointed out something I missed. He asked, “What’s your dad’s name?” and I realized right away. While he went by Jonathan and I went by John, it sure made a lot more sense that the cops were looking for him when they wrote “John.” Lazy cops didn’t even write his full name. He was in town, and he was on Long Island for the meeting. It wasn’t me! “Hey McFly!” Brian mocked. It was clear he’d watched Back to the Future recently and now I see where he got the knuckle rapping too. “You know you gotta stop being such a little pussy all the time.” He put on a high pitched voice that was supposed to resemble mine, “I’m a little pussy, I hide in my room when the cops come and they aren’t even looking for me they are looking for my weird ass dad.” I was too relieved to care about his mocking. Brian continued, “You know that place was into some weird shit. Where your dad worked before he bugged out. Dave’s brother worked there too.” “You mean the one who killed himself?” Immediately I regretted how I said it and looked over at Dave. He was too transfixed by the swirls of cinnamon in his bagel to register anything. Brian scolded me, “dude” and I felt embarrassed. I was so giddy from realizing the cops weren’t looking for me that this crossed over in my head to a true crime podcast, where I was more interested in the mystery than the characters, forgetting that these were real people with real lives. I felt distant enough from my father to view him that way. I don’t know how Dave felt about his brother anymore. I came back at Brian, trying to move past my faux pas. “Well at least my dad did something. Your dad doesn’t even drive the truck! He sits there and watches it drive. A real union man.” Dave now had finished his bagel and put his head down on the table. Brian smiled at the retort, “At least my dad isn’t some kind of Kaczynski freak.” This was the nature of our friendship. Last night I thought my world was closing in, now I realize this just all isn’t my problem. My dad was sort of a Kaczynski freak. Maybe he mailed bombs to people and the cops caught him. Maybe he has some lame manifesto about why he did it. I love reading manifestos. I took out my phone and venmoed Brian for my and Dave’s bagel. We’d venmo him about half the time; Brian’s mom was rich from the settlement and we knew she didn’t care. My mom still wasn’t back when I got home.
Here on a summer night in the grass and lilac smell Drunk on the crickets and the starry sky, Oh what fine stories we could tell With this moonlight to tell them by. A summer night, and you, and paradise, So lovely and so filled with grace, Above your head, the universe has hung its … Continue reading Dreams of Late Summer →
The first Rails World in Amsterdam was a roaring success back in 2023. Tickets sold out in 45 minutes, the atmosphere was electric, and The Rails Foundation set a new standard for conference execution in the Ruby community. So when we decided to return to the Dutch Capital for the third edition of the conference this year, the expectations were towering. And yet, Amanda Perino, our executive director and event organizer extraordinaire, managed to outdo herself, and produced an even better show this year. The venue we returned to was already at capacity the first time around, but Amanda managed to fit a third more attendees by literally using slimmer chairs! And I didn't hear any complaints the folks who had to sit a little closer together in order for more people to enjoy the gathering. The increased capacity didn't come close to satisfy the increased demand, though. This year, tickets sold out in less than two minutes. Crazy. But for the 800+ people who managed to secure a pass, I'm sure it felt worth the refresh-the-website scramble to buy a ticket. And, as in years past, Amanda's recording crew managed to turn around post-production on my keynote in less than 24 hours, so anyone disappointed with missing out on a ticket could at least be in the loop on all the awesome new Rails stuff we were releasing up to and during the conference. Every other session was recorded too, and will soon be on the Rails YouTube channel. You can't stream the atmosphere, the enthusiasm, and the genuine love of Ruby on Rails, though. I was once again blown away by just how many incredible people and stories we have in this ecosystem. From entrepreneurs who've built million (or billion!) dollar businesses on Rails, to programmers who've been around the framework for decades, to people who just picked it up this year. It was a thrill to meet all of them, to take hundreds of selfies, and to talk about Ruby, Rails, and the Omarchy expansion pack for hours on the hallway track! I've basically stopped doing prepared presentations at conferences, but Rails World is the one exception. I really try my best to put on a good show, present the highlights of what we've been working on in the past year at 37signals, and transfer the never-ending enthusiasm I continue to feel for this framework, this programming language, and this ecosystem. True, I may occasionally curse that commitment in the weeks leading up to the conference, but the responsibility is always rewarded during and after the execution with a deep sense of satisfaction. Not everyone is so lucky as I've been to find their life's work early in their career, and see it continue to blossom over the decades. I'm eternally grateful that I have. Of course, there's been ups and downs over the years — nothing is ever just a straight line of excitement up and to the right! — but we're oh-so-clearly on the up-up-up part of that curve at the moment. I don't know whether it's just the wind or the whims, but Rails is enjoying an influx of a new generation of programmers at the moment. No doubt it helps when I get to wax poetically about Ruby for an hour with Lex Fridman in front of an audience of millions. No doubt Shopify's continued success eating the world of ecommerce helps. No doubt the stability, professionalism, and execution from The Rails Foundation is an aid. There are many auxiliary reasons why we're riding a wave at the moment, but key to it all is also that Ruby on Rails is simply really, really good! Next year, with RailsConf finished, it's time to return to the US. Amanda has picked a great spot in Austin, we're planning to dramatically expand the capacity, but I also fully expect that demand will continue to rise, especially in the most prosperous and successful market for Rails. Thanks again to all The Rails Foundation members who believed in the vision for a new institution back in 2022. It looks like a no-brainer to join such a venture now, given the success of Rails World and everything else, but it actually took guts to sign on back then. I approached quite a few companies at that time who could see the value, but couldn't find the courage to support our work, as our industry was still held hostage to a band of bad ideas and terrible ideologies. All that nonsense is thankfully now long gone in the Rails world. We're enjoying a period of peak unity, excitement, progress, and determination to continue to push for end-to-end problem solving, open source, and freedom. I can't tell you how happy it makes me feel when I hear from yet another programmer who credits Ruby on Rails with finding joy and beauty in the writing web applications because of what I started over 22 years ago. It may sound trite, but it's true: It's an honor and a privilege. I hope to carry this meaningful burden for as long as my intellectual legs still let me stand. See you next year in Austin? I hope so!
I hadn’t lost my virginity yet. And it wasn’t for lack of trying; it seemed like the rest of my generation was no longer interested in sex. On some level, I understood where they were coming from, the whole act did seem kind of pointless. But after a few beers, that wasn’t how my mind was working. I turned 19 last week. Dad flew in from Idaho, and it was the first time he was in the house I shared with my mother. He left when I was 12, and it was always apparent that parenting wasn’t the top thing on his mind. There was some meeting on Long Island. That’s probably why he was there, in addition to the fact he knew mom wouldn’t make him sleep on the couch. He had many reasons to be in New York that weren’t me. My birthday was just a flimsy pretense. He’d worked on Wall Street the whole time he was around, a quant. He wrote programs that made other people rich. But something happened to him right before he left. A crisis of conscience perhaps; he was spiraling for weeks, cursing the capitalist system, calling my mother a gold-digging whore (which was mostly true), and saying things needed to change. Then he packed a single backpack and left for Idaho. I visited him out there once my sophomore year. He had a camouflaged one room cabin in the middle of a spruce forest, but instead of the hunting or fishing stuff you might expect, the walls were adorned with electrical test equipment and various things that looked like they were out of a biology or chemistry lab. I didn’t know much about this stuff and that wasn’t what he wanted to talk about anyway. He wanted to talk about “man shit” like nature and women and not being life’s bitch. I tried to act like I did, but I didn’t really listen. All I remember is how eerily quiet the night was, I could hear every animal movement outside. My dad said you get used to it. Brian was having a party tonight. Well okay, party is a lofty way to describe it. He’d replaced the fluorescent lights in his mom’s basement with blacklights, and we’d go over there to drink beer and smoke weed and sit around on our phones and scroll. And sometimes someone would laugh at something and share with the group. I had a case of Bud Light left over from the last party and drank two of them today. Hence the thinking about sex and not thinking that thinking about sex was stupid. People wouldn’t be going over there for a few more hours, so I laid in my bed, drank, and loosely beat off to YouTube. Celebrity gossip, internet gossip, speedrun videos, nothing even arousing. I liked the true crime videos about the hot female teachers who slept with their students. Yea yea yea terrible crime and they all act holier than thou about what if the genders were reversed, but the genders weren’t reversed. Maybe they just don’t want to get demonetized. There were never women at these parties. Okay maybe one or two. But nobody ever slept with them or much thought about them that way. They were the agendered mass like the rest of us. Fellow consumers, not providers. Fuck I should just go visit a hooker. I didn’t know much about that, were hookers real? I’d never met one, and there wasn’t a good way to find out about stuff like this anymore. The Internet was pretty much all “advertiser friendly” now, declawed, sanitized. Once the algorithms got good enough and it was technically easy to censor, there was nothing holding them back. It wasn’t actually censored, it would just redirect you elsewhere. And if you didn’t pay careful attention, you wouldn’t even notice it happening. I tried asking ChatGPT about hookers and it told me to call them sex workers. And this was kind of triggering. Who the fuck does this machine think it is? But then I was lost on this tangent, the algorithms got a rise out of me and I went back to comfort food YouTube. Look this guy beat Minecraft starting with only one block. The doorbell rang. This always gives me anxiety. And it was particularly anxiety inducing since I was the only one home. Normally I could just know that the door of my room was locked and someone else would get it and this would be a downstairs issue. But it was just me at home. My heart rate jumped. I waited for it to ring again, but prayed that it wouldn’t. Please just go away. But sure enough, it rang again. I went to my window, my room was on the second floor. There was a black Escalade in the driveway that I hadn’t seen before, and I could see two men at the door. They were wearing suits. I ducked as to make sure they wouldn’t look up at me, making as little noise as possible. Peering over the window sill I could see one opening the screen door, and it looked like he stuck something to the main door. My heart was beating even faster now. It was Saturday night, why were there two men in suits? And why were they here? It felt longer, but 3 minutes later they drove off. I waited another 3 for good measure, just watching the clock on my computer until it hit 6:57. I doubled checked out the window to make sure they were actually gone, and crept down the stairs to retrieve whatever they left on the door. It was a business card, belonging to a “Detective James Reese” of the Nassau County Police. And on the back of the card, there was handwriting. “John – call me” John was my name.
The first in a series of posts about doing things the right way