0% found this document useful (0 votes)
5 views

CORBA_3

This paper introduces a novel approach to compiling distributed programs using multiple programming languages by implementing a meta network programming language that simplifies the development process. It aims to reduce the complexity and overhead associated with service-oriented architectures by allowing developers to treat distributed programs as a single entity, while still leveraging the strengths of different programming languages. The proposed solution includes a compiler that translates these network programs into executable services, although an actual implementation is yet to be developed.

Uploaded by

zenith.shah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

CORBA_3

This paper introduces a novel approach to compiling distributed programs using multiple programming languages by implementing a meta network programming language that simplifies the development process. It aims to reduce the complexity and overhead associated with service-oriented architectures by allowing developers to treat distributed programs as a single entity, while still leveraging the strengths of different programming languages. The proposed solution includes a compiler that translates these network programs into executable services, although an actual implementation is yet to be developed.

Uploaded by

zenith.shah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Compilation of Distributed Programs to Services Using Multiple

Programming Languages

a
Thomas M. Prinz
Course Evaluation Service, Friedrich Schiller University Jena, Jena, Germany

Keywords: Service, Compiler, Distributed Programming, Programming Language, Engineering.

Abstract: Service-orientation recommends dividing software into separate independent services, with each service being
implemented in the programming language that best ts into the service’s problem space. However, data must
be shared between the distributed services, so common data models and interfaces must be dened in each
programming language used. This leads to a higher development effort and dependencies, while neglecting
the benets. This paper explains a new idea that arranges a distributed program as if it is a single one, even
though it consists of different parts using possibly different programming languages. For this purpose, the
idea of meta network programming languages is introduced. They are based on network machines and hide
the complexity arising during development of distributed software. A compiler translates and distributes these
programs by splitting them into several parts. As a result, this should reduce the overhead of developing
distributed general purpose software. The intention of this position paper is to give new ideas to implement
distributed programs in the future. An implementation of the idea does not exist yet.

1 INTRODUCTION other to achieve the overall goal of the software.


Therefore, they need communication interfaces. In
The development and implementation of software software development with one programming lan-
is a complex process. To deal with this complex- guage, these interfaces are realized with function
ity, researchers and practitioners have dened dif- (method) declarations. When using multiple pro-
ferent strategies. One strategy is to divide the soft- gramming languages, however, not all functions are
ware into different modules, whereby each module located in the same execution environment; they
can be developed separately from the others. To could be anywhere in the network or on the machine
reduce functional implementation effort, each mod- and are called via network or other approaches.
ule should be implemented in the programming lan- The big difference between calls within a pro-
guage and tool stack that best ts its problem space. gramming language or outside via services is mainly
Emerging technologies like service-oriented architec- in their support (De Paoli, 2018). In monolingual
tures (SOA) make this possible. If services are very programming, most of the program code is known at
closed (atomic) in their functionality, they are called compile time, so most of the code is known during
microservices. A microservice communicates over a development; integrated development environments
network, is deployed independently from other ser- (IDEs) can use these information and, therefore, can
vices, and uses the programming language and tool fully support the development. Modern IDEs iden-
stack that best ts its needs (Newman, 2015). For ex- tify, among other things, calls to undened methods,
ample, if someone needs to develop a software, which access violations, and incorrectly placed method pa-
deals with objects, but also with machine learning, rameters. In those cases, the IDE provides immediate
parts can be implemented in Java, a typical object- feedback during coding and, usually, some error han-
oriented language, and in Python, known for its data dling. Furthermore, since the software is developed
science packages. in a single language, compilers can translate it into
When software is divided into different subsys- (virtual) machine code and — in most cases and by
tems, the subsystems must communicate with each dening the execution environment — they are imme-
diately executable. On the contrary, in the context of
a https://orcid.org/0000-0001-9602-3482
service-based and distributed software architectures,

191
Prinz, T.
Compilation of Distributed Programs to Services Using Multiple Programming Languages.
DOI: 10.5220/0012151500003584
In Proceedings of the 19th International Conference on Web Information Systems and Technologies (WEBIST 2023), pages 191-198
ISBN: 978-989-758-672-9; ISSN: 2184-3252
Copyright © 2023 by SCITEPRESS – Science and Technology Publications, Lda. Under CC license (CC BY-NC-ND 4.0)
Compilation of Distributed Programs to Services Using Multiple Programming Languages

2 RELATED WORK of REST APIs in an OpenAPI specication (Swag-


ger, 2023b) and the generation of client and server
The idea of implementing software in a unied lan- code skeletons. JHipster (Raible, 2018) generates
guage is not new and came up early in research complete applications within a predened technol-
and industry. For this reason, many approaches for ogy stack. Both Swagger and JHipster are limited
languages for data models and functionality have by ignoring the system behavior. The framework
evolved in the past. For example, the Unied Mod- Flutter (Google, 2023) describes applications in Dart
eling Language (UML) (Object Management Group, and compiles them into native cross-platform applica-
2017b) is such a unied language, in which the soft- tions, but does not translate parts of the program into
ware development community and industry use vari- individual target machines and languages. Some web
ous diagrams that are widely used as modeling lan- template and behavioral languages, e. g., pug (pug,
guage standard (Oquendo et al., 2016) (especially, 2023), Haml (Catlin, 2023), and GWT (Tacy et al.,
class, use case, and sequence diagrams (Dobing and 2013), allow software descriptions and compile them
Parsons, 2006)). The Action Language for Foun- into web applications. They are powerful but limited
dational UML (Alf) (Object Management Group, to web applications, JavaScript, and Java.
2017a) and the Semantics of a Foundational Subset Although limited to C++, C, and Fortran,
for Executable UML Models (fUML) (Object Man- OpenMP (OpenMP Architecture Review Board,
agement Group, 2018) are standards for describing 2018) has similarities to our ideas and has become
complete systems in UML down to the behavior of a standard for programming shared memory systems
individual functions, but their application is not triv- in High Performance Computing (HPC). Rather than
ial and requires scientic knowledge (Ciccozzi et al., focusing on multiprocessors on the same machine as
2019). In contrary, our idea would be similar to usual OpenCL (Khronos OpenCL Working Group, 2023),
software development and should be easier to learn. it enables high-level parallel programming and porta-
Interoperability of different systems, program- bility (Yu et al., 2020) over a network. Programs are
ming languages, and platforms is the goal of the Com- translated into heterogeneous multiprocessor systems,
mon Object Request Broker Architecture (CORBA) but this complexity is hidden from the programmer.
(Object Management Group, 2021). CORBA fol- After compilation, the OpenMP environment auto-
lows a strong object-oriented approach and consid- matically moves different machine code to the proces-
ers each functionality to be bounded in (remote) ob- sors and handles data exchange between them. Our
jects as methods. Developers describe the signature idea is similar by hiding details about the infrastruc-
of such methods in an Interface Denition Language ture. However, our focus is not on HPC, but on pro-
(IDL), compile them into programming language spe- gramming for general purpose.
cic interface stubs, and add their functionality. An The game development engine Unity (Unity Tech-
Object Request Broker (ORB) handles requests to the nologies, 2023) follows a similar idea like ours. It al-
methods and delegate them to specic implementa- lows to describe games in a subset of C# running on
tions regardless where they are and how they are im- Mono (Mono Project, 2023), an open-source .NET
plemented. Although CORBA has similarities with framework. Mono is based on the Common Lan-
our approach, it also differs. CORBA focuses on guage Infrastructure (CLI) standard (Ecma Interna-
interacting objects; our approach, however, handles tional, 2012), which allows programs to run on dif-
objects just as complex data structures and provide ferent operating systems. The use of C# as a de-facto
functions/methods as (micro)services. Furthermore, meta programming language follows our idea to de-
CORBA denes function signatures separately in the ne data models and services independently of pro-
IDL, compiles them into stubs, and force to imple- gramming languages. However, instead of translat-
ment them subsequently; however, our approach al- ing the models and services into a single language
lows to integrate both the implementation and the and runtime environment, our approach is to dis-
“cross-language” signature. Finally and importantly, tribute them across different languages and environ-
CORBA is expensive for companies as ORBs are ments. Another example in game development is
complex and, therefore, usually are licensed from the GameEngine of (Apel, 2018) for the denition
commercial vendors; our approach, however, should of massively multiplayer online games (MMOG). The
result in a less complex environment and, therefore, novelty of his approach was the automatic generation
should be more attractive for small companies. of code for communication, controllers, etc. as well as
Alternative approaches try to minimize the effort their compilation at runtime. This made games leaner
between design and implementation. For example, in terms of shortened implementation times and lines
Swagger (Swagger, 2023a) allows the specication of code. However, its focus on MMOGs makes it dif-

193
Compilation of Distributed Programs to Services Using Multiple Programming Languages

The service functionality is executed in a sepa- 1 class Pair {


rate (possibly virtual) environment. These are ac- 2 public int a, b;
tual runtime environments for the programming lan- 3 Pair(int a, int b) {
guages used in the services, e. g., Java Virtual Ma- 4 this.a = a; this.b = b;
chines (JVM) (Lindholm et al., 2014) or Python and 5 }
6 }
R runtime environments. Since a network machine
is also a runtime environment, behind a service can
1 class Computation {
again be an own network machine. In addition, each
2 @Java
service has its own local memory and shares data only 3 public int[] handlePairs(int[][] pairs) {
via the interfaces. Global data should be used with 4 Pair[] pairList = new Pair[pairs.length];
caution, as with any distributed software. Network 5 for (int i = 0; i < pairs.length; i++) {
machines provide global data via a persistence inter- 6 int a = pairs[i][0], b = pairs[i][1];
face for all data structures dened in the network pro- 7 pairList[i] = new Pair(a, b);
gram and shared by the services. This persistence in- 8 }
9 return this.computeSums(pairList);
terface allows easy and continuous storage of data,
10 }
its access, modication, and deletion. Since services 11 @R
could run in parallel when asynchronous service calls 12 public int[] computeSums(Pair[] pairs) {
are used, this interface solves the race condition be- 13 sapply(pairs, function(pair) {
tween parallel accesses, e. g., by locking mechanisms. 14 pair$a + pair$b
15 })
16 }
17 }
4 NETWORK PROGRAMS Figure 3: An example of a network program.

Programming distributed software is a challenge be- The implementation of the program with the cur-
cause the developer cannot simply call another func- rent state-of-the-art is not a challenge but time con-
tion in a distributed part of the program, but must call suming. First the data structure Pair must be im-
an external service using the right parameters, for- plemented in Java and in R. Then, the Java part of
mat, etc. It is helpful during development to imag- the program must be implemented and made avail-
ine that all functions of a program are located in the able as a service, e. g., with REST. In addition, de-
same environment, regardless of where they are ac- velopers must implement the R part of the program
tually located (Kozlovics, 2019). The idea of net- and also make it available as a service. Since data
work programs creates this situation. Network pro- is transferred, a protocol must be dened or an exist-
grams are executed on the previously dened network ing one like JSON (Ecma International, 2017) must
machines and are written in a so-called network pro- be used for the exchange. Furthermore, the data must
gramming language that mainly denes data models be mapped to the correct parameters.
and the software structure as services. The advan- The implementation overhead can cause develop-
tages of such network programs are: (1) they dene ers to implement the program/software in a single
the interfaces of all services, (2) service calls are more language instead of multiple ones. However, some
similar to function/method calls, and (3) they describe problems can be solved, computed, and implemented
shared data models only once. much more efcient in other programming languages.
Figure 3 shows an example of a small network This advantage is then missing and, therefore, leads to
program. It is written in a Java-like language only increasing implementation costs (Apel et al., 2019).
as an example. At the beginning, the program de- Network programs should improve this situation since
nes the data model (class) Pair with two elds developers avoid the previous described steps.
a and b and a constructor. It also denes a class
Computation, which contains two methods. The
method handlePairs is written in Java and transfers
a nested integer array of pairs into a list of objects of 5 COMPILER ARCHITECTURE
type Pair. At the end, the method returns the sum of FOR NETWORK PROGRAMS
the list of pairs by calling the computeSums method,
which is written in R. The method computeSums re- Network programs are transferred to a runnable soft-
quires an array (or list) of pairs dened by the class ware with the help of a compiler. Basically, the archi-
Pair. It then calculates the sum of the two elds a tecture of such a compiler can follow a similar struc-
and b of each Pair object and returns it as an array. ture as classical compilers (e. g., (Cooper and Torc-

195
Compilation of Distributed Programs to Services Using Multiple Programming Languages

most programming languages there are compilers that pends on the number and types of programming lan-
generate executable les. guages initially supported. The network program-
Many modern programming languages, such as ming language itself should be less complex, as
Java, R, Python, and JavaScript, require special en- should its compiler. One difculty will be recognizing
vironments to be executable. Fortunately, there are calls to distributed functions in the target program-
tools to create such environments (e. g., (Docker Inc., ming languages. The use of a (language-dependent)
2023) and (Burns et al., 2019)). One goal of the com- library could be a solution for a rst prototype. The
piler is to generate containers for each partial pro- network machine should be the most complex part, as
gram describing their execution environments and the it provides several runtime components. A rst pro-
services. This is done in the Execution Environment totype should reuse an existing technology stack to
Generator and bundled in containers. As a result, the keep the implementation simple and feasible. How-
compiler generates a complete distributable and exe- ever, compared to other approaches, such as CORBA,
cutable network program. the implementation effort and the hurdle to use our
approach should be lower.
Future work includes the denition of a rst gram-
6 CONCLUSION / DISCUSSION mar of a network programming language, which al-
lows to include existing languages in the description
of functionality. The next step denes a parser of this
This paper presented a new idea for developing dis-
language and the phase of code extensions for service
tributed programs. An implementation would allow
calls in the compiler. Fortunately, the back end of the
to arrange each distributed program as if it is an undis-
compiler is lightweight, since it can reuse all existing
tributed one, although it consists of different parts,
compilers for the programming languages used in the
no matter which programming language they use. A
program. All this future work contains challenges, but
compiler distributes the program by splitting it into
could be feasible in a few years.
several parts in different programming languages. To
achieve this, the program must be dened in a so-
called network programming language. A network
program denes data models and services, where the REFERENCES
service functionality is described in an individually
available programming language chosen by the de- Apel, S. (2018). Reducing Development Overheads with
veloper. That language that best solves the function- a Generic and Model-Centric Architecture for On-
line Games. In IEEE International Conference on
ality can be used. The overall concept is based on
Software Architecture, ICSA 2018, Seattle, WA, USA,
principles of network machines, which generalize ar- April 30 - May 4, 2018, pages 21–28. IEEE Computer
chitectures of distributed and multiprocessor systems Society.
and are a runtime environment for network programs. Apel, S., Hertrampf, F., and Späthe, S. (2019). Towards
In this paper only the idea of network programs and a Metrics-Based Software Quality Rating for a Mi-
a conceptual compiler architecture are described. It croservice Architecture - Case Study for a Measure-
shall give a new view on developing distributed sys- ment and Processing Infrastructure. In Lüke, K., Eich-
tems and state-of-the-art approaches. Therefore, an ler, G., Erfurth, C., and Fahrnberger, G., editors, Inno-
vations for Community Services - 19th International
implementation does not exist yet.
Conference, I4CS 2019, Wolfsburg, Germany, June
Of course, the proposed approach does not have 24-26, 2019, Proceedings, volume 1041 of Communi-
only advantages. If development teams do not imple- cations in Computer and Information Science, pages
ment services separately, the resulting services (and 205–220. Springer.
their interfaces) might be less reusable and more cou- Burns, B., Beda, J., and Hightower, K. (2019). Kubernetes:
pled. This problem depends more on architecture and Up and Running — Dive into the Future of Infrastruc-
design decisions than on implementation decisions, ture. O’Reilly, California, USA, 2 edition.
which are the focus of our approach. Furthermore, Catlin, H. (2023). Haml. http://haml.info/. Last visit in
our approach leads to new middleware (the network September 2023.
machine) that must be installed and maintained by en- Ciccozzi, F., Malavolta, I., and Selic, B. (2019). Execution
terprises, although the goal is to keep this to a mini- of UML models: a systematic review of research and
practice. Software & Systems Modeling, 18(3):2313–
mum. Finally, some developers specialize in a small
2360.
number of programming languages. For this reason,
Cooper, K. D. and Torczon, L. (2011). Engineering a Com-
such developers might have problems writing, read- piler. Morgan Kaufmann, USA, 2nd edition.
ing, and understanding network programs. De Paoli, F. (2018). Challanges in services research: A
The implementation effort of our approach de- software architecture perspective. In Lazovik, A. and

197
WEBIST 2023 - 19th International Conference on Web Information Systems and Technologies

Schulte, S., editors, Advances in Service-Oriented and Object Management Group (2021). Common Object Re-
Cloud Computing, pages 219–227, Cham. Springer quest Broker Architecture Specication, Version 3.4.
International Publishing. https://www.omg.org/spec/CORBA/3.4.
Dobing, B. and Parsons, J. (2006). How UML is used. Com- OpenMP Architecture Review Board (2018).
munications of the ACM, 49(5):109–113. OpenMP Application Programming Interface
Docker Inc. (2023). Empowering App Development for De- — version 5.0. https://www.openmp.org/wp-
velopers — Docker. https://www.docker.com/. Last content/uploads/OpenMP-API-Specication-5.0.pdf.
visit in September 2023. Oquendo, F., Leite, J., and Batista, T. (2016). Execut-
Ecma International (2012). Standard ECMA-335: Common ing Software Architecture Descriptions with SysADL.
Language Infrastructure (CLI) — 6th edition (June In Tekinerdogan, B., Zdun, U., and Babar, A., ed-
2012). http://www.ecma-international.org/publica itors, Software Architecture, pages 129–137, Cham.
tions/les/ECMA-ST/ECMA-335.pdf. Springer International Publishing.
Ecma International (2017). Standard ECMA-404: The Prinz, T. M., Heinze, T. S., Amme, W., Kretzschmar, J., and
JSON Data Interchange Syntax — 2nd edition (De- Beckstein, C. (2015). Towards a Compiler for Busi-
cember 2017). http://www.ecma-international.org/p ness Processes - A Research Agenda. In de Barros,
ublications/les/ECMA-ST/ECMA-404.pdf. M. and Rückemann, C.-P., editors, SERVICE COM-
Fielding, R. T. and Taylor, R. N. (2002). Principled design PUTATION 2015: The Seventh International Confer-
of the modern Web architecture. ACM Trans. Internet ences on Advanced Service Computing, Nice, France,
Techn., 2(2):115–150. March 22–27, 2015. Proceedings, pages 49–54.
Geisriegler, M., Kolodiy, M., Stani, S., and Singer, R. Prinz, T. M., Spieß, N., and Amme, W. (2014). A rst
(2017). Actor based business process modeling and step towards a compiler for business processes. In
execution: A reference implementation based on on- Cohen, A., editor, Compiler Construction - 23rd In-
tology models and microservices. In 43rd Euromicro ternational Conference, CC 2014, Held as Part of the
Conference on Software Engineering and Advanced European Joint Conferences on Theory and Practice
Applications, SEAA 2017, Vienna, Austria, August 30 of Software, ETAPS 2014, Grenoble, France, April 5-
- Sept. 1, 2017, pages 359–362. IEEE Computer Soci- 13, 2014. Proceedings, volume 8409 of Lecture Notes
ety. in Computer Science, pages 238–243. Springer.
Google (2023). Flutter - Beautiful native apps in record pug (2023). Getting Started - Pug. https://pugjs.org/. Last
time. https://utter.dev/. Last visit in September 2023. visit in September 2023.
Khronos OpenCL Working Group (2023). The OpenCLTM Raible, M. (2018). The JHipster mini-book. C4Media,
Specication. https://registry.khronos.org/OpenCL/ USA, 5.0.1 edition.
specs/3.0-unied/html/OpenCL\ API.html. Shafranovich, Y. (2005). RFC 4180: Common Format
Kozlovics, S. (2019). The web computer and its operat- and MIME Type for Comma-Separated Values (CSV)
ing system: A new approach for creating web applica- Files. https://datatracker.ietf.org/doc/html/rfc4180.
tions. In Bozzon, A., Mayo, F. J. D., and Filipe, J., edi- Singer, R. (2016). Business process modeling and execu-
tors, Proceedings of the 15th International Conference tion - A compiler for distributed microservices. CoRR,
on Web Information Systems and Technologies, WE- abs/1601.05976.
BIST 2019, Vienna, Austria, September 18-20, 2019, Swagger (2023a). The Best APIs are Built with Swagger
pages 46–57. ScitePress. Tools. https://www.swagger.io/. Last visit in Septem-
Lindholm, T., Yellin, F., Bracha, G., and Buckley, A. ber 2023.
(2014). The Java Virtual Machine Specication, Java Swagger (2023b). OpenAPI Specication. https://swagger.
SE 8 Edition. Addison-Wesley Professional, Califor- io/specication/. Last visit in September 2023.
nia, USA, 8 edition. Tacy, A., Hanson, R., Essington, J., and Tokke, A. (2013).
Mono Project (2023). Mono — Cross platform, open source GWT in Action. Manning Publications Co., Green-
.NET framework. https://www.mono-project.com/. wich, CT, USA, 2nd edition.
Last visit in September 2023. Unity Technologies (2023). Unity — Game Engine.
Newman, S. (2015). Building Microservices: Designing https://unity.com/. Last visit in September 2023.
Fine-Grained Systems. O’Reilly, California, USA, 1 Yu, C., Royuela, S., and Quiñones, E. (2020). OpenMP
edition. to CUDA graphs: a compiler-based transformation to
Object Management Group (2017a). Action Lan- enhance the programmability of NVIDIA devices. In
guage for Foundational UML (Alf). Concrete Syn- Stuijk, S. and Corporaal, H., editors, SCOPES ’20:
tax for a UML Action Language, Version 1.1. 23rd International Workshop on Software and Com-
https://www.omg.org/spec/ALF/1.1. pilers for Embedded Systems, St. Goar, Germany, May
Object Management Group (2017b). OMG Uni- 25-26, 2020, pages 42–47. ACM.
ed Modeling Language — version 2.5.1.
https://www.omg.org/spec/UML/2.5.1.
Object Management Group (2018). Semantics of a Founda-
tional Subset for Executable UML Models (fUML),
Version 1.4. https://www.omg.org/spec/ALF/1.1.

198

You might also like