Re: [GENERAL] C++ port of Postgres

From: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
To: Christopher Browne <cbbrowne(at)gmail(dot)com>, Piotr Stefaniak <postgres(at)piotr-stefaniak(dot)me>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>, dandl <david(at)andl(dot)org>, "Adam Brusselback" <adambrusselback(at)gmail(dot)com>, Joy Arulraj <jarulraj(at)cs(dot)cmu(dot)edu>, kang joni <kangjoni76(at)gmail(dot)com>, Dmitry Igrishin <dmitigr(at)gmail(dot)com>, "Pg Hackers" <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: [GENERAL] C++ port of Postgres
Date: 2016-08-17 01:16:02
Message-ID: 0A3221C70F24FB45833433255569204D1F5C2668@G01JPEXMBYT05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

From: pgsql-hackers-owner(at)postgresql(dot)org
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Peter Geoghegan
> I think that the best thing about C++ is the ability to encapsulate and
> simplify some aspects of resource management quite well, which necessitates
> reimplementing PG_TRY/CATCH. The worst thing about C++ is that ABI
> compatibility is far messier. This makes a C++ port seem less compelling
> to me than the idea first appears.

From: pgsql-hackers-owner(at)postgresql(dot)org
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Christopher
> Further, it's not as if C++ is particularly newer than C. C is about 45
> years old; C++, at 33, hardly seems like a "spry young whippersnapper"
> whose inclusion ought to lead to vast excitement.
>
> The would-be "spry young things" that head to my mind are Rust and Go. I'm
> not sure it's terribly plausible to have parts of Postgres written in both
> C and (Rust|Go); they're different enough that I'm not sure what
> functionality would mix sensibly. But I think that would be more
> interesting, all the same. Perhaps it would work out well to be able to
> create background workers in Rust, or to implement a stored procedure
> language in Go.

First, I'm neither for nor against rewriting PostgreSQL in C++. But I wonder whether it would really pay for the cost. I'm worried about these, for example:

* Wouldn't it increase the coding and testing burdon? Coding and testing in C, and coding and testing in C++. PostgreSQL seem to have many features to develop, and I'm not sure C++ will help to speed up the development of them.

* Would it really attract more developers of PostgreSQL itself, not extensions? FYI, Tiobe Index says C is nearly twice as popular as C++.

http://www.tiobe.com/tiobe-index/

* Wouldn't it distance some developers if they don't want to learn C++? As Christopher said, C++ is old and there are many newer languages that attract developers -- C#, Swift, Go, Java, JavaScript, etc. I wonder whether recent developers want to spend time in learning complex C++ now. I learned C++ because it is still the most popular language in game development, but maybe I would not want to learn C++ anymore if I didn't know C++.

Regards
Takayuki Tsunakawa

In response to

Browse pgsql-general by date

  From Date Subject
Next Message 'Andres Freund' 2016-08-17 01:49:44 Re: [GENERAL] C++ port of Postgres
Previous Message Andres Freund 2016-08-17 01:02:52 Re: what change in postgres 9.5 improvements for multi-CPU machines

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-08-17 01:29:11 Re: anyelement -> anyrange
Previous Message Andres Freund 2016-08-17 00:54:22 Re: [GENERAL] C++ port of Postgres