Hacker News new | past | comments | ask | show | jobs | submit login
Put some CLOS in your ECS (edoput.it)
60 points by PaulHoule on Nov 23, 2023 | hide | past | favorite | 8 comments



Where is the code for the with-component* macro and for the metaclass object?? That would be the most interesting part of this post!


Where is the E? I only see the C and S. This also seems to be limited to components whose only useful data structure is an array and systems who only loop over the entire array.


Array-of-structs vs. struct-of-arrays is a well-known tradeoff that pops up very often, e.g. in row-oriented vs. column-oriented databases.

If for your specific usage pattern, whatever it is, looping over entire "columns" is more common than insertions and deletions, then you're likely to benefit from this pattern due to locality, even though the theoretical complexity is the same.


i think he just means the example code defines components, but doesnt have a entity modification code with queries and stuff.

im pretty used to existing ecs libs and they all let you add entities as collections of components and do queries. without that, this is just a collection of structs


An entity is a tuple of indexes into component arrays.

Components aren't arrays, components are stored in arrays.


Entity Component System, not Amazon's Elastic Container Service, if you were confused like me. It's a pattern used in game dev: https://en.wikipedia.org/wiki/Entity_component_system


Thank you! Cause I have expanded it to Elastic Common Schema! https://www.elastic.co/guide/en/ecs/current/ecs-reference.ht...


Thx!

was expecting a networking primer




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: