What you want isn't exactly possible but you can do something similar using the codeDom. See this thread for more details:

[link:cs.hubfs.net]

Cheers,

Rob

By on 11/19/2008 8:19 AM ()

Thank you for your reply.
Will F# been moved to Microsoft Script Host?

By on 12/3/2008 11:25 PM ()

Seems unlikely, "F# Interactive", fsi.exe does roughly the same thing as Microsoft Script Host does for VBScript/JScript. Microsoft Script Host is COM based and beginning to look pretty old, the old advantage I see to Microsoft Script Host is that it's deployed to virtually every version of windows by default.

Cheers,

Rob

By on 12/4/2008 2:07 AM ()

All right,maybe MSH(Microsoft Script Host) is a old technic just you said. As far as I know ,IronPython is the popular programming language that based on DLR. According to the offical some messages, DLR will be intergrated into CLR in the .Net framewok 4.0. When I use IronPython in my current C# Application,I can create a ScriptEnvironment and load python engine. So the environment will load ironpython script file or some snippet code.
Whether F# will support DLR or not? How can I use the function like as IronPython in F# Script?
Thanks a lot!

By on 12/8/2008 7:35 PM ()

F# is not based on the DLR because it is compiled statically typed language, so it has little need of the services the DLR provides.

As you point out one notable exception to this is the ablity to load an F# scripting engine to dynamically evaluate code _and_ have this code interact with code that has been previously evaluated. I put stress on the "and" as it's relatively easy to dynamically evaluate F# code via the code DOM, the difficult is having it interact with previously evaluated code.

So will F# one day get this features? Hard to say, it seems unlikely in the VS 2010 timeframe. But after that it seems there's reasonably chance, as it's a commonly enough requested feature. But even then it's hard to call whether it would be based on the DLR or just a hosted version of F# interactive. (I should also add this is my own speculation I'm not in anyway speaking for the F# team).

So for now you have to decide if you need your dynamic code to be able to interact with other previously executed dynamic code. If so, you'll have to stick to IronPython or IronRuby. If not you can dynamically execute F# using the codedom.

Cheers,

Rob

By on 12/12/2008 12:48 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper