Live data from Hacker News

JNumPy: Writing high-performance C extensions for Python in minutes

github.com

1–10 of 66 posts

Re: JNumPy: Writing high-performance C extensions for Python in minutes

#2
(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 in minutes

#3
Unless I'm misunderstanding, this seems to be writing python extensions in Julia not C. So quite a misleading title.

Also why should I pick this over cython, pythran or numba? with those I don't need to learn how to optimise another language (and no just writing Julia code does not necessarily get you large speed ups and certainly not the speed of C in many cases).

I really wish the Julia community would stop overselling the language.

Re: JNumPy: Writing high-performance C extensions for Python in minutes

#4
post #2

(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?

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.)

Re: JNumPy: Writing high-performance C extensions for Python in minutes

#5

Unless I'm misunderstanding, this seems to be writing python extensions in Julia not C. So quite a misleading title. Also why should I pick this over cython, pythran or numba? with those I don't need to learn how to optimise another language (and no just writing Julia code does not necessarily get you large speed ups and certainly not the speed of C in many cases). I really wish the Julia community would stop oversel…

Do you have any source on well written julia being any slower than well written C?

Re: JNumPy: Writing high-performance C extensions for Python in minutes

#6

Unless I'm misunderstanding, this seems to be writing python extensions in Julia not C. So quite a misleading title. Also why should I pick this over cython, pythran or numba? with those I don't need to learn how to optimise another language (and no just writing Julia code does not necessarily get you large speed ups and certainly not the speed of C in many cases). I really wish the Julia community would stop oversel…

This is why it's a C extension: https://github.com/Suzhou-Tongyuan/jnumpy/blob/main/TyPython...

The title is correct because it is a Julia numpy interface. Inside it seems is another project, TyPython, that provides an efficient Julia-Python-Numpy bridge, via C extensions.

Re: JNumPy: Writing high-performance C extensions for Python in minutes

#8

Unless I'm misunderstanding, this seems to be writing python extensions in Julia not C. So quite a misleading title. Also why should I pick this over cython, pythran or numba? with those I don't need to learn how to optimise another language (and no just writing Julia code does not necessarily get you large speed ups and certainly not the speed of C in many cases). I really wish the Julia community would stop oversel…

Do you have any source on well written julia being any slower than well written C?

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Re: JNumPy: Writing high-performance C extensions for Python in minutes

#10

Unless I'm misunderstanding, this seems to be writing python extensions in Julia not C. So quite a misleading title. Also why should I pick this over cython, pythran or numba? with those I don't need to learn how to optimise another language (and no just writing Julia code does not necessarily get you large speed ups and certainly not the speed of C in many cases). I really wish the Julia community would stop oversel…

Do you have any source on well written julia being any slower than well written C?

Don't be unreasonable. Numerical Julia code is just as fast, precisely because it's easy to design efficient high-level APIs and let the compiler optimise it.

Try timing Julia's IO, or it's string processing, or it's hash tables, or its array allocation or it's GC - you know, nearly everything other that mathematical operations on floats or ints. Nearly everything leaves performance on the table.

Sure Julia is fast, but not on a C level in these areas. There is still lots of room for optimisation, though.

Post reply on HN