StanzaOrg / lbstanza-old

L.B. Stanza Programming Language
Other
216 stars 23 forks source link

jb/fold box unbox #85

Closed jackbackrack closed 3 years ago

jackbackrack commented 3 years ago

Fold field access by digging into immutable fields of objects through tracked bindings. Bindings to objects are tracked through creation (EObject or ENewObject) and rebinding (EDef) so that when field access (EObjectGet or ELoad) happens through known bindings it can be folded. We only do this optimization on immutable fields and single-write bindings. Updated mutability of StateStruct bindings to reflect their usage. It might be worth making immutability opt-in instead of the opposite as sometimes structs are side affected in C code and users might not know to make those fields mutable.