Boost logo

Boost :

From: Hans Dembinski (hans.dembinski_at_[hidden])
Date: 2022-04-25 09:08:23


> On 20. Apr 2022, at 17:02, Timothy Keitt via Boost <boost_at_[hidden]> wrote:
>
> I'm just a hobbyist (I use C++ wrapped in R for my research and
> exploration) but my dream is something like julia (https://julialang.org/)
> but with modern C++ syntax. I have really enjoyed the recent
> metaprogramming additions to C++ and would love to have that in an
> interactive environment with incremental jit. (I know this can be kind of
> done now but its not like using R Studio or other nice user platforms.)
> BTW, C++ is found in high performance scientific computing, but not as
> often as Fortran and C.

This is getting off-topic, but let me comment as a fellow data scientist and Boost developer...

Julia was created for your use case, so I am not sure what you don't like about it (I never looked into Julia). I personally find less need to write C++ code nowadays, since my preferred language Python has the Numba JIT compiler, which produces very fast numerical code. In the past, I was writing C++ to accelerate the crunchy bits. As Stefan said, Boost.Python is great when you need to combine C++ and Python, although its clone pybind11 is more popular these days and has more features. The niche for C++ in my view is large high-performance applications with nice high-level APIs and close-to-the-metal implementations. But also numerical libraries like Eigen make very good use of these capabilities.

"modern C++ syntax": It is interesting that you say that, because many people think that C++ has a rather inconsistent and archaic syntax because of all the compromises one has to make in regard to backward compatibility.

"C++ is found in high performance scientific computing, but not as often as Fortran and C."
Old specialised numerical libraries are not replaced. SciPy and many other libs are still using FORTRAN and C implementations written in the 80'ies. They work and the bugs have been ironed out, plus, the code often is a horrible mess (goto's everywhere) that you cannot easily port to a modern language. Scientists, which are not programmers, are also often turned off by the complexity of C++. They don't need the type system very much, which is a strength of C++ but also adds a lot to the learning curve.

Why anyone would prefer programming in C over C++ is a mystery to me, though, automatic memory management with std::unique_ptr and friends alone is such a boon. The C++ interface provided by Boost.Python and pybind11 is much easier to use than the original Python C API exactly for that reason.

Best regards,
Hans


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk