Meeting 24 October 2019

Eric Niebler on Executors

Corentin: Executors are the least useful part of "A Unified Executors Proposal"

Eric Niebler:

It makes me happy to see the power of the Scheduler/Sender/Receiver recognized.

Much of traditional Rx assumes runtime polymorphism and garbage collection / ref counting. That's obviously a poor fit for C++. The sender/receiver design skews toward static polymorphism w/Generic interfaces, and explicit memory mgmt.

The factoring of submit into connect/start gives more flexible ownership semantics, and aligns the design conceptually with coroutines, making coroutines an efficient way of expressing sender/receiver.

Once you introduce concurrency with non-overlapping scopes, the lifetime of your async operation state no longer corresponds to a simple C++ scope. That's why explicit memory mgmt and ownership become issues where they wouldn't be otherwise.

One of coroutines great strengths is that they let us map async lifetime back to C++ scopes. Under the hood, the coroutine is carved up into callbacks, and the operation state (coroutine frame) is getting managed explicitly, but all that gets hidden from you by the coro types.

Sender/receiver is a library reification of this separation. You might argue (and some have) that we should just drop sender/receiver and use coroutines everywhere for everything "async". That's appealing, but goes too far. Coroutines, for all their value, come up short sometimes.

C++ has a long sad history of giving old things new names. Map and fold would have been better than transform and accumulate, and don't get me started on vector. Sender/receiver share some pedigree with Observable/Observer, but they really are different beasts ... by necessity.

The intended purpose of sender/receiver is to be a base lingua franca for all C++ async libraries. I expect end-users to interface at much higher levels of abstraction in their own code.

Are there any memory safety libraries for C++?

https://www.reddit.com/r/cpp/comments/d0hguz/are_there_any_memory_safety_libraries_for_c/

https://github.com/duneroadrunner/SaferCPlusPlus/

https://github.com/deplinenoise/ig-memtrace

MemTrace is a memory debugging tool developed internally at Insomniac Games.

https://github.com/ivmai/bdwgc

The Boehm-Demers-Weiser conservative C/C++ Garbage Collector (libgc, bdwgc, boehm-gc) https://www.hboehm.info/gc/

MSVC versions are crazy

/img/msvc-versions.png

Closing the gap: cross-language LTO between Rust and C/C++

http://blog.llvm.org/2019/09/closing-gap-cross-language-lto-between.html

https://www.reddit.com/r/cpp/comments/d6emaw/closing_the_gap_crosslanguage_lto_between_rust/

The Reddit thread descended into an irrelevant but heated discussion on the term "C/C++".

What's the difference between “STL” and “C++ Standard Library”?

https://stackoverflow.com/questions/5205491/whats-the-difference-between-stl-and-c-standard-library

https://www.reddit.com/r/cpp/comments/c90sxa/whats_the_difference_between_stl_and_c_standard/

STL is a maintainer of MSVC's implementation of the C++ Standard Library.

Quote

Sturgeon's Law:

90% of everything is crap.