General Articles
Apr 10, 2002
Introduction to the RTG style of programming.
Apr 9, 2002
Generating Random Indices. How do you pick K random elements from an array of N elements?
Nov 12, 2001
C++ Trivia 1
Aug 20, 2001
An elegant implementation of an N log N sort (heap sort) in C++.
Nov 19, 2000

Explicit specification of side effects.
We examine optimizations and error-checking benefits that result from adding a "no_side_effects" flag to user-defined functions.

Oct 31, 2000
A summary of ways to pass an argument to a function
Sep 25, 2000
Properties of C++ operator "."
We notice that operator "." is special in C and C++.
Sep 06, 2000
An efficient implementation of dynamic_cast<>
We describe how C++ operator dynamic_cast<> can be implemented. We also present "operator" guid_cast<>, which can be implemented by hand.
Sep 01, 2000
Function-classes in C++.
Aug 24, 2000

Manipulating IEEE floating-point numbers.

Aug 7, 2000

Generating unique variable names in C++.

July 09, 2000
Avoid passing extra data to a recursive function
June 10, 2000

On conversion of floats to integers on PC

 

Self-Similar
Mar 9, 2002
Constructor and destructor are simple object states; Other nested and parallel states can be added.
Dec 12, 2001
Consider bugs like returning a reference to a local variable, or storing a temporary pointer inside a function. These can be addressed with Lifespan specification.
Nov 26, 2001

C is a language which has existed for about 30 years, and in that time changed very little compared to number of versions of, say, Microsoft Word formats. It follows that a programming language is the best file format.

Nov 12, 2001

Dispatch Mechanisms

Mar 31, 2001

Types as value constraints

Mar 28, 2001

Choosing function call syntax
We try to devise a better function declaration than C++. We also discuss types and C++ "templates".

Oct 31, 2000

Language syntax, implicit information, and the program editor
We notice that much of a language's flavor is determined by what kind of imformation can be specified implicitely. We argue that a visual environment is needed in which implicit data could be shown or hidden by simply changing display options.

Oct 29, 2000
The case for move constructor
We propose to add a "move constructor(a,b)" to replace the common sequence "copy-constructor(a,b), destructor(a)"
Sep 29, 2000

Expressions and anti-expressions (modeling exceptions, return's, etc).
An anti-expression is associated with each expression. Anti-expressions are evaluated in reverse order, after all expressions are evaluated. We find that modelling exceptions and control flow statements (break, continue, return) is easy using this approach. We also find that double-exceptions are handled easily using this paradigm.

Sep 04, 2000

Describing types with interfaces
We describe a way to implement objects of unknown size in C++; We then describe an alternative to C++'s interfaces (which are too general).

Aug 29, 2000
Duality of templates and interfaces
We notice that a C++ template really specifies an interface. Given this interface, a template or a pure virtual class can be automatically generated. The "template" results in more bytes of faster code, whereas interface results in less bytes of slower code. Thus the choice between templates and interfaces is framed as an optimization issue.
Aug 12, 2000

Lambda functions in C++
We describe a way to retrofit lambda functions to C++ with very minor changes to compiler architecture. This is done by looking at function as an evolving class. We attempt to minimize resulting performance penalties.

 

Language Research Resources
A comprehensive list of links is maintained by Mark Leone at CMU
Pliant is a fairly advanced meta-extensible language.
Basic Issues in Floating Point Arithmetic and Error Analysis

 

A brief tutorial on recursion.

 

www.self-similar.com
e-mail: alexei at self-similar.com
© 2002 Alexei Lebedev