Provide a C# REPL mode
The idea is that there would be a mode where it is easy to execute single lines or blocks of codes, and all the variables from the main scope would automatically be available in subsequent runs.
The implementation is probably far from trivial, but one naive idea is to identify where variables are initialized and set, and have that mirrored as Get/SetData in the appdomain before compilation.
So for instance, if I have the following lines
var x = 1;
var y = x + 1;
Then running the first line would execute something like this
var x = 1;
AppDomain.CurrentDomain.SetData("x",x)
And running the second one something like this
var x = AppDomain.CurrentDomain.GetData("x",1)
var y = x+1;
AppDomain.CurrentDomain.SetData("y",y);
One of the challenges may be to find out the types of the variables, i.e. is it a question of some smart regexes, or is there a need to start using routines to parse the execution tree and modify to redirect everything to appdomain variables?