alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
alxs has joined #ponylang
alxs has quit [Client Quit]
alxs has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
<endformationage>
farismustafa: I look forward to taking a look!
<farismustafa>
please do! there were some things that I couldn't figure out regarding generics, but I just don't think pony has the same capabilities that c++ template metaprogramming does
<farismustafa>
but I'd love to be wrong :p
<strmpnk>
farismustafa: Really nice. I like how simple the systems are laid out, do you think it might be worth making the systems actors, to control granularity of their scheduling?
<endformationage>
Did you base pony-ecs off any existing ECS? As far as I know, Pony's generics are different than c++'s templates..
<endformationage>
strmpnk: That sounds nice.
<farismustafa>
strmpnk I tried doing things with actors off the bat, but couldn't figure out some of the refcap stuff so I went back to classes just to get something out there
<farismustafa>
I figured I could write things with classes and then port over to actors if I needed performance later, I assumed the pony compiler would help me out a lot with that transition
<strmpnk>
Ah. Fair enough. Keeping a collection of iso components means systems that deal with combinations of components could be difficult to synchronize.
<strmpnk>
Like Position + Velocity in this example.
<endformationage>
strmpnk: Are you aware of any ECS frameworks which utilize actors in any capacity?
<strmpnk>
Not yet but I'd be interested in figuring out where the trade-offs are.
<farismustafa>
endformationage I've written a few ECS in various languages but they draw inspiration from a couple different ones. The concept of aspects and using bits/flags to quickly check if a system is interested in an entity comes from an ecs called Artemis
<farismustafa>
that's probably the biggest performance gain you could get with this style of ECS
<strmpnk>
Actor folks are always modeling entities as actors where many games are more component centric... the middle ground of scheduling systems as actors seems like an interesting experiment for performance sensitive work.
<endformationage>
I see.
<farismustafa>
but you make a tradeoff in the maximum # of components you can have
<farismustafa>
strmpnk: I'm a bit mixed on where to use actors in an ECS. Making systems into actors is what makes the most sense to me off the bat, since you can just break up a entity set into parts and parallelize it (assuming the components you deal with are local and dont need synchronization)
<farismustafa>
But trying to figure out how to leverage the per-actor heap for GC purposes - which is really important in a game - is confusing for me
<farismustafa>
Which is why I think you see entities being modeled as actors and owning their own components
<strmpnk>
Yeah, I'll be curious to see where you take this. I'm still getting a handle for good refcap patterns so I can't offer advice, but I like the idea.
<farismustafa>
In the one I quickly prototyped all the memory is owned by the World, so you don't get any of those GC benefits
<farismustafa>
But one of the coolest parts about pony to me is that messages are not copied, so you can easily split up a set and parallelize it by passing it to multiple system actors
<farismustafa>
We will see, I spent a week reading and a weekend coding and I'm pretty hooked at this point. It's like my favorite parts of elixir mixed with my favorite parts of rust :)
<strmpnk>
Yeah, you might want to use allocator actors for each component type as a small improvement.
<farismustafa>
One thing I've struggled with is that actors are purely async in pony, whereas gen_server in elixir still has synchronous method calls, which are much more useful when trying to read.
<strmpnk>
yeah, the selective receive + refs is something that isn't trivial to replicate with library code. Instead actors need to be kept simple enough that it can keep local state explicitly for those cases.
<strmpnk>
I try pretty hard to not copy over my Erlang habits to Pony but it is still something that catches me from time to time.
<farismustafa>
well, if I have any more updates I'll let you know. I've been trying to get some websockets going on so I can get something rendering out to a client
<strmpnk>
👍
<endformationage>
farismustafa: As a Rust user have you heard of froggy (https://github.com/kvark/froggy)? Any thoughts on it? Wonder if a "CGS" might be more condusive to use of actors.
<farismustafa>
I have not heard of this, but a quick readme glance looks interesting. I'll have to do some reading later
alxs has joined #ponylang
alxs has quit [Client Quit]
codec1 has quit [Read error: Connection reset by peer]