Transformation of C programming language memory model into object-oriented representation of EO language
Modelirovanie i analiz informacionnyh sistem, Tome 29 (2022) no. 3, pp. 246-264.

Voir la notice de l'article provenant de la source Math-Net.Ru

The paper analyzes the possibilities of transforming C programming language constructs into objects of EO programming language. The key challenge of the method is the transpilation from a system programming language into a language of a higher level of abstraction, which doesn't allow direct manipulations with computer memory. Almost all application and domain-oriented programming languages disable such direct access to memory. Operations that need to be supported in this case include the use of dereferenced pointers, the imposition of data of different types in the same memory area, and different interpretation of the same data which is located in the same memory address space. A decision was made to create additional EO-objects that directly simulate the interaction with computer memory as in C language. These objects encapsulate unreliable data operations which use pointers. An abstract memory object was proposed for simulating the capabilities of C language to provide interaction with computer memory. The memory object is essentially an array of bytes. It is possible to write into memory and read from memory at a given index. The number of bytes read or written depends on which object is being used. The transformation of various C language constructs into EO code is considered at the level of the compilation unit. To study the variants and analyze the results a transpiler was developed that provides necessary transformations. It is implemented on the basis of Clang, which forms an abstract syntax tree. This tree is processed using LibTooling and LibASTMatchers libraries. As a result of compiling a C program, code in EO language is generated. The considered approach turns out to be appropriate for solving different problems. One of such problems is static code analysis. Such solutions make it possible to isolate low-level code fragments into separate program objects, focusing on their study and possible transformations into more reliable code.
Mots-clés : program transformation, transpilation, compilation
Keywords: procedural programming, object-oriented programming, programming languages.
@article{MAIS_2022_29_3_a6,
     author = {A. I. Legalov and Y. G. Bugayenko and N. K. Chuykin and M. V. Shipitsin and Ya. I. Riabtsev and A. N. Kamenskiy},
     title = {Transformation of {C} programming language memory model into object-oriented representation of {EO} language},
     journal = {Modelirovanie i analiz informacionnyh sistem},
     pages = {246--264},
     publisher = {mathdoc},
     volume = {29},
     number = {3},
     year = {2022},
     language = {ru},
     url = {http://geodesic.mathdoc.fr/item/MAIS_2022_29_3_a6/}
}
TY  - JOUR
AU  - A. I. Legalov
AU  - Y. G. Bugayenko
AU  - N. K. Chuykin
AU  - M. V. Shipitsin
AU  - Ya. I. Riabtsev
AU  - A. N. Kamenskiy
TI  - Transformation of C programming language memory model into object-oriented representation of EO language
JO  - Modelirovanie i analiz informacionnyh sistem
PY  - 2022
SP  - 246
EP  - 264
VL  - 29
IS  - 3
PB  - mathdoc
UR  - http://geodesic.mathdoc.fr/item/MAIS_2022_29_3_a6/
LA  - ru
ID  - MAIS_2022_29_3_a6
ER  - 
%0 Journal Article
%A A. I. Legalov
%A Y. G. Bugayenko
%A N. K. Chuykin
%A M. V. Shipitsin
%A Ya. I. Riabtsev
%A A. N. Kamenskiy
%T Transformation of C programming language memory model into object-oriented representation of EO language
%J Modelirovanie i analiz informacionnyh sistem
%D 2022
%P 246-264
%V 29
%N 3
%I mathdoc
%U http://geodesic.mathdoc.fr/item/MAIS_2022_29_3_a6/
%G ru
%F MAIS_2022_29_3_a6
A. I. Legalov; Y. G. Bugayenko; N. K. Chuykin; M. V. Shipitsin; Ya. I. Riabtsev; A. N. Kamenskiy. Transformation of C programming language memory model into object-oriented representation of EO language. Modelirovanie i analiz informacionnyh sistem, Tome 29 (2022) no. 3, pp. 246-264. http://geodesic.mathdoc.fr/item/MAIS_2022_29_3_a6/

[1] Y. Bugayenko, Elegant Objects, https://www.elegantobjects.org/

[2] Y. Bugayenko, Elegant Objects, v. 1, Amazon Kindle Direct Publishing, California, USA, 2016

[3] Y. Bugayenko, Elegant Objects, v. 2, Amazon Kindle Direct Publishing, California, USA, 2016

[4] Y. Bugayenko, EOLANG and $\varphi$-calculus, 2021, arXiv: 2111.13384 [cs.PL]

[5] H. Saleh, S. Zykov, and A. Legalov, “Eolang: Toward a New Java-Based Object-Oriented Programming Language”, Intelligent Decision Technologies. Smart Innovation, Systems and Technologies, 238 (2021), 355–363 | DOI | MR

[6] H. Saleh, J. Attakorah, S. Zykov, and A. Legalov, “Exploring the Eolang-Java Integration and Interoperability”, Procedia Computer Science, 192, Proceedings of the 25th International Conference KES2021: Knowledge-Based and Intelligent Information Engineering Systems (2021), 4560–4569 | DOI

[7] N. Kudasov and V. Sim, “Formalizing $\varphi$-calculus: a purely object-oriented calculus of decorated objects”, Proceedings of the ECOOP Workshop on Formal Techniques for Java-like Programs, FTfJP2022 (Berlin, Germany, 2022)

[8] Polystat Project: Polyglot Static Analyzer for Object-Oriented Programming Languages, https://github.com/polystat

[9] Y. Bugayenko, Reducing Programs to Objects, 2021, arXiv: 2112.11988 [cs.PL]

[10] Oberon 07 ompiler, https://github.com/vladfolts/oberonjs

[11] Visual Interactive Simulations for Education and Science, https://visual.sfu-kras.ru/

[12] JSSpeccy 3 a ZX Spectrum emulator in the browser, http://jsspeccy.zxdemo.org/

[13] JSNES A JavaScript NES emulator, https://jsnes.org/

[14] JSLinux, https://bellard.org/jslinux/

[15] Experimental compiler of C to EO, https://github.com/polystat/c2eo

[16] Clang: a C language family frontend for LLVM, https://clang.llvm.org/

[17] Tutorial for building tools using LibTooling and LibASTMatchers, https://clang.llvm.org/docs/LibASTMatchersTutorial.html