From: | "Chuck McDevitt" <cmcdevitt(at)greenplum(dot)com> |
---|---|
To: | "Dave Held" <dave(dot)held(at)arrayservicesgrp(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Woo hoo ... a whole new set of compiler |
Date: | 2005-04-22 17:35:11 |
Message-ID: | BB05A27C22288540A3A3E8F3749B45AB1EC604@MI8NYCMAIL06.Mi8.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> -----Original Message-----
> From: pgsql-hackers-owner(at)postgresql(dot)org [mailto:pgsql-hackers-
> owner(at)postgresql(dot)org] On Behalf Of Dave Held
> Sent: Friday, April 22, 2005 10:23 AM
> To: pgsql-hackers(at)postgresql(dot)org
> Subject: Re: [HACKERS] Woo hoo ... a whole new set of compiler
> headaches!! :)
>
> > -----Original Message-----
> > From: Alvaro Herrera [mailto:alvherre(at)dcc(dot)uchile(dot)cl]
> > Sent: Friday, April 22, 2005 12:06 PM
> > To: Tom Lane
> > Cc: Dave Held; pgsql-hackers(at)postgresql(dot)org
> > Subject: Re: [HACKERS] Woo hoo ... a whole new set of compiler
> > headaches!! :)
> >
> > [...]
> > Why don't we rewrite Postgres in D?
> >
> > http://www.digitalmars.com/d/
> >
> > :-D
>
> I see the smiley, but moving to C++ isn't just about switching
> to the latest fad language. First of all, you would literally
> have to rewrite it to use D. There would probably need to be
> very little work to make the Postgres codebase a conforming set
> of C++ programs (mostly renaming variables/types named 'class',
> 'virtual', 'bool', etc.). Second, you can find a decent C++
> compiler on virtually every platform that has a C compiler.
> Third, C++ offers real advantages in type safety, exception
> handling, resource management, and even performance.
>
> Even doing something as simple as writing a stored procedure
> in C is somewhat awkward because of all the boilerplate casting
> that must be done. I'm fairly certain that most of the macros
> in the stored procedure interface could go away if a C++ API
> were created.
>
> __
> David B. Held
I've done extensive coding in both C and C++, and I have to agree with
David.
C++ is "a better C", and if used properly, there isn't any performance
penalty. C++ code has better checking from the compiler, and can often
be written in ways that make the code far more readable.
That said, getting people to change is definitely an uphill battle. The
open-source community tends to be very focused on C, and very reluctant
to change.
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Dunstan | 2005-04-22 17:45:38 | Re: Woo hoo ... a whole new set of compiler headaches!! |
Previous Message | Dave Held | 2005-04-22 17:23:06 | Re: Woo hoo ... a whole new set of compiler headaches!! :) |