3 ms·
This is because 99% of users know only Python, and C++ is too much for them. If the advanced stuff was available in the language they use, larger portion of use
by dragandj 6y ago
This is because 99% of users know only Python, and C++ is too much for them. If the advanced stuff was available in the language they use, larger portion of users would write more advanced stuff.
I prefer Clojure for this. Even simpler than Python, fast, and enables me to match or even surpass the speed expected from mainstream tools.
See this for example: https://dragan.rocks/articles/20/Deep-Diamond-Deep-Learning-in-Clojure-is-Fast-and-Simpler-than-Keras https://dragan.rocks/articles/20/Deep-Diamond-Deep-Learning-...
- p1esk 6y agoDid you write gpu kernels in clojure? Or did you make function calls to cudnn like pytorch et al does it?
- dragandj 6y agoBoth. See https://github.com/uncomplicate/bayadera https://github.com/uncomplicate/bayadera too. Whatever the language, you have to make function calls to cuDNN, because cuDNN is optimized by Nvidia, which put serious resources into it. Even if you wrote everything in C++/CUDA, you probably can't match it for the standard stuff. The custom things that I write, I prefer to write in CUDA kernels + Clojure management code. Clojure kernels are technically possible in the same way as Julia or whatever kernels are possible, but the thing is that you have to match low-level hardware features anyway, so CUDA C/C++ just makes more sense for kernels, which are tiny part of code anyway.
- p1esk 6y agoSo if you have to use cuda c/c++, then why not do it from python?
- dragandj 6y agoNo. You don't use cuda/c++ as it is used from Python. You use cuda/c only in kernels. That is compiled dynamically, in process, from Clojure funcion calls, and 95% of related code is the management code, which is written in Clojure. There is no separate C++ build. You never touch any C++ tools such as CMake or anything. You work dynamically from the Clojure REPL.
- p1esk 6y agoAs a Pytorch user, I never touch c/cuda code. I never touch cmake. I can work dynamically from python repl. So, again, why should I care how those c/cuda calls are made if I don’t see them?
- pjmlp 6y agoBecause Clojure comes with a platform that supports AOT/JIT compilation out of the box, has several state of the art GC algorithms and in the near future even value types, while offering the same dynamism as Python, with all the capabilities of a Lisp in code manipulation.
- smabie 6y agoBecause Python is an ugly, inexpressive, and incredibly verbose language.
- fouc 6y agoHow much of a factor is the JVM for supporting this? In other words, I'm curious about how other lisps would fare?