Hacker News new | ask | show | jobs
by kpeel 3736 days ago
I hope I'm not reading this wrong... But is the new "C# Interactive Window" a C# REPL? That would be amazing.
6 comments

It's actually been there since Update 1.
Thanks for this.

It was a welcome surprise to go to View->Other Windows and see this. I'll have to update soon to the new version to see the additional features it's gained.

Yes, but I've found it to be lacking usability-wise (e.g. it doesn't load the current project's dependencies, and it doesn't provide an easy way to load in dependencies from your project [someone please correct me if I'm wrong!]).
That's what Update 2 brings: "You can now initialize the C# Interactive Window with a project's context, allowing immediate access to types inside that project."
That is great news, thanks!
Yep! This started life as the PTVS (Python Tools for VS) REPL and now Python, Node.js, C#, R, ... are using it.
Is this any different from the Immediate Window in Visual Studio?
Immediate is AFAIK a limited subset available during debugging. C# Interactive is what F# has had for years (F# Interactive), and even Mono has had something like this for a while. You can enter snippets of C# and eval like a real REPL. Update 2 brings project context support so you can just open the REPL and do stuff like var x = new MyType().
You might want to check out a web based C# REPL: http://csharppad.com
scriptcs (http://scriptcs.net/) is another awesome REPL for C# that's built on top of Roslyn. I've found it to be extremely flexible and handy for writing quick tools.