# Snap's Event-Loop model

**URL:** <https://forum.snap.berkeley.edu/t/snaps-event-loop-model/9272>\
**Category:** Advanced Topics\
**Created:** [November 27, 2021, 10:08pm UTC](https://forum.snap.berkeley.edu/t/snaps-event-loop-model/9272 "2021-11-27T22:08:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![des.1303.snap](https://forum.snap.berkeley.edu/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@des.1303.snap](https://forum.snap.berkeley.edu/u/des.1303.snap)\
**Post date:** [November 27, 2021, 10:08pm UTC](https://forum.snap.berkeley.edu/t/snaps-event-loop-model/9272/1 "2021-11-27T22:08:42Z")

</div>

I doubt something like this can be retrofitted, but was just curious if Snap's v7 (or later) architecture might allow something like this. Among other things it would make auto-testing of complete interactive assignments more tractable. This is from the Bootstrap folks at Brown.

> **[paper.pdf](https://cs.brown.edu/~sk/Publications/Papers/Published/plpk-reactor-design/paper.pdf)**
>
> 426.46 KB

---

<div class="post-metadata">

**Author:** ![bh](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/bh/32/31580_2.png) [@bh](https://forum.snap.berkeley.edu/u/bh)\
**Post date:** [November 28, 2021, 2:05am UTC](https://forum.snap.berkeley.edu/t/snaps-event-loop-model/9272/2 "2021-11-28T02:05:16Z")

</div>

Wow, that's a fascinating paper! Thanks for bringing it to my attention.

Certainly nothing in v7 would make this easier to do. More generally, they point out toward the end of the paper that it assumes non-concurrency. We can have half a dozen when-flag-clicked scripts in the same sprite. That's not an insuperable obstacle, but it means we couldn't just follow their work step by step.

On the other hand, Jens has been known to complain about Javascript's inability to remember where you're up to when you yield, so the Stopify part of their work (basically, introducing first class continuations _into Javascript_ ) might be directly relevant to him, provided that there's no performance cost.

---

<div class="post-metadata">

**Author:** ![des.1303.snap](https://forum.snap.berkeley.edu/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@des.1303.snap](https://forum.snap.berkeley.edu/u/des.1303.snap)\
**Post date:** [November 28, 2021, 3:16am UTC](https://forum.snap.berkeley.edu/t/snaps-event-loop-model/9272/3 "2021-11-28T03:16:30Z")

</div>

It is neat. The kind that once you've read it the model is so obviously correct. Frankly I'd be happy being able to do the older World model (from HtdP and Racket then Pyret) in Snap but don't yet see a clear path to it.

Btw, been sending you some emails (from Desmond D'Souza), not sure if your spam filter is catching them, will re-send one.

---

<div class="post-metadata">

**Author:** ![bh](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/bh/32/31580_2.png) [@bh](https://forum.snap.berkeley.edu/u/bh)\
**Post date:** [November 28, 2021, 4:34am UTC](https://forum.snap.berkeley.edu/t/snaps-event-loop-model/9272/4 "2021-11-28T04:34:54Z")

</div>

Ah, that's you!

I just replied to the BJC one. I forwarded the Snap_!_ ones to @jens, but he's been really busy lately.
