TL;DR a package is a directory of .odin files which can all see each other. A package is a library and not a way to taxonomize your code.
The main point is that all files within a directory can see each other without needing to explicitly import any. This solves a lot problems from other languages where this is not trivially possible, nor easy to maintain.
Not allowing circular dependencies is a MASSIVE feature. The point is that Odin is trying to have a well defined concept of what a libra…
So the lack of namespaces in Odin was something I wanted from day one. The code you wrote is effectively not more to type than entity_create in practice. I understand it might be nice to conceptually group things but it doesn’t really help anyone with the artificial taxonomy in the long run. I’ve seen the problems of this in other languages, I did not want to go anywhere near that. This is why packages are very flat and structs cannot have declarations inside them.
As for ECS, I usually recomme…
—-
I love the directory = package feature.
Lot less imports at the top, no artificial hierarchy, locality of behaviour, things that work together stay together.
After being burnt by dependency hell of package managers, versioning conflicts, cyclic redundancy, import barrels, and so on and so forth, I prefer the simplicity of Odin.
2 Likes