google/skylark

Feature: suspending, serializing, deserializing, and resuming threads (not a bug)

wdamron opened this issue · 1 comments

I've been experimenting with some changes to the interpreter: I added the ability for threads to be suspended and fully serialized then later deserialized and resumed (potentially elsewhere). This doesn't work if there are builtin Callable values within the call-stack, as builtin functions are inherently not resumable. An additional Resumable interface would be need to be implemented to support this, which I haven't gotten around to.

The majority of the my changes are in the new Encoder/Decoder types, and I split out the common Value types into their own files (from values.go).

The absence of these features isn't at all a "bug", and is arguably way out of scope for this project, so a pull request didn't seem appropriate, but I'm including a link to my experimental branch in case these changes would be of any interest:

github.com/wdamron/skylark/tree/reentrant

@alandonovan Feel free to close this.

The absence of these features ... is arguably way out of scope for this project

Yes, this is out of scope for the Go implementation, but not "way" out of scope: Blaze's implementation of Skylark does something not similar to this as part of an optimization to enable caching of build dependency graphs. Thanks for the pointer.