Title Image

Don Xml's Grok This

The home of Don Demsak
Welcome to Don Xml's Grok This Sign in | Help
in Search

This Blog

Syndication

Site Sponsors

DonXml's All Things Techie

VBx Announced at Mix - Replacement For VBA?

If you happen to have seen any of my Intro to LINQ - Reinventing Visual Basic talks, you wouldn't be that surprised by "semi-announcement" of VBx.  Paul Vick and Amanda Silver have the details that have been released to the public, and there is also a mention of VBx in this Silverlight poster.  Paul Vick has a number of features that they would like to support in post-Orcas, but the one that should sound familiar to one of my rants in my VB LINQ talk is:

Visual Basic should become a hostable language that can be easily used to do application scripting, akin to what you could do with VBScript and VBA. Furthermore, this hostable language engine should be fully portable to all platforms supported by the CLR, including all platforms supported by Silverlight (such as client-side scripting in the browser on a Mac...).

I'm looking for a little bit more than just a replacement for VBA.  I'd like to be able to extend the VB compiler with some of my own language constructs.  My idea is to allow framework developers (developers who build components/object models/LINQ enabled libraries) the ability to enhance support for their domain specific languages.  The example I give in my LINQ session is that of a framework developer that writes an Extension Method called Play that is to be used against the Windows Media Player object model.  In a perfect world, if you wanted to query your Windows Media Player library and play the meda that is returned from your query, they code should be as simple as

From My.WindowsMediaLibrary

Where UserRating > 3

Play

But, Play is not a keyword in Visual Basic, so the compiler does not know that it is really just shorthand to call the Play extension method (assuming that the Play extension method is in scope).  So, if you went out and created your own Play extension method, a person wishing to use it would have to write this nasty looking code:

MediaCollection.Play( _
MediaCollection.Where(My.WindowsMediaLibrary, _
Function (media As Media) CInt(media.getItemInfo("UserRating")) < 38 )

The idea that I'm trying to promote is to create a language so simple that my mom could write it.  IMHO, that is the essence of VBA, a language that even a non-coder can read and write.  The language construct of context, filter, action, is one that most people can write, with little effort, and is perfect for the VBA crowd.  Plus it is easy to create intellisense for them, if we start with the context.

Published Monday, May 07, 2007 2:55 PM by donxml
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Dave said:

John and Jim threw out the VBx as replacement to VBA as a scenario when they were talking about which languages to initially port to the DLR at their MIX07 talk. If the DLR supports the full metaprogramming facilities to enable a full Ruby on Rails port (or just plain running the code as is), we'll be able to have really wild "Internal DSLs." In Ruby it's possible to change operators so you could decide for this particular DSL you want that the "=" operator would be expressed as "is". As the DLR provides the backbone for any dynamic language I'd suspect that this will be across the board, VBx included. Our world's about to get very, very weird (and, by extension, interesting)!
May 7, 2007 2:33 PM

Leave a Comment

(required) 
(optional)
(required) 
Submit

About donxml

I’m an independent consultant, specializing in .Net solutions architecture, based out of New Jersey who also doubles as an evangelist for XML, Domain Driven Design, enterprise architecture and .Net. I do not work for Microsoft, the W3C or any other big company that you may know of (at least not yet). I’ve been an indie for over ten years, and although I’ve been tempted a couple times to take a job with companies like Microsoft, I’ve haven’t found something better than my current situation. I work mostly with the large pharmaceuticals that are based here in New Jersey, and usually find myself on long term contracts. Definitely not the prototypical indie consultant, but it lets me dedicate time to my non-income generating activities like the developer community stuff, plus financing open source projects like XPathmania and MVP-XML. If you would like to talk to me about doing some contract work, just contact me via the contact page. My rates vary widely, depending on lots of different variables, but mostly distance from Jersey, and type of work. Plus, I’ve been known to donate some of my code for various projects.
Powered by Community Server, by Telligent Systems