Papers: Types++: Typesafe Metadata, and Other Thoughts Beyond int

I wrote this paper for ADHOC 2005. While I was unable to attend, I submitted the paper anyway.


C/C++ (and other strongly, statically typed languages) use type data as a compile-time check: you can't put that there, or the ever-popular "some data might be truncated" warning. Still there is possibility for error: can you know for certain, just by looking at a function prototype, that the Str255 parameter is a PString, or a shortcut by a lazy programmer? Or can you ever be certain that your divisor (int) is not zero, without checks all over? What character encoding does that std::string contain? In essence: metadata, not just type, is an important factor of many variables. Metadata focus can be achieved by using a concept called meta-types, which can supply compile-time checks, runtime checks, and serve as form of documentation for future maintainers. This paper will further discuss metadata, meta-type classes (implementation, usage, examples, and drawbacks), and other thoughts for modern "type" safety.


Download the rest of the paper