Closed kuhlenh closed 9 years ago
It might be worth looking @ cake-build/cake to see an example of C# scripts in the wild.
Great to see this! Loving the openness, and we're really excited to see the scripting APIs back under development and as OSS! We're anxiously ready to get scriptcs to use this.....
Can I assume these apply to both inside and outside of the REPL?
One word, YES!!!. Having the script run in an async context, or at least a way to trigger this would be really useful. For example imagine I am using HttpClient, it would be really nice if I can just do
var client = new HttpClient();
var response = await client.GetAsync(...);
As so many of the framework libs have moved to async, this becomes very practical imo.
I see you have #r adding support for NuGet packages. How will this work?
Having inline specification for packages will be really useful. It would be nice though it it also supported externalizing the dependencies i.e. like in packages.config or packages.json. Was this considered?
We need this outside the REPL as a general scripting feature. For script "programs" this is really needed. It would be great to see this support both relative and absolute paths with relative being to the executing script.
Something else that would be really useful is to be able to define extension methods WITHIN script. We see this request commonly for scriptcs. You can load a binary with extensions, but no way to inline them in a script. I understand why as everything runs within the submission, but maybe there's a way to break outside of that somehow, or have code lifted at compile time to be an extension method.
The compiler doesn't actually do anything specific for #r's. It's all up to the host. The compiler asks the script host to resolve the string given in #r directive and expects back an array of MetadataReferences that are gonna be added to the compilation. It's up to the host to distinguish between a NuGet package name and a .dll name, find the library and get the metadata content.
All references are loaded at script compile time, just before the script code itself is compiled. At that point we need to load all metadata in order to bind identifiers in the source.
@tmat Interesting, I did not know that. Is there a virtual method or something that the host implements? Or is this something that is handled through the AssemblyResolve event?
It's probably not exposed via the hosting APIs yet.
Interactive Design Meeting Notes - 1/23/15
Definitions
Design Team
The following individuals are members of the dream team: Anthony D. Green Chuck Stoner Dustin Campbell Kasey Uhlenhuth Kevin Halverson Kevin Pilch-Bisson Lincoln Atkinson Manish Jayaswal Matt Warren Tomas Matousek
Special Guests: Mads Torgersen Neal Gafter
About the Design Process
We meet for 2 hours a week to sketch final designs and experiences for Interactive. It is usually up to Kasey to determine the topic for discussion.
Meeting notes will be shared publicly on the dotnet/roslyn GitHub so that the community can respond and give input on our thoughts. Notes will be posted as issues thus allowing the community to comment on the thread. We will take comments into consideration for the next meeting.
Ultimately, the Interactive Design team is still in charge of the interactive intiative. This is not a democratic process; the team will make the final decisions. That said, we will look at UserVoice, comments on notes, and feature requests.
Agenda: Interactive Language Semantics
Happy New Year! This meeting focused on design-time language semantics and experiences for the REPL and Scripting.
LANGUAGE FEATURES
Next time we will discuss incorporating F# directives: #l (adds “some path” to assembly and script resolution search path) and #time (turns on simple perf stats--Real, CPU, GC--for each evaluated command)