Posts

Showing posts with the label dsl

IronPython and data binding plus the PyBinding markup extension

XAML is a markup language used to describe user interfaces for the Windows Presentation Foundation (WPF) UI library. PyBinding is a library created by Pixel-in-Gene allowing you to use IronPython for custom expressions in data binding situations: " essentially a DSL for creating Bindings ". A second blog entry discusses a detail of the WPF framework that makes this less useful than it could be in some situations. The PyBinding MarkupExtension: use Python statements for Data Binding Huge limitation of a MarkupExtension Many of us have felt the need to have custom expressions inside of Bindings. The need has ranged from applying mathematical operators to calling methods on bound objects. For simple needs you can probably create a custom IValueConverter or a IMultiValueConverter that can do the job, but when you want to use arbitrary expressions, something more elaborate is needed. The ScriptConverter class that I blogged about earlier provides the underpinning for the PyBindi...

IronPython is the new IValueConverter, IMultiValueConverter

A blog entry on using IronPython to create a DSL (Domain Specific Language) to evaluate expressions in WPF XAML (the XML used to describe user interfaces for Windows Presentation Foundation and Silverlight): IronPython is the new IValueConverter, IMultiValueConverter "Applying simple mathematical operations inside WPF DataBindings has always been a non-trivial task. By default the {Binding} or MultiBinding syntax does not allow the use of arbitrary expressions inside the Path. " "There are several cases where you would like to do a little bit of math inside of the {Binding} expressions. " "This requires the use of a converter that would do the actual mapping of values to the bounds of the Canvas. " "Ideally you would want the complete flexibility of a scripting language inside of your Binding expressions. Note however that there is a tendency to over-use / abuse a scripting functionality. That however is for the team to decide what level of sanity nee...

Mixing Static and Dynamic Languages

Kevin Hazzard presented at the Philly Code Camp about mixing DLR (Dynamic Language Runtime) based languages with statically typed languages like C#. Mixing Static and Dynamic Languages for Philly Code Camp " The gist of this presentation is that it's possible to mix the Dynamic Language Runtime (DLR) into statically-typed, early-bound languages like C# to make them much more flexible. In this talk, I demonstrated how a ShoppingCart being filled with Products can adjust discount rates based on marketing rules written in an external Domain Specific Language (DSL). In this case, my DSL was really just Python. I chose to use Python because the syntax is so simple and clean. It's so light, it doesn't get in the way. It's not a real DSL, of course, but by injecting .NET objects into a ScriptScope on a ScriptRuntime (all DLR hosting terms), the Python syntax acting on those injected types looks an awful lot like a language for managing product discounts. " Slides and...

Twining, TwyDL (IronPython DSL)

David Seruyange has been working on his IronPython database DSL Twining . Twining, TwyDL He's been using Twining to export tables to SQL and also working on the ability to generate schema objects: database(cn).create.table("Employees", [ col.ident("EmployeeID"), col.string("FirstName"), col.string("LastName"), col.numeric("Salary") ] )

A Front-end for an IronPython DSL

David Seruyange is experimenting with a windows forms front end for Twining , his IronPython DSL for working with databases: Twy, an experimental front-end for Twining

Build your Own Language and IronPython DSL Update

Two new articles: IronPython DSL for Databses Update V - Another update to David Seruyange's IronPython DSL for working with databases. His target is to end up with a DSL that lets him write "database('excel').tables('sheet1').copyto.database('mydb')". DLR - Build Your Own Language - A Bitwise article on using the Dynamic Language Runtime and the ANTLR parser to create your own language.

Twining: IronPython DSL for Database Update III - Plus Other Incidentals

MetaDeveloper continues his exploration of IronPython with an update to his DSL for working with databased: Twining: IronPython DSL for Databases Update III Unfortunately Peter Seale includes IronPython in his list of things that he won't be learning ! Mark Ramm has written an interesting entry on the JVM as a Platform for Dynamic Languages which is relevant to IronPython. An interesting debate in the comments follows. I've also found an interesting link from late last year that I don't think I've posted before: on integrating IronPython with Visual Studio 2005 .

IronPython DSL for DB Update II

Metadeveloper posts an update to his IronPython DSL for working with databases: IronPython DSL for DB Update II

IronPython DSL for ETL

David Seruyange has been experimenting with creating a Domain Specific Language for working with databases: IronPython DSL for ETL