views:

326

answers:

5

Has anything useful come out of Intentional or "Language Oriented" Programming?

This isn't a rhetorical question. I'm looking for people who've tried these tools (ie. representing programs in some "higher level" format than mere text and using different editors for different domain specific subsets) and have some comments about how it was, Or recommendations for good tools.

( http://www.onboard.jetbrains.com/is1/articles/04/10/lop/ , http://stackoverflow.com/questions/201386/what-exactly-is-intentional-programming )

+3  A: 

One very useful usage it to make test cases clearer, not only for the business analyst but for yourself/your team.

When time passes and you've forgotten what the exact test case was all about, having LOP is very helpful. You can have the spec at hand, and even document the rules in source code comments, but those artifacts don't get executed. Code is!

You can also make the program very clear, but more clearer than a "language oriented" description would be almost impossible.

Consider this fictional fragment.

NOTE Is not that java is LOP but there are some frameworks that whose intention is to do something like the following, that is, make a test case easier to follow.

package a;
import static a.Help.*;

public class Test { 

    public void test(){
        Object value = "";
        Object obtained = "";
        assert that( expected( value , isEqualTo( obtained ) ) );
    }
}

This is a very simple example. The value in this code is the line that gets executed says what the test is all about:

            assert that( expected( value , isEqualTo( obtained ) ) );

That is very clear, it reads:

assert that expected value is equal to obtained

Well this is very simple. But you can have any kind of business rule an just read it literally.

assert client mortgage is processed when it reach... etc. etc

Martin Fowler explains about this and mention Hamcrest a framework to do this.

Here's the link ( I'm not completely sure if this where he talks about Hamcrest or is it another one :P sorry )

OscarRyz
A: 

I'm not sure if this is what you're asking about, but having tried AppleScript a few times I was really frustrated with it. In English, there are so many ways to express something that I found it really difficult to remember the syntax for even basic constructs.

I think that good programming languages feel natural, but still like you're constrained to a structure.

Kevin Davis
A: 

read Symonyi

Ric Tokyo
+2  A: 

The term "mere text" makes me want to butt in here.

A language is a system of symbols with syntax, semantics, and meaning. It can take the form of keyboard clicks, mouse clicks, auditory signals, or any modality capable of carrying information.

Its suitability is not a function of its mode of transmission, but of the directness with which it maps onto the mental concepts it is being used to express.

A simple measure of that directness is discovered when you change your mind: how hard is it to change the "code" without introducing a "bug"?

Take a look at this.

ADDED: Having just looked at the Simonyi stuff, maybe I can give an opinion of what's useful about it.

On the negative side, I'm not impressed with the emphasis on WYSIWYG and non-coders being able to build apps. People love pixels, especially colored moving pixels, especially if they are in California. Surely something can be done in toy domains, but as soon as you want to do your problem, you'll be disappointed. This is an AI problem, and it is worthwhile to work toward it. It is dishonest to claim to be near achieving it.

On the positive side, I wrote a book, where I talked about the Linguistic Method that sounds a lot like Language Oriented Programming. I like to base things on theory, so I based my approach loosely on Algorithmic Information Theory. That may sound scary, but it's basically about how to approach the most compact (but still meaningful) representation for units of information, and that includes programs.

I took a tangent from that. Rather than look for compact programs (which are good) I looked for the most compact stream of edits going from human brain through fingers/eyes to computer. That encompasses not only the writing of programs, but their maintenance through a lifetime of requirements changes.

I came up with the idea that basically if you seek to minimize the maintenance edit stream you necessarily improve the language to the point where it could well be called domain-specific. This is worth doing aggressively and being willing to swim against the tide of what is popular, because what is popular is holding us back.

I gave a number of examples, and I continue to give them, but they are all practical first, and pretty second. They are ways to get specific jobs done, but they are not good at starting one of the flashy bandwagons that programmers seem to hunger for so much.

So I didn't really intend to toot my horn, because that's a waste of time, but maybe I've given a bit of a reason why Language Oriented Programming, as I see it, will be a useful thing.

Mike Dunlavey
Mike. I personally agree with you re: "mere text". But that *is* what the intentional crowd are saying. I'm sceptical, but I want to know if it's working for anyone.
interstar
@interstar: Something works for me, and I tried to put it in a book, and since things seem to need names, I called it the "Linguistic Method". That said, I'm wary of bandwagons.
Mike Dunlavey
@interstar: OK, I just read up on the Simonyi stuff. It's along the lines of what I recommended, but 1) minus the theory, 2) plus a lot of Silicon-Valley vaporware hype.
Mike Dunlavey
A: 

This is just the futur

With hight level programming language, we have seen fairly smart (but psychorigid intolerant like me) guys starting to code interesting tools because they have been able to focus on the what, and not the how in programming.

With HTML, we have seen basic but massive communication becoming available to anyone with a bit of formal logic.

With CMS, we have seen human resource managers been able to build a reasonably usable intranet quickly, and at low cost.

With mashup, we have seen imaginative amateurs creating incredible services including data crossing, geonetworking, etc, while not having 1/100000 of the Microsoft budget.

Every time you remove difficulties, you open a new door for people that have not you abilities, but have others. You make your experience and their summing up.

Tomorrow, we will see Ms and Mr Everybody coding, without knowing it, some crazy cool stuff because they need of see it this way. Stuff you would never have done, because you are not them.

Now this is true we are VERY FAR from it, because the tools are not good enough. But we are getting closer every year, and I bet you we will see some improvement with the incoming semantic Web ;-) The next step could be advanced search in natural language, or something like the Ubiquity project. And then who knows ?

Eventually, I agree with you : for now, they are not really useful. Automatically generated GUI are not so good (quite usefully for prototyping or small apps, but not good when you want to "be in business"), natural programming is, well, let's say limited... But thing about what you could do with a computer 20 years ago (mine was not even in black and white, but black and GREEN), and you'll understand how promising it is.

e-satis