|
|
|
|
|
by trealira
752 days ago
|
|
Is an entity component system really functional programming? I had the sense that functional programming was more about writing functions that are pure and referentially transparent, and making data immutable normally, which can make code simpler and more modular. It tends to use higher-order functions (recursive operators) more than direct recursion, because it's easier to verify correctness then. Rather than imperative loops and mutation, the meat of the program consists of the composition of many different functions, both small and large. Entity component systems are pretty cool, as is functional programming, but I don't see the relation. In addition, object-oriented languages seem well-suited to making entity component systems. There are some tutorials on them in different object-oriented programming languages: C++: https://austinmorlan.com/posts/entity_component_system/ C#: https://matthall.codes/blog/ecs/ Common Lisp: https://edoput.it/2023/11/19/data-oriented-clos.html |
|