[Mono-devel-list] C#Shell, an interactive interpreter (please try it and comment)

Debian User mads_lindstroem at yahoo.dk
Wed Jul 21 14:07:43 EDT 2004


I have made a prototype of an interactive C# interpreter. I leave the
majority of the actual parsing to mcs, but to the user it looks like a
C# interpreter. I have made this program, because I as a Matlab
developer, became very fond of the interactive Matlab environment and
want the same thing for C#. The program can be downloaded from

The best way to understand what the program does is to try it. But I
have also tried to give a short explanation of what you can use it for
in this section. By interactive C# interpreter I mean an environment
where you can write small pieces of normal C# code. However with two
differences. Firstly, you do not write method or class
headers. Secondly, you can have variables that survive after a piece
of code has been executed and can be used when executing another piece
of code.

I would very much like to receive comments about making such an
interpreter. I would also like to receive comments about making this
program better integrate with mcs. But I do _not_ currently want to
receive comments about details in the user interface. Remember this is
just a prototype.

Below I will explain why I think such a program is a good idea.

Normally when programming, things go in a cycle. Firstly one needs to
write the code, then compile the code, then execute the code, then
discover errors, and then one writes new code, ...

This is a time consuming process and should be optimized. C#Shell can
help with this optimization in two ways.

1) In C#Shell one can write each sentence and see what happens. If
something do not go as planned, one can quickly locate and correct the
error. It therefore reduces the time between coding and
response. Which is not just good when programming, but a general
design principal when designing user interfaces (it is also called

2) Compiling code is often time consuming, as not only the changed
code needs to be recompiled but also the code depending on the changed
code. This can easily lead to a large number of files that needs to be
recompiled. This is not the case in C#Shell, as only the written
sentences needs to be compiled (and some method/class header
information automatically generated by the program). This again leads
to better responsiveness.

However, C#Shell also has limitations. When programs get larger it
will not be beneficiary to only use C#Shell for development, as large
programs will get unwieldy in C#Shell. What it is good for is trying
minor stuff, like the functioning of an API, unfamiliar language
constructs, or testing a homegrown algorithm.


Mads Lindstrøm

More information about the Mono-devel-list mailing list