Loading…
Extending type systems in a library: Type-safe XML processing in C++
Type systems built directly into the compiler or interpreter of a programming language cannot be easily extended to keep track of run-time invariants of new abstractions. Yet, programming with domain-specific abstractions could benefit from additional static checking. This paper presents library tec...
Saved in:
Published in: | Science of computer programming 2011-04, Vol.76 (4), p.290-306 |
---|---|
Main Authors: | , |
Format: | Article |
Language: | English |
Subjects: | |
Citations: | Items that this one cites |
Online Access: | Get full text |
Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
Summary: | Type systems built directly into the compiler or interpreter of a programming language cannot be easily extended to keep track of run-time invariants of new abstractions. Yet, programming with domain-specific abstractions could benefit from additional static checking. This paper presents library techniques for extending the type system of C++ to support domain-specific abstractions. The main contribution is a programmable “subtype” relation. As a demonstration of the techniques, we implement a type system for defining type qualifiers in C++, as well as a type system for the XML processing language, capable of, e.g., statically guaranteeing that a program only produces valid XML documents according to a given XML schema.
► Metaprogramming capabilities of C++ enable domain-specific type system extensions. ► A template library for building new type system extensions. ► Type system extensions for type qualifiers. ► Type system extensions for regular expression types for typing XML. |
---|---|
ISSN: | 0167-6423 1872-7964 |
DOI: | 10.1016/j.scico.2010.09.004 |