000227174 001__ 227174
000227174 005__ 20190317000655.0
000227174 0247_ $$2doi$$a10.1145/2784731.2784760
000227174 037__ $$aCONF
000227174 245__ $$aFunctional Pearl: A SQL to C Compiler in 500 Lines of Code’
000227174 269__ $$a2015
000227174 260__ $$c2015
000227174 336__ $$aConference Papers
000227174 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.
000227174 6531_ $$aSQL
000227174 6531_ $$aQuery Compilation
000227174 6531_ $$aStaging
000227174 6531_ $$aGenerative Programming
000227174 6531_ $$aFutamura Projections
000227174 700__ $$0243345$$g185682$$aRompf, Tiark
000227174 700__ $$0246589$$g164625$$aAmin, Nada
000227174 7112_ $$dAugust 31 - September 02, 2015$$cVancouver, BC, Canada$$aICFP 2015
000227174 773__ $$tProceedings of the 20th ACM SIGPLAN International Conference on Functional Programming
000227174 8564_ $$uhttps://infoscience.epfl.ch/record/227174/files/rompf-icfp15.pdf$$zPostprint$$s226638$$yPostprint
000227174 909C0 $$xU10409$$0252187$$pLAMP
000227174 909CO $$qGLOBAL_SET$$pconf$$ooai:infoscience.tind.io:227174$$pIC
000227174 917Z8 $$x164625
000227174 917Z8 $$x164625
000227174 917Z8 $$x166927
000227174 937__ $$aEPFL-CONF-227174
000227174 973__ $$rREVIEWED$$sPUBLISHED$$aOTHER
000227174 980__ $$aCONF