Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

Type qualifiers as composable language extensions

Published: 23 October 2017 Publication History

Abstract

This paper reformulates type qualifiers as language extensions that can be automatically and reliably composed. Type qualifiers annotate type expressions to introduce new subtyping relations and are powerful enough to detect many kinds of errors. Type qualifiers, as illustrated in our ableC extensible language framework for C, can introduce rich forms of concrete syntax, can generate dynamic checks on data when static checks are infeasible or not appropriate, and inject code that affects the program's behavior, for example for conversions of data or logging.
ableC language extensions to C are implemented as attribute grammar fragments and provide an expressive mechanism for type qualifier implementations to check for additional errors, e.g. dereferences to pointers not qualified by a "nonnull" qualifier, and report custom error messages. Our approach distinguishes language extension users from developers and provides modular analyses to developers to ensure that when users select a set of extensions to use, they will automatically compose to form a working compiler.

References

[1]
A.V. Aho, R. Sethi, and J.D. Ullman. 1986. Compilers – Principles, Techniques, and Tools. Addison-Wesley, Reading, MA.
[2]
Chris Andreae, James Noble, Shane Markstrum, and Todd Millstein. 2006. A Framework for Implementing Pluggable Type Systems. In Proceedings of the ACM Conference on Object Oriented Programming, Systems, Languages, and Applications (OOPSLA ’06). ACM, 57–74.
[3]
John Tang Boyland. 2005. Remote attribute grammars. J. ACM 52, 4 (2005), 627–687.
[4]
Martin Bravenboer and Eelco Visser. 2004. Concrete syntax for objects: domain-specific language embedding and assimilation without restrictions. In Proceedings of the ACM Conference on Object Oriented Programming, Systems, Languages, and Systems (OOPSLA ’04). ACM, 365–383.
[5]
Russel Cox, Tom Bergany, Austin Clements, Frans Kaashoek, and Eddie Kohlery. 2008. Xoc, an Extension-Oriented Compiler for Systems Programming. In Proceedings of Architectural Support for Programming Languages and Operating Systems (ASPLOS).
[6]
Werner Dietl, Stephanie Dietzel, Michael D. Ernst, Kivanç Muşlu, and Todd W. Schiller. 2011. Building and Using Pluggable Type-checkers. In Proceedings of the 33rd International Conference on Software Engineering (ICSE ’11). ACM, New York, NY, USA, 681–690.
[7]
Torbjörn Ekman and Görel Hedin. 2007. The JastAdd extensible Java compiler. In Proceedings of the ACM Conference on Object Oriented Programming, Systems, Languages, and Systems (OOPSLA ’07). ACM, 1–18.
[8]
Torbjörn Ekman and Görel Hedin. 2007. The JastAdd system - modular extensible compiler construction. Science of Computer Programming 69 (December 2007), 14–26. Issue 1-3.
[9]
Sebastian Erdweg, Tillmann Rendel, Christian Kastner, and Klaus Ostermann. 2011. SugarJ: Library-based Syntactic Language Extensibility. In Proceedings of the ACM Conference on Object Oriented Programming, Systems, Languages, and Systems (OOPSLA ’11). ACM, 391–406.
[10]
David Evans. 1996. Static Detection of Dynamic Memory Errors. In Proceedings of the ACM 1996 Conference on Programming Language Design and Implementation (PLDI ’96). ACM, 44–53.
[11]
Jeffrey Scott Foster. 2002. Type Qualifiers: Lightweight Specifications to Improve Software Quality. Ph.D. Dissertation. University of California, Berkeley.
[12]
Jeffrey S. Foster, Manuel Fähndrich, and Alexander Aiken. 1999. A theory of type qualifiers. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’99). ACM.
[13]
Jeffrey S. Foster, Tachio Terauchi, and Alex Aiken. 2002. Flow-Sensitive Type Qualifiers. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’02). Berlin, Germany, 1–12.
[14]
Robert Grimm. 2006. Better extensibility through modular syntax. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI ’06). ACM Press, New York, NY, USA, 38–51.
[15]
G. Hedin. 2000. Reference Attribute Grammars. Informatica 24, 3 (2000), 301–317.
[16]
Lingxiao Jiang and Zhendong Su. 2006. Osprey: A Practical Type System for Validating Dimensional Unit Correctness of C Programs. In Proceedings of the 28th International Conference on Software Engineering (ICSE ’06). ACM, New York, NY, USA, 262–271.
[17]
Ted Kaminski, Lucas Kramer, Travis Carlson, and Eric Van Wyk. 2017. Reliable and automatic composition of language extensions to C. Proceedings of the ACM, Programming Languages, OOPSLA 1, 98 (October 2017).
[18]
Ted Kaminski and Eric Van Wyk. 2012. Modular well-definedness analysis for attribute grammars. In Proceedings of the International Conference on Software Language Engineering (SLE) (LNCS), Vol. 7745. Springer, 352–371.
[19]
D. E. Knuth. 1968. Semantics of Context-free Languages. Mathematical Systems Theory 2, 2 (1968), 127–145. Corrections in 5(1971) pp. 95–96.
[20]
Shane Markstrum, Daniel Marino, Matthew Esquivel, Todd Millstein, Chris Andreae, and James Noble. 2010. JavaCOP: Declarative Pluggable Types for Java. ACM Transactions on Programming Languages and Systems (TOPLAS) 32, 2, Article 4 (Feb. 2010), 37 pages.
[21]
Cyrus Omar. 2017. Reasonably Programmable Syntax. Ph.D. Dissertation. Carnegie Mellon University, Pittsburgh, USA.
[22]
Cyrus Omar, Darya Kurilova, Ligia Nistor, Benjamin Chung, Alex Potanin, and Jonathan Aldrich. 2014. Safely Composable Type-Specific Languages. In Proceedings of the European Conference on Object Oriented Programming (ECOOP ’14), Richard Jones (Ed.). Lecture Notes in Computer Science, Vol. 8586. Springer, 105–130.
[23]
Matthew M. Papi, Mahmood Ali, Telmo Luis Correa, Jr., Jeff H. Perkins, and Michael D. Ernst. 2008. Practical Pluggable Types for Java. In Proceedings of the 2008 International Symposium on Software Testing and Analysis (ISSTA ’08). ACM, 201–212.
[24]
Tiark Rompf and Martin Odersky. 2010. Lightweight Modular Staging: A pragmatic approach to runtime code generation and compiled DSLs. In Proceedings of the ACM SIGPLAN 2010 Conference on Generative Programming and Component Engineering (GPCE ’10). ACM, New York, NY, USA, 127–136.
[25]
August Schwerdfeger and Eric Van Wyk. 2009. Verifiable Composition of Deterministic Grammars. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI ’09). ACM, 199–210.
[26]
Umesh Shankar, Kunal Talwar, Jeffrey S. Foster, and David Wagner. 2001. Detecting Format String Vulnerabilities with Type Qualifiers. In Proceedings of the 10th USENIX Security Symposium. Washington, D.C., 201–218.
[27]
Eric Van Wyk, Derek Bodin, Jimin Gao, and Lijesh Krishnan. 2010. Silver: an Extensible Attribute Grammar System. Science of Computer Programming 75, 1–2 (January 2010), 39–54.
[28]
E. Van Wyk, O. de Moor, K. Backhouse, and P. Kwiatkowski. 2002. Forwarding in Attribute Grammars for Modular Language Design. In Proceedings of the 11th Conference on Compiler Construction (CC) (LNCS), Vol. 2304. Springer-Verlag, 128–142.
[29]
Eric Van Wyk and August Schwerdfeger. 2007. Context-Aware Scanning for Parsing Extensible Languages. In Proceedings of the International Conference on Generative Programming and Component Engineering (GPCE ’07). ACM, 63–72.
[30]
Markus Voelter, Daniel Ratiu, Bernhard Schaetz, and Bernd Kolb. 2012. Mbeddr: An Extensible C-based Programming Language and IDE for Embedded Systems. In Proceedings of the 3rd Annual Conference on Systems, Programming, and Applications: Software for Humanity (SPLASH Wavefront ’12). ACM, New York, NY, USA, 121–140.
[31]
H. Vogt, S. D. Swierstra, and M. F. Kuiper. 1989. Higher-order Attribute Grammars. In Proceedings of ACM Conference on Programming Language Design and Implementation (PLDI). ACM, 131–145.

Cited By

View all
  • (2020)Precise inference of expressive units of measurement typesProceedings of the ACM on Programming Languages10.1145/34282104:OOPSLA(1-28)Online publication date: 13-Nov-2020
  • (2020)Synthesis of assurance cases for software certificationProceedings of the ACM/IEEE 42nd International Conference on Software Engineering: New Ideas and Emerging Results10.1145/3377816.3381728(61-64)Online publication date: 27-Jun-2020
  • (2017)Reliable and automatic composition of language extensions to C: the ableC extensible language frameworkProceedings of the ACM on Programming Languages10.1145/31382241:OOPSLA(1-29)Online publication date: 12-Oct-2017

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 52, Issue 12
GPCE '17
December 2017
258 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/3170492
Issue’s Table of Contents
  • cover image ACM Conferences
    GPCE 2017: Proceedings of the 16th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences
    October 2017
    258 pages
    ISBN:9781450355247
    DOI:10.1145/3136040
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 the author(s) 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].

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 23 October 2017
Published in SIGPLAN Volume 52, Issue 12

Check for updates

Author Tags

  1. dimensional analysis
  2. extensible languages
  3. pluggable types
  4. type qualifiers
  5. type systems

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)8
  • Downloads (Last 6 weeks)1
Reflects downloads up to 10 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2020)Precise inference of expressive units of measurement typesProceedings of the ACM on Programming Languages10.1145/34282104:OOPSLA(1-28)Online publication date: 13-Nov-2020
  • (2020)Synthesis of assurance cases for software certificationProceedings of the ACM/IEEE 42nd International Conference on Software Engineering: New Ideas and Emerging Results10.1145/3377816.3381728(61-64)Online publication date: 27-Jun-2020
  • (2017)Reliable and automatic composition of language extensions to C: the ableC extensible language frameworkProceedings of the ACM on Programming Languages10.1145/31382241:OOPSLA(1-29)Online publication date: 12-Oct-2017

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