Script# at MIX11

Followup to my talk at MIX11 - Script#: Compiling C# to JavaScript, along with links to sample code and slides.

At MIX11 last week, I presented the Script#: Compiling C# to JavaScript using Visual Studio.

As full-fledged script-based development becomes widespread with the HTML5 wave, a couple set of interesting questions emerge - what are the development tools you and your team uses to productively author and manage a code base? Shouldn’t you write code in a model that is optimized for development and productivity and let a compiler do its magic and produce code that is optimized for deployment and runtime?

Script# allows you to write your code in C# and compile it down to deployable JavaScript, it also unlocks the power of C#, Visual Studio and existing .NET tools for scripting scenarios.

Development with Script#

In my demo, I highlighted some of these tooling experiences (things like refactoring, static analysis, unit testing and IDE tools). I also demo'd how you can get started with the traditional "hello world" scenario and how you can continue to use frameworks like jQuery, as well as write your own jQuery plugins using Script#.

I have published the code and slides. I will be blogging a more detailed post on each demo over the course of the next few blog posts, so stay tuned.

Script# has been used successfully to develop various applications. These include Bing maps, Bing mobile, and the Messenger/Web IM integration within Hotmail.

Bing Maps Bing Mobile Web IM in Hotmail

If you’re building an application using Script#, I'd love to hear about it, and reference it in an upcoming revamp of the project's site.

You can now download the latest release of Script#, v0.7 off the Script# project site. It comes with the ability to consume generic types, a new script loader, and improved mvc integration, as well as nuget support to get you started on that. As always I look forward to hearing from you on your use of Script#.

Posted on Tuesday, 4/19/2011 @ 6:11 AM | #Presentations


2 comments have been posted.


Posted on 4/20/2011 @ 8:27 AM
Hi Nikhil,

Script# looks really great. But do we have support for calling any jquery plugins. E.g. jquery.imgareaselect.js. How can we write a wrapper for that. Is there any tool which can compile a js plugin to create a c# wrapper.

Nikhil Kothari

Posted on 4/20/2011 @ 12:30 PM
You can use jQuery plugins with script# - for example, out-of-the-box there is support for the jQuery BBQ and templating plugins. There is nothing automagic to build the wrapper, but it isn't rocket science either.

I'd suggest checking out the sources on to see the code for those plugins as examples... and furthermore if you do build any, perhaps share them as well. Hopefully that sets up a pattern of the community helping itself, and overall will ensure everyone doesn't have to build a wrapper from scratch every time for every plugin.
Post your comment and continue the discussion.