uliwitness / Stacksmith

An intuitive software erector kit targeted at people new to programming, but with enough potential to stay useful once they've learned, inspired by HyperCard.
http://stacksmith.org
131 stars 13 forks source link

Add a generic struct type for handing out internal structs w. lazy conversion #77

Open uliwitness opened 8 years ago

uliwitness commented 8 years ago

We currently have dictionaries (the "array" type), which are kind of heavyweight, and we have rects, points and ranges, which look like dictionaries to the user, but are actually more lightweight internally. We'll need more types like that (e.g. colors), and it would really be neat if we just could make them all the same LEOTypeStruct and LEOTypeStructVariant types that take a memory layout/key mapping. On MacOS, we might also need an "object" type that goes through accessors instead of accessing a struct directly, in this case Objective-C accessors.

This would also let us save some CPU by not converting e.g. the "the downloads" dictionary data on each callback, but rather only request it from the OS if the client actually asks for it.