Replies: 2 comments 23 replies
-
@daixtrose, thanks! =) I think, it is really good topic to discuss. To be honest, I have zero experience in embedded systems so I can't provide any valuable comment related to this part, but if we just narrow down to question "is it possible to customize synchronization primitives?" - i think it is pretty possible to do. First ever idea i can imagine from scratch right now: // something like rpp/utils/synchronization.hpp
#ifdef RPP_EMBEDED
class mutex {
// todo
};
#else
using mutex = std::mutex;
#endif It is a bit clumsy and forces rpp to support all variants iself... but at least avoids direct issues inside source code One more thing, is to use different specialization and etc. Something like this: https://gcc.godbolt.org/z/KaPrhvcxv but in this case user have to provide specialization before first ever usage of anything from rpp, not sure if it would be possible/easy to use |
Beta Was this translation helpful? Give feedback.
-
+1 for emscripten support This is what I've been working on, declarative React bindings for Dear Imgui (and eventually egui, written in Rust): https://andreamancuso.github.io/react-wasm/dear-imgui/ (very, very rough demo - Chrome, Edge, Firefox Nightly only) I now need to add reactive programming into the mix in order to boost performance through async events/data exchange. I've read about std::execution but I am new to C++, whereas I am fairly familiar with RxJS - I would totally prefer using your library! |
Beta Was this translation helpful? Give feedback.
-
First, I am super excited about the existence of rpp. I am very happy that someone tackled the issues of RxCpp and that reactive extensions for C++ took the next evolution step. @victimsnino many, many thanks for making this happen!
I'd like to discuss, whether it would be possible to have the code be a bit more platform-agnostic. I see many use cases for embedded systems, and the Emscripten/WASM community might be grateful, too, if the "normal" OS primitives for thread safety would only kick in as a customization point.
std::unique_lock lock{m_mutex};
is not available on some platforms. Since some operators likedebounce
rely on an available mutex the library loses some "customers" who are waiting eagerly for this library.The direct use of
std::lock_guard
onmutex
makes me feel uncomfortable. This does not mean that the code is not correct. I always fear a deadlock popping up somewhere. I always find it hard to reason whether I got it right. CopperSpice's libguarded to my rescue in most cases.For a modern C++ library using
MACRO
s is ugly but at least a straightforward mitigation for having this library run on top of e.g. modm.I consider this not a direct customization point. Not sure how to allow other synchronization methods to be injected. How to use modm's fiber implementation or coroutines I have not thought through yet.
Any comments?
Beta Was this translation helpful? Give feedback.
All reactions