2 ms·
(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
by metadat 4y ago
(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?
- kortex 4y agoYeah, 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.)
- majoe 4y agoI 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.