Обсуждение: C++ port of Postgres

Поиск
Список
Период
Сортировка

C++ port of Postgres

От
Joy Arulraj
Дата:
Hi folks --

We have ported Postgres over to the C++ language (C++11 standard).

https://github.com/jarulraj/postgresql-cpp

Our goal is to use certain features of the C++ language and its standard library to simplify coding, improve code reuse, and avoid bugs. Peter's article titled `Moving to C++` was a source of inspiration for us.

Regards.

Re: C++ port of Postgres

От
John R Pierce
Дата:
On 8/14/2016 2:05 PM, Joy Arulraj wrote:

We have ported Postgres over to the C++ language (C++11 standard).

https://github.com/jarulraj/postgresql-cpp

Our goal is to use certain features of the C++ language and its standard library to simplify coding, improve code reuse, and avoid bugs. Peter's article titled `Moving to C++` was a source of inspiration for us.

does this compile with the non-GCC compilers that postgres gets built with, for instance, IBM XLC++ on AIX, Oracle Studio C++ on Solaris, Microsoft Visual C++ on MS Windows, CLang on BSD ?   what about popular platforms like RHEL 6, where gcc is 4.4.7 ?



-- 
john r pierce, recycling bits in santa cruz

Re: C++ port of Postgres

От
Dmitry Igrishin
Дата:
Hi Joy,

2016-08-15 0:05 GMT+03:00 Joy Arulraj <jarulraj@cs.cmu.edu>:
> Hi folks --
>
> We have ported Postgres over to the C++ language (C++11 standard).
>
> https://github.com/jarulraj/postgresql-cpp
>
> Our goal is to use certain features of the C++ language and its standard
> library to simplify coding, improve code reuse, and avoid bugs. Peter's
> article titled `Moving to C++` was a source of inspiration for us.
What about the exceptions? Are you using them?

--
// Dmitry.


Re: C++ port of Postgres

От
Joy Arulraj
Дата:

Hi Dmitry -- We currently don't use exceptions, but we can certainly use them in the port. We can also use STL and smart pointers to simplify  development and minimize memory bugs.


On Aug 14, 2016 5:41 PM, "Dmitry Igrishin" <dmitigr@gmail.com> wrote:
Hi Joy,

2016-08-15 0:05 GMT+03:00 Joy Arulraj <jarulraj@cs.cmu.edu>:
> Hi folks --
>
> We have ported Postgres over to the C++ language (C++11 standard).
>
> https://github.com/jarulraj/postgresql-cpp
>
> Our goal is to use certain features of the C++ language and its standard
> library to simplify coding, improve code reuse, and avoid bugs. Peter's
> article titled `Moving to C++` was a source of inspiration for us.
What about the exceptions? Are you using them?

--
// Dmitry.

Re: C++ port of Postgres

От
kang joni
Дата:
I agree with this project, I dont like any setjmp/longjmp and the
like. It just fighting against the nature of c++ language. Building
either from scratch gcc48 or clang381 were easy nowdays on either old
linux debian squeeze or centos 5. PS: I had this requirement
circumtances.

On 8/15/16, Joy Arulraj <jarulraj@cs.cmu.edu> wrote:
> Hi Dmitry -- We currently don't use exceptions, but we can certainly use
> them in the port. We can also use STL and smart pointers to simplify
> development and minimize memory bugs.
>
> On Aug 14, 2016 5:41 PM, "Dmitry Igrishin" <dmitigr@gmail.com> wrote:
>
>> Hi Joy,
>>
>> 2016-08-15 0:05 GMT+03:00 Joy Arulraj <jarulraj@cs.cmu.edu>:
>> > Hi folks --
>> >
>> > We have ported Postgres over to the C++ language (C++11 standard).
>> >
>> > https://github.com/jarulraj/postgresql-cpp
>> >
>> > Our goal is to use certain features of the C++ language and its
>> > standard
>> > library to simplify coding, improve code reuse, and avoid bugs. Peter's
>> > article titled `Moving to C++` was a source of inspiration for us.
>> What about the exceptions? Are you using them?
>>
>> --
>> // Dmitry.
>>
>


Re: C++ port of Postgres

От
Joy Arulraj
Дата:
Kang -- Yes, this is one of the reasons why we chose to do this.

John -- We have not compiled it with non-GCC compilers. But, I presume that the changes required to support compilation with other compilers should be minimal as we don't rely on any compiler-specific features.

On Sun, Aug 14, 2016 at 6:30 PM, kang joni <kangjoni76@gmail.com> wrote:
I agree with this project, I dont like any setjmp/longjmp and the
like. It just fighting against the nature of c++ language. Building
either from scratch gcc48 or clang381 were easy nowdays on either old
linux debian squeeze or centos 5. PS: I had this requirement
circumtances.

On 8/15/16, Joy Arulraj <jarulraj@cs.cmu.edu> wrote:
> Hi Dmitry -- We currently don't use exceptions, but we can certainly use
> them in the port. We can also use STL and smart pointers to simplify
> development and minimize memory bugs.
>
> On Aug 14, 2016 5:41 PM, "Dmitry Igrishin" <dmitigr@gmail.com> wrote:
>
>> Hi Joy,
>>
>> 2016-08-15 0:05 GMT+03:00 Joy Arulraj <jarulraj@cs.cmu.edu>:
>> > Hi folks --
>> >
>> > We have ported Postgres over to the C++ language (C++11 standard).
>> >
>> > https://github.com/jarulraj/postgresql-cpp
>> >
>> > Our goal is to use certain features of the C++ language and its
>> > standard
>> > library to simplify coding, improve code reuse, and avoid bugs. Peter's
>> > article titled `Moving to C++` was a source of inspiration for us.
>> What about the exceptions? Are you using them?
>>
>> --
>> // Dmitry.
>>
>

Re: C++ port of Postgres

От
Adam Brusselback
Дата:
Just wondering what the end goal is for this project... Is it to just maintain an up to date Postgres fork that will compile with a C++ compiler? Is it to get a conversation going for a direction for Postgres itself to move?  The former I don't see gaining much traction or doing all that much for the state of the project. The latter possibly could if the community gets on board.

Thanks,
-Adam

Re: C++ port of Postgres

От
"dandl"
Дата:

Just wondering what the end goal is for this project... Is it to just maintain an up to date Postgres fork that will compile with a C++ compiler? Is it to get a conversation going for a direction for Postgres itself to move?  The former I don't see gaining much traction or doing all that much for the state of the project. The latter possibly could if the community gets on board.

 

I would certainly hope the latter. Having done some work on extension functions and an extension language for Postgres, the current situation can be quite limiting.

·         Parts of my code could only be written in C++, so I finished up with a mixed build, which is not ideal.

·         My other issue was dealing with the Datum macros. Type-safe inline C++ functions would help reduce dumb errors.

 

Not compelling reasons perhaps, but just a vote for a move in that direction, some time.

 

Regards

David M Bennett FACS


Andl - A New Database Language - andl.org

 

Re: C++ port of Postgres

От
Gavin Flower
Дата:
On 16/08/16 18:24, dandl wrote:
>
> Just wondering what the end goal is for this project... Is it to just
> maintain an up to date Postgres fork that will compile with a C++
> compiler? Is it to get a conversation going for a direction for
> Postgres itself to move?  The former I don't see gaining much traction
> or doing all that much for the state of the project. The latter
> possibly could if the community gets on board.
>
> I would certainly hope the latter. Having done some work on extension
> functions and an extension language for Postgres, the current
> situation can be quite limiting.
>
> ·Parts of my code could only be written in C++, so I finished up with
> a mixed build, which is not ideal.
>
> ·My other issue was dealing with the Datum macros. Type-safe inline
> C++ functions would help reduce dumb errors.
>
> Not compelling reasons perhaps, but just a vote for a move in that
> direction, some time.
>
> Regards
>
> David M Bennett FACS
>
> /
> ------------------------------------------------------------------------
> /
>
> /Andl - A New Database Language - andl.org/
>
I  note that gcc itself is now written in C++, and so is squid (web
proxy)...

In both cases, part of the motivation to change from C was to appeal to
new developers - from what I remember of the discussions.


Cheers,
Gavin



Re: C++ port of Postgres

От
"FarjadFarid\(ChkNet\)"
Дата:

Well done.  This is a much needed conversion. As Peter’s article says, it does open up more opportunities.

 

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Joy Arulraj
Sent: 14 August 2016 22:06
To: pgsql-general@postgresql.org
Subject: [GENERAL] C++ port of Postgres

 

Hi folks --

We have ported Postgres over to the C++ language (C++11 standard).

https://github.com/jarulraj/postgresql-cpp

Our goal is to use certain features of the C++ language and its standard library to simplify coding, improve code reuse, and avoid bugs. Peter's article titled `Moving to C++` was a source of inspiration for us.

Regards.

Re: C++ port of Postgres

От
Joy Arulraj
Дата:
On Tue, Aug 16, 2016 at 3:52 AM, Gavin Flower <GavinFlower@archidevsys.co.nz> wrote:
On 16/08/16 18:24, dandl wrote:

Just wondering what the end goal is for this project... Is it to just maintain an up to date Postgres fork that will compile with a C++ compiler? Is it to get a conversation going for a direction for Postgres itself to move?  The former I don't see gaining much traction or doing all that much for the state of the project. The latter possibly could if the community gets on board.


I was kind of hoping that this might start off a coversation on getting postgres to support C++.
 
I would certainly hope the latter. Having done some work on extension functions and an extension language for Postgres, the current situation can be quite limiting.

·Parts of my code could only be written in C++, so I finished up with a mixed build, which is not ideal.

·My other issue was dealing with the Datum macros. Type-safe inline C++ functions would help reduce dumb errors.

Not compelling reasons perhaps, but just a vote for a move in that direction, some time.


I concur.
 
Regards

David M Bennett FACS

/
------------------------------------------------------------------------
/

/Andl - A New Database Language - andl.org/

I  note that gcc itself is now written in C++, and so is squid (web proxy)...

In both cases, part of the motivation to change from C was to appeal to new developers - from what I remember of the discussions.



 

Cheers,
Gavin


Re: C++ port of Postgres

От
Joy Arulraj
Дата:
Thanks, I do hope so.

On Tue, Aug 16, 2016 at 7:00 AM, FarjadFarid(ChkNet) <farjad.farid@checknetworks.com> wrote:

Well done.  This is a much needed conversion. As Peter’s article says, it does open up more opportunities.

 

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Joy Arulraj
Sent: 14 August 2016 22:06
To: pgsql-general@postgresql.org
Subject: [GENERAL] C++ port of Postgres

 

Hi folks --

We have ported Postgres over to the C++ language (C++11 standard).

https://github.com/jarulraj/postgresql-cpp

Our goal is to use certain features of the C++ language and its standard library to simplify coding, improve code reuse, and avoid bugs. Peter's article titled `Moving to C++` was a source of inspiration for us.

Regards.


Re: C++ port of Postgres

От
Jim Nasby
Дата:
On 8/16/16 2:52 AM, Gavin Flower wrote:
> In both cases, part of the motivation to change from C was to appeal to
> new developers - from what I remember of the discussions.

I have moved this discussion over to -hackers.
(https://www.postgresql.org/message-id/f7682c24-4271-1ff5-d963-053ecb0fce40@BlueTreble.com)
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)   mobile: 512-569-9461


Re: C++ port of Postgres

От
Christian Convey
Дата:
On Sun, Aug 14, 2016 at 5:05 PM, Joy Arulraj <jarulraj@cs.cmu.edu> wrote:
> Hi folks --
>
> We have ported Postgres over to the C++ language (C++11 standard).
>
> https://github.com/jarulraj/postgresql-cpp
>
> Our goal is to use certain features of the C++ language and its standard
> library to simplify coding, improve code reuse, and avoid bugs. Peter's
> article titled `Moving to C++` was a source of inspiration for us.

Do you remember the particular commit of PG upon which you based this
work?  Or even better, are you able to post a patch which applies
cleanly to PG's current HEAD?

I ask because I'd like to compare your approach to the one Peter has
posted, and I think that will be easier if I can use a common (or at
least similar) baseline for the comparison.

Kind regards,
Christian


Re: C++ port of Postgres

От
Joy Arulraj
Дата:
Hi Christian -- Sorry about the delay. The patch is based on PG version 9.5.3.
The commit history of the repo should give a high-level idea of the changes 
required in PG to support compilation by a C++ compiler. I presume that 
Peter's patch would be easier to integrate into PG. In any case, I would be 
very glad to see PostgreSQL support C++. 

Regards.

On Sun, Sep 11, 2016 at 6:47 AM, Christian Convey <christian.convey@gmail.com> wrote:
On Sun, Aug 14, 2016 at 5:05 PM, Joy Arulraj <jarulraj@cs.cmu.edu> wrote:
> Hi folks --
>
> We have ported Postgres over to the C++ language (C++11 standard).
>
> https://github.com/jarulraj/postgresql-cpp
>
> Our goal is to use certain features of the C++ language and its standard
> library to simplify coding, improve code reuse, and avoid bugs. Peter's
> article titled `Moving to C++` was a source of inspiration for us.

Do you remember the particular commit of PG upon which you based this
work?  Or even better, are you able to post a patch which applies
cleanly to PG's current HEAD?

I ask because I'd like to compare your approach to the one Peter has
posted, and I think that will be easier if I can use a common (or at
least similar) baseline for the comparison.

Kind regards,
Christian