1

Is there any good embeddable scripting language for .NET that supports .NET 2.0? Every solution I've found is made for .NET 3.5 or newer.

user2102508
  • 1,009
  • 11
  • 23
  • While interesting, this question is off-topic here. Btw: Which solutions did you find? – TaW Jul 23 '17 at 16:31
  • @TaW https://github.com/AlexKotik/embeddable-scripting-languages – user2102508 Jul 24 '17 at 07:49
  • Right. [This is also of interest.](https://stackoverflow.com/questions/137933/what-is-the-best-scripting-language-to-embed-in-a-c-sharp-desktop-application) - any reason why you need to stick to that really really old version? – TaW Jul 24 '17 at 08:09
  • 1
    @TaW It is the will of my bosses, not mine. – user2102508 Jul 24 '17 at 08:36

1 Answers1

0

DynLan - it also supports PCL / net4.0 / net3.5 / net2.0 / net.ce / net.core (https://github.com/b-y-t-e/DynLan). The library parses the code itself and execute it line by line. Simple expression example:

// result = 4
Object result = new Compiler().
  Compile(" 1 + 3 ").
  Eval();

You can also execute more complex code with variables / if / elif / else / while statements:

var dict = new Dictionary<string, object>();
dict["maxValue"] = 100;

// result = 100
Object result = new Compiler().
  Compile(@"
    i = 0
    while i < maxValue {
      i = i + 1
    }
    return i
").Eval(dict);
byte
  • 65
  • 4