skip to main content
10.1145/1086365.1086387acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article

High-level views on low-level representations

Published: 12 September 2005 Publication History

Abstract

This paper explains how the high-level treatment of datatypes in functional languages—using features like constructor functions and pattern matching—can be made to coexist with bitdata. We use this term to describe the bit- level representations of data that are required in the construction of many different applications, including operating systems, device drivers, and assemblers. We explain our approach as a combination of two language extensions, each of which could potentially be adapted to any modern functional language. The first adds simple and elegant constructs for manipulating raw bitfield values, while the second provides a view-like mechanism for defining distinct new bitdata types with fine-control over the underlying representation. Our design leverages polymorphic type inference, as well as techniques for improvement of qualified types, to track both the type and the width of bitdata structures. We have implemented our extensions in a small functional language interpreter, and used it to show that our approach can handle a wide range of practical bitdata types.

References

[1]
Lennart Augustsson, Jacob Schwartz, and Rishiyur S. Nikhil. Bluespec Language definition. Sandburst Corporation, 2002.]]
[2]
Godmar Back. Datascript - a specification and scripting language for binary data. In Proceedings of the ACM Conference on Generative Programming and Component Engineering Proceedings (GPCE 2002), pages 66--77, October 2002.]]
[3]
Matthias Blume. No-Longer-Foreign: Teaching an ML compiler to speak C "natively". In BABEL'01: First workshop on multi-language infrastructure and interoperability, September 2001.]]
[4]
Kathleen Fisher and Robert Gruber. PADS: a domain-specific language for processing ad hoc data. In PLDI '05: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation, pages 295--304, 2005.]]
[5]
Benedict R. Gaster and Mark P. Jones. A polymorphic type system for extensible records and variants. Technical report, University of Nottingham, 1996.]]
[6]
J.A. Goguen, J.W. Thatcher, E.G. Wagner, and J.B. Wright. Initial algebra semantics and continuous algebras. JACM, 24(1):68--95, 1997.]]
[7]
Robert W. Harper and Benjamin C. Pierce. Extensible records without subsumption. Technical Report CMU-CS-90-102, School of Computer Science, Carnegie Mellon University, Feburary 1990.]]
[8]
Mark P. Jones. Qualified Types Theory and Practice. Cambridge University Press, 1994.]]
[9]
Mark P. Jones. Simplifying and improving qualified types. Technical Report YALEU/DCS/RR-1040, Yale University, New Haven, Connecticut, USA, June 1994.]]
[10]
Mark P. Jones. Type classes with functional dependencies. In ESOP 2000: European Symposium on Programming, March 2000.]]
[11]
Simon Peyton Jones, editor. Haskell 98 Language and Libraries, TheRevised Report. Cambridge University Press, 2003.]]
[12]
Simon Peyton Jones and Mark Shields. Lexically scoped type variables. March 2004.]]
[13]
Jochen Liedtke. On μ-kernel construction. In 15th ACM Symposium on Operating System Principles, December 1995.]]
[14]
Robin Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17(3):348--375, December 1978.]]
[15]
National Semiconductor. DP8390D/NS32490 NIC Network Interface Controller, July 1995.]]
[16]
Norman Ramsey and Mary F. Fernandez. Specifying representations of machine instructions. ACM Transactions on Programming Languages and Systems, 19(3):492--524, 1997.]]
[17]
L4ka Team. L4 eXperimental Kernel Reference Manual, January 2005. Available online from http://l4ka.org/.]]
[18]
Philip Wadler. Views: a way for pattern matching to cohabit with data abstraction. In 14'th ACM Symposium on Principles of Programming Languages.]]
[19]
Zilog, Inc. Z80-CPU, Z80A-CPU Technical Manual, 1977. Information about the Z80 is also available from www.z80.info.]]

Cited By

View all
  • (2024)Daedalus: Safer Document ParsingProceedings of the ACM on Programming Languages10.1145/36564108:PLDI(816-840)Online publication date: 20-Jun-2024
  • (2024)Unboxed Data Constructors: Or, How cpp Decides a Halting ProblemProceedings of the ACM on Programming Languages10.1145/36328938:POPL(1509-1539)Online publication date: 5-Jan-2024
  • (2023)Dargent: A Silver Bullet for Verified Data Layout RefinementProceedings of the ACM on Programming Languages10.1145/35712407:POPL(1369-1395)Online publication date: 11-Jan-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICFP '05: Proceedings of the tenth ACM SIGPLAN international conference on Functional programming
September 2005
342 pages
ISBN:1595930647
DOI:10.1145/1086365
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 40, Issue 9
    Proceedings of the tenth ACM SIGPLAN international conference on Functional programming
    September 2005
    330 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1090189
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 12 September 2005

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. bit manipulation
  2. bitdata
  3. bitfields
  4. data representation
  5. pattern matching
  6. polymorphism
  7. qualified types
  8. views

Qualifiers

  • Article

Conference

ICFP05
Sponsor:

Acceptance Rates

Overall Acceptance Rate 333 of 1,064 submissions, 31%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)4
  • Downloads (Last 6 weeks)0
Reflects downloads up to 15 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Daedalus: Safer Document ParsingProceedings of the ACM on Programming Languages10.1145/36564108:PLDI(816-840)Online publication date: 20-Jun-2024
  • (2024)Unboxed Data Constructors: Or, How cpp Decides a Halting ProblemProceedings of the ACM on Programming Languages10.1145/36328938:POPL(1509-1539)Online publication date: 5-Jan-2024
  • (2023)Dargent: A Silver Bullet for Verified Data Layout RefinementProceedings of the ACM on Programming Languages10.1145/35712407:POPL(1369-1395)Online publication date: 11-Jan-2023
  • (2018)MIL, a Monadic Intermediate Language for Implementing Functional LanguagesProceedings of the 30th Symposium on Implementation and Application of Functional Languages10.1145/3310232.3310238(71-82)Online publication date: 5-Sep-2018
  • (2015)Guilt free ivoryACM SIGPLAN Notices10.1145/2887747.280431850:12(189-200)Online publication date: 30-Aug-2015
  • (2015)Guilt free ivoryProceedings of the 2015 ACM SIGPLAN Symposium on Haskell10.1145/2804302.2804318(189-200)Online publication date: 30-Aug-2015
  • (2014)Building embedded systems with embedded DSLsACM SIGPLAN Notices10.1145/2692915.262814649:9(3-9)Online publication date: 19-Aug-2014
  • (2014)Building embedded systems with embedded DSLsProceedings of the 19th ACM SIGPLAN international conference on Functional programming10.1145/2628136.2628146(3-9)Online publication date: 19-Aug-2014
  • (2013)Synchronous digital circuits as functional programsACM Computing Surveys10.1145/2543581.254358846:2(1-27)Online publication date: 1-Nov-2013
  • (2008)Automatic transformation of bit-level C code to support multiple equivalent data layoutsProceedings of the Joint European Conferences on Theory and Practice of Software 17th international conference on Compiler construction10.5555/1788374.1788382(85-99)Online publication date: 29-Mar-2008
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media