Re: RustgreSQL

From: Jan de Visser <jan(at)de-visser(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Joel Jacobson <joel(at)trustly(dot)com>, Craig Ringer <craig(dot)ringer(at)2ndquadrant(dot)com>
Subject: Re: RustgreSQL
Date: 2017-01-08 21:51:20
Message-ID: 3249437.69VSFai492@coyote
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sunday, January 8, 2017 6:28:17 AM EST Joel Jacobson wrote:
> I don't want to learn the complicated details of C, that's true.

And this is where I think you're wrong, and why conversion would be hard. C
has very few complicated details. I don't think it has any, frankly. It
basically says "If you want your datastructure to outlive a function call,
I'll give you a chunk of memory and you're now responsible for it. Have fun".
That's not complicated: it's two functions, malloc() and free(), basically.

What's hard and complicated is keeping track of all those little chunks of
memory you have laying around. That management is deeply intertwined with the
algorithmics of the system, and separating memory management from the actual
work done will be very hard. In many cases the algorithm will have been
implemented with cheap memory management in mind, and porting it to a
different paradigm (garbage collection or rust's reference ownership) can
result in either a lot of work and probably bugs, or bad performing code.

I personally find keeping track of allocated memory easier than rust's
convoluted (to me) rules regarding reference ownership.

Your fear of C in unfounded. The definitive c89 reference is a little book of
about 250 pages, more than half of which is about the standard library of
which you'll never use more than half. If you have some notepaper laying about
on which to scribble pointer diagrams you can be a C programmer to :-)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-01-08 22:31:51 Re: RustgreSQL
Previous Message Jim Nasby 2017-01-08 21:50:41 Re: RustgreSQL