software development for the
existentially challenged
Older | Newer Older | Newer
Intellij MPS: Language Oriented Programming
comment share
I haven't actually tried Intellij's Meta Programming System yet, so it's really lame to say anything about it. I will anyhow.

Developing, I always see skew, confusion, and suffering because of the yawning gaps between business analysis and actual software. Eric Evan's excellent Domain Driven Design is all about this: how to approach modeling and creating applications that accurately represent their domains. My understanding is that this means the business model and the code do not represent the same thing in two fundamentally different ways. I've personally never felt I've ever satisfactorily closed the gap with anything I've worked on.

DDD talks about "Ubiquitous Language", which is developed collaboratively by domain experts and programmers. When a domain is captured using language that everyone agrees on, it becomes possible to have a consistent view. Changes to the model and the code are made through the language, providing a common model for experts, analysts and coders.

I was really excited when I read a paper Sergey Dmitriev wrote a few years ago on Language Oriented Programming. Intellij was going to create an application to build custom languages. To my naive mind, this seemed like a perfect idea: build the programming language as the ubiquitous language. When you change the ubiquitous you change your programming language and hence your model and your application. You unify everything in your development effort.

When I saw the first beta of MPS, I have to admit, I had a serious WTF? It looked strange and obscure and very bottom up. To create a custom language, you really were creating a language, using this "create a language" language. It was a very linguistic sort of thinking. It looked... hard. How could this be a fluid part of the process?

Basically I got confused and gave up.

Grabbing the latest Idea (8.1.2), I downloaded the latest Beta 3 of MPS. I'm really pleased that the application has continued to develop. For a long time the effort appeared to have stalled out. It's a polished looking app, which looks very much like... Idea! I actually laughed when I saw the Quick Start screen:

I'll admit, when I fired it up and created some kind of a root node stub, I saw the language and gasped again. It looked obscure and strange.

This is pure ignorance on my part. I haven't actually read anything yet, or looked at the tutorials, but at least I've taken the first step, which is to admit cluelessness.

My qualm about MPS in advance is this: groovy/python/ruby type and the ilk have shown that dynamic languages provide very powerful tools for creating domain specific languages very easily. Further, the builder pattern in groovy, is simply beautiful. It strips down tasks to terse declarations with a minimum of ceremony.

In advance of ACTUALLY TRYING OR DOING anything, I suspect that I'll still like the dynamic language approach better for its quickness and ease of "sketching." Working with MPS appears to have a lot of ceremony. Does it give you more power? Dunno yet.

In any case, I'm checking it out.

Links:
Recent interview with Sergey Dmitriev
Groovy Wiki page on DSLs

0 comments:

Post a Comment

What is this site?!

t (a professional software developer for a big company) writes about software development and stuff. Unix, Java, Groovy, OS X, and lots of open source libraries and tools.