DLR

TwitterFacebook
Get flash to fully experience Pearltrees
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. 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.

Scripting Your .Net Applications with IronPython

http://ironpython-urls.blogspot.com/2009/11/scripting-your-net-applications-with.html
http://jint.codeplex.com/ Differences with other script engines Jint is different as it doesn't use CodeDomProvider technique which is using compilation under the hood and thus leads to memory leaks as the compiled assemblies can't be unloaded. Moreover, using this technique prevents using dynamically types variables the way JavaScript does, allowing more flexibility in your scripts.

Jint - Javascript Interpreter for .NET

Seven hours of screencasts on the DLR, IronPython and IronRuby f

I am one of those developers who has become very smitten with Ruby of late. I was therefore extremely pleased to stumble across a bunch of screencasts on Ruby, Python and the DLR, oddly “hidden away” in the Overview section of “.NET Framework 3.5: Create Connected Applications”. The code is a little tough to read – but possible. http://geekswithblogs.net/iupdateable/archive/2009/05/14/seven-hours-of-screencasts-on-the-dlr-ironpython-and-ironruby.aspx
http://www.ironshay.com/post/IronRuby-Sample-3-Creating-a-DSL.aspx

IronRuby Sample #3: Creating a DSL

Posted by Shay Friedman on November 4, 2009 [ 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.

Create your own language on the DLR

http://www.dotnetguru.org/us/dlrus/DLR2.htm Intr oduction About DLR MyJScript Language context Create a syntax tree with the DLR Build syntax tree from the grammar Generate variables Using variables Data types Rules to run your syntax tree Object oriented programming with MyJScript Set and get object properties Build and call methods Global context and built-in functions CLR interoperability Command line interpreter Interoperability with other DLR languages To learn more Conclusion Acknowledgments You need sometimes in an application to provide to the user its own programming language. For example to let users configure theirs own rules in the engine or allow them to change operations to compute a field. In these cases, as a developer, you need to build your own interpreter or compiler and plug it with your .NET code. So, you not only have to have good knowledge in writing a scanner and a parser, you also need to have a very good understanding of code generation to run statements of your new language.
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.

Blog Archive » Expression evaluator in 15 minutes with Irony &

http://protsyk.com/cms/?p=233