Hi folks,

https://github.com/numpy/numpy/pull/19713 showcases what *could* be a first step
toward getting rid of generated C code within numpy, in favor of some C++ code,
coupled with a single macro trick.

Basically, templated code is an easy and robust way to replace generated code
(the C++ compiler becomes the code generator when instantiating code), and a
single X-macro takes care of the glue with the C world.

Some changes in distutils were needed to cope with C++-specific flags, and
extensions that consist in mixed C and C++ code.

I've kept the change as minimal as possible to ease the (potential) transition
and keep the C++ code close to the C code. This led to less idiomatic C++ code,
but I value a "correct first" approach. There's an on-going effort by seiko2plus
to remove that C layer, I acknowledge this would bring even more C++ code, but
that looks orthogonal to me (and a very good second step!)

All lights are green for the PR, let's assume it's a solid ground for 
discussion :-)
So, well, what do you think? Should we go forward?

Potential follow-ups :

- do we want to use -nostdlib, to be sure we don't bring any C++ runtime dep?
- what about -fno-exception, -fno-rtti?
- coding style?
- (I'm-not-a-farseer-I-don-t-know-all-topics)

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to