The MinCaml compiler + shift/reset
What is the MinCaml compiler ?
- The MinCaml compiler is a compiler for MinCaml, a subset of the programming language ML. It is developed by Eijiro Sumii.
- If you want to know in more detail about MinCaml and the MinCaml compiler, please refer to "A Crash Course for the MinCaml Compiler".
Extension to support shift/reset
- source code (PowerPC version extended with shift/reset)
- The delimited control operators shift and reset are proposed by Danvy and Filinski. Intuitively, shift captures the current continuation, and reset delimits the scope of the continuation captured by shift.
In this implementation, the expressions of the following forms
shift (fun <var> -> <exp>) reset (fun () -> <exp>)are accepted as well as lists and simple pattern matching on lists.
- The original MinCaml compiler uses a monomorphic type system, but here, we use a polymorphic type system which supports answer type polymorphism and answer type modification.
- After the type inference, the compiler transforms identifiers shift and reset into ordinary external functions. So, the behaviors of shift/reset are described in libmincaml.s.
- M. Masuko, and K. Asai "Direct Implementation of Shift and Reset in the MinCaml Compiler", Technical Report of Department of Information Science, Ochanomizu University, OCHA-IS 09-1, 27 pages (May 2009). (a4.pdf)
- M. Masuko, and K. Asai "Direct Implementation of Shift and Reset in the MinCaml Compiler", Proceedings of the 2009 ACM SIGPLAN Workshop on ML, pp. 49-60 (September 2009). (the ACM digital library)