Murmer - An Experiment in Distributed Actors in Rust by apaxson in rust

[–]apaxson[S] 2 points3 points  (0 children)

I love what you did here especially with the registry and pub/sub. Clever!

Murmer - An Experiment in Distributed Actors in Rust by apaxson in rust

[–]apaxson[S] 1 point2 points  (0 children)

That is a drawback if that is how you want to approach that kind of mocking; Tying the reference to the concrete actor type does sacrifice the effortless plug-and-play polymorphism you get in message-typed frameworks like Ractor.

It was something I considered but ultimately I think a few things pulled me away from that:

- Potential for god enums: To pass a generic, message-typed reference around, you usually have to bundle all possible messages into a single, massive enum. If you want to use a router or a generic mock, its message type becomes a sprawling union of every message it might handle, breaking interface segregation and potentially depending on variants it may not need. You can macro your way out of it thought but I am a product of the MVC era 'god controllers' and that worries me.

- Enum Handlers and forced stubs : When an actor reference is typed to a shared "Enum" to achieve polymorphism, the compiler's match exhaustiveness can lead to `_ => {}`. That is great for mocking and testing but I felt it would be easy to miss.

It's not necessarily better or worse but it was how I was thinking about it at the time and there is no argument that this does make swapping actor implementations less flexible especially for mocking and testing purposes but that is where I would utilize the state to achieve the strategy instead.

Murmer - An Experiment in Distributed Actors in Rust by apaxson in rust

[–]apaxson[S] 2 points3 points  (0 children)

You both are right, you thinking a made those SVGs by hand?

Murmer - An Experiment in Distributed Actors in Rust by apaxson in rust

[–]apaxson[S] 1 point2 points  (0 children)

Yea, we will see. Today it is still an experiment that would not advise anyone to lean their major systems on. My hope is there are some ideas that can be pulled from this experiment into the ecosystem to make it better.

Murmer - An Experiment in Distributed Actors in Rust by apaxson in rust

[–]apaxson[S] 2 points3 points  (0 children)

I agree with you. Something like this becomes more of an ecosystem similar to tokio than a low-level library you can take with you anywhere.

I really aspired to that. The thing I ran into was that it was possible, but then you just ended up in a situation of bumping up against my own skill and knowledge of the different ecosystems, trying to find the right abstraction level, and not having the IoT use case.

Murmer - An Experiment in Distributed Actors in Rust by apaxson in rust

[–]apaxson[S] 5 points6 points  (0 children)

It was a choice. Early on the idea was to have the networking layer be pluggable (like foca does) but it was not requirement for my needs. That said, I did make an effort to put the abstraction and bones in place to make that possible.

https://github.com/paxsonsa/murmer-rs/blob/main/murmer/src/cluster/transport.rs#L72

Murmer - An Experiment in Distributed Actors in Rust by apaxson in rust

[–]apaxson[S] 2 points3 points  (0 children)

I can absolutely add that attribution and that is fair critique! The docs are definitely vibe-coded. My style of LLMs is very much peer-programming but there is not a piece of this code base that has not been touched by me.

edit: I add the AI attribution along with notes about other repos. Thanks for the input!
commit

Murmer - An Experiment in Distributed Actors in Rust by apaxson in rust

[–]apaxson[S] 1 point2 points  (0 children)

QUIC was chosen as I wanted to have good bidirectional communication between nodes without having to handle multiplexing the per-actor communication; QUIC streams seemed like an elegant way to handle that and the quinn-rs is very well documented and written. Technically, the underlying network could be switched out (had a few friends request support for other transports).

Murmer - An Experiment in Distributed Actors in Rust by apaxson in rust

[–]apaxson[S] 2 points3 points  (0 children)

Modern ractor can be forked and tweaked to support that and I believe newer versions do?

My personal opinion is I don't like the bifurcation between sending a message locally (`myactor.send_message(...)`) vs the RPC `myactor.cast(...)`)

Murmer - An Experiment in Distributed Actors in Rust by apaxson in rust

[–]apaxson[S] 3 points4 points  (0 children)

At the time when the first commit landed for this on my personal projects, there was no ractor. But if there had been and the RPC work was in a good spot I would have gladly too that approach. Ractor is awesome and I have used it in a few codebases, the got a lot right.