both struct and unit are objects just like in any other OOP.
the difference is in the time of creation of the object. while struct can be created and recreated at any time during the run (just like doing x=new(); in other OOP languages), units are created only at the beginning, and are static, meaning that they cannot be deallocated during run-time. however, their fields can still be changed.
in other Words, all the units that are under sys (top level) are automatically generated at "world creation", and no other units can be created. structs are used for dynamic data that is allocated and dealloacated during the run
Copyright © 2026 eLLeNow.com All Rights Reserved.