digitalmars.D.learn - Writing Postgresql extension in D
- Ranjan (6/6) Nov 15 2018 This is my first time on the Dlang forum. I like the language but
- Andrea Fontana (3/9) Nov 15 2018 Did you read this: https://dlang.org/spec/interfaceToC.html ?
- Ranjan (7/18) Nov 15 2018 Yes, but it's not useful, in Postgesql extension C code needs to
- rikki cattermole (4/24) Nov 15 2018 There isn't anything special you need to learn.
- Radu (8/28) Nov 15 2018 There is -betterC [1] compiler flag that allows one to code
- Bienlein (5/25) Nov 16 2018 I'm not an exert with C nor D. So I might misuderstand the
This is my first time on the Dlang forum. I like the language but my usecase is a bit different. I want to write Postgresql extension in D. Currently extension can be written in C or C linked languages. Has anyone done this or can point me to some code. Thanks
Nov 15 2018
On Thursday, 15 November 2018 at 13:05:59 UTC, Ranjan wrote:This is my first time on the Dlang forum. I like the language but my usecase is a bit different. I want to write Postgresql extension in D. Currently extension can be written in C or C linked languages. Has anyone done this or can point me to some code. ThanksDid you read this: https://dlang.org/spec/interfaceToC.html ? Andrea
Nov 15 2018
On Thursday, 15 November 2018 at 17:03:55 UTC, Andrea Fontana wrote:On Thursday, 15 November 2018 at 13:05:59 UTC, Ranjan wrote:Yes, but it's not useful, in Postgesql extension C code needs to call D, without GarbageCollection. I am able to do this in RustLang but I am not sure how to in D, as it has a GC. Looking for examples from the community. ThanksThis is my first time on the Dlang forum. I like the language but my usecase is a bit different. I want to write Postgresql extension in D. Currently extension can be written in C or C linked languages. Has anyone done this or can point me to some code. ThanksDid you read this: https://dlang.org/spec/interfaceToC.html ? Andrea
Nov 15 2018
On 16/11/2018 3:18 PM, Ranjan wrote:On Thursday, 15 November 2018 at 17:03:55 UTC, Andrea Fontana wrote:There isn't anything special you need to learn. As long as you don't mutate anything you receive via the GC or send any GC owned memory outside of D, you'll have an easy time of it.On Thursday, 15 November 2018 at 13:05:59 UTC, Ranjan wrote:Yes, but it's not useful, in Postgesql extension C code needs to call D, without GarbageCollection. I am able to do this in RustLang but I am not sure how to in D, as it has a GC. Looking for examples from the community. ThanksThis is my first time on the Dlang forum. I like the language but my usecase is a bit different. I want to write Postgresql extension in D. Currently extension can be written in C or C linked languages. Has anyone done this or can point me to some code. ThanksDid you read this: https://dlang.org/spec/interfaceToC.html ? Andrea
Nov 15 2018
On Friday, 16 November 2018 at 02:18:11 UTC, Ranjan wrote:On Thursday, 15 November 2018 at 17:03:55 UTC, Andrea Fontana wrote:There is -betterC [1] compiler flag that allows one to code without the D runtime and create programs that depend only on the C runtime, so there is no GC - and no GC related functionality also. You probably want to try this route for creating the extension, as it will be simpler if you know C and the Postgres API. 1. https://dlang.org/spec/betterc.htmlOn Thursday, 15 November 2018 at 13:05:59 UTC, Ranjan wrote:Yes, but it's not useful, in Postgesql extension C code needs to call D, without GarbageCollection. I am able to do this in RustLang but I am not sure how to in D, as it has a GC. Looking for examples from the community. ThanksThis is my first time on the Dlang forum. I like the language but my usecase is a bit different. I want to write Postgresql extension in D. Currently extension can be written in C or C linked languages. Has anyone done this or can point me to some code. ThanksDid you read this: https://dlang.org/spec/interfaceToC.html ? Andrea
Nov 15 2018
On Friday, 16 November 2018 at 02:18:11 UTC, Ranjan wrote:On Thursday, 15 November 2018 at 17:03:55 UTC, Andrea Fontana wrote:I'm not an exert with C nor D. So I might misuderstand the issue... You can write a skeleton plugin for postgres in C that at init time starts the D runtime. From then on your C skelton plugin can call some function in D.On Thursday, 15 November 2018 at 13:05:59 UTC, Ranjan wrote:Yes, but it's not useful, in Postgesql extension C code needs to call D, without GarbageCollection. I am able to do this in RustLang but I am not sure how to in D, as it has a GC. Looking for examples from the community. ThanksThis is my first time on the Dlang forum. I like the language but my usecase is a bit different. I want to write Postgresql extension in D. Currently extension can be written in C or C linked languages. Has anyone done this or can point me to some code. ThanksDid you read this: https://dlang.org/spec/interfaceToC.html ? Andrea
Nov 16 2018