Script.NET
Encyclopedia
Script.NET or S# is a metaprogramming
language that provides scripting functionality in Microsoft .NET applications, allowing runtime execution of custom functionality, similar to VBA
in Microsoft Office
applications. The syntax of Script.NET is similar to JavaScript
. It is designed to be simple and efficient scripting language allowing to customize .NET applications. The language has a true runtime interpreter, and it is executed without generating additional in-memory assemblies.
Script.NET is an open-source project.
of a given program. Additionally, the AST of the current program may be accessed with the prog object.
Here is an example:
The <[ ... ]> operator and prog objects allow Script.NET to generate new scripts or modify existing scripts at runtime.
There is a special operator := called Mutantic or Generalized assignment. Its purpose is to assign values of DataMutant fields to corresponding fields of an object of any type.
Example. Creation and Usage of MObject:
feature
Metaprogramming
Metaprogramming is the writing of computer programs that write or manipulate other programs as their data, or that do part of the work at compile time that would otherwise be done at runtime...
language that provides scripting functionality in Microsoft .NET applications, allowing runtime execution of custom functionality, similar to VBA
VBA
VBA can mean:* Virtual backup appliance, a virtual machine used to back up other virtual machines* Visual Basic for Applications, the application edition of Microsoft's Visual Basic programming language...
in Microsoft Office
Microsoft Office
Microsoft Office is a non-free commercial office suite of inter-related desktop applications, servers and services for the Microsoft Windows and Mac OS X operating systems, introduced by Microsoft in August 1, 1989. Initially a marketing term for a bundled set of applications, the first version of...
applications. The syntax of Script.NET is similar to JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....
. It is designed to be simple and efficient scripting language allowing to customize .NET applications. The language has a true runtime interpreter, and it is executed without generating additional in-memory assemblies.
Script.NET is an open-source project.
Metaprogramming features
Script.NET has a special quotation operator <[ program ]> which returns ASTAbstract syntax tree
In computer science, an abstract syntax tree , or just syntax tree, is a tree representation of the abstract syntactic structure of source code written in a programming language. Each node of the tree denotes a construct occurring in the source code. The syntax is 'abstract' in the sense that it...
of a given program. Additionally, the AST of the current program may be accessed with the prog object.
Here is an example:
The <[ ... ]> operator and prog objects allow Script.NET to generate new scripts or modify existing scripts at runtime.
Generalized objects
Script.NET includes so-called "Mutantic Framework" which introduces a special kind of "meta" objects for controlling objects of any type. It is composed of a set of classes, on top of which is the "DataMutant" class. It implements several principles of mutant object:Definition
A Mutant is a special object which could have all properties (fields, methods, etc.), and may be converted to any type (or assigned to object of any type). The semantics of such conversion (or assignment) are pragmatically conditional.There is a special operator := called Mutantic or Generalized assignment. Its purpose is to assign values of DataMutant fields to corresponding fields of an object of any type.
Example. Creation and Usage of MObject:
Bubble sort function
RSS Reader
Stack
Stack limited to 10 elements using Design by contractDesign by contract
Design by contract , also known as programming by contract and design-by-contract programming, is an approach to designing computer software...
feature
See also
- L SharpL SharpL# .NET is a dynamic computer programming language intended to be compiled and executed on the Ecma-334 and Ecma-335 Common Language Infrastructure...
- Lisp-like scripting language for .NET - Boo - a Python Like language for .NET platform
- IronPythonIronPythonIronPython is an implementation of the Python programming language targeting the .NET Framework and Mono. Jim Hugunin created the project and actively contributed to it up until Version 1.0 which was released on September 5, 2006. Thereafter, it was maintained by a small team at Microsoft until...
- an implementation of Python for the .NET platform, similar to JythonJythonJython, successor of JPython, is an implementation of the Python programming language written in Java.-Overview:Jython programs can seamlessly import and use any Java class. Except for some standard modules, Jython programs use Java classes instead of Python modules...
. - Nemerle - a high-level language for the .NET platform.