Metaprogramming is the writing of computer programs that write or manipulate other programs as their data, or that do part of the work at runtime that would otherwise be done at compile time.... language that provides scripting functionality in Microsoft .NET applications, allowing runtime
Runtime
In computer science, runtime or run time describes the operation of a computer program, the duration of its execution, from beginning to termination .... execution of custom functionality, similar to VBA
VBA
VBA can mean:* Visual Basic for Applications, the application edition of Microsoft's Visual Basic programming language.* Veterans Benefits Administration, an organizational element of the U.S.... in Microsoft Office
Microsoft Office
Microsoft Office is a popular set of interrelated desktop applications, servers and services. Microsoft Office is collectively referred to as an office suite, for the Microsoft Windows and Mac OS X operating systems.... applications. The syntax of Script.NET is similar to JavaScript
JavaScript
JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard.... . 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.
Metaprogramming is the writing of computer programs that write or manipulate other programs as their data, or that do part of the work at runtime that would otherwise be done at compile time.... Features Script.NET has a special quotation operator <[ program ]> which returns AST
Abstract syntax tree
In computer science, an abstract syntax tree , or just syntax tree, is a directed tree representation of the abstract syntactic structure of source code written in a certain programming language.... of a given program.
Metaprogramming is the writing of computer programs that write or manipulate other programs as their data, or that do part of the work at runtime that would otherwise be done at compile time.... language that provides scripting functionality in Microsoft .NET applications, allowing runtime
Runtime
In computer science, runtime or run time describes the operation of a computer program, the duration of its execution, from beginning to termination .... execution of custom functionality, similar to VBA
VBA
VBA can mean:* Visual Basic for Applications, the application edition of Microsoft's Visual Basic programming language.* Veterans Benefits Administration, an organizational element of the U.S.... in Microsoft Office
Microsoft Office
Microsoft Office is a popular set of interrelated desktop applications, servers and services. Microsoft Office is collectively referred to as an office suite, for the Microsoft Windows and Mac OS X operating systems.... applications. The syntax of Script.NET is similar to JavaScript
JavaScript
JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard.... . 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.
Metaprogramming is the writing of computer programs that write or manipulate other programs as their data, or that do part of the work at runtime that would otherwise be done at compile time.... Features
Script.NET has a special quotation operator <[ program ]> which returns AST
Abstract syntax tree
In computer science, an abstract syntax tree , or just syntax tree, is a directed tree representation of the abstract syntactic structure of source code written in a certain programming language.... of a given program. Additionally, the AST of the current program may be accessed with the prog object.
Here is an example:
//Create an AST for MessageBox.Show('Hello'); program
ast = <[ MessageBox.Show('Hello'); ]>;
//Add this AST at the and of the current program
prog.AppendAst(ast);
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:
// Create Data Mutant Object
mobj = [ Text -> 'Hello from Mutant' ];
// Set Additional Fields
mobj.Top = 0;
mobj.Left = 0;
// Set corresponding fields of Windows Form object
// (Mutantic Assignment)
form := mobj;
Bubble sort is a simple sorting algorithm. It works by repeatedly stepping through the list to be sorted, comparing two items at a time and swapping them if they are in the wrong order.... function
a=[17, 0, 5, 3,1, 2, 55];
for (i=0; i < a.Length; i=i+1)
for (j=i+1; j < a.Length; j=j+1)
if (a[i] > a[j] )
s = 'Results:';
for (i=0; i < a.Length; i++)
s = s + ',' + a[i];
Design by Contract or Programming by Contract is an approach to designing computer software. It prescribes that software designers should define Formal methods, precise and verifiable interface specifications for Component-based software engineering#Software component based upon the theory of abstract data types and the conceptual metaph... feature
function Push(item)
[
//Limit to 10 items
pre(me.Count < 10 );
post;
invariant;
]
function Pop
[//Check emptiness
pre(me.Count > 0);
post;
invariant;
]
IronPython is an implementation of the Python targeting the .NET Framework and Mono , created by Jim Hugunin. Version 1.0 was released on September 5, 2006.... - an implementation of Python for the .NET platform, similar to Jython
Jython
Jython, successor of JPython, is an implementation of the Python written in Java .... .
Nemerle is a high level language static typing programming language for the Microsoft .NET platform. It offers functional programming, object-oriented and imperative programming features.... - a high-level language for the .NET platform.