Computing Papers
Here you'll find various self-published technical papers written by yours truly...
As anyone familiar with my software might guess, based on the amount of documentation, i like to write. i admit it: i'm one of those rare programmers who gets a signicant amount of joy out of writing documentation (gasp!).
This page hosts several papers i have written during the development of various projects. These papers are not specifically geared towards any given project, but cover topics which are generally applicable to many 21st-century C++ projects.
Any and all constructive feedback on these papers is very happily received. Useful feedback will be published in future, updated revisions of these papers, of course with full credit going to those who provide suggestions.
If you happen to re-distribute any of these papers, or get any use whatsoever out of them, i would be absolutely flattered if you would tell me so.
Fair warnings to potential readers:
- i am not a C/C++ guru. i can get by with both languages, but i'm always learning new things about them (often things which surprise me!). Thus these papers may contain some factual errors about C or C++. If the reader notices any, i would ask that he please gently prod me along in the proper direction...
- All of these papers are released into the Public Domain, and of course carry No Warranties of any type.
Context Singletons
Last updated: 14 June 2004This is a paper discussing the use of what i call Context Singletons, written during the development of libs11n's first classloader layer. It also develops a non-intrusive, light-weight Phoenix Singleton class.
- context_singletons.pdf (191.63KiB)
- context_singletons.html (41.33KiB)
"Context Singleton" is a bit of a misnomer: this paper probably should have been called "Context Monostates", or something similar.
The latest source code for the phoenix class developed in this paper is available here: libphoenix++-2004.08.17.tar.gz (3792 bytes)
Context Types
Doc last updated: 14 June 2004Like the Context Singletons paper, this one discusses the idea of using types as contexts in C++. It is a gentler introduction to the topic as given in the Context Singletons paper, and is more generic.
- context_types.pdf (85.26KiB)
- context_types.html (10.00KiB)
Supermacros
Doc last updated: 22 August 2004"Supermacros" are a technique the s11n project uses to get at the code generation possibilities implied by traditional C++ macros, while eliminating some of their more notorious problems. This short paper gives an overview of what they are, how they can be used, and their advantages (and one tiny disadvantage) over classic macros.
- supermacros_cpp.pdf (131.50KiB)
- supermacros_cpp.html (22.59KiB)
Lexical casting
Doc last updated: 14 Aug 2005This paper covers the topic of "lexical casting." That is, the conversion of non-string data to and from strings. Loosely-typed languages (e.g., Perl and PHP) inherently support this, but strongly-typed languages (e.g., C++) do not have such a feature built-in. This paper develops a class which generically adds this capability to C++ software.
The source code for the lex_t class developed in this paper can be found here:
libs11n_lex_t++-2004.12.31.tar.gz (16.72KiB)
- lexical_casting.pdf (239.72KiB)
- lexical_casting.html (62.16KiB)
Classloading in C++: bringing it into the 21st century
Doc last updated: 3 Jan 2005This paper addresses the topic of classloading in C++, and presents a generic back-end for adding such support to arbitrary classes and applications.
- classloading_cpp.pdf (271.37KiB)
- classloading_cpp.html (89.35KiB)
Generic Cleanup in C++
Doc last updated: 14 Aug 2005This paper develops an alternate approach to smart pointers for guaranteeing proper cleanup of unmanaged pointers in the face of errors. This approach is used in libs11n 1.1.3+ to provide leak-safety guarantees which it otherwise could not make.
- generic_cleanup_cpp.pdf (166.24KiB)
- generic_cleanup_cpp.html (36.39KiB)
Download the accompanying source code, including Makefile, test program, and doxygen file for generating API docs: libcleanup-2005.08.04.tar.gz (15.62KiB)
Doing OO in C
Doc last updated: 8 Dec 2010This paper develops presents a memory-light, generic approach to "doing OO in C." The model it develops is in use to good effect in several libraries and applications of my own, and it is documented in detail here with the hope that it might help some other C hacker out there. This article is targeted at seasoned C coders.
- DoingOOInC.pdf (224.31KiB)