yielding api
something i'm experimenting with in https://github.com/devsnek/jsont/pull/1
Are you still working on this or did you hit a roadblock? I'd be interested in exploring a high-level variant of this using Rust's async functions.
I no longer work at the company where I was working on this. Async functions would be cool and I experimented with it a bit. The main issue is that it's difficult to provide an Env to async functions correctly. I tried some hacks like a fake env that implements deref to get the real env but I'm fairly sure it's not actually possible in safe rust to prevent the reference from being held across await points. It is doable in generators though, and I at one point had something working where env references are passed in via yield. the only annoyance with this is that you still can't hold any values across suspend points, you need to somehow interface with rust and put all the values it captures into the reschedule arguments and that's not possible. So I ended up with the much simpler model you see here.
The only safe way is to copy all terms to a process-independent environment and use the terms from that one. But that should actually work across awaits, right?