I was thinking some today about long-running computations on function-as-a-service (hereafter FaaS) platforms. FaaS platforms have relatively strict runtime constraints (e.g. 10s on Vercel's unpaid plan, but up to 15m on AWS Lambda, with others usually falling somewhere in-between). When doing computations that are either interruptable (a sequence of less expensive operations) or take place remotely (e.g. expensive API calls to something like an AI service), the ability to suspend and resume these long-running/blocking computations may make it possible to run them on FaaS platforms.
A quick web search told me what I was looking for is called "serializable first-class continuations" and, unfortunately, JS doesn't have support for first-class continuations, much less serializable ones. However, since I was primarily interested in interrupting and serializing computations at await
-points, I thought I might be able to get somewhere by leveraging generators. Unfortunately generators aren't serializable either,