News for hackers. Stuff that matters.
Re:Writing a Postgres Foreign Data Wrapper for Clickhouse in Go by _ph_ on Thursday November 19, 2020 @06:15PM (#25155513)
I have done something similar. For a software, which take shared libraries - usually written in C - as plugins, I wrote such a plugin in Go. This was a very good experience. It took only little work to set up the C compatible Go functions realizing the API, but the rest I could implement in Go which made the life so nice. I also ended up calling back into some of the applications APIs from Go, that worked seamlessly.

Go has good facilities interfacing with C, the only attention you need to pay is properly handling C pointers (manual memory management) vs. Go pointers (automatically managed via the GC). But with very little care this is not a big issue. The Go part of the code is however much nicer than if you had to implement the functionality in C. (Yes, I do think that Go is a great C replacement)

Re:Writing a Postgres Foreign Data Wrapper for Clickhouse in Go by gscho on Thursday November 19, 2020 @06:19PM (#25155548)
I only just discovered foreign data wrappers today but it seems like you can write these in python though right? Might be easier than using Go to interface with C.
Re:Writing a Postgres Foreign Data Wrapper for Clickhouse in Go by tankenmate on Thursday November 19, 2020 @07:14PM (#25155994)
Messagebird uses Go on the backend; I suspect that's why they wrote the FDW in Go.
Re:Writing a Postgres Foreign Data Wrapper for Clickhouse in Go by arunk-s on Friday November 20, 2020 @12:48AM (#25157660)
Hi, Author here!

Yes, your hypothesis is correct. We chose Go, mostly because almost all of us were quite familiar with it and there weren't many C experts :)