Question

I need a scripting language for describing very complicated workflows.

  • These workflows need to be paused whenever user input is required, and resumed after it is given (could be months later). Seems like serializable continuations from Stackless would be a good fit.

  • Users also need to be able to edit the workflows themselves. I'm not sure how serialized continuations would handle underlying code changes. I think I might need to save the Git version hash along with the continuation, and only 'upgrade' a continuation at checkpoints where no state is needed.

  • I prefer the Python syntax since readability is a very high priority, and dynamic features are key. I'm open to suggestions, though.

  • Eventually I'll probably write a visual flow-chart editor that maniupulates the underlying code.

I've looked in depth at Stackless and PyPy. Stackless doesn't seem to offer any promises of sandboxing, while PyPy seems to offer both stackless and sandboxed, but I can't find any mention of having both at the same time.

Any solutions? If there's an expert out there who can get me going with a good solution, I've got a paypal account and I'm willing to use it.

Was it helpful?

Solution

Your serialization requirement will be difficult in most languages with native co-routine libraries. You might need to implement co-routines in another way to allow for object graph serialization.

Lua has the Pluto library, which CAN persist threads (co-routines): http://lua-users.org/wiki/PlutoLibrary

As far as "safe" execution in a sandbox, Lua is a first choice. You can have multiple lua states in a single application with zero issues, and it supports co-routines in the language. It also has the benefit of being quite fast in its VM form, and with luajit is competitive with Java JIT in many cases.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top