Abstract
Recently there have been a number of researches to provide code mobility to lazy functional language (LFL) programs by translating LFL programs to Java programs. These approaches are basically baled on architectural similarities between abstract machines of LFLs and Java. The abstract machines of LFLs and Java programming language, Spineless Tagless G-Machine(STGM) and Java Virtual Machine(JVM) respectively, share important common features such as built- in garbage collector and stack machine architecture. Thus, we can provide code mobility to LFLs by translating LFLs to Java utilizing these common features. In this paper, we propose a new translation scheme which fully utilizes architectural common features between STGM and JVM. By redefining STGM as an eval-apply evaluation model, we have defined a new translation scheme which utilizes Java Virtual Machine Stack for function evaluation and totally eliminates stack simulation which causes array manipulation overhead in Java. Benchmark program translated to Java programs by our translation scheme run faster on JDK 1.3 than those translated by the previous schemes.
최근에 지연 계산 함수형 언어를 자바 프로그램으로 변환함으로써 지연 계산 함수형 언어 프로그램에 대해 코드 이동성을 제공하려는 연구가 있었다. 이러한 연구들은 자바와 지연 계산형 함수형 언어의 추상 기계가 가지는 구조적 유사성에 바탕을 두고 있다. 지연 계산 함수형 언어에 대한 추상 기계인 STGM(Spineless Tagless G-machine)과 자바 언어에 대한 추상 기계인 JVM(Java Virtual Machine)은 기억장소 재활용 체계와 스택 기계 구조를 가진다는 점에서 공통된 특징을 가지고 있다. 그러나 현재가지의 지연 계산 함수형 언어로부터 자바로의 변환 구조는 이와 같은 추상 기계 구조상의 공통점을 충분히 이용하지 못하였다. 본 논문에서는 STGM의 계산 모델을 eval-apply 모델로 새로이 정의함으로써 STGM과 JVM의 공통점을 충분히 이용하는 새로운 변환 구도를 제안한다. 새로이 제안된 변환 구도에서는 자바 스택(Java Virtual Machine Stack)을 사용하여 함수 계산을 수행하도록 함으로써 스택 시뮬레이션으로 인해 나타나는 자바에서의 배열 접근 부담을 제거하였다. 본 논문의 변환 구도에 의해 자바로 변환된 벤치마크 프로그램들은 기존의 변환 구도에 의해 변환된 경우보다 JDK 1.3에서 빠르게 동작한다.