There are two different types of UI - retained and immediate.
Retained uses a state of controls (e.g. a list of children.) This is what Snap! uses (Morphic!)
and Immediate stores almost no state, and the UI is determined by functions (blocks!) called every frame to draw, and variables the user made for the value of them. Note that even still you need some global state for interacting with the UI, but aside from that everything is variables the user controls.
But.. averaging 100ms. 10 frames per second. This is horrible (I had to close every single other app on my computer for it to run, even at that, otherwise it would be like 150ms). Any optimization ideas? (maybe my computer is just bad.. but its Snap!, so you never know.)
Anyway, I’m still happy with what I’ve made so far!
the lag seems to me to be from the block copying from the ring creation in Process.prototype.reify, and the excess operations from the field [ v] @list @:> ::list reporter block, and the fact that snap’s not that fast
Thank you for those ideas!
I have modifed my context write block to manually join the font family and size, as to skip the logic that the stats write block does, while still allowing font changes in the theme.
I have done several let → script variable changes, and that also improved the speed.
And then I also did a bunch of field → item conversions.
It breaks above 30 FPS! Seems like now it does multiple “frames” in one Snap! thread frame. Fun!
Give me a bit while I do a bit more polish (and some docs!)