Jump to content

CS-Script

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by John of Reading (talk | contribs) at 14:01, 11 October 2016 (Typo/general fixes, replaced: viceversa → vice versa using AWB). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

CS-Script (www.csscript.net) is a CLR (Common Language Runtime) based scripting system which uses ECMA-compliant C# as a programming language. CS-Script currently targets Microsoft implementation of CLR (.NET 2.0/3.0/3.5/4.0) and with full support for Mono.

CS-Script as well as a few other .NET languages (e.g. Boo) is a statically typed language and it allows unlimited access to .NET/CLR functionality with plain vanilla C# syntax.

CS-Script as a scripting environment offers stand alone script execution as well as hosting the script engine from CLR application.

Because of statically typed nature of the script execution CS-Script demonstrates no performance degradation comparing to the compiled managed binaries.

Existing .NET development tools (e.g. MS Visual Studio, Sharp Develop) can be used, allowing editing and debugging scripts within traditional .NET Development environment.

In addition to this in 2013 an Open Source CS-Script plugin for Notepad++ has been made publicly available.

CS-Script has been used in a number of open-source and proprietary products of different scale and complexity (e.g. FlashDevelop, MediaPortal).

CS-Script is released under the custom "liberal" license, which is allows free commercial use and free access to the source code.

Benefits of a C#-based scripting system

Simple deployment approach

Just bring both script and engine file (about 100 KB size) on the system that has .NET runtime installed and script can be run.

Portability

Scripts can be run on any system, which has CLR installed (including Mono).

Base language is a full featured C#

CS-Script is a truly object-oriented language, supports VB.NET, C++/CLI and J#. All .NET functionality is available (FCL, COM Interop, Remoting, WPF, WCF, etc.). Easily available debugger and rich IDE (Visual Studio or third-party IDEs). Execution model within the script is the same as for any .NET application: static void Main().

Optimised interpretation

interpretation of any statement in the script is done only once even if the statement is frequently used throughout the code.

The script language is type safe (strongly typed)

Strong typing is a luxury not available for the most of the scripting languages.

All software development tasks can be done in the same language.

GUI development for script application becomes easy.

Extensibility

Scripting system can be extended by using new assemblies written in any .NET languages or COM components. Any script can be easily converted into an application and vice versa. Functionality of any CLR application can be extended with scripting.

Script hosting

Can be run within WSH and can be mixed in one WSF file.

References