>
> On May 18, 2013, at 11:54 PM, "Vicente J. Botet Escriba" <
> vicent...@wanadoo.fr> wrote:
>
> > Le 17/05/13 23:26, Charousset, Dominik a écrit :
> >> Hi,
> >>
> >> is there any interest in a library for actor programming?
> >>
> >> The library we've developed is a C++11 open source library named
> "libcppa".
>
> > There is something that I would like to see on the Actors architecture.
> > The interface of an actor is not really defined other than by their
> > behavior. It can receive any dynamic tuple. This is a lot. I would like
> > a more statically typed interface. An actor could define statically the
> > kind of messages/signals it is allowed to handle and make it part of the
> > interface.
>
> There was some discussion about this topic after the talk at the C++Now
> conference.
To continue that discussion...
> I do agree that it is desirable to enable the compiler to verify the
> correctness of actor programs at compile time. However, in order to be able
> to ensure the correctness of a program, one would have to define not only
> all possible input messages, but the response types depending on the input
> as well.
Yes, and when writing code with strong compiler guarantees, this is a
desirable feature.
> However, an approach like this cannot allow an actor to change its
> behavior.
I think there is a large subset of use-cases where there is a willingness
to disallow an actor to "change its behavior" (aka, change its type), in
order to gain the benefit of compile-time guarantees.
> Hence, something as simple as the classical dining philosophers example (
> https://github.com/Neverlord/libcppa/blob/master/examples/message_passing/dining_philosophers.cpp)
> is not possible.
>
I don't think it's been demonstrated that the 'typed' and 'untyped'
approaches are mutually exclusive.
For a Boost.Actor library, I would really like to see static types being
well supported. That would likely be the only type of Actor library I would
personally use in practice. Strong compiler guarantees enable safe
refactoring of large applications, which is where C++ shines.
I wouldn't object to there being a trap door to type-unsafety to fit some
need, though its use should rightfully be discouraged.
Long story short: a type-safe interface would be less powerful and would
> require more boilerplate code.
The same argument can be used for any dynamic vs. static type argument. The
user base of this library has already taken a stance on the issue by their
choice of C++. That may be why there is so much push back to the current
dynamic approach of libcppa.
> However, perhaps there is a middle ground for doing type checks at runtime
> when compiled in debug mode?
>
> int my_actor() {
> // macro, defined as nothing if not compiled in debug mode
> assert_protocol(reacts_to<atom("add"),int,int>::with<int>,
> reacts_to<atom("hello")>::with<std::string>);
> }
>
>
This mimics the python approach to check types at runtime. The whole
benefit of compile time safety is that we get guarantees about code
correctness *before* we run.
-- David Sankel
> On 11/06/2013 13:03, Brandon Kohn wrote:
>
>> On 6/10/2013 4:30 PM, james wrote:
>>
>>> I don't think that the limited correctness you get from that is very
>>> useful in a concurrent system.
>>>
>>
>> Why not? I think the development crews that worked on the mars orbiter
>> mission which failed would beg to differ.
>>
>
> [I]t all goes back to schema evolution, and that's why systems like
> protobuf tend to sacrifice clean syntax for extensibility..
>
I think that goes back to my original point. For a large subset of users,
schema evolution is a non-issue—the entire system is deployed at once. A
Boost.Actor library should have a good story for these users IMO.
As an aside, the whole concept of 'schema evolution' has really piqued my
curiosity. Is there some academic key-word I can search with to learn more
about data structure evolution in systems that need to maintain some kind
of backwards compatibility?
--David Sankel
> As an aside, the whole concept of 'schema evolution' has really piqued my
> curiosity. Is there some academic key-word I can search with to learn more
> about data structure evolution in systems that need to maintain some kind
> of backwards compatibility?
You find this term all over discussions about applications—especially
web apps—that use persistent databases, but it also applies to anything
that saves and reads files whose format might need to change over time,
i.e. standard desktop apps.
--
Dave Abrahams
> On Tue, Jun 11, 2013 at 3:31 PM, james <ja...@mansionfamily.plus.com> wrote:
>
>> On 11/06/2013 13:03, Brandon Kohn wrote:
>>
>>> On 6/10/2013 4:30 PM, james wrote:
>>>
>>>> I don't think that the limited correctness you get from that is very
>>>> useful in a concurrent system.
>>>>
>>>
>>> Why not? I think the development crews that worked on the mars orbiter
>>> mission which failed would beg to differ.
>>>
>>
>> [I]t all goes back to schema evolution, and that's why systems like
>> protobuf tend to sacrifice clean syntax for extensibility..
>>
>
> I think that goes back to my original point. For a large subset of users,
> schema evolution is a non-issue—the entire system is deployed at once. A
> Boost.Actor library should have a good story for these users IMO.
+1
--
Dave Abrahams