Guest Blogger Erik Meijer

As you may have noticed Erik Meijer has been guest blogging here about his recent work on Microsoft's LINQ.

I am extremely pleased to have Erik guest blog here. I've been after him for a couple of years now to come join us.

Erik's many interests and contributions are chronicled on his home page, but I want to take this opportunity to remind everyone of the paper Functional Programming with Bananas, Lenses, Envelopes, and Barbed Wire by Erik, Maarten Fokkinga, and Ross Paterson (FPCA'91). This foundational paper is one of our favorites, and I urge those interested in grasping what functional programming is all about to go and read it. Hopefully, a more accessible version, titled Bananas in VB, is forthcoming...

We invite Guest Bloggers so that the LtU community can engage them in discussion about their work and opinions. I am sure the discussion with Erik can be enlightening for us all.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

VB Goes Bananas

I'm curious about the LINQ implementation, and my curiosity is especially picqued by mention of HaskellDB and monads as sources of inspiration.

A difference between Haskell and VB is that in Haskell, HaskellDB can be written as a library - it embeds a relational query language into Haskell using monadic combinators - whereas in VB the "host" language must itself be extended in order to provide such features.

Are the mechanisms used to add LINQ to VB accessible to VB programmers, and could they be used to extend the language in other interesting ways?

Monad and Query Comprehensions In Visual Basic

Query comprehensions in Visual Basic are really very similar to Haskell's monad (or list) comprehensions.

It is special syntactic sugar that get's compiled to some fixed underlying operations.

The difference is that in Haskell you can express the types (but not the required monad laws) in the type system, whereas the VB type system is not (yet) powerfull enough to do that. That is why we talk about the query operators pattern.

However, just like in Haskell, in VB you can also directly call the underlying operations.

Hope this helps,

Visual Bananas Studio

Having experience with evolving language features while at the same time responsible for the only IDE for the PL, I would be very interested to learn how the fact that Microsoft has to provide the IDE support for all the language features affected design choices ("no, no, we cannot afford this nice feature, just think about rewriting our code-completion").

I guess I need to rephrase this sentence using comprehensions :-)

Just Curious

Is there any special reason for the Google logo on the bottom of Erik's home page? Is is just because of Mondrian?


"I worked on advanced scripting languages such as Haskell..."

Guess scripting will never have the same meaning again! But then, what to expect after a bunch of bananas?... :)

Interesting blog, btw. Yet, i don't think i'm willing to touch Basic code again just to have access to things other languages have had for ages. Still, way to go for the huge masses of VB programmers. Well, if only they are able to follow it...

For what it's worth...

Intuitively, when people say "scripting language" they usually mean "a language that requires a runtime written in some other language".

Requiring GC can do that to you, for example. (Sadly though, I can't say anything productive about Haskell in this case.)


schluehk: "is a usage pattern not an intrinsic property of a language"

Yes, i agree. And i'm aware that Haskell conciseness has got a lot of people using it to do "scripting" tasks generally reserved for the likes of awk, perl or tcl.

tkatchev: "a language that requires a runtime written in some other language"

Like Java? Frankly, no, i don't believe a VM, specially sophisticated ones like the jitted java hotspot, are what characterize "scripting".

btw, i was just poking some fun in the first place...

C is a scripting language

"Scripting" is a usage pattern not an intrinsic property of a language. If you want C for doing "scripting" you can install a C interpreter and run C-scripts on the top.

Three main classes of PL usage come to my mind: "systems programming", "application programming" and "scripting". Those distinctions are quite relevant at least for the german law where only "systems programming" is considered to be an "engineering-like" activity. In the late '90s some freelancing IT consultants had severe problems with their legal status because they could not prove being "enigneer-like". This has been softened in the last couple of years - maybe after introducing the "softare-engineering" buzz? Since then I call myself a "software-engineer" - at least in the income tax form.