Language-Oriented Development as a Software Engineering Method

by Ali Mohammad (amokhammad_1@edu.hse.ru)

Introduction:

For most people, coding is writing a computer program that manipulates binary bits, but according to Computer Scientists, studying Software Design, coding is a means to exchange information among different developers as clearly as possible

Traditional programming is not always suitable for the developers to provide solutions or even express them clearly because current languages take a generalized approach to help to solve problems instead of a specific approach to a particular domain, which has its own characteristics and properties, so a traditional programming language might not be the best tool for developers working in that domain.

Programmable Programming Language:

Corresponding to the idea above, a “Programmable Programming Language” term is introduced, or “Language-Oriented Programming” (LOP), which aims mainly to simulate the usage of many languages and the ability to specialize them to various situations, so that a developer may develop a new little language to handle this special situation and to express the solution as clearly as possible. It involves creating at least one Domain-Specific Language (DSL) by developers to handle the problem, which allows them to focus more on domain-specific tasks.

In 1994 Ward introduced Language-Oriented Programming (LOP) [5] to handle 4 problematic properties of large software systems: complexity, conformity, changeability and invisibility [1]. As a result, LOP takes an unconventional approach to handle these 4 problems as follows:

  • The large complexity of the system: The development process is split into two parts, writing the program in a DSL and create a compiler or interpreter for this DSL, thus the complexity of the system is reduced. and the ability to use multiple DSLs can reduce it even more.
  • The conformity to other systems: It could be done easily since DSL uses the same concepts present in systems the code should conform to.
  • Its ability to change in time: Changes could be made easily because the source code is smaller in size and the fact that the code is written in terms of the domain.
  • The invisibility of the system due to the lack of a geometrical representation is still a difficult problem but it is easier than in the traditional cases because some complexity is hidden.

A Domain-Specific Language (DSL) is a programming language designed for application in a particular field. it's done according to the life cycle[6]:

  • Domain analysis: to come up with a model that contains all information about dependencies and characteristics of the software.
  • Software design according to the analysis, which may not reserve all the regulations defined in the analysis.
  • Coding: it concerns building a library to contain the semantic notions and designing and implementing a compiler that translates DSL programs to a sequence of library calls [4].
  • Testing of DSL Prototype: Testing could be done on different levels such as ease of understanding and execution, resource management, usability, etc. so if the DSL fails in any test it should be reevaluated.
  • Deployment: after passing all the tests. but that doesn't mean that the DSL is final, it must be reevaluated, updated, and maintained frequently.

the figure on the right shows that using a general programming language (not designed specifically for the domain) to find the solution is the most time-consuming step which is reduced significantly using LOP (figure on the left) corresponding to the similarity of the domain and its DSL [2] [6].

Benefits and Drawbacks:

Doorenbos and KaushalAn [6] state both benefits and drawbacks of LOP.

Benefits:

  • The code of a software system implemented in a new language is easily portable due to the designing process, just the middle language has to be ported, then we could copy the implementation of the system without any change.
  • Well-designed DSL could be reused to handle new risen problems in the same domain.
  • The expression of problems in the language of the domain itself so that any expert of this domain can use it without asking for developers' help.
  • The reduction of the size and complexity of the system implementation if the new language was properly created. it's possible that creating a very high DSL could express problems using few lines of code.
  • Easier maintenance due to the small code base.

Drawbacks:

  • To design a good DSL, the developer will require to have a very good understanding of the subject domain and requirements of the system more so than in the traditional cases. Developers could use recursive application of DSLs, i.e use a previously developed DSL to create a new one that could help with problem management
  • users must spend some time learning the new language instead of using a familiar one. This time could be reduced (but not eliminated) when the design of the DSL is better
  • The new DSL skills are only used in the subject domain
  • For larger projects, the lack of technical experience seems to prevent domain experts from being able to program the rules
  • Since we build a new language, any support tool must be built from scratch, leading to a long development duration

Conclusion:

After all, I want to say that LOP is a progressive approach to improve flexibility and development of the software systems, especially in our time where it helps the end-users to implement their simple technical knowledge to develop the rules for the field they are working in, whatever that field was. Despite the difficulties and challenges shown by this methodology, one day it will be the methodology used by developers and programmers to reach the highest level of development of appropriate software systems for all life domains due to the ease of reading code segments between different developers and frequent DSL updates

References:

  1. F. P. Brooks. No silver bullet essence and accidents of software engineering. Computer, 20:10–19, 1986.
  2. S. Dmitriev. Language oriented programming: The next programmingparadigm. JetBrains onBoard, 1(2):1–13, 2004.
  3. A. Van Deursen and P. Klint. Domain-specific language design requiresfeature descriptions. Journal of Computing and Information Technology,10(1):1–17, 2002.
  4. A. Van Deursen, P. Klint, and J. Visser. Domain-specific languages: Anannotated bibliography. ACM Sigplan Notices, 35(6):26–36, 2000.
  5. M. P. Ward. Language-oriented programming. Software-Concepts andTools, 15(4):147–161, 1994.
  6. L. Doorenbos, A. KaushalAn Analysis of Domain Specific Languages and Language-Oriented Programming. 16th SC@RUG proceedings 2018-2019Computing Science, University of GroningenNUR-code: 980