Tuesday 19 April 2011

C as a Systems Language

The "Systems Language" definition is a bit fuzzy. I'd say it has to have address manipulation, type coercion (not conversion but all that evil stuff with unions and the like). It should also support plenty of bit meddling operations and structures.

To this end C has served well.

What has not served well has been the standard libraries and it's evolution.

Huge amounts of the specification can no longer change due to backwards compatibility. For example, we really don't need both typedefs and structs. We really could use polymorphism and even templates (without classes). We could build an object system (ala QObject or Objective C) if we had a slightly better macro system. The typedef synonym system really doesn't work well with automatic type conversion (which should be banned!). The string format is a bit... hmmm... It WOULD be FAR more efficient to store length (I really can't over-emphasize that!)

We could... but it works.

Maybe there's a need for a "new" C... but maybe what we've got is just damn good enough.

I say this as I just been rolling a new first fit and buddy memory allocator - it would be nice to have ref counted objects but, you know what, we can still work without them.

No comments: