Hostname: page-component-7c8c6479df-995ml Total loading time: 0 Render date: 2024-03-27T19:58:35.185Z Has data issue: false hasContentIssue false

Embedded interpreters

Published online by Cambridge University Press:  05 January 2005

NICK BENTON
Affiliation:
Microsoft Research, 7 J J Thomson Avenue, Cambridge CB3 0FB, UK (e-mail: nick@microsoft.com)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

This is a tutorial on using type-indexed embedding/projection pairs when writing interpreters in statically-typed functional languages. The method allows (higher-order) values in the interpreting language to be embedded in the interpreted language and values from the interpreted language may be projected back into the interpreting one. This is particularly useful when adding command-line interfaces or scripting languages to applications written in functional languages. We first describe the basic idea and show how it may be extended to languages with recursive types and applied to elementary meta-programming. We then show how the method combines with Filinski's continuation-based monadic reflection operations to define an [lsquor]extensional[rsquor] version of the call-by-value monadic translation and hence to allow values to be mapped bidirectionally between the levels of an interpreter for a functional language parameterized by an arbitrary monad. Finally, we show how SML functions may be embedded into, and projected from, an interpreter for an asynchronous $\pi$-calculus via an ‘extensional’ variant of a standard translation from $\lambda$ into $\pi$.

Type
Article
Copyright
© 2005 Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.