Re: libgmp deimos library

2017-01-16 Thread Nordlöw via Digitalmars-d
On Sunday, 15 January 2017 at 03:04:30 UTC, Andrew Hall wrote: On Thursday, 12 January 2017 at 16:55:10 UTC, Nordlöw wrote: On Thursday, 12 January 2017 at 09:19:26 UTC, Russel Winder wrote: Is the intention for this to stand with or replace std.bigint ? I have no plan yet. I'm just gonna

Re: libgmp deimos library

2017-01-14 Thread Andrew Hall via Digitalmars-d
On Thursday, 12 January 2017 at 16:55:10 UTC, Nordlöw wrote: On Thursday, 12 January 2017 at 09:19:26 UTC, Russel Winder wrote: Is the intention for this to stand with or replace std.bigint ? I have no plan yet. I'm just gonna work on it for fun until it covers most of GNU MP. Pull requests

Re: libgmp deimos library

2017-01-12 Thread Nordlöw via Digitalmars-d
On Thursday, 12 January 2017 at 09:19:26 UTC, Russel Winder wrote: Is the intention for this to stand with or replace std.bigint ? I have no plan yet. I'm just gonna work on it for fun until it covers most of GNU MP. Pull requests are very welcome.

Re: libgmp deimos library

2017-01-12 Thread Russel Winder via Digitalmars-d
On Wed, 2017-01-11 at 18:32 +, Nordlöw via Digitalmars-d wrote: […] > Great. I'll merge mine and your's stuff and put it in > > https://github.com/nordlow/gmp-d.git > […] Is the intention for this to stand with or replace std.bigint ? -- Russel.

Re: libgmp deimos library

2017-01-11 Thread Andrew Hall via Digitalmars-d
On Thursday, 12 January 2017 at 02:12:01 UTC, Mike Parker wrote: On Wednesday, 11 January 2017 at 23:12:30 UTC, Nordlöw wrote: On Wednesday, 11 January 2017 at 22:19:58 UTC, Andrew Hall wrote: also, why nogc? Because C-functions never use the D garbage collector :) They should also be

Re: libgmp deimos library

2017-01-11 Thread Mike Parker via Digitalmars-d
On Thursday, 12 January 2017 at 02:12:01 UTC, Mike Parker wrote: They should also be marked nothrow. Which I see they are.

Re: libgmp deimos library

2017-01-11 Thread Mike Parker via Digitalmars-d
On Wednesday, 11 January 2017 at 23:12:30 UTC, Nordlöw wrote: On Wednesday, 11 January 2017 at 22:19:58 UTC, Andrew Hall wrote: also, why nogc? Because C-functions never use the D garbage collector :) They should also be marked nothrow. That and @nogc should generally be applied to all C

Re: libgmp deimos library

2017-01-11 Thread Nordlöw via Digitalmars-d
On Wednesday, 11 January 2017 at 22:19:58 UTC, Andrew Hall wrote: also, why nogc? Because C-functions never use the D garbage collector :)

Re: libgmp deimos library

2017-01-11 Thread Andrew Hall via Digitalmars-d
On Wednesday, 11 January 2017 at 22:18:53 UTC, Andrew Hall wrote: On Wednesday, 11 January 2017 at 22:14:03 UTC, Nordlöw wrote: One important thing...you've forgotten to qualify the D wrapper functions as `pure @nogc`. in the actual bindings, I did include pure & nothrow however I've not

Re: libgmp deimos library

2017-01-11 Thread Andrew Hall via Digitalmars-d
On Wednesday, 11 January 2017 at 22:14:03 UTC, Nordlöw wrote: One important thing...you've forgotten to qualify the D wrapper functions as `pure @nogc`. in the actual bindings, I did include pure & nothrow however I've not had time in the wrapper.

Re: libgmp deimos library

2017-01-11 Thread Nordlöw via Digitalmars-d
On Wednesday, 11 January 2017 at 21:52:57 UTC, Andrew Hall wrote: Basically, gmp.h is split up into 4 files: gmp.d, integer.d, floating.d & rational.d. these are all public import'd by package.d so if you would like the contents of all of gmp.h, import deimos.gmp. However if you only need the

Re: libgmp deimos library

2017-01-11 Thread Andrew Hall via Digitalmars-d
On Wednesday, 11 January 2017 at 18:32:36 UTC, Nordlöw wrote: On Wednesday, 11 January 2017 at 13:53:18 UTC, Andrew Hall wrote: I was planning on extending this wrapper but since you have one, you may as well have the test cases. Great. I'll merge mine and your's stuff and put it in

Re: libgmp deimos library

2017-01-11 Thread Nordlöw via Digitalmars-d
On Wednesday, 11 January 2017 at 13:53:18 UTC, Andrew Hall wrote: I was planning on extending this wrapper but since you have one, you may as well have the test cases. Great. I'll merge mine and your's stuff and put it in https://github.com/nordlow/gmp-d.git Could you please give some

Re: libgmp deimos library

2017-01-11 Thread Andrew Hall via Digitalmars-d
On Wednesday, 11 January 2017 at 12:50:15 UTC, Nordlöw wrote: On Wednesday, 11 January 2017 at 10:29:26 UTC, Andrew Hall wrote: https://github.com/andrew-m-h/libgmp Nice. I'll make use of it in my high-level wrapper at https://github.com/nordlow/phobos-next/blob/master/src/gmp.d instead of

Re: libgmp deimos library

2017-01-11 Thread Jacob Carlborg via Digitalmars-d
On 2017-01-11 13:33, Guillaume Chatelet wrote: I'm not at all an expert on D bindings, I found the following links: - This page explains the procedure: http://wiki.dlang.org/D_binding_for_C - But this one too: http://dlang.org/spec/interfaceToC.html - This page seems out of date:

Re: libgmp deimos library

2017-01-11 Thread Nordlöw via Digitalmars-d
On Wednesday, 11 January 2017 at 10:29:26 UTC, Andrew Hall wrote: https://github.com/andrew-m-h/libgmp Nice. I'll make use of it in my high-level wrapper at https://github.com/nordlow/phobos-next/blob/master/src/gmp.d instead of my hand-coded externs. It is currently well tested (unittests

Re: libgmp deimos library

2017-01-11 Thread Guillaume Chatelet via Digitalmars-d
On Wednesday, 11 January 2017 at 11:34:55 UTC, Andrew Hall wrote: Cheers, I've done as you suggest, and 'libgmp' is registered under DUB. Feel free to have a look at the code because this is the first binding I've written in D. That said, it does have a test suite (unit tests) that do work.

Re: libgmp deimos library

2017-01-11 Thread Andrew Hall via Digitalmars-d
On Wednesday, 11 January 2017 at 10:52:40 UTC, Guillaume Chatelet wrote: On Wednesday, 11 January 2017 at 10:29:26 UTC, Andrew Hall wrote: I've been writing D bindings for GMP and I was wondering if they warrant inclusion in the Deimos git repo. I know Dlang has bignum, but GMP is still the

Re: libgmp deimos library

2017-01-11 Thread Guillaume Chatelet via Digitalmars-d
On Wednesday, 11 January 2017 at 10:29:26 UTC, Andrew Hall wrote: I've been writing D bindings for GMP and I was wondering if they warrant inclusion in the Deimos git repo. I know Dlang has bignum, but GMP is still the fastest library for extremely large numbers. The repos is in 'Deimos'

libgmp deimos library

2017-01-11 Thread Andrew Hall via Digitalmars-d
I've been writing D bindings for GMP and I was wondering if they warrant inclusion in the Deimos git repo. I know Dlang has bignum, but GMP is still the fastest library for extremely large numbers. The repos is in 'Deimos' format so if you care to use it, please tell me how to proceed.