William "Chops" Westfield wrote: > I've opined before that part of C's success may have been due to > having the language specification completely separate from the > language definition. That wasn't true of Fortran, it's not true of > Pascal (one of things that particularly annoyed me about Pascal was > that the language's built-in functions got to have more features than > user-written functions. Like variable numbers of arguments.) > Indeed, I think many languages got "bogged down" trying to define a > "complete" set of useful library functions. I think this is something that made the porting of compilers rather easy, and may be one of the reasons why C spread so (comparatively easily) to many platforms. Especially true in the small micro and bare metal world, where it's important that it's easy to replace the standard library functions with custom implementations with little effort. See for example printf and putch (used by printf) -- it's easy to adapt the functionality of a standard function (printf), without having to provide a custom implementation for it, by redefining another standard function (putch) for your specific system. Which is easily possible without modifying the compiler itself, even for the user. >> But didn't AT&T (owner of Bell Labs) sell Unix licenses? Not to the >> general public, but still sell them? > > I don't think so. Not tell MUCH later, anyway (depending on who you > mean by "not the general public.") Until the mid-80s, unix was > almost exclusively found only in universities and research institutes > and such. But how did those universities and research institutes get it? Did they get it for free? I thought they had to buy it. > They check the types of printf() arguments against the format > descriptors (which is a really weird thing for a compiler that > doesn't define printf() to do, but still rather useful.) Now /this/ is something that's closely related to what I was talking about :) Because how printf works is defined in the standard, even though it's not part of the compiler, the compiler "knows" what printf is supposed to do. And so it can do argument checking against the format string, simply because this is defined in the standard. The compiler doesn't have to have a built-in implementation of printf to do that -- it simply will work with any standard implementation of printf. Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist