News for hackers. Stuff that matters.
Re:JNumPy: Writing high-performance C extensions for Python ... by metadat on Tuesday August 09, 2022 @11:35PM (#32407608)
(Writing Python extensions in Julia)

..which could be a heckuva lot friendlier and often safer than C!

The requisite python boilerplate is pretty ugly, though:

  init_jl()
  include_src('example.jl', __file__)
  exec_julia('example.init()')
I also don't understand how jl_mat_mul gets mapped to mat_mul.

  jl_mat_mul = Pyfunc(jl_mat_mul)
Huh?
Re:JNumPy: Writing high-performance C extensions for Python ... by majoe on Wednesday August 10, 2022 @03:13AM (#32408674)
I had a look at the demo folder, that's just a typo. It should be:

jl_mat_mul = Pyfunc(mat_mul)

which makes a lot more sense.

Re:JNumPy: Writing high-performance C extensions for Python ... by kortex on Wednesday August 10, 2022 @12:09AM (#32407760)
Yeah, the boilerplate is rough, but python's import system is magic. There's no reason why you couldn't just do

    from example.jl import mat_mul
and have it just work. (With the right libraries and import functionality of course.)