000216042 001__ 216042
000216042 005__ 20190317000407.0
000216042 0247_ $$2doi$$a10.1145/2784731.2784760
000216042 022__ $$a0362-1340
000216042 02470 $$2ISI$$a000367255800002
000216042 037__ $$aCONF
000216042 245__ $$aFunctional Pearl: A SQL to C Compiler in 500 Lines of Code
000216042 260__ $$bAssoc Computing Machinery$$c2015$$aNew York
000216042 269__ $$a2015
000216042 300__ $$a8
000216042 336__ $$aConference Papers
000216042 520__ $$aWe present the design and implementation of a SQL query processor that outperforms existing database systems and is written in just about 500 lines of Scala code - a convincing case study that high-level functional programming can handily beat C for systems-level programming where the last drop of performance matters. The key enabler is a shift in perspective towards generative programming. The core of the query engine is an interpreter for relational algebra operations, written in Scala. Using the open-source LMS Framework (Lightweight Modular Staging), we turn this interpreter into a query compiler with very low effort. To do so, we capitalize on an old and widely known result from partial evaluation known as Futamura projections, which state that a program that can specialize an interpreter to any given input program is equivalent to a compiler. In this pearl, we discuss LMS programming patterns such as mixed-stage data structures (e.g. data records with static schema and dynamic field components) and techniques to generate low-level C code, including specialized data structures and data loading primitives.
000216042 6531_ $$aSQL
000216042 6531_ $$aQuery Compilation
000216042 6531_ $$aStaging
000216042 6531_ $$aGenerative Programming
000216042 6531_ $$aFutamura Projections
000216042 700__ $$0243345$$g185682$$aRompf, Tiark
000216042 700__ $$aAmin, Nada$$g164625$$0246589
000216042 7112_ $$dAUG 31-SEP 02, 2015$$cVancouver, CANADA$$a20th ACM SIGPLAN International Conference on Functional Programming (ICFP)
000216042 773__ $$j50$$tAcm Sigplan Notices$$k9$$q2-9
000216042 8564_ $$uhttps://infoscience.epfl.ch/record/216042/files/rompf-icfp15.pdf$$zPostprint$$s226638$$yPostprint
000216042 909C0 $$xU10409$$0252187$$pLAMP
000216042 909CO $$qGLOBAL_SET$$pconf$$ooai:infoscience.tind.io:216042$$pIC
000216042 917Z8 $$x166927
000216042 917Z8 $$x164625
000216042 937__ $$aEPFL-CONF-216042
000216042 973__ $$rREVIEWED$$sPUBLISHED$$aEPFL
000216042 980__ $$aCONF