Script.NET

Script.NET

Infobox programming language
name = Script.NET

paradigm = Imperative
designer =
developer =
latest_release_version =
latest_release_date = 2007-10-02
typing = Dynamic
implementations =
dialects =
influenced_by = Java Script
influenced =
operating_system =
license = Free
website =

Script .NET or S# is a metaprogramming language that provides scripting functionality in Microsoft .NET applications allowing execution of custom functionality in run-time. It can be used as VBA in Microsoft Office application. The syntax of Script.NET is similar to JavaScript language. It is designed to be simple and efficient scripting language allowing to customize .NET applications. The language has real run-time interpreter. 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 AST of a given program. The AST of the current program may be accessed with prog object.

Here is an example://Create an AST for MessageBox.Show('Hello'); programast = < [ MessageBox.Show('Hello'); ] >;//Add this AST at the and of the current programprog.AppendAst(ast);

The < [ ... ] > operator and prog object allows Script.NET to generate new scripts or modify existing script at the run-time.

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 set of classes. On top of which is DataMutant"' class. It implements several principles of mutant object:

Definition: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) is 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;

Examples:

Hello world

MessageBox.Show('Hello World!');

Bubble sort 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] ) { temp = a [i] ; a [i] = a [j] ; a [j] = temp; }

s = 'Results:';for (i=0; i < a.Length; i++) s = s + ',' + a [i] ;

MessageBox.Show(s);

RSS Reader

a = new XmlDocument();a.Load('http://www.codeplex.com/scriptdotnet/Project/ProjectRss.aspx'); MessageBox.Show('CodePlex Script.NET RSS::');foreach (n in a.SelectNodes('/rss/channel/item/title')) MessageBox.Show(n.InnerText);

tack

Stack limited to 10 elements using Design by contract featurefunction Push(item) [//Limit to 10 items pre(me.Count < 10 ); post(); invariant();] { //me is mutated object, //stack in this case me.Push(item);}

function Pop() [//Check emptiness pre(me.Count > 0); post(); invariant();] { return me.Pop();}

stack = new Stack<|int|>();

//Create Mutant//1. Set Functions, override stack.PushmObject= [Push->Push,PopCheck->Pop] ;//2. Capture objectmObject.Mutate(stack);

for (i=0; i<5; i++) mObject.Push(i);

Console.WriteLine((string)mObject.PopCheck());

imilar Languages

* L Sharp.NET - Lisp-like scripting language for .NET
* Boo - a Python Like language for .NET platform
* IronPython - an implementation of Python for the .NET platform, similar to Jython.
* Nemerle - a high-level language for the .NET platform.

External links

* [http://www.codeplex.com/scriptdotnet Latest release]
* [http://www.protsyk.com/scriptdotnet/ Script.NET Homepage]
* [http://www.protsyk.com/scriptdotnet/examples.html Code Examples]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Script.NET — Тип Язык программирования Операционная система Windows 98 или старше Последняя версия Версия 1.0 (17 декабря 2007) Лицензия LGPL …   Википедия

  • Script.NET — Paradigmen: Skriptsprache Entwickler: Petro Protsyk Aktuelle Version: Beta 17122007  (17. Dezember 2007) Typisierung: schwach …   Deutsch Wikipedia

  • Script.aculo.us — Тип JavaScript библиотека Разработчик Thomas Fuchs …   Википедия

  • script.aculo.us — Тип JavaScript библиотека …   Википедия

  • Net.art — has two definitions:net.art is a group of artists who worked in internet art from 1994. The members are usually referenced as Vuk Ćosić, Jodi.org, Alexei Shulgin, Olia Lialina, Heath Bunting. This group was united as a parody of avantgarde… …   Wikipedia

  • net.art — refers to a group of artists who worked in the medium of Internet art from 1994. The main members of this movement are Vuk Ćosić, Jodi.org, Alexei Shulgin, Olia Lialina, and Heath Bunting (irational.org, Heath Bunting, Rachel Baker, Minerva… …   Wikipedia

  • Script of the bridge — (1983) est le premier album, phare et indispensable, de The Chameleons: un son unique (mélange de chorus sur la guitare et d une batterie très intense sur un rythme assez lent), dont l ambiance générale semble avoir influencé quelques groupes des …   Wikipédia en Français

  • Script of the Bridge — (1983) est le premier album, phare et indispensable, de The Chameleons: un son unique (mélange de chorus sur la guitare et d une batterie très intense sur un rythme assez lent), dont l ambiance générale semble avoir influencé quelques groupes des …   Wikipédia en Français

  • Script kiddie — In hacker culture, a script kiddie (as opposed to speed kiddie Fact|date=August 2008), occasionally script bunny , skiddie , script kitty , script running juvenile (SRJ) , or similar) is a derogatory term used for an inexperienced malicious… …   Wikipedia

  • .NET Remoting — У этого термина существуют и другие значения, см. .NET. .NET Remoting  компонент, созданный компанией Microsoft. API для межпроцессного взаимодействия. Реализация от Microsoft протокола SOAP (веб сервисы). Выпущен в 2002 году вместе с… …   Википедия

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”