2 ms·
I'm not aware of any but I've been thinking about this too, but more on the level of "code regions" vs "nested data structures". Currently access is often regul
by flohofwoe 3y ago
I'm not aware of any but I've been thinking about this too, but more on the level of "code regions" vs "nested data structures". Currently access is often regulated by knowledge of a reference/pointer to some specific piece of data.
I'd like all application data to accessible via one big nested data structure without knowing "secret" pointers or references which grant access, but instead just filesystem-path-like accessors, e.g. 'root.gfx.buffers.count'.
Then restrict certain sections of the code to have no access, read-only access or full read-write access to certain parts of the data. Pretty much as if the application data is a file system, and certain code sections/subsystems are users/groups.
(for instance only a physics subsystem has full read/write access to its data under 'root.physics', some other subsystems that need to inspect the current state of the physics world only have read access, while all other subsystems have no access at all)
- zademn 3y agoSounds interesting. However, it seems...cumbersome? to define for each code block the relation with each data structure. Maybe if you can abstract a "code block type" and build relations between that type and some data. Something like struct Player{ int rwo hp; int rwo damage; Vec<Items> rwo inventory; } codeblock hpSomething{ uses rw Player.hp; uses r Player.inventory; } int main(){ // init player that fought something hpSomething { // read a potion and heal potion = player.inventory.potion.value; player.hp += potion; } }