I may want to do this in time for Aria 1.0 since it's a rather big VM internal change. Right now, the RuntimeValue layout is .. all over the place. I would like to simplify into: a RuntimeValue is a Rc of three things, two optional:
- an inner value (e.g. an integer, a string, ...);
- an
ObjectBox for attribute storage;
- a type tag of some kind
So, Integer would boil down to Rc<(InternalValue<i64>, ObjectBox, BuiltinType::Integer)>, an Object probably to Rc<(None, ObjectBox, Struct)> and so on and so forth
If something needs internal mutability, well, it's their problem. Then, for all things, you can say - if I want attribute X, first I look in the ObjectBox, and if not I go ask the type to look in its ObjectBox if it has one, and then I do whatever bound-method work I need to do
I may want to do this in time for Aria 1.0 since it's a rather big VM internal change. Right now, the
RuntimeValuelayout is .. all over the place. I would like to simplify into: aRuntimeValueis aRcof three things, two optional:ObjectBoxfor attribute storage;So,
Integerwould boil down toRc<(InternalValue<i64>, ObjectBox, BuiltinType::Integer)>, anObjectprobably toRc<(None, ObjectBox, Struct)>and so on and so forthIf something needs internal mutability, well, it's their problem. Then, for all things, you can say - if I want attribute
X, first I look in theObjectBox, and if not I go ask the type to look in itsObjectBoxif it has one, and then I do whatever bound-method work I need to do