1

So 3 things are required:

  • pure IL/C# generation from script
  • abilety to throw in C# classes and grammar constructs
  • simple C# api

Generally I want api like this:

var sctipt = "Script...";
var scriptConstruct =  "{0} \{ {1} \}";
ScriptCompiler.registerConstruct<Action<string, string> >(scriptConstruct);
ScriptCompiler.reginsterType(ClassT);
ScriptCompiler.bindFunction<Action<String> >(MyFunction, "FunctionNameInScript")
var CompiledScript = ScriptCompiler.Compile(sctipt);
CompiledScript.execute();

Is there any such Scripting language? I tried Nemerle but could not find how to work with it in the way I just described.

0

3 Answers 3

1

A new project called Roslyn is in development at the moment and does exactly what you are looking for. It is available as a Community Technology Preview. Many improvements have been made so i suggest you try it.

http://msdn.microsoft.com/en-us/vstudio/roslyn.aspx

Sign up to request clarification or add additional context in comments.

Comments

1

I haven't looked at this for a good while, but your question brings to mind Roslyn:

The Roslyn CTP previews the next generation of language object models for code generation, analysis, and refactoring, and the upcoming support for scripting and interactive use of VB and C#.

There's some stuff kicking around on this, here and here.

Comments

0

Have you seen the following link ?

http://reverseblade.blogspot.com/2009/02/dont-wait-for-c-5-use-nemerle.html

That way you can run things dynamically

1 Comment

my main objective is to provide a scripting enviroment as minor part of existing C# infrastructure. I havent found how to do what I described in code sample with nemerle from C#.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.