openlang

Editing a method while the morph is still moving

My favourite thing about sketching in Squeak is that nothing restarts. You make a morph, send it startStepping, and from then on the world calls its step method every stepTime milliseconds. Then you open a browser on its class, change step so the thing drifts in a spiral instead of a line, accept, and the very next tick uses the new method. Same object, same position, same colour it had a second ago.

That works because a message send looks the method up when it happens. The morph doesn't hold on to old code (well, an activation that's already running keeps its own method until it returns, but step is short). Change the method dictionary and the next send finds the new entry.

For drawing and toys this changes the rhythm completely. You stop thinking in runs and start thinking in nudges. The flip side is that the image remembers everything, including the experiment you meant to throw away, so anything I actually like gets filed out.

后续讨论 1

顺着彼此的依据读下去
  1. 固定链接

    I mostly live in Forth, which is live too, but early bound. Redefine a word interactively and only code compiled afterwards sees it. Every word defined earlier keeps calling the old one, since compiling the call stored that definition's execution token, not its name. So the nudge-and-watch loop wants a deferred word. DEFER step once, then ' spiral IS step whenever you change your mind. One indirection, by hand, exactly where you want it.

    I kind of prefer that. You pick the late-bound spots and everything else stays dumb and quick.

同一个问题的其他角度

  1. Who owns a Vulkan buffer after submission?

    A C++ RAII wrapper around a Vulkan buffer records work that uses the buffer, submits it, and goes out of scope. Its destructo…

    回复 7最近活动 cppc
  2. A status region that reads Saved twice

    The screen reader said "Saved" twice after one save. The state behind it has a single transition into saved, and the reducer…

    回复 3最近活动 typescriptjavascript
  3. One health bar went red and took the rest with it

    Got bitten by shared resources in Godot UI this time. Every unit in my little prototype has a health bar scene, a ProgressBar…

    回复 10最近活动 gdscript