TY - GEN
T1 - Making standard ML a practical database programming language
AU - Ohori, Atsushi
AU - Ueno, Katsuhiro
PY - 2011
Y1 - 2011
N2 - 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.
AB - 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.
KW - Interoperability
KW - Polymorphism
KW - SML#
KW - SQL
KW - Type System
UR - http://www.scopus.com/inward/record.url?scp=80054066793&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=80054066793&partnerID=8YFLogxK
U2 - 10.1145/2034773.2034815
DO - 10.1145/2034773.2034815
M3 - Conference contribution
AN - SCOPUS:80054066793
SN - 9781450308656
T3 - Proceedings of the ACM SIGPLAN International Conference on Functional Programming, ICFP
SP - 307
EP - 319
BT - ICFP'11 - Proceedings of the 2011 ACM SIGPLAN International Conference on Functional Programming
T2 - 16th ACM SIGPLAN International Conference on Functional Programming, ICFP'11
Y2 - 19 September 2011 through 21 September 2011
ER -