{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,11,18]],"date-time":"2025-11-18T12:14:18Z","timestamp":1763468058215},"reference-count":33,"publisher":"Cambridge University Press (CUP)","issue":"6","license":[{"start":{"date-parts":[[2011,9,29]],"date-time":"2011-09-29T00:00:00Z","timestamp":1317254400000},"content-version":"unspecified","delay-in-days":0,"URL":"https:\/\/www.cambridge.org\/core\/terms"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["J. Funct. Prog."],"published-print":{"date-parts":[[2011,11]]},"abstract":"<jats:title>Abstract<\/jats:title><jats:p>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<jats:italic>glue code<\/jats:italic>needed to use an embedded interpreter. Where embedding in C requires a special-purpose \u201cglue function\u201d 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.<\/jats:p>","DOI":"10.1017\/s0956796811000219","type":"journal-article","created":{"date-parts":[[2011,9,29]],"date-time":"2011-09-29T14:56:16Z","timestamp":1317308176000},"page":"585-615","source":"Crossref","is-referenced-by-count":5,"title":["Embedding an interpreted language using higher-order functions and types"],"prefix":"10.1017","volume":"21","author":[{"given":"NORMAN","family":"RAMSEY","sequence":"first","affiliation":[]}],"member":"56","published-online":{"date-parts":[[2011,9,29]]},"reference":[{"key":"S0956796811000219_ref29","first-page":"285","article-title":"A single intermediate language that supports multiple implementations of exceptions","volume":"35","author":"Ramsey","year":"2000","journal-title":"Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation"},{"key":"S0956796811000219_ref28","unstructured":"Ramsey N. (September 2005) ML module mania: A type-safe, separately compiled, extensible interpreter. In Proceedings of the ACM SIGPLAN Workshop on ML, pp. 172\u2013202."},{"key":"S0956796811000219_ref10","doi-asserted-by":"publisher","DOI":"10.1002\/(SICI)1097-024X(199606)26:6<635::AID-SPE26>3.0.CO;2-P"},{"key":"S0956796811000219_ref25","volume-title":"Tcl and the Tk Toolkit","author":"Ousterhout","year":"1994"},{"key":"S0956796811000219_ref23","doi-asserted-by":"crossref","unstructured":"Olinsky R. , Lindig C. & Ramsey N. (January 2006) Staged allocation: A compositional technique for specifying and implementing procedure calling conventions. In Proceedings of the 33rd ACM Symposium on the Principles of Programming Languages, pp. 409\u2013421.","DOI":"10.1145\/1111320.1111073"},{"key":"S0956796811000219_ref21","unstructured":"Libes D. (December 1994) Exploring Expect: A Tcl-based Toolkit for Automating Interactive Programs. pub-ORA:adr: O'Reilly & Associates, Inc."},{"key":"S0956796811000219_ref19","unstructured":"Leroy X. , Doligez D. , Garrigue J. , R\u00e9my D. & Vouillon J. (July 2004) The Objective Caml system release 3.08: Documentation and user's manual. INRIA. Available at: http:\/\/pauillac.inria.fr\/ocaml\/htmlman"},{"key":"S0956796811000219_ref18","first-page":"109","article-title":"Domain-specific embedded compilers","volume":"35","author":"Leijen","year":"2000","journal-title":"Proceedings of the 2nd Conference on Domain-Specific Languages"},{"key":"S0956796811000219_ref15","volume-title":"Extending and Embedding Perl","author":"Jenness","year":"2002"},{"key":"S0956796811000219_ref5","unstructured":"Celes W. (March 2003) toLua\u2013Accessing C\/C++ code from Lua [online]. Accessed August 29, 2011. Available at: http:\/\/www.tecgraf.puc-rio.br\/~celes\/tolua"},{"key":"S0956796811000219_ref22","unstructured":"Mogilefsky B. (May 1999) Lua in Grim Fandango [online]. Accessed July 2011. Available at: http:\/\/www.grimfandango.net\/?page=articles&pagenumber=2"},{"key":"S0956796811000219_ref20","doi-asserted-by":"publisher","DOI":"10.1145\/199448.199528"},{"key":"S0956796811000219_ref1","first-page":"129","volume-title":"Proceedings of the Fourth Annual Tcl\/Tk Workshop","author":"Beazley","year":"1996"},{"key":"S0956796811000219_ref11","unstructured":"Ierusalimschy R. , de Figueiredo L. H. & Celes W. (November 1996b)s Reference Manual of the Programming Language Lua 2.5. TeCGraf, PUC-Rio. Available from the author."},{"key":"S0956796811000219_ref30","doi-asserted-by":"publisher","DOI":"10.1145\/641909.641910"},{"key":"S0956796811000219_ref14","doi-asserted-by":"crossref","unstructured":"Ierusalimschy R. , de Figueiredo L. H. & Celes W. (June 2007) The evolution of Lua. In Proceedings of the Third ACM SIGPLAN Conference on History of Programming Languages, pp. 2-1\u20132-26.","DOI":"10.1145\/1238844.1238846"},{"key":"S0956796811000219_ref2","unstructured":"Benson B. W. (October 1994) Libscheme: Scheme as a C library. In Proceedings of the USENIX Symposium on Very High Level Languages, pp. 7\u201319."},{"key":"S0956796811000219_ref6","doi-asserted-by":"publisher","DOI":"10.1145\/237721.237784"},{"key":"S0956796811000219_ref7","doi-asserted-by":"publisher","DOI":"10.1007\/BFb0055112"},{"key":"S0956796811000219_ref13","unstructured":"Ierusalimschy R. , de Figueiredo L. H. & Celes W. (May 2001) The evolution of an extension language: A history of Lua. In Proceedings of the V Brazilian Symposium on Programming Languages, pp. B14\u2013B28. Invited paper."},{"key":"S0956796811000219_ref17","first-page":"419","article-title":"Elk: The extension language kit","volume":"7","author":"Laumann","year":"1994","journal-title":"Comput. Syst."},{"key":"S0956796811000219_ref16","unstructured":"Jeske D. (1998) ***Hz\u2013A real-time action strategy engine [online]. Unpublished software. Accessed August 29, 2011. Available at: http:\/\/dj1.willowmail.com\/~jeske\/Projects\/HZ\/"},{"key":"S0956796811000219_ref9","unstructured":"Ierusalimschy R. (December 2003) Programming in Lua. Lua.org. ISBN 85-903798-1-7."},{"key":"S0956796811000219_ref12","unstructured":"Ierusalimschy R. , de Figueiredo L. H. & Celes W. (October 2000) Reference Manual of the Programming Language Lua 4.0. TeCGraf, PUC-Rio. Available at: http:\/\/www.lua.org"},{"key":"S0956796811000219_ref3","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796804005398"},{"key":"S0956796811000219_ref24","unstructured":"Ousterhout J. K. (January 1990) Tcl: An embeddable command language. In Proceedings of the Winter USENIX Conference, pp. 133\u2013146."},{"key":"S0956796811000219_ref4","doi-asserted-by":"crossref","unstructured":"Blume M. (September 2001) No-longer-foreign: Teaching an ML compiler to speak C \u201cnatively\u201d. In Proceedings of the First Workshop on Multi-Language Infrastructure and Interoperability (BABEL '01).","DOI":"10.1016\/S1571-0661(05)80452-9"},{"key":"S0956796811000219_ref27","doi-asserted-by":"crossref","unstructured":"Ramsey N. (June 2003) Embedding an interpreted language using higher-order functions and types. In Proceedings of the ACM Workshop on Interpreters, Virtual Machines, and Emulators, pp. 6\u201314.","DOI":"10.1145\/858570.858571"},{"key":"S0956796811000219_ref32","unstructured":"van Rossum G. (2002) Extending and Embedding the Python Interpreter. Release 2.2.2."},{"key":"S0956796811000219_ref33","first-page":"289","article-title":"Encoding types in ML-like languages","volume":"34","author":"Yang","year":"1999","journal-title":"Proceedings of the 1998 ACM SIGPLAN International Conference on Functional Programming"},{"key":"S0956796811000219_ref26","first-page":"1","volume-title":"Proceedings of the International Conference on Principles and Practice of Declarative Programming","author":"Peyton Jones","year":"1999"},{"key":"S0956796811000219_ref31","first-page":"410","volume-title":"Proceedings of the 8th European Conference on Principles and Practice of Knowledge Discovery in Databases","author":"Siefkes","year":"2004"},{"key":"S0956796811000219_ref8","first-page":"1","volume-title":"Advanced Functional Programming","author":"Fokker","year":"1995"}],"container-title":["Journal of Functional Programming"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.cambridge.org\/core\/services\/aop-cambridge-core\/content\/view\/S0956796811000219","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2021,12,8]],"date-time":"2021-12-08T04:38:11Z","timestamp":1638938291000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.cambridge.org\/core\/product\/identifier\/S0956796811000219\/type\/journal_article"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2011,9,29]]},"references-count":33,"journal-issue":{"issue":"6","published-print":{"date-parts":[[2011,11]]}},"alternative-id":["S0956796811000219"],"URL":"https:\/\/doi.org\/10.1017\/s0956796811000219","relation":{},"ISSN":["0956-7968","1469-7653"],"issn-type":[{"value":"0956-7968","type":"print"},{"value":"1469-7653","type":"electronic"}],"subject":[],"published":{"date-parts":[[2011,9,29]]}}}