Features

License

  • XSharper is free, open source, redistributable, and works without any installation so scripts can be included into setup of commercial products, or may be run w/o administrative rights.

Complexity

  • Easy to learn, read and remember. I don't write scripts very often and tend to forget syntax details of a specific language, let alone functionality of a framework, after not using it for a couple of weeks. It's self documenting too, invoking XSharper /? produces help not only about XSharper, but also about other classes in .NET framework
  • .NET framework is used as standard library
  • Minimum required .NET framework is .NET 2.0 ( .NET 1.0 is too limiting, .NET 3.5+ is not always installed on the XP/Windows 2003/Vista machines ).
  • It's very easy to insert C# code snippets into a script, and interleave it with XML actions
  • The script engine is simple, and it is easy to debug the script and the engine simultaneously with Visual Studio.
  • IntelliSense and syntax highlighting works in Visual Studio from day one
  • Language details

  • The language is suited for writing Windows console applications. Not web servers, not multithreaded GUI monsters, not games, but simple console applications.
  • There is a simple yet reliable mechanism to define and parse command line parameters. And it prints help automatically too, and does it nicely.
  • In XSharper it's easy to embed "data islands" into the script in XML, CSV, plain text and other formats.
  • It is easy to do things that console applications often do: copy/delete/move files from place to place, create and extract .ZIP archives, download files from web servers, run SQL statements. Much easier than writing code in C#.
  • Same things can be written in C# or XML, although XML is often more easily readable for sequential tasks like batch files
  • Standard try/catch/finally error handling
  • There is even a small package manager built-in, that can be used to upgrade software modules and SQL databases using a central repository
  • Compilation and script creation

  • It is easy to create XSharper script programmatically
  • It is a simple, single step process to produce .CS source or .EXE files out of scripts to improve performance and simplify deployment. Who needs XCOPY deployment, if a single EXE can do everything?
  • It is possible to decompile produced executables into something close to the original script, to handle cases when the original script is lost or unavailable.
  • Script execution and embedding

  • XSharper can execute scripts from files, command line, .config files, standard input, URLs
  • It's very easy to embed XSharper code into any application. Needs just a single assembly reference and a few lines of wrapper code.
  • XSharper scripts can be run in another application domain (or even process), communicating back through remoting
  • Ctrl+C is handled automatically, and script has a chance to shut down gracefully with deleting any temporary files.
  • Supports Vista UAC, and escalated console application gets the original console
  • Framework features

  • XSharper.Core library can be used as an assembly, or source code files comprising the assembly may be extracted and reused independently
  • Library includes, in no particular order:
    • a general purpose and simple expression parser and evaluator with C#-like syntax
    • a flexible XML serialization library for .NET 2.0, that does not require serialization code to be compiled, with automatic XSD schema generator
    • text templates expansion
    • simplified C# compiler invocation classes, making compilation of custom C# code with multiple references and requirements much easier
    • table output with column auto formatting
    • command-line parsing and help generation
    • parsing and creating CSV files
    • converting binary to hex and vice versa
    • dumping arbitrary object to text for debugging & logging purposes
    • simplified registry access, with support for x64 and x32 versions of registry
    • easy conversions between types (useful for parsing user input)
    • many other utility classes and functions, from text parsing to reflection acceleration through caching
  • And this is just the beginning.