Re:Why Python keeps growing, explained
by VBprogrammer on Friday March 03, 2023 @09:13AM
(#35009870)
Did you rewrite the whole thing or just drop into C for the relevant module(s)? Because the ability to chuck some C into the performance critical sections of your code is another big plus for Python.
[ Parent
| on HN ]
But... pretty much any language can interoperate with C, it's calling conventions have become the universal standard. I mean, I still remember at $previousJob when I was deprecating a C library and carefully searched for any mention of the include file... only to discover that a whole lot of Fortran code depended on the thing I was changing, and I had just broken all of it (since Fortran doesn't use include files the same way, my search for "#include <my_library" didn't return any hits, but the function calls were there none-the-less).
Julia, to use the great-great-grand-op's example, seems to also have a reasonably easy C interop (I've never written any Julia, so I'm basing this off skimming the docs, dunno, it might actually be much more of a pain than it looks like here).
Calling C from Julia is pretty straightforward
https://docs.julialang.org/en/v1/manual/calling-c-and-fortra...
Even if you do this, you're still paying a penalty whenever you move data Python->C and C->Python.
Plus that you now need to write performant (and safe) C code, which (to me) defeats part of the reason to use Python in the first place.