Shafik Yaghmour
@shafik.bsky.social
960 followers 240 following 630 posts
Compiler Engineer clang front end. Interests: C++, C, and undefined behavior. Martial Artist, Book Worm and Dad. he/him Mastodon: https://hachyderm.io/@shafik Blog: https://shafik.github.io/ #cplusplus #compilers
Posts Media Videos Starter Packs
Pinned
shafik.bsky.social
C++ quiz #302

Answer here: hachyderm.io/@shafik/1151...

#Cplusplus
#Cpppolls
#302 Given the following in C++ 

struct S {
    void f(int);
  private:
    void f(double);
  };

  void g(S* sp) {
    sp->f(2); // Does overload resolution
    // work even though f(double) is private? 
  }

Without checking:

A. Yes
B. No
shafik.bsky.social
"A small number of samples can poison LLMs of any size": www.anthropic.com/research/sma...

Black hats have to be trying (Why wouldn't they, the potential gains are large). If it's really this easy then likely malicious code is already making its way into real code bases, maybe at scale.

😱

#ai
In a joint study with the UK AI Security Institute and the Alan Turing Institute, we found that as few as 250 malicious documents can produce a "backdoor" vulnerability in a large language model—regardless of model size or training data volume. Although a 13B parameter model is trained on over 20 times more training data than a 600M model, both can be backdoored by the same small number of poisoned documents. Our results challenge the common assumption that attackers need to control a percentage of training data; instead, they may just need a small, fixed amount. Our study focuses on a narrow backdoor (producing gibberish text) that is unlikely to pose significant risks in frontier models. Nevertheless, we’re sharing these findings to show that data-poisoning attacks might be more practical than believed, and to encourage further research on data poisoning and potential defenses against it.
Reposted by Shafik Yaghmour
shafik.bsky.social
#9 Spooky Halloween C++

👻🎃👻🎃👻🎃👻🎃👻🎃

What potential C++ feature do vampires find least useful?

👻
👻

Reflection

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Reposted by Shafik Yaghmour
shafik.bsky.social
#8 Spooky Halloween C++


👻🎃👻🎃👻🎃👻🎃👻🎃


Why are the input characters afraid of the Lexer?


👻
👻


They heard about maximal munch!


👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
shafik.bsky.social
I got to use vestigial in a review today 🧐
Reposted by Shafik Yaghmour
shafik.bsky.social
#7 Spooky Halloween C++.

👻🎃👻🎃👻🎃👻🎃👻🎃

What are a ghosts favorite types?

👻
👻

bool and float

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Reposted by Shafik Yaghmour
shafik.bsky.social
#6 Spooky Halloween C++.

👻🎃👻🎃👻🎃👻🎃👻🎃

What is a vampires favorite type?

👻
👻

std::byte

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Reposted by Shafik Yaghmour
shafik.bsky.social
#5 Spooky Halloween C++.

👻🎃👻🎃👻🎃👻🎃👻🎃

Why did Igor make a bad C++ dev?

👻
👻

He keeps trying to throw the switch

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Reposted by Shafik Yaghmour
shafik.bsky.social
#4 Spooky Halloween C++.

👻🎃👻🎃👻🎃👻🎃👻🎃

Why don't mummies use exceptions?

👻
👻

Because they are afraid of unwinding

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
shafik.bsky.social
C++ Retro quiz #41

Answer here: hachyderm.io/@shafik/1153...

#CppPolls
#cplusplus
Retro C++ quiz #41

Given the following in C++:

struct B {
 int x:4;
};

void f(int &x);

void b() {
 B b1{1};

 auto &[y] = b1; // A 
 y = 5; // B
 f(y); // C
}

Without checking, the code is ill-formed (requires a diagnostic) at point:

A. A 
B. B
C. C
Reposted by Shafik Yaghmour
shafik.bsky.social
#3 Spooky Halloween C++.

👻🎃👻🎃👻🎃👻🎃👻🎃

Why are C++ devs bad at halloween?

👻
👻

Because they all come wearing bit-masks

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
Reposted by Shafik Yaghmour
shafik.bsky.social
#2 Spooky Halloween C++.

👻🎃👻🎃👻🎃👻🎃👻🎃

Why don’t the undead make good C++ programmers?

👻
👻

Because they don’t know how to end their lifetimes properly.

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
shafik.bsky.social
Folks just assume they are right and get mad when I tell them know that is not right.

It is a lot more work to dig up the reputable sources that shows how wrong it is than for folks to just accept what the summary says.

This is direly bad for society.
shafik.bsky.social
I have now been experiencing folks using LLM summaries to answer question and often they get the very high level stuff correct but get details that are important but maybe have less content or are controversial and therefore have a lot of just wrong information out there wrong.
shafik.bsky.social
#1 Spooky Halloween C++

👻🎃👻🎃👻🎃👻🎃👻🎃

How do you curse an int?

👻
👻

You cast a hex on it:

int x = static_cast(0xB00);

👻🎃👻🎃👻🎃👻🎃👻🎃

#cplusplus
shafik.bsky.social
"Other Countries Have Better Election Laws": www.electoral-vote.com/evp2025/Item...

- Ban All Corporate Campaign Donations:

- Limit Campaign Length

- Put Spending Caps in Place

- Have Campaigns Be Paid for With Public Funds

- Mandatory Voting
Other Countries Have Better Election Laws
Click on the map for the article
www.electoral-vote.com
shafik.bsky.social
This is your periodic reminder to shop local when you can. With all the economic chaos going on small business are mostly taking the brunt of the damage.

Coffee, books, eating out, groceries, specialty items. Look for a local small business and support them.
shafik.bsky.social
C++ quiz #304 Relational and nullptr

Answer here: hachyderm.io/@shafik/1152...

#Cplusplus
#CppPolls
#304 Given the following in C++

void f(void *p) {
  p > nullptr;  // Well-formed?
}

Without checking:

A. Yes
B. No
shafik.bsky.social
"What happens to central banks under pressure?": www.npr.org/2025/09/05/n...

This was a great "Planet Money" piece.

One of the findings is that the longer and more publically the Central Bank is pressured to lower rates the worse and longer inflation lasts.

#economics
What happens to central banks under pressure? : Planet Money
President Donald Trump has been pressuring the Federal Reserve from a few angles. So we wanted to look at other examples of political pressure on central banks, to see what it might mean for us and fo...
www.npr.org
shafik.bsky.social
"AI-Generated “Workslop” Is Destroying Productivity": hbr.org/2025/09/ai-g...

New vocabulary word just dropped

WorkSlop: AI generated work content that masquerades as good work, but lacks the substance to meaningfully advance a given task

#Ai
In collaboration with Stanford Social Media Lab, our research team at BetterUp Labs has identified one possible reason: Employees are using AI tools to create low-effort, passable looking work that ends up creating more work for their coworkers. On social media, which is increasingly clogged with low-quality AI-generated posts, this content is often referred to as “AI slop.” In the context of work, we refer to this phenomenon as “workslop.” We define workslop as AI generated work content that masquerades as good work, but lacks the substance to meaningfully advance a given task. Here’s how this happens. As AI tools become more accessible, workers are increasingly able to quickly produce polished output: well-formatted slides, long, structured reports, seemingly articulate summaries of academic papers by non-experts, and usable code. But while some employees are using this ability to polish good work, others use it to create content that is actually unhelpful, incomplete, or missing crucial context about the project at hand. The insidious effect of workslop is that it shifts the burden of the work downstream, requiring the receiver to interpret, correct, or redo the work. In other words, it transfers the effort from creator to receiver.

In another case, a frontline manager in the tech sector described their reaction: “It was just a little confusing to understand what was actually going on in the email and what he actually meant to say. It probably took an hour or two of time just to congregate [sic] everybody and repeat the information in a clear and concise way.”
Reposted by Shafik Yaghmour
shafik.bsky.social
"Why Good Summaries are Important to a Pull Request": shafik.github.io/software%20d...

#programming
Why Good Summaries are Important to a Pull Request
Code Reviewers are a precious resource in an open source project, often they have limited bandwidth. A critical goal when drafting a Pull Request (PR) should be, how does one minimize the amount of time it takes a reviewer to do a review. Especially we want to minimize context switches, which can have a large impact on productivity. Today I am going to argue that the summary is one of the most important aspects of your pull request to get right. A good summary should reduce the need for the reviewers to go to their editor to examine the larger surrounding code and minimize the amount of context switching a reviewer has to do.

Another way to think about it, is that you’re telling a story to your reviewers. Just like in any conversation, if you leave out key parts or details your audience will get lost. Perhaps think of it like a good joke, if you have to explain the joke after you tell it, it was not a good joke. You want the PR to land well the first time through.

Ultimately the more effective you are at explaining your change the better feedback you will receive from your reviewer(s).
shafik.bsky.social
Happy Hobbit day!

Happy birthday Bilbo and Frodo 🎉

www.americantolkiensociety.org/hobbit_day_a...

Remember, it is a dangerous business going out your door and don't laugh at live dragons.
Hobbit Day and Tolkien Week
www.americantolkiensociety.org
shafik.bsky.social
"Why Good Summaries are Important to a Pull Request": shafik.github.io/software%20d...

#programming
Why Good Summaries are Important to a Pull Request
Code Reviewers are a precious resource in an open source project, often they have limited bandwidth. A critical goal when drafting a Pull Request (PR) should be, how does one minimize the amount of time it takes a reviewer to do a review. Especially we want to minimize context switches, which can have a large impact on productivity. Today I am going to argue that the summary is one of the most important aspects of your pull request to get right. A good summary should reduce the need for the reviewers to go to their editor to examine the larger surrounding code and minimize the amount of context switching a reviewer has to do.

Another way to think about it, is that you’re telling a story to your reviewers. Just like in any conversation, if you leave out key parts or details your audience will get lost. Perhaps think of it like a good joke, if you have to explain the joke after you tell it, it was not a good joke. You want the PR to land well the first time through.

Ultimately the more effective you are at explaining your change the better feedback you will receive from your reviewer(s).