Compilation the closure of TypeScript nested function into Common Intermediate Language of .NET platform

Keywords: translator, intermediate representation of the program, nested function, closure, CIL, CLR, .NET, TypeScript.

Abstract

This article proposes a method that allows you efficiently compile the closure of nested functions with captured variables into the Common Intermediate Language of the .NET platform. The considered method is based on the idea of ​​transforming the intermediate representation of the program by creating a structure that stores the values ​​of closed variables and passes them to the last argument in the nested function. This allows you to associate a function call with its captured variables. CIL instructions are generated for the converted program. The result of the method is the generated code, which shows better performance than the code generated by the existing analog.

References

YangSun Lee, SeungWon Na, DaeHoon Hwang, Language Translator for Execution Java programs in .NET [Electronic resource]

Yannis Bres, Bernard Serpette, Manuel Serrano, Compiling Scheme programs to .NET Common Intermediate Language [Electronic resource]

Ivanenko A.R., Marchenko O.I Translation the concatenation of TypeScript string expressions into Common Intermediate Language of .NET platform. [Electronic resource]

Marchenko O.I., Ivanenko A.R. Analysis of TypeScript translation methods into Common Intermediate Language of .NET platform

Jeffrey Richter. CLR via C#. 2012

Marchenko O.I Synopsis of lectures on the subject "Software Engineering-1. Basics of translator design », Kyiv 2013.

Currying. Wikipedia. [Electronic resource] – Access mode:https://en.wikipedia.org/wiki/Currying

Mono.Cecil documentation [Electronic resource] – Access mode: https://cecil.pe/


Abstract views: 118
PDF Downloads: 131
Published
2022-07-01
How to Cite
Ivanenko, A., & Marchenko, O. (2022). Compilation the closure of TypeScript nested function into Common Intermediate Language of .NET platform . COMPUTER-INTEGRATED TECHNOLOGIES: EDUCATION, SCIENCE, PRODUCTION, (47), 71-75. https://doi.org/10.36910/6775-2524-0560-2022-47-11
Section
Computer science and computer engineering