Hacker News new | ask | show | jobs
by Koshkin 2306 days ago
Honestly, the source code of the examples looks rather complicated, like something that should better be generated from a nicer high-level language that has a native actor concept. (Obviously, the power of C++ templates does not come for free - you pay with noisy code and increased cognitive load.)
4 comments

> Honestly, the source code of the examples looks rather complicated

There are several CAF alternatives with very different usages of C++ features:

* QP/C++: https://www.state-machine.com/qpcpp/

* SObjectizer: https://github.com/Stiffstream/sobjectizer

* actor-zeta: https://github.com/jinncrafters/actor-zeta

* rotor: https://github.com/basiliscos/cpp-rotor

At least two of them (QP/C++ and SObjectizer) are evolved and used for a longer time than CAF.

Zeek uses CAF internally for data exchange over networks and workers [1]. It's not quite a "native actor concept", but it is a nice way to interact with the framework. I've used it before and its worked quite smoothly.

[1] https://docs.zeek.org/en/current/frameworks/broker.html

On the contrary, I worked with CAF and I found it one of the simpler frameworks that provide the actor model (simpler to use, that is). Later I learned about Erlang and I noticed a lot of similarities between CAF and message passing in Erlang. Look at this https://github.com/actor-framework/actor-framework/blob/mast..., for example. There are multiple implementations of the same thing (calculator). But each implementation is simple enough to grasp without any prior knowledge of the framework.
And compilation times and memory requirements for it.