A SQL to C compiler in 500 lines of code. (2019)
- Record Type:
- Journal Article
- Title:
- A SQL to C compiler in 500 lines of code. (2019)
- Main Title:
- A SQL to C compiler in 500 lines of code
- Authors:
- ROMPF, TIARK
AMIN, NADA - Abstract:
- Abstract: We 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 toward generative programming. The core of the query engine is an interpreter for relational-algebra operations, written in Scala. Using the open-source lightweight modular staging framework, 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: the first Futamura projection, which states that a process that can specialize an interpreter to any given input program is equivalent to a compiler. In this context, we discuss lightweight modular staging 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.
- Is Part Of:
- Journal of functional programming. Volume 29(2019)
- Journal:
- Journal of functional programming
- Issue:
- Volume 29(2019)
- Issue Display:
- Volume 29, Issue 2019 (2019)
- Year:
- 2019
- Volume:
- 29
- Issue:
- 2019
- Issue Sort Value:
- 2019-0029-2019-0000
- Page Start:
- Page End:
- Publication Date:
- 2019
- Subjects:
- Functional programming (Computer science) -- Periodicals
- Journal URLs:
- http://journals.cambridge.org/action/displayJournal?jid=JFP ↗
http://firstsearch.oclc.org ↗ - DOI:
- 10.1017/S0956796819000054 ↗
- Languages:
- English
- ISSNs:
- 0956-7968
- Deposit Type:
- Legaldeposit
- View Content:
- Available online (eLD content is only available in our Reading Rooms) ↗
- Physical Locations:
- British Library STI - ELD Digital store
- Ingest File:
- 13009.xml