Open ksanderon opened 7 years ago
@ksanderon FYI, https://github.com/grantila/q is another promise implementation
Yep. It's very nice to see, that great minds think the same way - eg. "q" seems to be very "promising" ;)
I currently host my stuff on gitlab if you want check it out: https://gitlab.com/rilis/rili (promise submodule of rili project have ~ scope of "q").
I'v started with only promises but latter imagined that there is lot of stuff, which make using promises useful for end user (mostly IO related), which usually are not needed by all projects but at least some parts (exclusive for each project) are "must have" - for instance "https stuff" or "event streams" working out of box - maybe some work on randombit/botan to make tls easier/more integrated (main maintainer of botan - Jack LLoyd seems to be very open for such contributions at least after some discussions with him).
From my experience promises are nothing without surrounding ecosystem for most of potential users(and to by honest also from my perspective), so I want to create it.
I wanted to have nice granularity of these packets(not that huge monolith like boost or poco[even if they say these libraries are modular... ROTFL ]), so for example prototype of "hell" was needed (it is git and cmake oriented packet manager which currently I know is way more popular than promise library - used > 1000 times / day + in industry production fo private projects), just because other packet managers for C++ like hunter, vcpkg or conan just not meet basic(at least mine) functional requirements.
Maybe it could be useful to merge our ideas and create "great plan to conquer the world", to not duplicate further work - for now we have some implementations of promise like stuff - maybe we should make next step and add real blocks from which people can easier create better apps.
For me it's also super important to have this stuff very clean as I also found that using close to all of c++ or c libs is huge pain in the ass if you are on embedded devices or even cellphones or xbox/nintendo/ps4 or something just little bit different than big 3(mac, windows, linux)
1- Suppose to have cooperative multitasking?
3- I suggest to look at Duff's device
and read about fibers if you would like to implement coroutines. If you just want something which work somehow: https://github.com/tonbit/coroutine should be easy to understand and use(0.5kloc single header file) if you do not need nothing more sophisticated.
ucontext.h or fibers were removed. Promise-cpp would be a pure library that supports to implement promisified tasks, that means, it has no fiber or event loop, but can be integrated with other asynchronized libraries, such as boost asio or libuv.
await is definitely possible if we import something like boost::coroutine and use boost::asio as io service. In this case, we must bind "promise-cpp" tightly to the special coroutine library and will need more dependencies. Currently, "promise-cpp" is designed without boost required. Anyway, await is important features and will be considered.
Hello, I'm owner of rili project. It also implements promise/defered pattern for c++. Maybe you would like to contribute it? I suppose together we can create something really good ;)