[Mono-dev] CSharpRepl for scripting
Capyvara
capyvara at gmail.com
Thu Jul 19 18:02:00 UTC 2012
Hello,
I've been using C# as my scripting language for a while, using the excellent
CS-Script (http://www.csscript.net/), which nicely supports Mono.
But now with the class compilation support from CSharpRepl I'm feeling
tempted to use a Mono provided solution, so I don't need to ask the users to
install both Mono and CS-Script (which requires some manual steps, such as
modifying $PATH environment variable) and also provides better
multi-platform support.
CSharpRepl already works for simple snippets scripts, however it lacks some
features that I feel important to improve the overall usability, I'd like to
discuss some nice to have features and how to better implement it:
- Support for "importing" other scripts
It's possible to put scripts in the ~/.config/csharp folder or adding
multiple source files in the command-line (such as csharp MyScript.cs
Utils.cs) but ideally the script itself should contain which dependencies it
have.
The way CS-Script does is by a special tag on a comment //css_import
fileA.cs fileB.cs; in your script, this way if MyScript.cs requires access
to some class in Utils.cs all I have to to is include a //css_import
Utils.cs
Is this feature desirable? using a comment is the best option or maybe other
alternative?
- MonoDevelop integration
Provide some way to load the script into MonoDevelop, so we can use the
autocompletion, debug, etc.
This is trickier since MonoDevelop has to know that it's a script file, and
should contain special things such as a shebangs on the top of the file, and
classless scripts.
I have no idea where to start looking for on this one, any clues if it's
possible or where to look for it? I'm not familiar with the source code.
- Command line arguments passing
Allows something like:
MyScript.cs
#/usr/bin/env csharp
Console.WriteLine("Output: " + args[0]);
> chmod +x MyScript.cs
> ./MyScript.cs Foo
Output: Foo
- Allow to compile script into .net executables or .dll's
Any other suggestions?
Thanks
--
View this message in context: http://mono.1490590.n4.nabble.com/CSharpRepl-for-scripting-tp4650480.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
More information about the Mono-devel-list
mailing list