Continuations in Jade
Posted: Mon Oct 12, 2009 10:18 am
I have just watched the interesting video on "Swarm", an answer to "distributed computing in the cloud". The URL for the video is http://vimeo.com/6614042.
A particular feature being discussed is "continuations". In short, a continuation is where the state of execution of an application can be stored, and then continued later on. Kind of like a "save game", or "pause". Continuations become powerful when they can be continued on another process, or another computer altogether (a "remote continuation"). This would be a very powerful technology in Jade, as it would allow code to be distributed (and even parallelised) much more easily.
It seems to me that this is already implemented in Jade to a certain degree with the serverExecution method tag. By some magic Jade takes the call stack, all local variables and any transients it needs and executes the method on the server node. It then passes control back to the client node either when the method has completed, or when the clientExecution tag is encountered. From what I can tell this is kind of like a remote continuation.
It would be very nice if you could not only say "continue execution on the server", but "continue execution on a node/process that I specify". I know there are asynchronous methods, but they do not take the call stack, local variables or defined transients - an asynchronous method call spawns a call stack all of it's own. Parallelisation become a lot easier you could do something similar to a fork, where all required local data is fed to another process (which could be on another node) and then execution is continued there, with a result passed back to the calling process.
This concept could be extended by allowing a continuation to execute on an SDS system - so heavy data read processes (such as queries) can use data from multiple separate (read only) databases. Heavy data processing applications would benefit from this as the load could be spread not only among different nodes of the same system, but across different physical databases.
A question for other Jade developers: Has anyone started down the path of heavily parallelising the execution of a Jade system, or researched into getting a Jade system "in the cloud" (whatever that buzzword means to you)?
A question for the Jade plant or Jade support: At what level in the Jade technology stack is the serverExecution funcionality built? Is it at the kernel, the JOM or code in RootSchema? Are there any obvious technical impediments in using this technology to provide for some kind of remote continuation support in Jade?
A particular feature being discussed is "continuations". In short, a continuation is where the state of execution of an application can be stored, and then continued later on. Kind of like a "save game", or "pause". Continuations become powerful when they can be continued on another process, or another computer altogether (a "remote continuation"). This would be a very powerful technology in Jade, as it would allow code to be distributed (and even parallelised) much more easily.
It seems to me that this is already implemented in Jade to a certain degree with the serverExecution method tag. By some magic Jade takes the call stack, all local variables and any transients it needs and executes the method on the server node. It then passes control back to the client node either when the method has completed, or when the clientExecution tag is encountered. From what I can tell this is kind of like a remote continuation.
It would be very nice if you could not only say "continue execution on the server", but "continue execution on a node/process that I specify". I know there are asynchronous methods, but they do not take the call stack, local variables or defined transients - an asynchronous method call spawns a call stack all of it's own. Parallelisation become a lot easier you could do something similar to a fork, where all required local data is fed to another process (which could be on another node) and then execution is continued there, with a result passed back to the calling process.
This concept could be extended by allowing a continuation to execute on an SDS system - so heavy data read processes (such as queries) can use data from multiple separate (read only) databases. Heavy data processing applications would benefit from this as the load could be spread not only among different nodes of the same system, but across different physical databases.
A question for other Jade developers: Has anyone started down the path of heavily parallelising the execution of a Jade system, or researched into getting a Jade system "in the cloud" (whatever that buzzword means to you)?
A question for the Jade plant or Jade support: At what level in the Jade technology stack is the serverExecution funcionality built? Is it at the kernel, the JOM or code in RootSchema? Are there any obvious technical impediments in using this technology to provide for some kind of remote continuation support in Jade?