Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-20 Thread jmh530 via Digitalmars-d-learn
On Friday, 20 July 2018 at 15:20:43 UTC, bachmeier wrote: Can confirm that dpp works to create mex files. Rewriting the mypow2.c example in D: [snip] This sounds really great. I assume if it works with Octave it is very likely to work with Matlab's mex.h without issues (I might get

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-20 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: Another possibility might be in dlopen'able functions. Currently Octave uses so-called oct functions, which are nothing more than C++ object code that is dynamically loaded by the interpreter at runtime. They are

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-18 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 17 July 2018 at 22:10:52 UTC, jmh530 wrote: On Tuesday, 17 July 2018 at 16:39:48 UTC, bachmeier wrote: On Tuesday, 17 July 2018 at 15:55:03 UTC, bachmeier wrote: On Tuesday, 17 July 2018 at 06:57:37 UTC, drug wrote: [...] I'm going to create an issue on Github. This is the

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-17 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 17 July 2018 at 16:39:48 UTC, bachmeier wrote: On Tuesday, 17 July 2018 at 15:55:03 UTC, bachmeier wrote: On Tuesday, 17 July 2018 at 06:57:37 UTC, drug wrote: [...] I'm going to create an issue on Github. This is the output I get: [...] I solved that problem but now I have

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-17 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 17 July 2018 at 15:55:03 UTC, bachmeier wrote: On Tuesday, 17 July 2018 at 06:57:37 UTC, drug wrote: [...] I'm going to create an issue on Github. This is the output I get: [...] I solved that problem but now I have others. dpp is a good thing on paper but maybe not yet in

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-17 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 17 July 2018 at 06:57:37 UTC, drug wrote: I just build it using dub then do something like that(from memory): `d++ some_c_header.h --include-path path/to/other/c/header/files --keep-d-files` and it generates d file for the corresponding c header. Although dpp is intended to be

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-17 Thread drug via Digitalmars-d-learn
16.07.2018 17:32, bachmeier пишет: On Friday, 13 July 2018 at 19:53:45 UTC, Laeeth Isharc wrote: On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: What are your ideas? If you would like to expose C function and type declarations to D, you could take a look at DPP,

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-16 Thread bachmeier via Digitalmars-d-learn
On Friday, 13 July 2018 at 19:53:45 UTC, Laeeth Isharc wrote: On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: What are your ideas? If you would like to expose C function and type declarations to D, you could take a look at DPP, which allows you to just #include

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-16 Thread Seb via Digitalmars-d-learn
On Monday, 16 July 2018 at 13:15:56 UTC, Timoses wrote: On Monday, 16 July 2018 at 11:31:32 UTC, Seb wrote: On Monday, 16 July 2018 at 11:12:20 UTC, Dukc wrote: On Saturday, 14 July 2018 at 03:08:50 UTC, Vladimir Panteleev wrote: I'll follow up with Alawain. Regardless, dscripten-tools

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-16 Thread Timoses via Digitalmars-d-learn
On Monday, 16 July 2018 at 11:31:32 UTC, Seb wrote: On Monday, 16 July 2018 at 11:12:20 UTC, Dukc wrote: On Saturday, 14 July 2018 at 03:08:50 UTC, Vladimir Panteleev wrote: I'll follow up with Alawain. Regardless, dscripten-tools borrows very little from the redistributable parts of

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-16 Thread Seb via Digitalmars-d-learn
On Monday, 16 July 2018 at 11:12:20 UTC, Dukc wrote: On Saturday, 14 July 2018 at 03:08:50 UTC, Vladimir Panteleev wrote: I'll follow up with Alawain. Regardless, dscripten-tools borrows very little from the redistributable parts of dscripten - mostly the "minimalistic runtime", which I think

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-16 Thread Dukc via Digitalmars-d-learn
On Saturday, 14 July 2018 at 03:08:50 UTC, Vladimir Panteleev wrote: I'll follow up with Alawain. Regardless, dscripten-tools borrows very little from the redistributable parts of dscripten - mostly the "minimalistic runtime", which I think was itself borrowed from somewhere else. Indeed, it

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-13 Thread Vladimir Panteleev via Digitalmars-d-learn
On Friday, 13 July 2018 at 07:51:51 UTC, Dukc wrote: I know about Vladimir's d-scripten tools library which would help, but it's based on Alawains library copyleft library, which makes also Vladimir's work copyleft, so I won't use it. Hmm, I wasn't aware of this. I wonder if the decision to

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-13 Thread Laeeth Isharc via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: I'm specifically thinking of the GNU Octave codebase: http://hg.savannah.gnu.org/hgweb/octave/file/@ It's a fairly old and complicated C++ codebase. I would like to see if I could slowly introduce some D in it,

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-13 Thread Dukc via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: Now, as I understand it, I would need to begin with making `main` a D function, because D needs to initialise the runtime. Is this correct? No. Some initialization is required if you use the GC, as I understand it.

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-13 Thread Dukc via Digitalmars-d-learn
On Thursday, 12 July 2018 at 15:12:51 UTC, Seb wrote: it might also be feasible to simply use normal D. Have you already tried this? There's no strict distinction between using D normally and in systems programming fashion for me, because my main function isn't written in D. But in

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-12 Thread Seb via Digitalmars-d-learn
On Wednesday, 11 July 2018 at 20:38:13 UTC, Dukc wrote: On Wednesday, 11 July 2018 at 19:41:37 UTC, Jordi Gutiérrez Hermoso wrote: Just getting it into -betterC territory seems like a very daunting task. You do not need -betterC anymore. At least the LDC frontend will only add linking hooks

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-11 Thread Dukc via Digitalmars-d-learn
On Wednesday, 11 July 2018 at 19:41:37 UTC, Jordi Gutiérrez Hermoso wrote: Just getting it into -betterC territory seems like a very daunting task. You do not need -betterC anymore. At least the LDC frontend will only add linking hooks for what you use, -betterC or no. No need build a stub

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-11 Thread Jordi Gutiérrez Hermoso via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 20:28:00 UTC, Seb wrote: Maybe looking at the recent DMD Backend to D conversion PRs (https://github.com/dlang/dmd/pulls?utf8=%E2%9C%93=is%3Apr+label%3A%22D+Conversion%22+) helps? Here -betterC is used. Octave is so far from -betterC, though. It's very

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-10 Thread Seb via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: I'm specifically thinking of the GNU Octave codebase: http://hg.savannah.gnu.org/hgweb/octave/file/@ It's a fairly old and complicated C++ codebase. I would like to see if I could slowly introduce some D in it,

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-07-10 Thread Jordi Gutiérrez Hermoso via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 19:57:55 UTC, jmh530 wrote: I'm not sure adding D to the GNU Octave code base is necessarily the biggest value add... I'm daydreaming of being able to rewrite all of Octave in D. I just was trying to think of where to start.

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-06-20 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 19:57:55 UTC, jmh530 wrote: I suppose that. [snip] I suppose that would be good.

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-06-20 Thread user1234 via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: I'm specifically thinking of the GNU Octave codebase: http://hg.savannah.gnu.org/hgweb/octave/file/@ It's a fairly old and complicated C++ codebase. I would like to see if I could slowly introduce some D in it,

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-06-20 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: I'm specifically thinking of the GNU Octave codebase: http://hg.savannah.gnu.org/hgweb/octave/file/@ It's a fairly old and complicated C++ codebase. I would like to see if I could slowly introduce some D in it,

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-06-20 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: I'm specifically thinking of the GNU Octave codebase: http://hg.savannah.gnu.org/hgweb/octave/file/@ It's a fairly old and complicated C++ codebase. I would like to see if I could slowly introduce some D in it,

Re: Is it feasible to slowly rewrite a C++ codebase in D?

2018-06-20 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez Hermoso wrote: I'm specifically thinking of the GNU Octave codebase: http://hg.savannah.gnu.org/hgweb/octave/file/@ It's a fairly old and complicated C++ codebase. I would like to see if I could slowly introduce some D in it,