John Dallman
2024-08-15 21:36:00 UTC
A moderately experienced developer asked me why we have a formal
31-character limit on the length of identifiers in our published API, and
why there are some C macros with names longer than that which don't cause
problems.
I gave him a short version of the history of linkers and the gradually
increasing limits of symbol name length over the decades. I explained how
C macros get replaced: he's a mathematician by education, and took a
while to appreciate that practical computing involves compromises rather
than truly implementing mathematical abstractions.
In the process I realised that 6-character names would fit into the
36-bit words (using 6-bit bytes) of IBM 700/7000 series machines, where
Fortran was originally developed, and this is probably the origin of the
6-character limit.
John
31-character limit on the length of identifiers in our published API, and
why there are some C macros with names longer than that which don't cause
problems.
I gave him a short version of the history of linkers and the gradually
increasing limits of symbol name length over the decades. I explained how
C macros get replaced: he's a mathematician by education, and took a
while to appreciate that practical computing involves compromises rather
than truly implementing mathematical abstractions.
In the process I realised that 6-character names would fit into the
36-bit words (using 6-bit bytes) of IBM 700/7000 series machines, where
Fortran was originally developed, and this is probably the origin of the
6-character limit.
John