SectorLISP Now Fits in One Sector

C++ Coroutines Do Not Spark Joy

Relative relocations and RELR

Issue #116



Heads up, I got rid of the big buttons for articles; you can just click their titles. Trying to minimize the number of issues that land in the promotions tab, and apparently that depends on the number of links in the email. Also if issues are landing in your promotions tab, please move them over the primary. Thanks. Anyway I hope you had a decent weekend. Mine was alright. I was experimenting with webapp development using a combination of Clojure and Svelte, contemplating switching providers again for sending out emails, and wrestling with OAuth.

Ultimately I've found that the best way to learn a new language for me, is to use it to implement something I'm very familiar with. In my case that means a website or a webapp. Fortunately, that usually covers pretty much any part of a language you'd be interested in interacting with. You might say that's fairly obvious, but in my self-confident youth I tried to learn a new language by implementing something completely new to me (like a neural net). Big mistake. The only thing I can equate that to was that at the end of the day, it felt like my brain had taken up a full time position as a punching bag at the local gym.

Optimal work is done during the flow (I feel like I'm ultra instinct Goku in that state), and obtaining it when trying to learn two fundamental new things is waaaay too hard (for me). This weekend proved the new approach to be far superior, although I did spend a lot of time deciding if I wanted to implement the project using ClojureSript or Svelte for the frontend. I think I'll go with the latter, since a) from what I can tell ClojureScript interfaces best with React, and screw using React, and b) I already know Svelte and it's so much better than React. The only issue is that I've become so spoiled with running "npm run dev" to start both the server and client sides, that now I feel like I'm obliged to implement a similar workflow in a non-monolothic (not one language) project. If anyone has coincidentally done something along these lines, let me know, because I'd love to pick your brain.

A major annoyance that arose from the above experimentation, was that I realized my new provider for the newsletter service has a very weak API. Oh right, I didn't mention that the project I'm talking about is basically an admin dashboard for running this newsletter, where I can create issues and schedule other related tasks like posting on social media and notifying authors. This is of course mostly my fault; I should've definitely checked their API more thoroughly before switching, since I had this idea in the back of my mind for a while now, but I guess I just assumed one would be able to create a campaign programmatically, since most services offer that. Oh well. You know what they say about when you assume! I'm going to explore some different options, because I think having the dashboard would substantially reduce the shittier parts of running this newsletter while also opening up the opportunity of hiring someone to help me out. Exciting times! If you happen to run/know of a newsletter service that has a great API for developers, and is relatively cheap (currently paying $20/month for 2.5k subs + $1 per 10k emails via Amazon SES), let me know!

Which brings us to the last point about implementing OAuths. Probably of minor interest to you, but the site now supports Google OAuth for subbing. I also wanted to add Twitter OAuth, but they declined my application for access to the dev API. I'm not sure why. I probably triggered some bad keyword check when I mentioned that I might use it in the future to automate posting on the A Byte of Coding twitter account whenever a new issue is released, but the conspiracy theorist in me thinks it's because they recently acquired Revue (a newsletter service), and they purposely shun anyone who's not conforming. If you or anyone you know works at Twitter and might be able to help shine light on the issue, I'd greatly appreciate it.

On a related note, one thing I'm proud of in regards to the OAuth stuff is that it's all implemented via Cloudflare workers. It's super convenient honestly. Although the initial setup kind of blows (debugging sucks, but I didn't use their command line tool wrangler, so maybe that makes it better somehow), it's nice not having to manage any of it on my own server. Maybe this whole serverless thing isn't a bad idea, even if it's a terrible inaccurate name. More like "a ton of servers, but none that you have to really worry about when it comes to maintenance". I guess that's not as catchy though.

Well anyway, that was a phat intro. Should I make it a thing for Mondays? I'd aim for it to be a bit less rambly in the future, although I can't promise it won't be as scattered topic wise. Welp, here's the issue!


SectorLISP Now Fits in One Sector

Published: 30 October 2021
Tags: lisp, assembly

Have you ever implemented in your own language? Really? Awesome! Have you done it so that it fits in 512 bytes? No? Not surprised. In this mind-boggling article by Justine Tunney, we get a glimpse of a couple of the hacks used to make SectorLisp fit in the "master boot sector of a floppy disk". It's not as long or as much of a technical deep-dive as usual, but the astounding engineering required to make it work warrants having it featured.


C++ Coroutines Do Not Spark Joy

Published: 31 October 2021
Tags: cpp

Coroutines have been defined in the C++ standard as "simply a function that behaves differently when called multiple times: Instead of restarting from the start on each call, it will continue running after the return statement that last returned". In this informative article, Malte Skarupke explains why the current coroutine implementation in C++ doesn't really fit the language design, and goes on to manually implement them to give you a better idea of how they work.


Relative relocations and RELR

Published: 31 October 2021
Tags: elf

"Relocation is the process of connecting symbolic references with symbolic definitions". One way to optimize the size of your programs is to reduce the size of these connections. In this technically-heavy article, Fangrui Song does a deep dive into implementing a new feature for glibc that compresses relative relocations, resulting in smaller footprints.

Want to discuss the issue? 

If you want to discuss or comment on this issue, head on over to this page at A Byte of Coding.
Thanks for your Support! 

Thanks to sponsors and supporters like Євген Грицай, Scott Munro, zturak, pek, Emil Hannesbo, and Joe Hill this newsletter is provided to you for free. If you'd like to also show your support and buy me a monthly meal, you can donate on the Patreon page. It's not necessary, but it lets me know that I'm doing a good job and that you're finding value in the content.

Stats (updated daily)

Sent: 2448

Opens: 1127

Clicks: 224

Link Clicks Clicks % Unique Clicks Unique Clicks %
SectorLISP Now Fits in One Sector 76 36.89% 64 33.86
C++ Coroutines Do Not Spark Joy 92 44.66% 88 46.56
Relative relocations and RELR 38 18.45% 37 19.58


Back to Issues