Sep 13, 2011
Have you heard about Script#?
Now C# developers can do the same using Nikhil Kothari's Script# project. This is not quite the same as using Atlas with ASP.NET though both cover similar territory.
How it works?
The inputs into the C# compiler are your source files, and any referenced assemblies. The referenced assemblies represent either script APIs in existing script files written manually, or script APIs defined within another Script# project with a corresponding generated script file.
The regular C# compiler is used to produce an assembly for your code and the XML doc-comments file that can then be used to produce documentation. The Script# compiler on the other hand generates a .js script file. All the script files - existing and generated – can then be deployed into a Web site or Web application running on any platform for use at runtime without any Script# dependency.
During compilation, the C# compiler and Script# compiler together provide build-time type checking and validation of your code. This helps catch typos and other common script errors at build-time on the development machine as opposed to at runtime on the end-user's machine.
The Script# compiler produces both release and debug versions of your script. The release version is minimized by removing whitespace and by reducing identifier lengths for internal and private members with shorter names. The debug version is formatted for readability and debuggability
The Script# System
Logically speaking there are three layers to the Script# system:
- The Compiler
- The Core RunTime
- The Framework
Script# Runtime - At development time, the runtime provides the equivalent of mscorlib.dll. It defines various key .NET types such as System.Object, primitive types and other core BCL types needed to author and compile C# source code.
The default Script# runtime is implemented in sscorlib.dll and its accompanying runtime counterpart sscorlib.js. To use Microsoft ASP.NET Ajax, the equivalent pair consists of aacorlib.dll and MicrosoftAjax.js as its runtime counterpart.
Runtime assemblies shipping with Script# representing other script APIs such as Virtual Earth, RSS Feeds etc. ship in assemblies named ss*.dll.
Script# Framework - The framework is completely optional. The choice of framework also depends on the application and the developer. The compiler itself is not bound or dependent in any way against any particular framework choice. The default ScriptFX framework accompanying Script# ships in assemblies and scripts named ssfx.*.dll and ssfx.*.js.
Script# can be used either via the command-line (ssc.exe) or via MSBuild (via a custom task added to your .csproj profile file). The MSBuild approach is recommended.
Sourcecode Download : SSharp.zip
For more reference click here