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.
- A.V. Aho, R. Sethi, and J.D. Ullman. 1986. Compilers – Principles, Techniques, and Tools. Addison-Wesley, Reading, MA.Google Scholar
- 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. Google Scholar
Digital Library
- John Tang Boyland. 2005. Remote attribute grammars. J. ACM 52, 4 (2005), 627–687. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- 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). Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- 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.Google Scholar
- 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.Google Scholar
- 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. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- Jeffrey Scott Foster. 2002. Type Qualifiers: Lightweight Specifications to Improve Software Quality. Ph.D. Dissertation. University of California, Berkeley.Google Scholar
- 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. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- G. Hedin. 2000. Reference Attribute Grammars. Informatica 24, 3 (2000), 301–317.Google Scholar
- 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.Google Scholar
Digital Library
- 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).Google Scholar
- 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.Google Scholar
- D. E. Knuth. 1968. Semantics of Context-free Languages. Mathematical Systems Theory 2, 2 (1968), 127–145. Corrections in 5(1971) pp. 95–96.Google Scholar
Cross Ref
- 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.Google Scholar
Digital Library
- Cyrus Omar. 2017. Reasonably Programmable Syntax. Ph.D. Dissertation. Carnegie Mellon University, Pittsburgh, USA.Google Scholar
- 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. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- 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.Google Scholar
- 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.Google Scholar
Digital Library
- 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. Google Scholar
Cross Ref
- 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. Google Scholar
Digital Library
- 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.Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
Index Terms
Type qualifiers as composable language extensions
Recommendations
Type qualifiers as composable language extensions
GPCE 2017: Proceedings of the 16th ACM SIGPLAN International Conference on Generative Programming: Concepts and ExperiencesThis 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 ...
Flow-insensitive type qualifiers
We describe flow-insensitive type qualifiers, a lightweight, practical mechanism for specifying and checking properties not captured by traditional type systems. We present a framework for adding new, user-specified type qualifiers to programming ...
Semantic type qualifiers
Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementationWe present a new approach for supporting user-defined type refinements, which augment existing types to specify and check additional invariants of interest to programmers. We provide an expressive language in which users define new refinements and ...







Comments