Tuesday, February 12, 2008

FastSharp - Quick C# Snip Executer (Think Immediate Window without Visual Studio)

This Blog Can Also Be A Hat - FastSharp - Write it, Execute it

"Last year I wrote this program which I named FastSharp.  It is a text editor which lets you compile and run C# code that would normally exist inside a method.  The inspiration for this came from getting tired of opening up Visual Studio and creating a project when all I want to do is execute one line of code and see what it outputs.

...

image

...

Things To Consider and Future Consideration

  1. FastSharp can only do console output not input.  I was unable to figure out how to make Console.ReadLine() work inside the program.  This will be an important future feature if someone can figure it out.
  2. FastSharp compiles only C# code but it is not hard to make it work for Visual Basic, which would also be a nice feature upgrade.
  3. FastSharp uses the out-of-the-box winforms RichTextBox control as the code editor.  It would be nice to replace this with a code editor that color coded or even give intellisense :)

..."

I hate posts that start a "Thought Storm"... Posts that get me thinking about all the cool things I could do with it and code I could write...   ;)

There are enough times where I fire up VS just so I can try something very quickly via the Immediate Window and this project caught my eye.

Now all I need to do is get it to support VB, maybe add color and intellisense and I'd be gold... lol... Yeah, that's all I need to do (and I think I've posted things that will help me do all those...). And since the source is available (yeah for "Source Available" projects!) all I need is time and mental bandwidth...

Greg.Add("FastVB Project")

3 comments:

Anonymous said...

I am glad you found it interesting. If you make any upgrades to it let me know and I will post about the changes you make. Adding VB support is easy and adding color coding isn't hard but the intellisense would be the coolest and probably the hardest.

Dean Heard said...

Hiya, I use Snippet Compiler by Jeff Key (http://www.sliver.com/dotnet/SnippetCompiler/). Whilst it isn't quite so simple to get one line of code working, it's invaluable for creating a function definition to include into a main project - and it has intellisense.

Greg said...

Absolutely...

Yeah for intellesense I'd have to beg, borrow or steal an implementation (like DotNetFireball ... I knew I blogged about something to help me with that...lol... ;)

Again if I actually do get started on this, or get anywhere with it I'll let you know...

Thanks,
Greg