![]() |
Some thoughts about further MC# development |
|
[ Ðóññêàÿ âåðñèÿ ñòðàíèöû ]
[ Version for printing ]
Although MC# language already has enough features necessary for creating distributed applications, there are a number of further enhancements that could be made to improve the usability of the language. It’s quite possible that some of these features we will implement already in the next version:
1. Generics.
MC# language appeared when there were no generics in C# language. That’s why the syntax of typed channels in MC# is different from the well known C# 2.0 standard for class templates (where ‘<’ and ‘>’ symbols are used). For example, currently in MC# the typical chord and movable method can be described in the following way:
If we consider C# 2.0 syntax it will look like this:
This syntax better integrates into C# 2.0 and thus can be easier understood and accepted by programmers.
2. Typed bidirectional channels
Currently bidirectional channels are not typed in MC#, i.e. it is possible to send object of any type that implements ISerializable interface. One can only check the types of incoming objects in run-time and programmer is fully responsible for checking this:
With the help of generics it is possible to create typed bidirectional channels and rely on the compiler to check the typical “Types mismatch” errors:
3. Static movable functions and channels
In the current implementation all movable methods are public and cannot be static (as well as channels). This means that when you launch any movable function the “owner object” of this function is transferred to another node (and if there are some channels defined in this object then their proxies are created and passed to this node). But very often we don’t need this object at all. In such cases static movable methods and static channels is what we need:
4. movable – identifier or a class?
From the point of view of GRID systems, where theoretically started tasks can run for a few months and some of the nodes of GRID network can just “disappear” for a long time (or forever), it is crucial to have the mechanisms of checking the statuses of launched movable methods. And there must be some mechanism that allow programmer to restart and/or stop any running movable method. Ideally we would need to get some kind of “handler” after the launch of the movable function. Using this handler we would be able to know the status of this function (“launched”, “not launched”, “node doesn’t response”, when it was started and etc.) and if necessary perform some actions with this function (start/stop/restart). However, this would mean that movable is not the distributed analogue of void or async keyword, but either a special object that have some methods and properties! This conflicts with the tradition which says that movable methods do not return any values. However, there is a workaround for this problem if we consider that we cannot return any values from movable methods and Runtime system will do this for us. The following example shows how it can be used:
I.e. movable in this example is both identifier (analogue of void and async) and a class. |
|