Re: [GENERAL] C++ port of Postgres - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] C++ port of Postgres
Date
Msg-id 27271.1471366764@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] C++ port of Postgres  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [GENERAL] C++ port of Postgres  (Robert Haas <robertmhaas@gmail.com>)
Re: [GENERAL] C++ port of Postgres  (Peter Geoghegan <pg@heroku.com>)
Re: [GENERAL] C++ port of Postgres  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I'm not really interested in supporting PostgreSQL code written in
> other languages entirely, such as Rust, but I do think it would make
> sense to write our code so that it can be compiled using either a C
> compiler or a C++ compiler.  Even if we don't ever use any C++ code in
> core, this would let people who create forks or extensions use it if
> they wished.  It wouldn't be that much work to maintain, either: we'd
> just set up some buildfarm members that compiled using C++ and when
> they turned red, we'd go fix it.

I think this might have advantages purely from the standpoint of new
compilers possibly offering useful warnings we don't get now.  But
if we only go this far, I'm pretty dubious that it really helps people
to develop extensions in C++.  Almost invariably, if you ask *why* they
want to do that, you'll get an answer involving C++ libraries that are
not going to play very nice with our error handling or memory management
conventions.  I do not see how we could C++-ify the error handling without
making a complete break with C compilers ... which is a step I don't
really want to take.

The whole thing would make a lot more sense given a credible design
for error handling that keeps both languages happy.

A lot of the other things people have muttered about, such as heavier
use of inline functions instead of macros, don't particularly need C++
at all.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [Patch] Temporary tables that do not bloat pg_catalog (a.k.a fast temp tables)
Next
From: Alvaro Herrera
Date:
Subject: Re: Assertion failure in REL9_5_STABLE