KlongPy: Vectorized port of Klong array language
github.com
github.com
Nils' book on Klong is awesome. Very well written and could not have done this project without his very detailed and thorough documentation and C code reference implementation. Nils also helped with some clarifying details on the finer points of the language for KlongPy.
1. I've written a bit of J for Advent of Code/Project Euler, and I love J's tacit/point-free style. Does KlongPy have hooks and forks? What is the general difference between J and K/Klong/KlongPy?
2. Have you considered adding PyTorch as a backend, in addition to numpy/cupy? Array programming on GPU with autograd would be a magic combination.
3. Would it benefit to rewrite some of the verbs (or add new/optimized verbs) in C? I know numpy has an ok C API, and I've tried the C FFI in J with interesting results.
Again, beautiful work -- starred the repo, bookmarked, I hope to check this out sometime this summer. Thank you so much for sharing! (also thanks to Nils for your work!)
I need to read more about hooks and forks to answer that. Klong itself is relatively straightforward, however with Python integration there’s a lot that can be done.
Multiple backends would be quite interesting. There’s still some gaps in fully supporting CuPy so perhaps after getting that further along it would be interesting to expand the backends.
Related to multiple backends, I think there’s a lot to explore with JIT and other tricks to make KlongPy faster.
Generally, the bulk of my focus will be on performance going forward.
This makes me think about a better plugin model where capabilities are selectable.