So here's the thing. No one really knows what 4GL (4th Generation Language) is, even though everybody wants to develop in it. That's because everybody also realized that object-oriented technology by itself didn't really turn out to be the silver bullet to make programming fast & easy.
A quick recap:
1GL = machine language (starting from punch cards)
2GL = Assembler language (symbolic machine language)
Then depending on who you ask, either
3GL = Functional, object-oriented languages
or 3GL = Functional languages
and 4GL = Object-oriented languages
Given that the basics of object-oriented programming were developed at roughly the same time as the basics of functional programming and that a method call is just a function call with one additional parameter (a reference to the object itself), I would be more inclined to say object-oriented programming is just a 3GL language. Only it has better packaging of functionalities than functional languages.
Ask any programmer now, and at least all the good ones will say that object-oriented programming is the best and most productive way of programming now on the market. Although they will likely also tell you that it's still not a picnic. Ask them how to to make it better, and they don't have any idea.
I've always been saying that while learning multiple programming languages is easy because the concepts stay more or less the same, actual programming is just inherently laborious and tedious. It's not the big things that are difficult, but the small things, like taking care of all the exceptions, error handling, fail recovery and generally making the code robust enough to expect the unexpected.
Sure, design patters, unit testing, IDEs with code completion, increasing number of available frameworks, components etc. make things easier, but many times you still end up solving the same problem over and over again.
One problem is that the more complex and the greater amount of concepts you try to replace with simpler language concepts the bigger your language tends to get. And if you don't extend the language itself, but write code frameworks (which arguably is a better way), you need to know them as well. Consider an elegant language like Smalltalk, which only has five reserved words. Pretty easy to remember them, huh? But can you do anything with Smalltalk if you are not familiar with its foundation classes? No. Believe me, it's a bitch to trace down through fifteen subsequent method calls to find out what one badly named method actually does.
One answer is domain-specific languages. Create a specific language for well-defined, stable domain and you can make your language support concepts at much higher levels of abstraction without the burden of concepts you don't actually need. It's great for the programmer as well, since you have less possibilities to make mistakes :) I've worked with domain-specific languages and code generation in the past, so I know the approach works. In some cases really really well too. Only the problem is that it works in just those limited, well defined domains. What if you don't have the domain, or your domain is still quickly evolving? The task to maintain a DSL will quickly become more laborious than the actual development with the DSL.
So, I try to think out of the box. Functional and object-oriented languages really revolutionized programming, as did assembler programming to machine language programming. Can there be anything new anymore? Many say that components and component-based development is programming in 4GL. But aren't they just mature objects with well-defined, stable interfaces?
Often new inventions have been made by studying nature. Nature has already had billions of years to think things through. Could we do that again? Functional languages imitates machines with functionality broken down to smaller pieces and objects have their ideals in real-life objects that provide different functionalities. But what do living beings do that their counter-part code objects don't? They perceive, think and evolve. Could it be that the next step of programming evolution after object-oriented programming is Creature Programming? (See I even have a catchy name :)
Creature Programming, as I envision it, is based on three fundamentals:
- Means of perception
- Ability to memorize events
- Ability to dynamically change your own behaviour
If you think about it, we already have much of the elements needed for Creature Programming in place, much the same way as we had for object-oriented programming before actual object-oriented programming.
JIT compilers today can already change the behaviour of an object run-time. Granted, it's pretty limited and there's no way for you to tell it to optimize differently, but it's something. But what if you as the programmer could teach your creature how to do things?
Also, lines between compiled and interpreted languages start to become more and more blurred. Fairly well-developed languages, such as Java, support introspection and dynamic method invocation. You can include scripting engines, such as Rhino inside your Java-application and write your Java-application in scripting language.
Objects can already listen and react to events, but their perception is fairly limited. They don't see, feel or hear anything in the world they are live in. What is the world they live in? What kind of means of perception they would need to observe it? They also don't remember anything they just did, and thus cannot evolve to do the same thing better next time. Many AI implementations are based on state machines reacting to various events, but you need to carefully create those events that you want to system to respond. If the objects had better means of perception and ways of trying out different reactions we wouldn't need to create so many specific events for different situations.
Objects would need memory to become creatures that could evolve. The creature could work in two different modes, in "practising" mode, where it could track its performance and verify it did the task right and in "automated" mode where it would execute the task the best way it found to get accepted result with minimum amount of work. Isn't that the same thing you do when you practice your golf swing or optimize your commuting route?
What would programming the creatures be like? Probably you wouldn't like to write code to tell the creature exactly what to do, but it would be more like teaching or interactive question and answer session.
One problem though. How does the creature know what is the best way of doing something? What motivates the creature to do things? Wouldn't the creature need a mission, to hold everything together? We need a mission too, our purpose to exist and to live on. While some days your conscious self can feel like you don't have a direction, that life is just not worth living, we all have built-in mechanisms to just hang on to life, to grow and to breed. On those days, it's very handy.
Is this more like AI I hear you say. Isn't it terribly hard to do? But no, I'm envisioning only little things, only very dumb creatures that you can teach to do small tasks. This looks like something I could try out, build prototypes of it and in general make my hobby. I'm happily leaving somebody brighter than me to envision AI programming in 5GL :)
All for now about this topic, I'll keep you posted if and when I have something real to show. I probably still need to clean this entry a bit over the next few days and add some URLs.