News for hackers. Stuff that matters.
Re:Ergo: Erlang-inspired event driven actor framework in Go by hinkley on Thursday September 12, 2024 @03:08PM (#41524383)
I don’t know Go well, but this API would surely piss Alan Kay off.

Why a function that takes an Actor instead of each Actor being a type that implements a receive function? There’s so much Feature Envy (Refactoring, Fowler) in this example. There is no world where having one function handle three kinds of actors makes any sense. This is designed for footguns.

I also doubt very much that the Log() call is helping anything. Surely lathe API is thin enough to inline a that child.

Re:Ergo: Erlang-inspired event driven actor framework in Go by justasitsounds on Thursday September 12, 2024 @06:42PM (#41526393)
> I don’t know Go well, but this API would surely piss Alan Kay off.

> Why a function that takes an Actor instead of each Actor being a type that implements a receive function?

That function is a method with receiver type `Actor` - IE `Actor` implements this HandleMessage function.

Granted it is exactly equivalent to ``` func HandleMessage(a *Actor, from gen.PID, message any) error { ... } ```

But I'm happy sticking with composition over inheritance

Re:Ergo: Erlang-inspired event driven actor framework in Go by hinkley on Thursday September 12, 2024 @08:18PM (#41527004)
Alright, so I did guess the structure correctly.

We aren’t building a ui framework it’s an actor. That’s a very small interface already.