Oct 01 2008
Script#: The .NET Response to the Google Web Toolkit
For those of you who could not make it to Skills Matter last week, here is the video of my presentation about Script# (ScriptSharp). Script# is a free .NET tool that converts C# into JavaScript, allowing us to use a lot of existing C# tool support to write and manage large JavaScript code bases easier. This presentation introduces Script#, explains when and how to use it and discusses some common pitfalls with this tool.
Here are some related links:
- Powerpoint slides from the talk
- Source code for the examples used in the talk
- Main Script# Web site (docs and download)
- ExtSharp – ExtJS in Script#
- JQuerySharp – JQuery in Script#
![]() |
![]() |



[...] Script#: The .NET Response to the Google Web Toolkit – Gojko Adzic [...]
This has got to be the craziest thing but it comes form the mind of .NET so go figure. Why in the world must one convert C# to Javascript and even have tools to do so? To modify what Laurence Olivier once told Dustin Hoffman, “Why don’t you write Javascript?”
Rob:
The reason you have to convert it is because C# doesn’t run client side. And you can write well-formed C# using Visual Studio (with intellisense, etc) whereas that would not be possible coding directly in Javascript. Did you even watch the video?
Or check out jsc that supports:
c# -> dll -> javascript
c# -> dll -> actionscript
c# -> dll -> java
http://zproxy.wordpress.com/2008/09/30/wpf-subset-powered-by-flash-and-dhtml-part-2/
http://zproxy.wordpress.com/2008/09/25/jsc-september-2008-refresh-2/
http://jsc.sourceforge.net/
Bart, are you saying that it’s not possible to write well-formed Javascript, or that you can’t get code auto-completion in Javascript? Both positions are going to be very difficult for you to defend.
Rob, the reason tools like this exist is because the majority of developers don’t know Javascript very well and/or would prefer not to step outside their comfort zone. Developers are a surprisingly conservative bunch.
Google implemented GWT because they have vast numbers of Java coders, and wanted to leverage that in the browser. Similarly the Microsoft-based dev community have vast numbers of C# developers.
Rich,
it’s not just that. You do have JS intellisense for standard stuff, but (at least I have not seen an editor that does this good) for your classes. JS modularisation and dependency management is generally left to developers to do by hand as well. As I said in the talk, unless you are going to have a really complex JS code base, using Script# is an unnecessary overhead. When you have a complex code base, writing and maintaining code in an environment that can provide sort of a “compile time” check, dependency management and full type-safe intellisense for your own objects and classes can save a lot of time.
Rich:
Yes, you can write well-formed javascript. This makes it easier. And by coding in C# you get to take advantage of the full power of Visual Studio.
Hi all there.
Script# is indeed a very useful tool to write complex javascript and gives the advantage of using Visual studio and its intellisense as well as managed code. surely its not for the people like Rich who just write the Hello World applications in javascript. Developers don’t use tools just to be in comfort zone. Its the matter of productivity and achievement. Why do you use Visual Studio? You can code in notepad and compile your code in a command line compiler.