background preloader

DLR

Facebook Twitter

Scripting Your .Net Applications with IronPython. One of the major use cases for IronPython is embedding in .NET applications to provide user scripting. The hosting APIs make it easy to experiment with embedding IronPython. Chris Umbel has written up a blog entry demonstrating the IronPython 2.6 hosting API and giving an example of exposing an API to Python scripts from a C# applications.

Scripting Your .Net Applications with IronPython At several points in my .Net development career I've had the need to make an application I wrote scriptable. Sometimes it was to provide easy product extension to customers or lower level information workers. Sometimes it was to ease maintenance of very fine grained logic that has the capacity to change frequently or unpredictably.

But every time I found it to be one of the more interesting facets of the project at hand. Early in .Net's history this was made easy by using Visual Studio for Applications (VSA) which allowed you to host arbitrary C# or VB.Net code within the executing AppDomain. Jint - Javascript Interpreter for .NET. Seven hours of screencasts on the DLR, IronPython and IronRuby f. IronRuby Sample #3: Creating a DSL. [ This is part 3 of my IronRuby samples series. You can read the first post (Hello World) and the second post (C# Recorder using IronRuby) as well. ] The Ruby language is very powerful in general, and in its metaprogramming abilities in particular. This time I’m going to demonstrate how you can take advantage of these abilities along with Ruby’s syntax capabilities in order to create a custom DSL (Domain Specific Language) in a matter of minutes. Pay attention that these features are not specific to IronRuby, they are a part of every implementation of the Ruby language. Let’s start from the end this time.

This is the code you will be able to write with my little DSL: Running this will result in the next output to the console: Please buy: - 3000 grams of peanuts - 100 grams of cheese - 2000 grams of snacks It’s a nice little DSL to manage your shopping lists with. How is it Written? I’m not going to go through the code line by line. The DSL code: All the best, Shay. MyJScript - Home. Create your own language on the DLR. Berne, Göttingen, Europe Le 16 octobre 2008, nous célébrerons le 300e anniversaire de la naissance d’Albrecht von Haller (1708 – 1777).

Savant universel, Haller compte parmi les personnalités les plus éminentes du Siècle des lumières et a été un des plus grands scientifiques de la Suisse de tous les temps. A la fois fondateur de la physiologie expérimentale, explorateur de la flore suisse et poète des Alpes, il a ouvert de nouvelles perspectives à la médecine, à la botanique et à la littérature par l’excellence de ses travaux.

Nommé professeur à Göttingen, il y a créé le célèbre Jardin botanique et marqué de son empreinte la jeune université, faisant d’elle une institution moderne vouée à la recherche. En tant que magistrat, il sut préserver son pays des épizooties qui, à l’époque, sévissaient en Europe et mit au point des procédés économes en énergie pour exploiter le sel.

Haller 300. Blog Archive » Expression evaluator in 15 minutes with Irony & Evaluation of a string expression to a value is a common programming task. Almost any college course in informatics includes this excercise. It involves implementing some fundamental algorithms and structures such as: recursive-descent parser, regexp matching, traversal algorithms, syntax tree, hash-tables, etc. And for sure it should be done on some pure programming language such as ANSI C or Pascal. .NET Framework brought a lot of in-box algorithms and structures which simplifies the usual live of software developer. But fortunately there are some new tools that facilitate producing language parsers and their interpreters/compilers. DLR will be a part of the upcoming .NET Framework 4.0 and C#.

Irony is a library for creating parsers in C#. About a year ago I’ve posted few posts about using DLR for creating dynamic languages: DLR Language Part 1DLR Language Part 2DLR Language Part 3 Also I’ve used Irony to create Script.NET. So, please take a look at the results.