BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News CS-Script - The C# Script Engine

CS-Script - The C# Script Engine

Do you wish for a scripting language with access to the .NET Framework and the syntax of C#? With CS-Script, you get just that.

CS-Script supports running individual C# files as if they were script files. The author claims the system has a performance hit of only 40 to 60 seconds over compiled executables. The script engine can target both 1.1. and 2.0 frameworks.

CS-Script supports assembly references in one of two ways. The first option is to implicitly pull in assemblies by searching the Global Assembly Cache (GAC) and local directory for assemblies with names that match the needed namespace. According to the documentation:

The approach is based on the fact that in a real life there is a strong correlation between the assembly name and the root namespace. For example, the namespace System.Windows.Forms is implemented in the assembly System.Windows.Forms, and the namespace System.XML is implemented in the assembly System.XML. This is also applicable to the assembly file name, which is usually a DLL file with the same name as the assembly name.
The second method is to embed the reference as a comment using "//css_reference ;"

CS-Script can also be used as a host to enable script support from within another application.

 

Rate this Article

Adoption
Style

BT