--
Francesc Alted
--
You received this message because you are subscribed to the Google Groups "numexpr" group.
To post to this group, send email to num...@googlegroups.com.
To unsubscribe from this group, send email to numexpr+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/numexpr?hl=en.
On Mon, Jan 23, 2012 at 1:39 AM, Francesc Alted <fal...@gmail.com> wrote:2012/1/22 Mark <mww...@gmail.com>Numexpr only has two C files, interpreter.c and interp_body.c. I'd
like to switch them to compile with C++, and have already tried it
with minimal changes required. The differences were nearly all due to C
++ having stricter type conversion rules than C, something which I
think is very good. Is there anyone here attached to using C over C++?
Would the resulting code be able to compile with a plain C compiler? And, can you tell what advantages would result in doing that? Just curious.Initially, yes. This change converts it into the subset shared between C and C++. Do you see an advantage to keeping it compileable in C over the long term? The days of poor C++ compiler support are long behind us now.
The ability to use objects and other C++ features to reorganize the code would be extremely helpful in my opinion, so I would prefer not to stick to the C subset. The contributions I've already made to numexpr were much more unpleasant to do than if it had been good quality C++ code. The performance is the same, any performance in C is also possible in C++.
On Mon, Jan 23, 2012 at 12:15 AM, Francesc Alted <fal...@gmail.com> wrote:2012/1/23 Mark Wiebe <mww...@gmail.com>On Mon, Jan 23, 2012 at 1:39 AM, Francesc Alted <fal...@gmail.com> wrote:2012/1/22 Mark <mww...@gmail.com>Numexpr only has two C files, interpreter.c and interp_body.c. I'd
like to switch them to compile with C++, and have already tried it
with minimal changes required. The differences were nearly all due to C
++ having stricter type conversion rules than C, something which I
think is very good. Is there anyone here attached to using C over C++?
Would the resulting code be able to compile with a plain C compiler? And, can you tell what advantages would result in doing that? Just curious.Initially, yes. This change converts it into the subset shared between C and C++. Do you see an advantage to keeping it compileable in C over the long term? The days of poor C++ compiler support are long behind us now.
Yup, I think you are right: C++ compilers are ubiquitous now, and its advantages could be very important in many fields.
The ability to use objects and other C++ features to reorganize the code would be extremely helpful in my opinion, so I would prefer not to stick to the C subset. The contributions I've already made to numexpr were much more unpleasant to do than if it had been good quality C++ code. The performance is the same, any performance in C is also possible in C++.
Ok. Seems good to me. So +1 for C++ adoption.I've pushed the changes, tested it on both Linux and Windows.