This was my first encounter with Julia metaprogramming and especially MacroTools.jl, and I find it rather uncomfortable when it comes to handling different syntax variations like having zero or more inner constructors. Somehow prewalk and postwalk also seems to be out of phase with the documentation, but the relatively large user base of the tool suggests that the problem is with my understanding. For those reasons I plan to reimplement the macro using https://github.com/thautwarm/MLStyle.jl to see if it feels more natural.
Some other work on the public api is also included here:
Reordering of onmessage() parameters, which also provides significant (10%) performance boost on the producer-consumer benchmark.
Removed the NothingMessage type and got back to Message{Nothing} in the hope to free up the user from a small amount of cognitive burden. Creating a Start signal and passing it to the firstly spawned actor:
Start = Message{Nothing}
machine(Start())
As we strive for full distribution, providing a single point of contact to a whole actor system may seem inadequate. The idea is that the system builds itself up from a single spawn provided to the Machine() constructor, as in the actor-tree example. The Start message is just the token for event-based scheduling. The machine() call finishes when the system is built and ready. Signals sent later (if any) may be delivered to different actors using a yet-to-be designed mechanism.
@component
works for mutable actors with at least one inner constructor.This was my first encounter with Julia metaprogramming and especially MacroTools.jl, and I find it rather uncomfortable when it comes to handling different syntax variations like having zero or more inner constructors. Somehow
prewalk
andpostwalk
also seems to be out of phase with the documentation, but the relatively large user base of the tool suggests that the problem is with my understanding. For those reasons I plan to reimplement the macro using https://github.com/thautwarm/MLStyle.jl to see if it feels more natural.Some other work on the public api is also included here:
onmessage()
parameters, which also provides significant (10%) performance boost on the producer-consumer benchmark.As we strive for full distribution, providing a single point of contact to a whole actor system may seem inadequate. The idea is that the system builds itself up from a single spawn provided to the Machine() constructor, as in the actor-tree example. The Start message is just the token for event-based scheduling. The machine() call finishes when the system is built and ready. Signals sent later (if any) may be delivered to different actors using a yet-to-be designed mechanism.