[ prog / sol / mona ]

prog


ECS as a full replacement for OOP

1 2023-01-28 22:02

https://www.reddit.com/r/symta/comments/10nquzr/ecs_as_a_full_replacement_for_oop/

2 2023-01-29 08:07 *

Sure it's possible, I don't mind that at all. I like the ECS architectural approach.

I barely remember the Symta language from w4ch. Is it done by the Russian guy?

3 2023-01-29 08:51

guy

Trans girl.

Sure it's possible, I don't mind that at all. I like the ECS architectural approach.

Currently ECS is used only for video games, because in the basic implementation it has no encapsulation and there is too little practice around applying it. "Everything global" is fine for video games, where there is a single world. But it gets in the way with a multiverse systems, which have to talk with each other only occasionally and in a controlled way. Still ECS is a superset of OOP and nothing stop people from introducing different kinds of encapsulation, interfacing and types. For some tasks, ECS is slower than the basic OOP, which is more of an optimization hack. But ideally you want everything to be a database table, and if it is a table of XYZ vectors residing in memory, you can process it order of magnitude quicker than a number of sparse XYZ coords each residing in its own objects at a completely different memory location. What is slow is accessing a random field of a random unclassified object, which is rarely done in a well written code. I.e. if you see it in a loop, just iterate over the array instead, and then do join by id with other arrays (akin to SQL joins). Of course, in its most purest form, ECS requires a hashtable, but openhashing tables are basically array, and can be processed as quickly as usual arrays. Furthermore, in scripting languages, like Lua and Python, the language itself overhead will overshadow the ECS table overhead anyway, so why limiting oneself to classic OOP even for basic objects?

4 2023-01-29 10:37

that's a man

5 2023-01-29 18:57

plz stop being transphobic

6 2023-02-01 10:54 *

>>5
I can't do things that don't exist. Transphobia is not real.

7 2023-02-01 14:17

>>6

Then learn proper pronouns.
Easier than anaphoric macros.

<3

8 2023-02-03 12:40

https://www.pornhub.com/view_video.php?viewkey=63dc35d2b34ca

Yes. _She_ read _her_ SICP today.

9


VIP:

do not edit these