scriptcs gets a REPL!

Hello c# scripters!

Before you go further, if you are wondering what all the scriptcs hype is about please check out Scott Hanselman’s great post and his new Tekpub video.

Last few days I’ve been working on a new REPL experience for scriptcs and now it’s in! REPLs are nothing new to dynamic languages but they have not really been available in C# with one exception, Mono has a great REPL. Roslyn introduces the Roslyn interactive window in VS which is also a REPL which runs in the editor.

This REPL is different than both in that it is specific for scriptcs, and like the rest of the scriptcs experience, there’ s no IDE required. Basically it combines the goodness of scriptcs (nuget) with an interactive experience. You can just install some nuget packages and type code which instantly executes. For example imagine just pulling in HttpClient and then just doing some http requests!

Below you can see I am installing the mongo nuget package. Then running scriptcs by itself and typing in some simple code to work with the package.

clip_image001

And then we have pretty error handling.

clip_image002

Thanks to the Roslyn team’s efforts layering a REPL on top was AMAZINGLY easy. The REPL part itself was like 15 lines of code! And thanks to the nuget team for even making this a remote possibility through having an awesome package ecosystem. I look forward to ALSO seeing the mono version soon :-)

If you wanna try it, you can grab the latest from github at http://github.com/scriptcs/scriptcs in the dev branch.

It will also be on our chocolately nightly builds tomorrow: http://www.myget.org/F/scriptcsnightly. It should be on our public feed very soon there after.

This entry was posted in scriptcs. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • animaonline

    lol!

  • http://blogs.msdn.com/gblock Glenn Block

    BOOM that sounds is my head exploding.

  • animaonline

    The compiler runs directly on the device :)

  • http://blogs.msdn.com/gblock Glenn Block

    Looks awesome! (reply 6 months too late). Is that using a local compiler i.e. Mono? Or pushing to the cloud?

  • animaonline
  • http://twitter.com/ppetrovdotnet pip010

    format windows 8 partition. forget about the crappy vs2012, switch to Linux, and … voila PERL :)

  • http://twitter.com/gblock Glenn Block

    Hi Lars

    Or you can do it :-)

    Can you go file a bug in our github repo? Also do you mean just recording what you typed? Or some sort of state serialization?

  • Lars Wilhelmsen

    Excellent! Feature request: a good REPL should have a “record input to file” functionality, so that the session can be edited/reused later.