Swirly Mein Kopf

Monday, September 3. 2012

A copying garbage collector animated


Next weekend I will hold an advanced Haskell talk at the Meta Rhein-Main ChaosDays in Darmstadt. It will mostly be a guided tour through the main memory of a running Haskell program, showing how things are represented and how they change over time. For this I cannot avoid to touch the issue of garbage collection, so I created a short animation:

(If you do not see it above, then you can try on YouTube.)

It is created with Synfig, feel free to use the sources. It seems that Synfig, although it has some features that allow you to link position in various objects, or calculate with them, is not really meant for programmers. Take the arrows: They are all quite similar, and defined by starting point, end point, and how much the initial segment sticks out to the right. I could even create them so that when I move the first or last point, the rest adjusts automatically. So one would expect that I can combine these shapes in one re-usable object that has these three values as parameters, but unfortunately, that is not the case. I guess next time I want to animate something as structured as this, I use either tikz (and generate one page per frame, convert them to an image and then to a video) or a Haskell library like gloss or diagrams.

Update: I made some minor improvements to the video. Youtube does not allow me to change the video, so you’ll see the new version only here.


No Trackbacks


Display comments as (Linear | Threaded)

*I think diagrams would work quite well for this (though of course I am biased). In particular it has nice tools (using the active package, http://hackage.haskell.org/package/active) for composing animations in both space and time without having to worry about a global clock -- with gloss you simply give a function from time to a picture, but it's not compositional at all. The only thing somewhat lacking is diagrams' current support for drawing arrows, but that will improve soon.

If I get a chance I might even try replicating your animation using diagrams, it would certainly make for a nice example!
#1 Brent Yorgey (Homepage) on 2012-09-03 17:15 (Reply)
*If you do it before Saturday and I like the result and you allow me to, I would be happy to use it in my talk.
#1.1 Joachim Breitner (Homepage) on 2012-09-03 17:40 (Reply)
*I'd love to use something like TikZ for video, since it works so well for static diagrams. However, making a smoothly-animated video would require some kind of auxiliary mechanism for interpolation, to avoid hand-writing a pile of intermediate frames. Something like Beamer's incremental changes, but with a way to say "change this parameter smoothly from A to B".
#2 Anonymous on 2012-09-03 17:18 (Reply)

Add Comment

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.

Gravatar, Favatar, Identica author images supported.
What is the first name of the owner of this blog? / Wie heißt der Betreiber diess Blogs mit Vornamen?
Nach oben