Tweet fijado
Blake Ridgway
8.5K posts

Blake Ridgway
@cipher_vance
Hard Problems. Long Rides. Open Code.
Enid Se unió Kasım 2010
765 Siguiendo383 Seguidores
Blake Ridgway retuiteado
Blake Ridgway retuiteado
Blake Ridgway retuiteado

Sooo... now that we've established that I do horrible, terrible, evil things with the C programming language (on my Sega Dreamcast), that make the purist, minimalist C programmers want to puke, lets take another deep-dive into the dark side of C...
Today we're looking at my GblStringView API, which is my own equivalent of C++'s std::string_view, with several notable exceptions:
First of goddamn all, stop telling me std::string_view is always "zero overhead for strings" when any time you have to pass one to a function taking a C string as a const char*, you are FORCED to copy it into a temporary buffer, which you must then ensure is NULL-terminated, before forwarding it on as a const char* to a function.
Rather than dealing with that bullshit, I reserve one bit from the size field (declared using my own GBL_BIT_FIELDS() meta macro, which ensures endian-independence), so that I know that I can elide such a temporary copy when needing to use my string view with a C API.
Next, you'll notice I have taken the liberty of stealing the very few useful functions provided by C++'s std::string_view and have augmented them by continuing on to steal every useful method that operates on constant strings from Java, C#, Python, and even Perl's chomp() (for the lulz), making searching, tokenizing, comparing, returning substrings, and working with string views not a total pain in the ass!
Moving right along to the next great sin against C's purity, you'll notice something strange about many of my function declarations... I have taken the liberty of including values within parentheses for the final argument(s) of many of them...
...WTF? Well, after several rewrites, whittling down 999 different variants of the same routine depending on the number of arguments that it received (or always having to unnecessarily pass extra args I don't care about), I have settled upon a new kind of blasphemy for many of my APIs: default arguments in plain C17...
Yes, it's evil, unnatural, and horrible. No, I don't care. It's glorious to use and is sooo much more ergonomic! Sorry, not sorry!
So how does it work? Well, for any public API which features default function arguments, if you scroll down to the bottom of the header file (where I hide my evil misdeeds to not scare off the grug-minded and pure), you will immediately notice that each function with default arguments has a corresponding macro WITH THE SAME NAME that actually "overrides" and hides the C function, propagating a variadic argument list through a series of proxy macros which append default arguments onto it before finally invoking the actual function itself with them...
This is a practice which has drastically improved the ergonomics of many of my APIs... You'll get raised eyebrows, you'll be called a bad person, and you might be ostracized from your social circles, but don't knock it until you try it!
Stay tuned for more unholy C practices, as we continue our journey into the dark side!
github.com/gyrovorbis/lib…

English
Blake Ridgway retuiteado

I changed my phone number and forgot to update it on my @GuildWars2 account. Well I changed my ISP a week or so ago...now I'm being asked to use my SMS auth to access my account. I can't do that because new phone #...can't create a support ticket because I can't log in @ArenaNet
English

@DobsonFiber Is that why I'm still waiting after a week to hear back from your customer service? :)
English

We believe passion for customer service leads to success. Sound like your kind of company? Let’s chat. 💬 hubs.ly/Q03j12Vf0

English

Maybe 2026 is the year I can get my job to move to @NetgateUSA firewalls. 🙏🙏🙏
English

Well we've made it to week one of @DobsonFiber not responding to a inquiry I made of their services.
Bets on how long it will take to get a response? All I asked as a potential new customer if it was possible to pay a monthly fee to get a static IP as a residental user. :))))))
English

@iFightForKids I know this looked familiar when I was browsing Facebook and EPD posted his mugshot lol

English
Blake Ridgway retuiteado

⚒️ Upcoming maintenance
On February 19, our infrastructure will undergo scheduled maintenance.
⏰ Duration (2 hours):
7:00 AM - 9:00 AM UTC
2:00 AM - 4:00 AM EST
During this period, Spacemail, Free Email Forwarding, Domain Privacy, and our email support system will be affected, meaning that incoming emails will be queued and delivered once the maintenance is complete.
We're sorry for any inconvenience this may cause. In the meantime, our support team will still be able to assist you in chats. You can find the chat widget at the bottom right corner of this page: spaceship.com/about/contact-…
Thanks for your understanding!
English

@BlakeRidgway_ @system76 I upgraded to 32GB because I got a new Crucial 16GB chip for $30, and the laptop came with only 1x16GB chip, so it was a no-brainer. The 990 Pro was on sale for $80 dollars, so that was also a no-brainer. Not really that I need 32GB RAM, but it's future-proofed for a while.
English


@OWGotStung @system76 Nice! I'm comtemplating on upgrading my Darter Pro to 32GB of RAM and a 1TB Crucial P3 Plus.
But I just bought the Darter Pro and a new car, so money spending is going to have to be very careful. Haha
English

@BlakeRidgway_ @system76 I love how they use flagship hardware, they don't use stuff that you find in value or even mid-level machines. I also love the ability to tweak. I zoomed my Gazelle with a 1TB Samsung 990 PRO, and 32GB 2x16GB RAM. With the i9 13900H, and the stuff I put in, it's one zippy unit.
English

@OWGotStung @system76 I have a Thelio, Lemur Pro 9, had a Gazelle, now I have my new Darter Pro! I'm excited to expand my System76 devices :D
English

@BlakeRidgway_ @system76 I love my Gazelle, it's a really nice unit.
English

@ZanussiZaandam @system76 My desktop is Skywalker, Lemur Pro 9 is Kenobi, Darter Pro is Chewbacca haha
English











