next up previous
Next: 8 Related Work Up: CLANGER : an interpreted Previous: 6 Implementation

7 Examples

The provision of associative arrays in CLANGER has already been mentioned. In addition, all the modules providing language run-time support in Nemesis have interfaces specified in MIDDL and so are usable by CLANGER. Here we give three examples of further facilities to which an interpreter has access:

7.1 Filing Systems

Directory services of filing systems in Nemesis are just another part of the name space. Implementing an ls command in CLANGER is a matter of calling the List method on a name space, then printing the list of results by calls on the Print method of a Console. If the notion of a ``current working directory'' is required, it is simple to have a variable in the root name space called cwd or somesuch. Its type is, of course, Context.

7.2 Inter-domain communication

Some command languages have extensions to provide inter-process communication via RPC, but require the programmer to create stubs for each RPC interface. The Nemesis inter-domain communication mechanism uses surrogate interfaces and dynamically creates such surrogates at bind time. The interface to the binding mechanism is (naturally) defined in MIDDL. Thus RPC support in CLANGER is already there.

7.3 Threads

Support for concurrency is becoming more widespread in programming languages and operating systems, but shells are some way behind. Access to the thread primitives and synchronisation mechanisms of Nemesis user-level schedulers is via interface calls and is therefore trivially easy from CLANGER, regardless of which particular abstraction is provided by the current domain. Many interfaces in a Nemesis system have concurrency control; those that do not can be protected in the command language.



T. Roscoe