Language-Oriented Programming as a Tool to Streamline Product Development

by Tsivinsky Petr, petsivinskii@edu.hse.ru

In today's fast-paced and competitive software industry, efficient product development is important for success. Language-oriented programming (LOP) offers a unique approach to streamline the development process by focusing on designing and utilizing domain-specific languages (DSLs). By tailoring languages to specific problem domains, LOP enables developers to express solutions more naturally, leading to increased productivity and improved software quality. The purpose of this essay is to explore the significance of language-oriented programming as a tool for streamlining product development, highlighting its benefits, challenges, and real-world references.

Language-oriented programming (LOP)[1] is a software-development paradigm where “language” is a software building block with the same status as objects, modules and components, and rather than solving problems in general-purpose programming languages, the programmer creates one or more domain-specific languages (DSLs) for the problem first, and solves the problem in those languages. It involves creating languages that are tailored to the needs of a particular domain, enabling developers to express their solutions in a more natural and concise manner.

General-purpose languages (GPLs) like Java, C++, or Python are designed to be versatile and applicable to a wide range of problem domains. In contrast, domain-specific languages (DSLs) are created specifically for a particular problem domain, providing a higher level of abstraction and expressiveness. DSLs allow developers to focus on the core concepts and requirements of the domain, leading to more efficient and effective development.

“We could use domain-specific languages (DSLS, aka 'little languages'), which are tailored to be highly productive in a specific problem domain, such as SQL for writing database queries. The strength of DSLs, domain specificity, is also their weakness, since any real-world program will involve many different domains.” – Sergey Dmitriev, JetBrains. [2].

The main differences between mainstream approach and DSL you can see on Picture 1 and Picture 2.

Picture 1. Mainstream programming with a general-purpose language

Picture 2. Language-oriented programming with domain-specific languages

In mainstream programming, most of the time spent 'programming' is really just finding ways to express natural language concepts in terms of programming level abstractions, which is difficult, not very creative, and more or less a waste of time. — Sergey Dmitriev, JetBrains. [2].

Language design plays a critical role in software development. Well-designed languages can enhance developer productivity, improve code quality, and facilitate better communication between developers and domain experts. By creating languages that align closely with the problem domain, LOP enables developers to work more effectively and efficiently.

The main problem with introducing this development method is that good language design is hard. It is a highly skilled task, requiring a good grasp of the problem domain, the system requirements, and the available options in terms of computer science technology [1].

The graph allows us to simplify the comparison of the growth of labor costs when using traditional and language-oriented approaches. As can be seen, DSL is expedient only starting from some threshold of volume and complexity of functionality of the target system.

Picture 3. Comparison of DSL with the traditional approach

LOP allows developers to work at a higher level of abstraction, focusing on the essential concepts of the problem domain. This abstraction reduces the cognitive load on developers, enabling them to write code more quickly and accurately.

DSLs in LOP act as a common language between developers and domain experts, facilitating better communication and understanding. Domain experts can directly contribute to the development process by expressing their requirements and constraints in a language they are familiar with, reducing misunderstandings and improving the accuracy of the final product.

Domain-specific languages (DSLs) provide high expressive power focused on a particular problem domain. They provide linguistic abstractions over common tasks within a domain, so that developers can concentrate on application logic rather than the accidental complexity of low- level implementation details [3].

Using DSLs instead of general-purpose languages significantly increases the level of code abstraction, which allows you to develop quickly and efficiently and create programs that are easy to understand and maintain [4][5].

LOP enables rapid prototyping by providing a more efficient means of expressing ideas and exploring different design options. By using DSLs, developers can quickly iterate on their designs, leading to faster time-to-market and increased customer satisfaction.

Just a few lines of DSL can implement very complex functions. The DSL implementation is also kept simple by containing only the necessary functions. [1]

Several real-world examples demonstrate the effectiveness of LOP in streamlining product development. JetBrains MPS (Meta Programming System), a language workbench for DSL development, allows developers to create custom languages and integrate them seamlessly into their development workflow.

With MPS you can express your domain processes and knowledge in a language that directly uses the concepts and logic from your particular field.

Picture 4. Screenshot of MPS Editor. Source: https://www.jetbrains.com/mps/

Microsoft Power Apps empowers citizen developers by providing low-code DSLs that enable them to build applications without extensive programming knowledge [6].

Adopting LOP requires developers to learn new languages and tools specific to the problem domain. This learning curve can be a challenge, especially for teams with limited resources or tight deadlines.

Integrating DSLs into existing development processes can be challenging, especially if there is a reliance on legacy systems or established workflows.

For developers to be productive with DSLs, good integrated development environments (IDEs) for these languages are essential. Over the past four decades, IDEs have slowly risen from novelty tool status to becoming a fundamental part of software engineering [8].

DSLs offer flexibility and customization, but striking the right balance between flexibility and standardization can be challenging. Too much flexibility can lead to inconsistency and decreased maintainability, while too much standardization can limit creativity and adaptability.

The computational performance of a “sloppy” DSL implementation may be low, and good optimization may be unreasonably expensive. Of course, due to the purpose of some DSLs, speed is not of fundamental importance for them (ΤΕΧ, AutoLisp). In other cases, it depends both on the implementation method and on the target compilation platform, and in many cases it is possible to achieve very good results. For example, Walid Taha describes [9] the implementation of a translator of the functionally pure FRP language by generating imperative code in C, with the help of which real-time applications were developed for the 16-bit PIC16C66 microcontroller.

Language-oriented programming offers significant advantages in streamlining product development by leveraging domain-specific languages. The benefits range from increased productivity and improved software quality to faster time-to-market and better communication between developers and domain experts. However, challenges such as the learning curve, integration, flexibility, and performance must be addressed to maximize the potential of LOP. Real-world references like JetBrains MPS, Microsoft Power Apps showcase the practical applicability of LOP in various industries. As LOP continues to evolve, it holds great promise for revolutionizing software development processes and enabling more efficient and effective product development.

  1. Martin Ward (1994) “Language Oriented Programming” https://www.researchgate.net/publication/234125675_Language_Oriented_Programming Software Concepts and Tools 15(4):147-161. DOI:10.1007/978-1-4302-2390-0_12 ISBN 978-1-4302-2389-4.
  2. Sergey Dmitriev 2004, Language Oriented Programming: The Next Programming Paradigm https://resources.jetbrains.com/storage/products/mps/docs/Language_Oriented_Programming.pdf
  3. M. Mernik, J. Heering, and A. Sloane. “When and how to develop domain-specific languages”. ACM Computing Surveys (CSUR), 37(4):344, 2005, DOI:10.1145/1118890.1118892 https://www.researchgate.net/publication/200040446_When_and_How_to_Develop_Domain-Specific_Languages
  4. Jon Bentley - Little languages, 1986. https://dl.acm.org/doi/10.1145/6424.315691
  5. Czarnecki, O’Donnell, Striegnitz, Taha - DSL implementation in metaocaml, template haskell, and C++, 2004. https://www.researchgate.net/publication/221025927_DSL_implementation_in_MetaOCaml_template_Haskell_and_C