Posts

Showing posts with the label dlr

A Good Mix 35: Visual Studio, WPF, a cross-platform Resolver One and IronJS (A DLR based Javascript)

Image
Another collection of IronPython and DLR related articles from recent weeks. Visual Studio 2010 Extension: IronPython IronRuby Console This extension adds IronPython and IronRuby to PowerConsole  so that you can interact with Visual Studio in IronPython/IronRuby. Please be aware that this extension only provides a simple tool to explore and interact with VS itself. It does not aim to be a development experience for the included languages. Tinesware: EasyWPF 0.3.93 An IronPython GUI library compatible with the Python GUI library EasyGUI . As the name implies, it is built on the WPF GUI library (making it Windows only). Like EasyGUI it has a demo app when you run the file showing the different controls/widgets the library supports. For more examples of how to use it visit the EasyGUI tutorial . Preview of the New Grid in Resolver One Resolver One  is a programmable spreadsheet written in IronPython. As well as being extremely powerful Resolver One is the largest ...

Pumping Iron in Denmark and on Channel 9

Harry Pierson, IronPython program manager, has now returned in triumph from his world tour . The world tour included a series of talks at Danish universities and the Copenhagen .NET user group. Danish University Tour Trip Report  At each of these universities, I did two talks. The first was Pumping Iron: The State of Dynamic Languages on the .NET Framework. That’s the one in the Channel 9 video. The other talk was Developing with the DLR , which I’ve posted to my Skydrive. That talk was more focused on the CLR and DLR as a platform for language development. If there’s interest (leave a comment), I’ll record audio for that presentation and post it up on SlideShare or something like that. If you aren't prepared to take Harry's word that it went well, here is a blog entry from Allan Juhl Petersen who attended one of the presentations: IronPython in Copenhagen I had the pleasure of attending Harry Piersons TechTalk at Microsoft Development Center Copenhagen (MDCC) on IronPytho...

A Good Mix 19: Reflection, the Silverlight Toolkit, Dynamic JSON, libraries, builds and more

A collection of blog entries and articles on IronPython and the Dynamic Language Runtime from the last few weeks. Speed Test: Reflection vs IronPython Randall Sutton was using reflection to apply rules to an object when he realised he could do it with IronPython, but he was worried about performance. He wrote a quick test to compare the performance and was surprised by the results. The first run was very expensive for IronPython, but from there on in IronPython was much faster than C#. Without expending any effort actually working it out, my guess is that because IronPython uses reflection so heavily it caches the reflection lookups - and it is this caching that is giving it the performance benefit. Reflection on .NET is not fast, by any stretch of the imagination, and improving the performance of reflection would make a big difference to speeding up DLR languages. The Silverlight Toolkit and the Dynamic Language Console The Silverlight Toolkit is an open source project by Microsoft ...

OS Jam at Google London: C# 4 and the DLR

Image
Jon Skeet, author of the well regarded C# in depth , did a five minute talk on C# 4.0 and the Dynamic Language Runtime at a recent Google Open Source Jam in London. The 'innovative' slides are online, and they touch on details like the dynamic keyword, binders and IDynamicMetaObjectProvider . OS Jam at Google London: C# 4 and the DLR The fundamental point of the DLR is to handle call sites - decide what to do dynamically with little bits of code. Oh, and do it quickly. That's what the caches are for. They're really clever - particularly the L0 cache which compiles rules (about the context in which a particular decision is valid) into IL via dynamic methods. Awesome stuff. I'm sure the DLR does many other snazzy things, but this feels like it's the core part of it. At execution time, the relevant binder is used to work out what a call site should actually do. Unless, that is, the call has a target which implements the shadowy IDynamicMetaObjectProvider interfa...

New JavaScript Implementation for the DLR

The Dynamic Language Runtime was announced at the same time as Silverlight. Along with IronPython and IronRuby a third, Silverlight only, language was announced that ran on the DLR. This language was Managed JScript, an ECMA compliant version of Javascript that was touted as an easy way to port AJAX applications to run on Silverlight. Unfortunately as IronPython and the DLR developed Managed JScript stagnated. It was only ever released as binaries and hasn't been kept up to date with recent versions of the DLR. Someone called it the Bastard, red-headed step-child in the DLR . However, there is now an alternative implementation of JavaScript for the DLR: RemObjects Script for .NET: The free scripting engine for .NET RemObjects Script for .NET is an embeddable engine for .NET applications that allows developers to let their users introduce written scripts that influence the behavior of the application. The RemObjects Script engine is built in a language-agnostic way, so that differen...

Two New Releases: DLR 0.9.1 and IronPython 2.6 Beta ASP.NET Integration

To go with the four releases of IronPython and IronRuby are two more new releases: Dynamic Language Runtime 0.9.1 0.91 Release Notes A new source release of the DLR. This includes the Sympl sample language and can be built with Visual Studio 2008: This release has several design cleanups and final calls for the bits we’re shipping in CLR 4.0. This release is also consistent with Visual Studio’s Beta1 release in that these sources (with namespace tweaks) were used for parts of CLR 4.0. Documents have all been updated, and there is a new walkthrough document for an example language implementation on the DLR. The language, Sympl, has a C# and an IronPython implementation in the source tree, along with some example code written in Sympl. There are many one-off examples for Expression Trees node types that are in the DLR source tree now. ASP.NET Dynamic Languages Support Release Notes This is an updated release for using IronPython with ASP.NET and is compatible with the recent IronPython...

A Good Mix 6: Databases, the DLR and Programming Languages

Another selection of blog entries and articles on IronPython culled from the last few weeks. FBConsole 0.8.2 Released I last reported on FBConsole in August 2007, when version 0.7.2 was released . FBConsole is a "Firebird RDBMS Tool Powered by IronPython" (a Python console for the Firebird database ). This new release ( via ) is built with IronPython 2.0. Configuring the DLR for IronPython and IronRuby Another blog entry in Japanese. It is useful though as it shows you the ScriptRuntime configuration ( app.config ) needed for hosting both IronPython and IronRuby in a single application. Useful if you are using the DLR to provide user scripting and want to give your users a choice of languages to use. Cobra Programming Language April Update Another update, with accompanying release , for the Cobra Programming Language . Cobra is a .NET programming language with both dynamic and static binding, a Python inspired syntax and first class support for unit tests and contracts. As...

New Sample: Writing a DLR Language in C# or IronPython

As well as being the basis for language implementations like IronRuby and IronPython the Dynamic Language Runtime is intended to be a framework making it easy for YOU to implement a dynamic language that runs on .NET and Mono. So far there hasn't been a rush of languages using the DLR. The only ones I'm aware of are: IronScheme (at 1.0 Beta 3a released May 2nd 2009) Groovy DLR (at 1.0 Beta 4 released May 9th but may already be abandoned - see my previous blog entry ) Nua (Lua for the DLR) (no releases and last checkin July 2007 - so looks dead) DLR Basic (no releases and last checkin November 2008) IronSmalltalk (at version 0.1 with last checkin October 2008) IronLogo (at version 0.0.1 with last checkin January 2008) Managed JScript (Javascript) - developed by Microsoft and only ever released as Silverlight binaries. The future of Managed JScript is very unclear. Python, Ruby, Javascript (Managed JScript), Scheme, Groovy, Lua, Smalltalk, Basic and Logo would be an impre...

Groovy: A New Language on the DLR?

There was an interesting new release on a codeplex project a few days ago: Groovy DLR 1.0 Beta 4 Released Groovy is an " agile dynamic language for the Java Virtual Machine ", with Java inspired syntax and capabilities but with additional dynamic features " inspired by languages like Python, Ruby and Smalltalk ". Groovy has a Rails inspired web framework called Grails and aims to be the " JVM's defacto dynamic language ", but faces stiff competition from both JRuby and Jython . So if Groovy is a JVM language, what is it doing on .NET and the Dynamic Language Runtime? Groovy DLR is the brainchild of Gavin Grover . His website says: Groovy/DLR Recently, Gavin Grover began adding the Groovy Language to Microsoft's dynamic language runtime . He's focusing on creating a full-featured syntactic skin using combinator parsers because that's what's most lacking in (J)Groovy. Groovy's syntax is the next generation in the C language famil...

Writing your own programming language with the DLR

Benjamin Nitschke's has written a couple of posts on writing your own programming language with the Dynamic Language Runtime. The first is a long list of links and resources on the DLR and the tools (like the ANTLR parser) used in creating a programming language. The second is a very long entry comparing the performance of code written in various ways - including on top of the DLR. Writing your own programming language with the DLR I will also try to post some useful links about my recent DLR (Dynamic Language Runtime for .NET) research. I have been working a bit on the DLR before, mostly together with Silverlight, which was cool, but Silverlight was way too hard to work with and I still think it is not distributed enough. And even before that quite a bit with the Visual Studio SDK, early IronPython versions and other language implementations in .NET and even with native c code (but usually I just modified existing samples). I have also modified Lua for my own needs recently and m...

The Fundamentals of the Dynamic Language Runtime (DLR)

From the Microsoft web library, six videos (with full transcript) on the Dynamic Language Runtime. The Fundamentals of the DLR The videos are presented by Nancy Strickland from IT Mentors. After a general introduction to dynamic languages in the DLR, I’ll talk about what you have to download and install in order to use dynamic languages with .NET. Then, we’ll look at two of the new .NET Dynamic Languages, IronPython and IronRuby and we’ll work with some of the basic syntax using the command line interface. Then we’ll talk about the role of dynamic languages in Silverlight and we’ll use three tools for creating, editing and testing web applications that use dynamic languages: Chiron, the DLR console and Visual Studio 2008. The six sessions are: Introduction and installation Command line IronPython and IronRuby Silverlight Silverlight with Chiron demo DLR Languages in Visual Studio Visual Studio Silverlight Projects demo

Another Awesome Collection - IronPython Links

A selection of IronPython and Dynamic Language Runtime related web pages and blog entries. Getting Started with IronPython John Cook makes a start with IronPython. This means using one of the three distributions available from the Codeplex homepage: the source code, the prebuilt binaries or the msi installer. IronPython is a One Way Gate Having got started John Cook is disappointed that he can't use Python C extensions from IronPython, and finds it hard to call into IronPython from C#. The answer to the latter problem is to use the IronPython hosting API , and John Cook has written another blog post on the former problem which will get an IronPython-URLs entry all of its own. NaroCAD to have support for IronPython 2.0! This seems like an exciting announcement, but is short on links to find further information. The upshot is that NaroCAD has, or will shortly have, support for scripting it with IronPython 2 and possible IronRuby as well: This means that with minimal change right now...

YAAS 2 (Another Yet Another Awesome Selection)

Another blog entry accreted from only the finest selection of IronPython related blog postings from the last few weeks: A Simple DLR Binder This entry is notable because Dino Viehland (core IronPython developer) has finally written another blog post! This post is on writing DLR binders, a core part of creating dynamic languages that use the Dynamic Language Runtime. DLR binders define the semantics of your language, and Dino explains them along with some C# example code implementing integer addition: There’s a few key pieces you need to understand here. First you’re returning an expression tree back to the DLR to tell the DLR what to do. The DLR will compile this expression tree and run it. You’re also returning a set of restrictions. These will be evaluated by the DLR to see if it can re-use the same code for other objects in the future. You’re unlimited in what you can do with restrictions as they can be arbitrary Expression trees. But here I’m simply restricting based upon th...

IronScheme 1.0 Beta 2 Released

There are three Microsoft developed languages that use the Dynamic Language Runtime: IronRuby, IronPython and a closed source language that only runs on Silverlight - Managed JScript. IronScheme is a 'community-developed' language that also runs on .NET through the DLR. IronScheme includes a Visual Studio plugin (for VS 2008 SP1) and IronScheme 1.0 Beta 2 has just been released. IronScheme aims to be a R6RS conforming Scheme implementation. IronScheme Homepage 1.0 Beta 2 Release Notes New in the 1.0 Beta 2 release: Added a new LINQ library (ironscheme linq2) which implements all methods found under System.Linq.Enumerable. The new version also uses deferred execution Added a few more libraries Added (ironscheme unsafe) library Many bug fixes Added P/Invoke functionality, and a small FFI layer Many compiler optimizations added (TCE, lambda body hoisting, assignment elimination), more coming for beta 3! Rewrote fixnums and flonums in Scheme. Uses unsafe features. Memory optimizati...

Expression evaluator in 15 minutes with Irony & Dlr

One use for IronPython in .NET applications is as an embedded engine for expression evaluation: Expression evaluator in 15 minutes with Irony & Dlr 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. However it is still a good excercise to evaluate a string expression, say 2+(4*5)^12. But fortunately there are some new tools that facilitate producing language parsers and their interpreters/compilers. Piter has used the DLR, along with a C# parser library called Irony (which he has also used to create Script.NET ), t...

Another Selection

Another selection of blog entries and articles about IronPython and the Dynamic Language Runtime that have appeared over the last month or so. I still have a problem with the DLR A blogger called mithrandir explains the problems he has with the source code for the DLR. It basically boils down to two things: There seems to be a lot of hard coded references to the main DLR languages IronPython & IronRuby, potentially making it hard to implement other languages. There are a lot of compiler directives (#ifdefs) for the Silverlight version Bill Chiles (DLR PM) responds to this (particularly the first point) in the comments, so it really boils down to mithrandrir not liking compiler directives... Hosting IronPython 2.0 What looks like a great article on hosting IronPython 2.0 from C#, explaining the core classes and replete with diagrams and code examples. Unfortunately (for me) the article is in Chinese - although as usual the code examples are easy to follow. For those who only speak ...

Combining Dynamic Languages and Static Languages

The UK MSDN Flash developer newsletter features an article on the Dynamic Language Runtime by Mark Bloodworth : Combining Dynamic Languages and Static Languages Traditionally, there has been tension between dynamic languages and static languages. Each language has its distinct strengths and weaknesses, which means a choice: constrain yourself to one language or face the pain of language interoperability. The Dynamic Language Runtime (DLR) solves this problem. The Common Language Runtime (CLR) provides a unified platform for statically typed languages. The DLR extends the CLR to provide a unified platform for dynamic languages on the .NET platform. This means that there is a common, unified platform for static and dynamic languages. By having one platform, which means one object world, the pain of language interoperability is history. In addition to dynamic languages such as IronPython and IronRuby , C# and VB will also, in the 4.0 release of the .NET platform, be able to ta...

A New Year Selection

Another selection of interesting links related to IronPython and the Dynamic Language Runtime. Encoding Name Normalization in Python Notable in that this is the first blog entry in a long while from Seo Sanghyeon, maintainer of FePy the community distribution of IronPython. The blog entry focuses on the differences between how CPython (the reference implementation) and IronPython do encoding name normalisation in the codecs module. So Python normalizes encoding names received from codecs.lookup. How exactly this is done isn't really specified. But did you know that the following code work with CPython? (I don't recommend this!!!) import codecs codecs.lookup('utf!!!8') Yes, those are three exclamation marks. I'm not kidding... Jimmy Hacking (at) Microsoft Jimmy Schementi is part of the dynamic languages team at Microsoft and maintains the integration with Silverlight. This blog entry is really a presentation that he gave in December, but it has lots of interesting ...

End of Year Selection

A few months ago I got behind on posting interesting IronPython related links. I've caught up a lot, but a whole bunch of interesting stuff happened in November and December that I haven't reported yet. Some of that will have to wait for another day, but we'll end the year with a selection of some of the snippets from the last couple of months. IronPython Cookbook A couple of new recipes in the IronPython Cookbook , by Davy Mitchell and Atif Aziz: Process Monitor - demonstrates how to write a small utility in IronPython that monitors a process and re-launches it if it dies. How to Play a Wav - this short example plays a WAV format sound file using System.Media.SoundPlayer . Speech Synthesis in IronPython Another short example of how to use IronPython to make your computer speak like a robot: Speech Synthesis in IronPython Other Assortments IronPython in Bazaar - an import of the IronPython sources onto launchpad. Useful if you want to use a DVCS (Distributed Version Co...

C# Becomes a Dynamic Language...

This post is a bit late - in fact this news was announced several months ago at this year's Microsoft Professional Developer's Conference . At the PDC the Dynamic Language Runtime was demonstrated - along with the news that it will be part of .NET 4.0. Both Visual Basic 10 and C# 4.0 will have dynamic elements that make use of the Dynamic Language Runtime. In a blog entry after the conference Jim Hugunin links to Channel 9 videos of his talk on the DLR and Anders Hejlsberg's talk on the way C# is changing. Dynamic Language Runtime Talk at PDC C# 4 will allow you to use objects dynamically through a new static declaration. A new keyword that allows you to statically declare dynamic objects! Objects that are declared as dynamic will have operations on them (attribute lookups, method calling, indexing, numerical operations and so on) done through the DLR. The intarwebz were awash with the news. Here is a selection of the most interesting and informative responses that I foun...