A flattening strategy for SML module compilation and its implementation

Liu Bochao, Atsushi Ohori

Research output: Contribution to journalArticlepeer-review


This paper presents a method to compile the Standard ML module language into a flattened intermediate language. An innovative point on this approach lies in viewing a functor as a code template with place holders representing the functor arguments. Each functor application fills these place holders in the code template with the actual functor argument and generates a fresh structure. After this compilation, module language constructs are all eliminated. This method allows us to compile the full set of Standard ML language into a typed intermediate language that contains no special mechanism for module, and provides a simpler model for separate compilation. The proposed compilation method has been successfully implemented in the SMLJ compiler, which demonstrates the feasibility of the method. This paper also reports the details of our implementation.

Original languageEnglish
Pages (from-to)136-154
Number of pages19
JournalComputer Software
Issue number3
Publication statusPublished - 2009

ASJC Scopus subject areas

  • Software


Dive into the research topics of 'A flattening strategy for SML module compilation and its implementation'. Together they form a unique fingerprint.

Cite this