[Radiance-general] FYI Re: CVS, ANSI
Greg Ward
[email protected]
Sat, 8 Jun 2002 07:14:59 -0700
I agree that a code rewrite would be nice, but would require way more
free time than I have, and I'm not sure I'd trust the task to someone
else. Making Radiance ANSI-C compatible, at least as far as adding
function prototypes and the like, wouldn't be terribly difficult, and is
probably a recommended first step to having others working on the code
base. I only wish I were more familiar with what's in ANSI-C and what's
not.
There are two reasons Radiance wasn't converted to ANSI-C long ago.
First, some systems (Sun in particular) were distributed with a free K&R
compiler, but you had to pay for the ANSI-C compiler, so many people
couldn't have built Radiance if it were ANSI-C. Second, I had a bias
against ANSI-C because I never ran into portability problems before its
invention, but had nothing but trouble afterwards. From my perspective,
ANSI-C was a giant step backwards in compatibility, with a subsequent
explosion of header files and prototypes and subtle system differences.
Before ANSI, I could hop onto virtually any machine and read the header
files to know what was going on. After ANSI and the related attempts to
"standardize" UNIX, I couldn't make sense of any of the headers anymore,
since there were about a dozen #ifdef's in each one for all the various
attempted compatibilities.
If I were to really rewrite Radiance, I would want to start from the
ground up and take a different approach to many problems. The process
might take years, and it's by no means certain that the final result
would be any better than what we currently have. Furthermore, who would
fund such a development effort? It was a brutal struggle to do it in
the first place within all the budget constraints at LBNL, and what
little money there was for research software development there and
elsewhere in the U.S. has all but dried up.
I solved Len's compile problems by jumping onto his machine and making a
few changes. Besides the sys_errlist definition, there were a couple of
other things that were messed up due to the combination of GNU-C and
Solaris. That's a good idea to use strerror(), though -- I'll put that
into the next release. I embarrassed to say that I didn't know about it.
-Greg