[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] Integrating High-precision arithmetic into Octave Core ?
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: [RFC] Integrating High-precision arithmetic into Octave Core ? |
Date: |
Fri, 21 Mar 2014 15:52:10 -0400 |
On Fri, 2014-03-21 at 08:55 -0700, CdeMills wrote:
> Jordi Gutiérrez Hermoso-2 wrote
> > On Fri, 2014-03-21 at 05:10 -0700, fgnievinski wrote:
> >> Of course, you can implement any of its methods in C/C++.
> >
> > Please, no C/C++. Just C++.
>
> MPFR IS C.
Using C++ to interface to C is fine. What I meant that I don't like is
this mixture of styles where you use malloc and free in C++ code
instead of new and delete, or macros instead of templates (for
example). If possible, RAII wrappers to the C code should be written.
If possible, templates should be used instead of macros. If possible,
use polymorphism instead of switch statements on type. This is how all
of Octave works, especially for wrapping the Fortran libraries and the
occasional C library.
Although most of C is a subset of C++, one should not write C++ as if
it were C. And for new Octave code, we really should avoid writing C
unless absolutely necessary. It's just a pet peeve when people say
"C/C++" as if they were the same language. For example, few people say
something like "you can implement any of its methods in Java/Haskell".
- Jordi G. H.
- Re: [RFC] Integrating High-precision arithmetic into Octave Core ?, (continued)
- Re: [RFC] Integrating High-precision arithmetic into Octave Core ?, fgnievinski, 2014/03/21
- Re: [RFC] Integrating High-precision arithmetic into Octave Core ?, Georgios Ouzounis, 2014/03/21
- Re: [RFC] Integrating High-precision arithmetic into Octave Core ?, fgnievinski, 2014/03/21
- Re: [RFC] Integrating High-precision arithmetic into Octave Core ?, Georgios Ouzounis, 2014/03/21
- Re: [RFC] Integrating High-precision arithmetic into Octave Core ?, Nir Krakauer, 2014/03/21
- Re: [RFC] Integrating High-precision arithmetic into Octave Core ?, Georgios Ouzounis, 2014/03/21
- Re: [RFC] Integrating High-precision arithmetic into Octave Core ?, fgnievinski, 2014/03/21
- Re: [RFC] Integrating High-precision arithmetic into Octave Core ?, Georgios Ouzounis, 2014/03/21
Re: [RFC] Integrating High-precision arithmetic into Octave Core ?, Jordi Gutiérrez Hermoso, 2014/03/21