Last weekend, I added distributed features to my open source interpreter AjSharp. I wrote about them in:
In these days, I wrote more code to support distributed running of an AjSharp application. It’s a work in progress. In this post, I want to write down the list of features that I like to have (some of these points are implemented in the trunk, but I should review, test and post about them):
– Start a local host in an address
– Connect to a remote host by address
– Connect to a remote host and send the address of another (local or remote) host (register the new host in the remote host)
– Execute a local callback when a remote host sends a the address of a host to my local host (OnRegisterHost).
– Send a local defined command to a remote host and execute it in the remote host.
– Send a local defined expression to a remote host and evaluate it in the remote host, returning the new value.
– Send a local defined function, subroutine, to a remote host, send its parameters, and evaluate the function/subroutine in the remote host.
– Send a text to a remote host, parse and execute it as a command.
– Send a text to a remote host, parse and evaluate it as an expression, returning a value.
– Send the local file content to a remote host, parse and execute it.
– Get a list of local host register in the current machine
– Get a list of remote host in the current machine
– Set a remote variable, sending a local evaluated value
– Send a copy of a DynamicObject to remote host (I should resolve what happens when the DynamicObject has an associated class)
– Send an object reference of a DynamicObject to remote host, to use there as a proxy to the original object still residing in local host.
– Send a copy of an agent to a remote host, and start it.
– Export a local file with source code to the remote host, to use in Include(“…”) commands to execute in remote host.
– Export a local assembly to remote host (I should decide if I need this feature)
Machine is a base object that keeps the global environment (Machine.Current.Environment), with the name/values of global variables, class definitions, global functions, etc. Host is the object that exposes a machine to other hosts.
– A proof-of-concept sample application: a distributed web crawler, or a distributed genetic algorithm.
Add all these features to go routines, futures, channels, and agents, and we have an interesting soup.