SML# Document Version 4.0.0
III Reference manual

Chapter 29 SML# Run-time data management

SML# adopts the most natural data representation (the data representation that the ABI (Application Binary Interface) of the target platform adpots) for all the basic data types. For example, in x86_64 platform, int is a 32-bit integer, and real is a 64-bit IEEE754 floating point number. The evaluation of expressions of these types are performed by using appropriate registers. In arrays, tuples, and records, these data are aligned appropriately. The natural data representation is kept in the entire SML# program including polymorphic functions.

SML#’s separate compilation and interoperability with C is realized on top of this natural data representation. Therefore, power users that exploits these features need detailed knowledge about runtime data representation. This chapter describes the runtime data representation and memory management of SML#.