I am looking for a small interpreter for C # that I could load in some applications. Something that could trigger things like this:
> var arr = new[] { 1.5,2.0 }; arr = { 1.5, 2.0 } > var sum = arr.Sum(); sum = 3.5
And so I thought that this could be achieved by creating a dictionary of all the variables and their types, and then compiling each of the lines as they arrived, and then execute the function, get the result and paste it into the variables dictionary.
However, it seems to me that it can be quite difficult to build and, possibly, very inefficient.
Then I thought Powershell was doing what I needed. But how is this done? Can someone enlighten me on how Powershell works or what could be a good way to create a .Net interpreter?
d - b source share