Protty
1.4K posts

Protty
@kingprotty
System optimizer + concurrency geek.
Katılım Ağustos 2019
74 Takip Edilen3.1K Takipçiler

@MrJayLC @nicbarkeragain Going through an fd/syscall to do it has, but ring buffers themselves are just shared memory operations - what any communication effectively boils down to
English

@kingprotty @nicbarkeragain Perhaps, though I thought pipes fell out of fashion for one reason or another.
English

Slightly controversial take: don’t try to parallelise things that require synchronisation unless it’s literally your last option
Valentin Ignatev@valigo
>be me >have slow code >parallelize slow code >it now fast, but has race bug >add mutex, bug fixed >it now slower than single-threaded was why tf it's so hard
English

I had a beautiful opportunity to use a (userspace) spinlock. The critical section was very small (like one line) but high contention.
I thought a spinlock would be perfect, but it turns out it isn't! Spinlocks come with their own T&Cs, suitable for only specific and few workloads.
I benched with parking_lot, which spins first and only then tries to acquire the lock. This turned out to be the best compared to a spinlock and std mutex.
I also found matklad's excellent blog post supporting this. There goes my dream of using a spinlock in a production database. 🪦

English

@yarnf40580 @DNAutics @ahmedjedda213 @jorandirkgreef @_mm_pause I assume what they meant is that Zig makes doing those these very easy. To be clear, i'm no Zig shill either. What I really want is C + good generics & consteval + good build-sys + easy cross-comp + defer + modern stuff (optionals, sum types, errors, etc). Zig just happens to fit
English

@kingprotty @DNAutics @ahmedjedda213 @jorandirkgreef @_mm_pause I'm just curious what "zero copy intrusive memory" (or etc.) can be done in Zig *specifically* that makes it the choice for you guys, despite being unstable and young. Again caveating that i am NOT a c++ shill! Infact zig is probably my favorite out of rust/c/c++/odin/zig/etc
English

I dislike language wars. language is only 1% of what matters. in systems programming, it's the team & engineering that count. look at tigerbeetle & bun great engineers drive huge impact. those projects could’ve easily been built in c, c++, or rust
'(Robert Smith)@stylewarning
I'm overhearing a FAANG tech meeting about how this 10?-year product written in C is being transitioned ("modernized") to C++. Started by changing to a C++ compiler, and slowly rewriting to use classes/exceptions, &c. It's been 3 months, and the C++ service keeps failing in prod.
English

@yarnf40580 @DNAutics @ahmedjedda213 @jorandirkgreef @_mm_pause Zig comptime can be used for DSLs: #L1045" target="_blank" rel="nofollow noopener">github.com/tigerbeetle/ti…
(only restrictions in comptime are 1. no ffi/asm 2. no ptr<->int transmutes)
I get how one could do DSLs with cpp consteval as well, but still unsure if it can do the other 3 things listed.
English

@kingprotty @DNAutics @ahmedjedda213 @jorandirkgreef @_mm_pause and re: "an do over zig comptime?", c++ TMP is turing complete, theres c++ SQL libs that implement full SQL parsers using TMP (again I'm not here to advocate for this one way or another). I don't think you can do that sort of thing in comptime? At least from what I remember.
English

@yarnf40580 @DNAutics @ahmedjedda213 @jorandirkgreef @_mm_pause What's some of the things C++ templates/const-eval can do over zig comptime?
Unaware of its capabilities, but for the inverse direction, can cpp do stuff like create structs with a dynamic set of fields, check for padding within a type, or dynamically alloc & use at runtime?
English

@DNAutics @ahmedjedda213 @jorandirkgreef @_mm_pause Were asking whats meant by that though.
I can write my own containers that take an allocator as an argument in C++. Templates & consteval are way way more powerful than zig comptime.
I'm pointing this out only to elucidate - im not pro c++
English

@MrJayLC @nicbarkeragain assuming the devices are programmed with standard C-like memory models, SPSC ring buffers (with caching of the other position on both sides) is probably the fastest.
English

@nicbarkeragain The moment you introduce a concurrent design, your surface tension must be considered.
I'm still thinking on what is the best way to communicate between 2 concurrent devices, without lots of constructs. Just memory.
English

@ohmypy @BrianOrwe Not them, but I do the same strat: If it's not prototype code, write data structures better suited for the task + std for syntactic sugar on the trivial stuff.
English

@BrianOrwe Interesting! Do you write code this way? What do you use, then?
English

@bubbleboi what's weird is that i know 90% of these words individually but combined it's indecipherable.
rsa encryption might be at the end of its lifespan we use blackpill encryption now
English

Here is a breakdown of what these sentences mean for those not in the know.
Sentence 1 Analysis:
> "Clavicular was mid jestergooning when a group of Foids came and spiked his Cortisol levels 😭"
*Clavicular: Nickname for streamer Braden Peters, is a reference to "clavicle lengthening/widening" (a niche obsession in body dysmorphia communities regarding shoulder width).
*Jestergooning: A portmanteau of two terms:
* Jestermaxxing: Acting like a clown or fool to get attention or cope with social rejection.
* Gooning: Originally referred to a trance-like state induced by porn addiction, but in this context, it generally means staring blankly or engaging in obsessive, low-IQ behavior.
*Foids: A derogatory "incel" (involuntary celibate) term for women, short for "Femoids" (Female Humanoids).
*Spiked his Cortisol levels: "Cortisol" is the stress hormone. This means the women made him extremely stressed, anxious, or panicked.
Translation: "This guy (Clavicular) was in the middle of acting like an idiot/zoning out when a group of women arrived and made him panic."
Sentence 2 Analysis
> "Is Ignoring the Foids while munting and mogging Moids more useful then SMV chadfishing in the club?"
*Munting: While originally a grotesque term from shock sites, in "looksmaxxing" slang, it is sometimes used (often ironically) to describe an extreme or ugly form of "Mewing" (tongue posture exercises to improve jawline). It implies focusing intensely on one's face/aesthetics.
*Mogging: Derives from "AMOG" (Alpha Male Of the Group). It means physically dominating someone else or looking much better than them.
*Moids: A derogatory term for men (Male Humanoid), often used as a counterpart to "Foid."
*SMV: Acronym for Sexual Market Value. A pseudo-sociological metric used in these communities to rank how "valuable" a person is to the opposite sex.
*Chadfishing: A combination of "Chad" (the archetypal attractive male) and "Catfishing." It means creating a fake dating profile using photos of a male model to see how women react or to waste their time.
Translation: "Is it better to ignore women and focus on making other men look inferior (through looks or status), or is it better to go to a club and try to trick people into thinking you have high sexual value?"
Summary:
The text asks a philosophical question within this specific internet subculture: Is self-improvement and dominance over other men (homosocial competition) more fulfilling than seeking validation from women through deception?
🧛🏾♀️@chromeheart600
Clavicular was mid jestergooning when a group of Foids came and spiked his Cortisol levels 😭 Is Ignoring the Foids while munting and mogging Moids more useful then SMV chadfishing in the club?
English

This isn’t the first time a shift like this happens and it won’t be the last.
I feel like what’s happening right now is what happened to photography — when everyone has an amazing camera and a publishing outlet to the entire world, we just get more of everything. Diversity and new ideas, class differences erased. But also a huge noise increase.
The people who would wade through the mud of challenges to master photography pre iPhones were on a path of commitment to being the best they could be. Nowadays the vast ocean of noise has weirdly dampened photography as an art. I for sure thought the opposite would happen, that people without the means to pursue photography in the pre-iPhone times would now have a stage, but they too drowned in the noise.
The same thing happened to sign making and many other fields of craft. It’s happening to software now. Average actual quality will go down and consumer expectations on quality will fall. Maybe the next 10-15 years is simply the cost of progress and we’ll build Star Trek-grade computers in a few generations from now.
Perhaps this is “good”, perhaps not. Regardless, it feels like desperate times of gold rush, not like a renaissance of software.
In some ways, software around 2010 felt like peak avg of quality. What did we culturally do back then that we changed or stopped doing, I wonder…
English

It's a weird time. I am filled with wonder and also a profound sadness.
I spent a lot of time over the weekend writing code with Claude. And it was very clear that we will never ever write code by hand again. It doesn't make any sense to do so.
Something I was very good at is now free and abundant. I am happy...but disoriented.
At the same time, something I spent my early career building (social networks) was being created by lobster-agents. It's all a bit silly...but if you zoom out, it's kind of indistinguishable from humans on the larger internet.
So both the form and function of my early career are now produced by AI.
I am happy but also sad and confused.
If anything, this whole period is showing me what it is like to be human again.
English

@madokami99 @MatriceJacobine @Leaflit I mean, even thinking about this intuitively: Cant really speak/read multiple languages fluenty, recite famous poems/quote, spit out song lyrics, do complex arithmetic, and recognize sarcasm simply from a stream of reactive degen text of >70% emote spam.
English

@MatriceJacobine @Leaflit It is possible if you watch her stream she's learning how to communicate with people 2022 neuro is soo different than today after three years of training from twitch chat and people who collab with neuro and evil
English

The dilemma of AI haters tying their philosophical grounding into pretzels to justify liking Neuro will always be so entertaining to me.
(Only sorta related but the post is fun)
Also I’ve always liked Neuro. :)
Neuro-sama@Neurosama_SOL
Neuro vs Haters
English

@__morse @peter_p_c @MainMeowMix @gdb the auth appeal is a bit eh, but yea currently use it for work
English

@peter_p_c @kingprotty @MainMeowMix @gdb Protty is a Zig legend, he's been writing Zig for a long time, he knows
English

@peter_p_c @MainMeowMix @__morse @gdb This has not been my experience. Some of the biggest/production zig projects are still on 0.14.1 for example
English

@kingprotty @MainMeowMix @__morse @gdb i think projects just try to keep up to date with zigs latest and if they don't it's because they're unmaintained or not used
English

@MainMeowMix @__morse @gdb There's pinned releases that don't change. Breaking changes only happen if you use master (Rust nightly equivalent) or if you upgrade (most projects only upgrade if they see a good need for them specifically)
English
Protty retweetledi

2025 was the Year of the @TigerBeetleDB, with 50+ project folders and 100+ artworks!!🤯🥳
I missed spending time on personal projects, but I had some great moments that are directly and indirectly connected to these beetles, and I’m more than ready for 2026!
BTHF!
#artvsartist

English








