Hostname: page-component-6766d58669-vgfm9 Total loading time: 0 Render date: 2026-05-15T03:40:14.941Z Has data issue: false hasContentIssue false

Embedding an interpreted language using higher-order functions and types

Published online by Cambridge University Press:  29 September 2011

NORMAN RAMSEY*
Affiliation:
Department of Computer Science, Tufts University, Medford, MA 02155, USA (e-mail: nr@cs.tufts.edu)
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.

Using an embedded, interpreted language to control a complicated application can have significant software-engineering benefits. But existing interpreters are designed for embedding into C code. To embed an interpreter into a different language requires an API suited to that language. This paper presents Lua-ML, a new API that is suited to languages that provide higher-order functions and types. The API exploits higher-order functions and types to reduce the amount of glue code needed to use an embedded interpreter. Where embedding in C requires a special-purpose “glue function” for every function to be embedded, embedding in Lua-ML requires only a description of each function's type. Lua-ML also makes it easy to define a Lua function whose behavior depends on the number and types of its arguments.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 2011
Supplementary material: File

Ramsey Supplementary Data

Ramsey Supplementary Data

Download Ramsey Supplementary Data(File)
File 183 KB
Submit a response

Discussions

No Discussions have been published for this article.