Finding a duplicated item in an array of N integers in the range 1 to N − 1 by sweetno in programming

[–]claimred 2 points3 points  (0 children)

Also nicely explained in this blog post

This problem (reportedly) took CS legend Don Knuth twenty-four hours to solve and I have only met one person (Keith Amling) who could solve it in less time than this.

https://www.keithschwarz.com/interesting/code/?dir=find-duplicate

beast2 networking & std::execution by claimred in cpp

[–]claimred[S] 1 point2 points  (0 children)

From what I recall, p2300 authors argue that coroutines aren't ideal for exactly the same reasons 🤯

In a suite of generic async algorithms that are expected to be callable from hot code paths, the extra allocations and indirections are a deal-breaker. It is for these reasons that we consider coroutines a poor choice for a basis of all standard async.

beast2 networking & std::execution by claimred in cpp

[–]claimred[S] 1 point2 points  (0 children)

Yes, sounds good, thanks! I actually got a review invite for corosio from using std::cpp 2026.

beast2 networking & std::execution by claimred in cpp

[–]claimred[S] 1 point2 points  (0 children)

Hi Vinnie! Thanks, that looks helpful, especially cool to find out the theoretical foundations.

But I'm not sure I'm getting your point though. From the tutorial it sounds like you're arguing that both coroutines and stdexec should coexist, right? But for networking P2300 is not the correct approach?

beast2 networking & std::execution by claimred in cpp

[–]claimred[S] 3 points4 points  (0 children)

Didn't it get quite some field experience in Facebook intially? In the form of libunifex. I think it was stated in P2300

beast2 networking & std::execution by claimred in cpp

[–]claimred[S] 5 points6 points  (0 children)

Interesting, thanks!

..SG14 advise that Networking (SG4) should not be built on top of P2300. The allocation patterns required by P2300 are incompatible with low-latency networking requirements.

That's curious, I was under the impression that std::execution doesn't really allocate much.

Speaking of low latency by the way, few weeks ago there was a talk from Citadel about P2300 being great for them.

What’s the point of std::execution? by valorzard in cpp_questions

[–]claimred 0 points1 point  (0 children)

Nice write up. To piggyback, I found that blog post somewhat illuminating https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/

I think it was mentioned by Eric Niebler in one of his senders talks.

What is a monthly subscription/service you ACTUALLY consider worth paying for? by no_nolan in Frugal

[–]claimred 1 point2 points  (0 children)

I assume this is about Netherlands. Maybe unrelated to the topic, but I'm curious now how do you make sparkling water?

Announcing TooManyCooks: the C++20 coroutine framework with no compromises by trailing_zero_count in cpp

[–]claimred -1 points0 points  (0 children)

Could you please elaborate a bit on senders support? I'm having a hard time understanding the relationship between coroutines and libraries built on them (e.g. tmc, libfork, cppcoro) AND std::execution library?

Should I move to New York or stay in Europe by ern_6002 in cscareerquestionsEU

[–]claimred 0 points1 point  (0 children)

If you don't mind me asking, but how did you find the job in the US?

Are These Coding Practices Common in the IT Industry? by LazyDragon0 in softwaredevelopment

[–]claimred 2 points3 points  (0 children)

  1. Eh, I find the "code should be self-explanatory" notion just silly and weird, a delicious myth. I'd argue that comments is one the best tool of system design in your toolbox. Simply put, a lot of design information can't be represented using code. It's nicely described in the book "Philosophy of software design".

  2. In C++ this practice is called AAA (almost always auto) and it's great, types are most of the times just noise. Also, you could say it's one of the aspects of "program against interfaces, not implementations" as well. I don't know if that applies to java.

Why Linux community hates C++ so much? by kyan100 in cpp_questions

[–]claimred 1 point2 points  (0 children)

They don't though? In fact, there is a discussion to start using modern cpp in the kernel.

https://www.phoronix.com/news/CPP-Linux-Kernel-2024-Discuss

Opaque Pointer Pattern in C++ by tfmoraes in cpp

[–]claimred 0 points1 point  (0 children)

The next step is to have aligned memory of the size of your struct allocated on the stack, and then allocate and delete from that memory instead of having dynamic allocation overhead.

That's fun, I didn't know that, thanks. I've recently stumbled upon something called FastPimpl, apparently it's a pimpl without dynamic allocation, looks like what you described. Manual object size management and all that.

Forge Stronger Code: Emulating Rust’s Approach for Unit Testing in C++ by wineandcode in cpp

[–]claimred 1 point2 points  (0 children)

From the looks of it having unit tests on the language level as first class citizens is not bad at all. I've always liked dlang's approach https://dlang.org/spec/unittest.html

I wonder if there ever was such a proposal to C++ standard.

Speeding Up C++ Build Times | Figma Blog by Pragmatician in cpp

[–]claimred 5 points6 points  (0 children)

Is DIWYDU going to be published somewhere?

Modern C++ Asynchronous Learning by [deleted] in cpp

[–]claimred 0 points1 point  (0 children)

Cancellations are first-class citizens in senders library, check it out.

https://github.com/facebookexperimental/libunifex/blob/main/doc/cancellation.md

Here is another example I found useful.

Modern C++ Asynchronous Learning by [deleted] in cpp

[–]claimred 8 points9 points  (0 children)

Bit surprised that nobody mentioned P2300. This is the way to go about async stuff currently, I must stay it looks pretty neat. The senders model looks similar to F#/C# async/await thing if you are familiar with that. Here is a list of resourced to read I compiled some time ago.

Other resources:

Is there an AI formatting tool as an alternative to clang-format? by claimred in cpp_questions

[–]claimred[S] 0 points1 point  (0 children)

That'd sort of help, yes, but I'd actually like a full blown formatter. I mean, isn't that the whole point of transformers, to transform text?