Making standard ML a practical database programming language

Atsushi Ohori, Katsuhiro Ueno

Research output: Contribution to journalArticlepeer-review

12 Citations (Scopus)


Integrating a database query language into a programming language is becoming increasingly important in recently emerging high-level cloud computing and other applications, where efficient and sophisticated data manipulation is required during computation. This paper reports on seamless integration of SQL into SML# - an extension of Standard ML. In the integrated language, the type system always infers a principal type for any type consistent SQL expression. This makes SQL queries first-class citizens, which can be freely combined with any other language constructs definable in Standard ML. For a program involving SQL queries, the compiler separates SQL queries and delegates their evaluation to a database server, e.g. PostgreSQL or MySQL in the currently implemented version. The type system of our language is largely based on Machiavelli, which demonstrates that ML with record polymorphism can represent type structure of SQL. In order to develop a practical language, however, a number of technical challenges have to be overcome, including static enforcement of server connection consistency, proper treatment of overloaded SQL primitives, query compilation, and runtime connection management. This paper describes the necessary extensions to the type system and compilation, and reports on the details of its implementation.

Original languageEnglish
Pages (from-to)307-319
Number of pages13
JournalACM SIGPLAN Notices
Issue number9
Publication statusPublished - 2011 Sep


  • Interoperability
  • Polymorphism
  • SML#
  • SQL
  • Type System

ASJC Scopus subject areas

  • Computer Science(all)


Dive into the research topics of 'Making standard ML a practical database programming language'. Together they form a unique fingerprint.

Cite this