Alternatively, couldn't you use JavaScript to dynamically generate itself? You could even write it in sexps if you really wanted to using JS arrays [1]. This is not meant as a critique of your approach but rather as an observation of JS's expressiveness and of the fact that much logic (not all, and maybe not in this particular case) can be implemented client-side or server-side with only subtle differences in the end result.
Yeah I can imagine using js to generate js. But if I'm using arc on the server anyway it doesn't seem to make sense to hand off to a js compiler just to to code-generate js. When I need to generate event handlers I'm within the arc html code-generation. Or am I misunderstanding you?
Nope, you got it. :) You're right it wouldn't make sense in this case where the app is already based in Arc. If you were approaching the project again from scratch though, perhaps there would be a just-as-good implementation path that involves letting JS handle more of the logic.