But beside this breakthrough idea, the language oriented programming concepts and its implementation may also revolutionize the development of existing programming languages and typical applications. It all begins with dropping code representation based on text and basing all development on direct changes to the abstract syntax tree. However, manual editing of the AST would not be very user-friendly, so it is done by a projection. In essence, the AST is projected into some editable representation (text-like most often) that interprets any changes made and updates the AST accordingly. So the AST is the single, unambiguous form being edited and the representation is derivative, not the other way around as in current state of art.
After playing with Jetbrains MPS and reading some blogs, I am very much enthusiastic about this concept:
- The projectional editor will make error checking and code completion instantaneous. It can also make typing faster after some practice if you are not a text maniac and believe it. I have to admit it takes some time to get used to and can be un-intuitive. BUT: the style wars will be gone forever (every developer may create their own looks for the language), and any developer will be able to use any style or representation they like.
- Implementation of any language is made much simpler, I would argue. Instead of writing a compiler from scratch, as it is done now, using a language workbench abstracts away all the boring work (like writing a look-ahead buffer for parsing). In an ideal world, this would become a standardized way of creating any language and all programmers would unite and cherish each other! As you can see, this is a second fact, along the lack of style wars, that Language Oriented Programming strives for world peace.
- Implementing some new features in a language becomes way simpler. No more backward compatibility issues, no more careful and hard work of hunting all the edge cases with interaction with existing features. The new features becomes just an extension to a language, integrating seamlessly with the language it wraps. Getting it involves just downloading a module from web repository after some other team member starts using the fancy feature in his code. All typical human programmers can create any syntactic sugar they like.
- The version control becomes intelligent. No more text comparing and trying to deduce logical changes from it. The version control system would be an integral part of the project being developed, seeing all changes ever made. A commit would become just a grouping of some changes. Even more importantly, changes could be automatically grouped based on logical, higher level differences, like creation of a new class, renaming a method and all references. Reordering the class members could be made transparent to the users, presenting no changes. Viewing changes of other team members would be easier and merge conflicts would be simpler to resolve.
Unfortunately, although via those features, creating code and collaborating would become easier, other aspects of software development remain mostly unchanged, like testing and debugging. And they are the causes making programming hard in general. This is mostly another topic, but Jonathan Edwards has some very interesting (and controversial) ideas about how to start programming profession from scratch.